/*
* x86 TSS data structure and routines
* Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
- * $Revision: 1.1 $
+ * $Revision: 1.4 $
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "COPYING".
#include <geekos/tss.h>
#include <geekos/serial.h>
+#include <geekos/debug.h>
+
/*
* We use one TSS in GeekOS.
*/
-//static struct TSS s_theTSS;
-static struct TSS *s_theTSS = (struct TSS *) TSS_LOCATION;
+static struct TSS s_theTSS;
static struct Segment_Descriptor *s_tssDesc;
static ushort_t s_tssSelector;
static void __inline__ Load_Task_Register(void)
{
+
/* Critical: TSS must be marked as not busy */
s_tssDesc->type = 0x09;
s_tssDesc = Allocate_Segment_Descriptor();
KASSERT(s_tssDesc != 0);
- memset(s_theTSS, '\0', sizeof(struct TSS));
- Init_TSS_Descriptor(s_tssDesc, s_theTSS);
+ memset(&s_theTSS, '\0', sizeof(struct TSS));
+ Init_TSS_Descriptor(s_tssDesc, &s_theTSS);
s_tssSelector = Selector(0, true, Get_Descriptor_Index(s_tssDesc));
*/
void Set_Kernel_Stack_Pointer(ulong_t esp0)
{
- s_theTSS->ss0 = KERNEL_DS;
- s_theTSS->esp0 = esp0;
+ s_theTSS.ss0 = KERNEL_DS;
+ s_theTSS.esp0 = esp0;
/*
* NOTE: I read on alt.os.development that it is necessary to
*/
Load_Task_Register();
}
+
+
+/* JRL THIS FUCKING SUCKS */
+
+uint_t GetTR_Base() {
+ return (uint_t)(&s_theTSS);
+}
+uint_t GetTR_Limit() {
+ return sizeof(struct TSS);
+}
+
+ushort_t GetTR_Selector() {
+ return s_tssSelector;
+}
+
+
+
+/* ** */