Page 1 of 1
returning real mode from pmode
Posted: Thu Oct 20, 2005 12:25 am
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)??
Re:returning real mode from pmode
Posted: Thu Oct 20, 2005 5:25 am
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)