[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: regarding 0x7c00



Hi

x86 processors above 386 can operate in two modes, real and protected.

Real mode is one in which processor behaves as traditional microprocessor where
all hardware address are used as it is. It's the mode in which dos operates. It
has limit of memory space available and it does not allow process isolation.
Think it as 32/64 bit 8086 at whatever speed you are using....

In protected mode, the code execution can take place in 4 levels 0-3. Additional
Memory management unit comes into picture which can translate memory addressess.
This MMU provides following operations

1)Mapping memory addresses
2)Raises interrupt when particular memory page is not available. So it can be
used for virtual memory implementation.
3)Implements hardware bound on memory. Any attempt to access memory outside
range will raise interrupt. Typically OS is expected to core dump such
program.This happens without affecting any other programs.
4)Provides variable lengh memory segments varying from 0 bytes to 4GB. The
resolution is 1 byte till some bound(about 512MB, don't remember) and then it's
64 KB. It's a 48 bit word, which stores resolution, base address in terms of
64K pages and some offset. At large size pages, last field offset is turned into
64K pages rather than a single byte. Nice architecture....

Additionally four levels of code execution isolates processes. No program can
jump to another level other than OS granted ones. Stack/code/data is separate
for each level and is typically inaccessible for lower level i.e. 3. Level three
can not access space for level 1 1but level 1 can access space for level 0 etc.

OS operates at level 0 code and user program at level 3. Unix(Don't know if this
applies to linux) does not take advantage of all 4 levels to maintain
portability as many other architectures like Motorola 68K offers only two modes
of program isolation. Anyway according to unix philosophy only two level
isolation is required i.e. user level and kernel level. I wonder how they did
with 286... :-))

In simple words, following will work for real mode but not for protected mode.

/*C code*/
char *ptr=0xb8000000;

while(1)*ptr++=0;
/*C code */

Or real mode is what is not protected mode... :-))

The reason I hate windows is that they did not implement protected mode truely
with 95 and 98. I hope they have done it for NT but even not sure of that...

For more explanation read a book for 386 by Tally. Not even sure of that. It was
my B.E. course book. Will come back on this by tommorow.

HTH

 Correct me if I am wrong.

BTW any idea if multiple GDT's can be maintained on x86 processors so that more
number of processes can be run? I mean this should be possible if one GDT is
always maintained in the memory while rest of them made swappable. A chain of
GDT->GDTs->LDTs can made number of processes available truely high....

Sorry if that was stupid...

 Bye
  Shridhar

kamesh jayachandran wrote:

> what is realmode?