returning real mode from pmode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
zobada

returning real mode from pmode

Post by zobada »

what precautions must be taken in order to return real mode from pmode. I mean are there some parts of memory not to be touched to return real mode later in pmode (like interrupt vector table area)??
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:returning real mode from pmode

Post by Pype.Clicker »

well, anything that contains real mode stuff (e.g. IVT, BDA, EBDA) shouldn't be touched. If you're returning to DOS, then you should additionnally make sure you didn't touch anything that wasn't allocated through DOS functions (including XMS based functions for HMA).

Otherwise, you should make sure the PIC is restored to its initial value, that segment limits are reset to 64K (or you're actually returning to _unreal_ mode), and that TS bit is cleared (or you might experience system hangup on FPU operations).

I think it's all. my SOS does all this (located in kernel/src/init directory of clicker)
Post Reply