Protected mode
I was wondering what exactly is protected mode, segmentation, and paging?
Do you know of any good explanations? |
This section of an "introduction to operating systems" guide has some info on segmentation/sharing and paging. IMO that guide is a fascinating read. :)
|
Hi -
Here's another good article: http://www.internals.com/articles/pr...troduction.htm Short explanation: * "Protected mode" is the opposite of "Real Mode" * "Protected mode" uses "virtual memory", which offers many, many benefits. "Real mode" accesses RAM directly, and has many, many limitations. * DOS used to use "real mode" (because that's the only thing that existed on earlier Intel CPU's). Linux boots into "real mode" (to set up the low-level virtual memory configuration). * "Real Mode" and "Protected mode" are Intel-specific terms. But virtually all general-purpose CPUs support "virtual memory" and, hence, generally run in the architecture equivalent of "real mode". * Segmentation" is largely an artifact of "real mode": you can safely consider it an "anachronism" in assembly programming. * "Pages" are an artifact of virtual memory ("protected mode"). * "Protected mode" is Good. "Real mode" not so much, most of the time. Which is why a lot of DOS-oriented tutorials and tips on the web can actually be *misleading* to the novice assembly language programmer. IMHO .. PSM PS: Did you resolve the 32-bit/64-bit issue in your "other thread"? Did you look up "multilib" yet? PPS: When you reference "another thread", it's helpful to provide a link. You can do this with the little icon of a "globe-and-chain-link" in the toolbar at the top of your LQ response window, if you didn't already notice it. Just a suggestion :) PPS: Book recommendation: "Professional Assembly Language", Richard Blum |
Quote:
|
By the way, I think that segment registers in x86 are rather an attempt to have more than 16 bits of address space on what otherwise is a 16 bits CPU.
Nowadays the segment registers are longer and allow access to 16Gbytes of address space using still 32 bits CPU - the trick/approach is called PAE (Physical Address Extension); there are PAE enabled kernels (both Linux and Windows); works visibly slower. |
Quote:
I can see what you meant, but I think that changes whether it is absolutely correct or not. |
I vaguely understand what segmentation and paging do, but I would like to know what the differences are?
How do you actually do segmentation/paging? What are the registers involved? |
Quote:
|
Quote:
I tried googling with no luck. |
Quote:
... Regarding "no luck" - sorry, but I simply do not trust such statements of yours anymore. So far I know that you apparently stop after reading just first 5 lines of 'ld --help | less', i.e. you've arrived up to this place: Code:
1 Usage: ld [options] file... So, just try harder. ... Have just rechecked myself by entering 8086 instruction set into yahoo.com search - a lot of relevant links as a result. |
Quote:
There you'll find the COMPLETE instruction set described in every great detail. In Volume 1 and 3, IIRC, you should also find good descriptions of the different operating modes: Volume 3a, Chapter 3: PROTECTED-MODE MEMORY MANAGEMENT Volume 3a, Chapter 4: PAGING That should contain all the information you need ... Happy reading :-D - Andi - |
Quote:
|
Quote:
|
Quote:
|
Quote:
What other excuses will you be looking for to avoid reading/learning ? Does yahoo.com work for you as search engine ? |
All times are GMT -5. The time now is 08:49 PM. |