Therx wrote:1. If I'm using paging to control memory access should my GDT just have a code and data segment covering the whole memory?
2. What ring level should these segments be?
You should have 4 segments: ring 0 code and data, and ring 3 code and data. Plus the null descriptor, of course.
3. How do I change ring level in software multitasking?
INT to go to a lower (more privileged) level, IRET to go to a higher (less privileged) level.
4. When I call is made to a hardware driver how do I make the ring change so that the driver can do IO or should the driver run as a ring 0 task and the call from the ring 3 app just add a command to a queue?
It's easier to have drivers running in ring 0, especially if all your driver management and I/O functions are in ring 0 as well. Otherwise, you can give drivers access to I/O ports using the I/O permissions bitmap in the TSS, and you can give them access to adapter memory using paging.
5. Is there a problem with this:-
Kernel Space to 3mb mapped to the same place in physical memory. Only the page tables for memory over 3mb change on a task switch
If I understand, you want to keep the kernel mapped into the same place at all times, and have the rest of the address space change when you switch processes. This is the 'right' way of doing it.
6. Is this as confusing as I think it is? ;D
Not when you get the hang of it.