I can only understand what the task control block and task table are for. But what i don't understand is what's inside a task(such as stack, new page directory and tables, size of stack).
I am trying to implement the multitasking for about a month now, still I am stuck at the begining stage. Here is what I think I know:
I need a tss descriptor in gdt for initialize a hardware switch.
I need a task table to hold the task control blocks.
Can anyone help me please.
I am looking at a diagram from intel. a system architecture overview.
In a task state segement(TSS), a task has code, data, and stack.
What I want to know is
what does the stack stores???
what does the code stores? is it just a cs register from the task below?
What does the data stores? is it just a ds register from the task below?
what does a new page directory and table do when create a task?
Here is my task state segment or task content, whatever the name is...
Code: Select all
struct task_state_segment
{
short backlink, __blh;
int esp0;
short ss0, __ss0h;
int esp1;
short ss1, __ss1h;
int esp2;
short ss2, __ss2h;
int cr3;
int eip;
int eflags;
int eax, ecx, edx, ebx;
int esp, ebp, esi, edi;
short es, __esh;
short cs, __csh;
short ss, __ssh;
short ds, __dsh;
short fs, __fsh;
short gs, __gsh;
short ldt, __ldth;
short trace, bitmap;
}__attribute__((packed));