Okay, I understand the basics of PMode after lots of experimenting. I now know how to load selectors, setup the GDT and do some basic PMode work (yay!) but there is much I need to learn. I could use LDTs but I'm not sure how to impliment them or why I need them. Should each program have a LDT inside them? Maybe someone could point me to a good online book since the Intel manuals confuse the hell out of me and I can't get any local books that are worth reading. I need "down to earth" speak.
I would also like to learn the basics of multitasking using the control registers that the 386 offers.
If I need a task table (if thats what it's called) then can I have the programs task state anywhere in memory or does it have to be in the same segment as the kernel?
I'm thinking I just need a GOOD book.
Thankyou.
The Neverending PMode
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:The Neverending PMode
whether you need LDT or not basically depends on how you're going to implement your Application Binary Interface and your process protection model. If you go for a pure-Unix way, then you need just one TSS per CPU, and hardly more than 4 segments (code & data, user & system) ... so no need for LDT.
Now, let's imagine you want to run all the small tools launched by a shell in the same address space as the thread (for performance reasons) and that you want to provide a bit of protection among them (not letting them overwrite each other's memory as 'normal' threads would do). You can give each of those 'tool-process' a separate LDT so that they cannot interfere with each other, but still having the opportunity of sharing memory buffers for data exchange and synchronization ...
Now, let's imagine you want to run all the small tools launched by a shell in the same address space as the thread (for performance reasons) and that you want to provide a bit of protection among them (not letting them overwrite each other's memory as 'normal' threads would do). You can give each of those 'tool-process' a separate LDT so that they cannot interfere with each other, but still having the opportunity of sharing memory buffers for data exchange and synchronization ...
Re:The Neverending PMode
Wow, okay. There is so much to think about in the design area.
I would like to give each task its own personal space and make each task think it's at address 0. If I read correctly, this means I need paging? I want each program to have its own data and code segments seperate from all others so that a memory layout would look something like..
kernel code
kernel data
task1 code
task1 data
task2...
I want each task to think- its the only task and starts at the beginning of memory.
Can I move memory around and still make applications think they are at the same memory location? This is what paging does right?
If I'm thinking correctly, this doesn't allow for memory holes (fragmentation) right?
Thanks.
I would like to give each task its own personal space and make each task think it's at address 0. If I read correctly, this means I need paging? I want each program to have its own data and code segments seperate from all others so that a memory layout would look something like..
kernel code
kernel data
task1 code
task1 data
task2...
I want each task to think- its the only task and starts at the beginning of memory.
Can I move memory around and still make applications think they are at the same memory location? This is what paging does right?
If I'm thinking correctly, this doesn't allow for memory holes (fragmentation) right?
Thanks.