I wonder if anybody knows about effective address calculations in vm86. We know that we can execute 16 bits codes (real mode codes) in vm86.

When using CS, DS, ES, SS,  the numbers are multiplied by 16 and then are added to offset in real mode to make an effective=linear address while they are selectors in protected and have different meanings.

The real mode code may consider some assumptions about address which may be incorrect being executed in vm86. How the real mode code is executed perfectly? 
Posted on 2010-05-22 22:11:17 by logicman112
I think the answer to that lies in "virtual memory". The effective=linear address is calculated as segreg * 16 + offset, as if in real mode, but linear address != physical address. The address calculated by segreg * 16 + offset is further "interpreted" via page tables to discover the actual physical address (if the page is "not present", we may need to "page out" some other memory to disk and reuse its physical address - we don't want this to happen!) My knowledge of the details of vm86 mode and paging is pretty shakey, but I think that's how "protection" is maintained in conjunction with a "fake" 16-bit addressing mode. Your book has details, no doubt. :)


Posted on 2010-05-23 00:04:35 by fbkotler