hello guys
can any one tell me how to set only 1 TSS to be used for all processes and how to do multitasking with it.
and how can i set and LDT for every process using pure segmentation.
please i know some theoritcal i need simple code in assembly or c to understand it , please
i will appreciate this.
thanks alot
TSS howto ?
Re:TSS howto ?
You need to be more specific, and provide some evidence that you've at least tried it for yourself before I'll just throw code to you.
The idea for software multitasking is that you create the TSS but don't use any of it except for SS0 and ESP0 (and optionally the IO Bitmap), just LTR (assembly instruction) the TSS and IRET to the first task (manually pack the parameters for IRET using PUSH). Note that you will need a seperate TSS for each CPU.
For the LDT, you'll probably need to manually LLDT the LDT before the IRET to switch tasks (I am unsure about this as I don't use the LDT).
The idea for software multitasking is that you create the TSS but don't use any of it except for SS0 and ESP0 (and optionally the IO Bitmap), just LTR (assembly instruction) the TSS and IRET to the first task (manually pack the parameters for IRET using PUSH). Note that you will need a seperate TSS for each CPU.
For the LDT, you'll probably need to manually LLDT the LDT before the IRET to switch tasks (I am unsure about this as I don't use the LDT).
Re:TSS howto ?
how can i try without understanding well ?
can i achive multitasking by means of software without any TSS ?
i read that gdt is loaded by lgdt mem this mem points to the gdt information (limit, start), but can IDT and LDT loaded the same way or i've to create a descriptor for them in the gdt and put it in ax then do lidt ax or lldt ax ?
sorry for my newbies questions :-\
can i achive multitasking by means of software without any TSS ?
i read that gdt is loaded by lgdt mem this mem points to the gdt information (limit, start), but can IDT and LDT loaded the same way or i've to create a descriptor for them in the gdt and put it in ax then do lidt ax or lldt ax ?
sorry for my newbies questions :-\
Re:TSS howto ?
The IDT requires a straight size descriptor like the GDT, don't remember about the LDT as I don't use it but it requires a GDT entry declaring the LDT Table I think, then you LLDT the selector.
There is an example of how to declare a TSS over on Bonafide, if you're already in protected mode then you should know how to create GDT Descriptors, the TSS is pretty much the same, it just has a different segment type IIRC.
You can multitask without the TSS, but only if all programs run in kernel space, or the kernel runs in user space, both of which will kill all security.
There is an example of how to declare a TSS over on Bonafide, if you're already in protected mode then you should know how to create GDT Descriptors, the TSS is pretty much the same, it just has a different segment type IIRC.
You can multitask without the TSS, but only if all programs run in kernel space, or the kernel runs in user space, both of which will kill all security.