Thanks
the tss...
-
Poseidon
the tss...
How do I use the tss exactly.. do I have to fill it in myself, does the CPU do it - and if it does, how do I let the CPU fill it in..?
Thanks
Thanks
-
AR
Re:the tss...
Yes and no, the CPU fills in an outgoing tasks state before loading in the new tasks state (Assuming hardware switching), but the initial values must be filled in manually.
In software switching the TSS is mostly unused with only the IOBitmap, SS0 and ESP0 being relevant.
A TSS definition looks like:Before you can (far) jump to the TSS in software switching you will have to fill CR3, the segment registers, EFLAGS, EIP and ESP. The jump will cause the CPU to load all the values in, beyond that point only SS0/ESP0 and the IOBitmap need to be maintained, everything else won't be used again as the active task is changed by simply changing the register contents manually before IRETing after an interrupt.
In software switching the TSS is mostly unused with only the IOBitmap, SS0 and ESP0 being relevant.
A TSS definition looks like:
Code: Select all
struct TSS {
unsigned short backlink, __unused0;
unsigned int esp0;
unsigned short ss0, __unused1;
unsigned int esp1;
unsigned short ss1, __unused2;
unsigned int esp2;
unsigned short ss2, __unused3;
unsigned int cr3;
unsigned int eip;
unsigned int eflags;
unsigned int eax, ecx, edx, ebx;
unsigned int esp, ebp, esi, edi;
unsigned short es, __unused4;
unsigned short cs, __unused5;
unsigned short ss, __unused6;
unsigned short ds, __unused7;
unsigned short fs, __unused8;
unsigned short gs, __unused9;
unsigned short ldt, __unused10;
unsigned short trace, iobitmap;
} __attribute__((__packed__));-
Poseidon
Re:the tss...
what do you mean actually with jumping to the tss? how can i do that?
and restoring the registers... just push 'n pop them on the process its stack?
thanks
and restoring the registers... just push 'n pop them on the process its stack?
thanks
-
Guest
Re:the tss...
Iam not sure, because iam not at the point of adding multitasking to my kernel but i think its something like this...
jmp TSS_GDT_SELECTOR:0
get the intel docs and look @ 6.1.3. Executing a Task
jmp TSS_GDT_SELECTOR:0
get the intel docs and look @ 6.1.3. Executing a Task
-
DruG5t0r3
Re:the tss...
I suggest ordering that book, it's quite usefull and more up to date than whats on the web site (oddly it should be the reverse)..
Re:the tss...
iirc exactly volume 3 was out of print permanently... I only got volume 1 + 2a/2b + optimization.
Re:the tss...
Same here, had to get it as pdf, which is a shame since i can't read it whenever i like ( can't print it either). :'(
-
DruG5t0r3
Re:the tss...
Realllyy...nice to know I'm one of them that has a copy. It's a brick by the way 
