News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

questions about 80386

Started by class, June 01, 2012, 12:16:19 AM

Previous topic - Next topic

class

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 ?

dedndave


class

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?

MichaelW

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.
Well Microsoft, here's another nice mess you've gotten us into.

class

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!!!

dedndave

he never said it wouldn't generate an exception   :biggrin:

class

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

MichaelW

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.

Well Microsoft, here's another nice mess you've gotten us into.

Greenhorn

Maybe it's worth to take a look at this project.
http://www.henkessoft.de/OS_Dev/OS_Dev1.htm

Some resources on OS development: 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 ...
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.

class


brethren

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