Author Topic: questions about 80386  (Read 9709 times)

class

  • Guest
questions about 80386
« on: June 01, 2012, 12:16:19 AM »
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

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: questions about 80386
« Reply #1 on: June 01, 2012, 01:46:40 AM »

class

  • Guest
Re: questions about 80386
« Reply #2 on: June 01, 2012, 02:12:31 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

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: questions about 80386
« Reply #3 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.
Well Microsoft, here’s another nice mess you’ve gotten us into.

class

  • Guest
Re: questions about 80386
« Reply #4 on: June 01, 2012, 04:53:15 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

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: questions about 80386
« Reply #5 on: June 01, 2012, 04:56:14 AM »
he never said it wouldn't generate an exception   :biggrin:

class

  • Guest
Re: questions about 80386
« Reply #6 on: June 01, 2012, 05:11:37 AM »
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

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: questions about 80386
« Reply #7 on: June 01, 2012, 07:06:49 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

  • Member
  • ***
  • Posts: 434
Re: questions about 80386
« Reply #8 on: June 01, 2012, 09:21:47 AM »
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

  • Guest
Re: questions about 80386
« Reply #9 on: June 02, 2012, 01:59:05 AM »
Thank you guys

brethren

  • Guest
Re: questions about 80386
« Reply #10 on: June 05, 2012, 05:47:22 AM »
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