I try to write a very simple boot code that hook INT 10 as below:
New_int10:
Pushf
Cli
Call [CS:old_Int10]
Iret
The code work fine for all the cases, however when I try to boot to Window. The system hang. I debug in Bochs and notice the OS try to switch to v8086
mode then call the Int10
and with my new Int10 handler (at address 0x97400
) the execution fail (it does not go to handler that cause the system hang, it seems some mapping in protected mode not correct).
If don't change the INT10
I can step in the int10 handler
(the original handler at address 0xC0152
).
Do I miss anything?
I already hook the Int15h
to register the area of new handler withe820 type = 2
Update: I did more debug and find out...when the Window (it happen only when windows boot to safe mode) switch to v8086 mode, it set VME (in CR4) = 1,IPOL=3 and the program jump to 0x97400. Unfortunately, the page mapping is currently mapped this address to another physical address 0x7dd2000...so the application go crazy. The address 0xC0000 is still mapping to 0xC0000 that explain why if we don't change the INT10, the window can boot.
My question: is there any way to inform Window Boot Loader not to remap address 0x97400?
Thanks