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

Re: regarding 0x7c00

Shridhar Daithankar wrote:

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

I think it is not a 32/64 bit 8086 in real mode. It still have 20 bit address space + 64k - 16 bytes becasue of the segmentation technique which i used in the 8086 processor. All the processors from 386 to pentium start in the real mode with 0xffff0 as the starting address. This address is hardwired to the boot ROM. [ I think Itanium directly starts in the protected mode . Some body clear me ?].

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

 hey i think it is turley - titile : advance programming in 80386. It is fantastic book on 80386. you
can try a search in amazon.com. Worth

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

I think it is tidious to have multiple GDTs. Because for every memory access the segment address is converted to the linear - physical address [dependent on whether paging is enabled or not] using the selector register [CS, DS etc..] and the offset register [IP, etc..]. So to swap the GDTR register the swapper code must be highly suffisticated.

what it is GDT->GDTs->LDTs ? I dont think it is possible.  But still with GDT-> LDTs we can run few thousands of process.

> Sorry if that was stupid...
>  Bye
>   Shridhar
> kamesh jayachandran wrote:
> > what is realmode?
> ---------------------------------------------
> LIP is all for free speech.  But it was created
> for a purpose.  Violations of the rules of
> this list will result in stern action.