hi guys this is my first topic in this forum :)
i want to make a simple 32 bit operating system
but i have question about protected mode(i visit many websites but still not understand )
first: what is relationship between GDT(memory) and GDT register ?
or relationship between LDT(memory) and LDT register ?
the tables exist in memory
the registers point to the tables
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html (http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html)
Quote from: dedndave on June 01, 2012, 01:46:40 AM
the tables exist in memory
the registers point to the tables
ok
you mean this register is used for loading the table from memory.
i have another question:
who set the selector (like DS)? is the operating system?
can selector(like DS) change inside the program or task like in real mode?
A selector is an index into a descriptor table. Selectors are generally loaded into the segment registers by whoever set up the descriptor tables, and the contents of the segment registers can be changed as the program executes.
Quote from: MichaelW on June 01, 2012, 03:47:34 AM
A selector is an index into a descriptor table. Selectors are generally loaded into the segment registers by whoever set up the descriptor tables, and the contents of the segment registers can be changed as the program executes.
but
if segment registers can be changed as the program executes(by the task itself)
this mean that, the task can load any LDT,
then the task can access a segment of other tasks!!!
he never said it wouldn't generate an exception :biggrin:
U mean DS can't be changed during execution?
and if we try change DS during execution an exception will appear?
I ask these question because i want to build very simple 32 bit OS
and also On Monday i have seminar about 80386
Quote from: class on June 01, 2012, 04:53:15 AM
Quote from: MichaelW on June 01, 2012, 03:47:34 AM
A selector is an index into a descriptor table. Selectors are generally loaded into the segment registers by whoever set up the descriptor tables, and the contents of the segment registers can be changed as the program executes.
but
if segment registers can be changed as the program executes(by the task itself)
this mean that, the task can load any LDT,
then the task can access a segment of other tasks!!!
Actually, I did not specify who/what would be changing the contents of the segment registers, just that the contents can be changed. Windows will not allow a user program to make such a change, but protected-mode DOS apps can and do make such changes.
And I can't see how a "simple 32 bit OS" could possibly implement anything resembling multitasking.
Maybe it's worth to take a look at this project.
http://www.henkessoft.de/OS_Dev/OS_Dev1.htm (http://www.henkessoft.de/OS_Dev/OS_Dev1.htm)
Some resources on OS development: http://www.henkessoft.de/OS_Dev/OSDEV%20Ressourcen.html (http://www.henkessoft.de/OS_Dev/OSDEV%20Ressourcen.html)
Although it is in german you can get some good information there.
And maybe google-translation can help you, but I don't know how good thewe translations are ...
Thank you guys
if your interested in os development this book
http://www.amazon.com/Developing-32-Bit-Operating-System-Cd-Rom/dp/0672306557/ref=sr_1_6?ie=UTF8&qid=1338838748&sr=8-6
is now available as a free pdf, just search for mmurtl v1.0 to get source code
and heres the book (placed there by the author)
http://www.scribd.com/doc/15200312/MMURTL-V10