I am working on the Suspend/resume support for X86 platform in Windows CE 6.0. I am doing the below steps to resume.
Before sleep I am saving the GDTR and all other control and segment register values to a location above 1 MB because the entire 1MB region is used by BIOS, so we can’t save anything there. After the BIOS gives control to the OS during resume, it is
in the real mode. SO I need to shift to protected mode. Now the GDTR register value is stored in region above 1MB which is not accessible in real mode. But I cannot access above 1MB in real mode and mode shift cannot be done without a valid GDT table address
stored in GDTR register. So, my idea is to create a GDT table for mode shift temporarily and use the base address for that table as the GDTR value and set the protection enable bit with paging disabled, and after mode shift we can reload the previous GDTR
and CR0 value so that the OS resumes to exact place from where it went to sleep with paging enabled.
can anyone please advice whether this method is correct?