Calling Real-mode interrupt idea....
Posted: Sat Sep 13, 2003 11:00 pm
While I was debating if I should put a v86 handler (for calling bios interrupts from pmode) into my OS, or just write everything without it (although, I was having issues with a vga driver without access to the bios interrupts), I came upon a great idea and was wondering if anybody has attempted it yet. Simply put an entry in my GDT for 16-bit code/data at memory address 0h, that way, I can manully get the address of each 16-bit interrupt. Would the iret in the 16-bit code return properly if it was called form a pmode interrupt (using a simple jump instruction). Anyways, here's the idea:
Call a pmode interrupt
Interrupt would read in the ivt at 0h and translate it's address over to a pmode address (it'd be a real-mode address), then jump to this address, which would have a valid 16-bit code/data entry in the GDT (so it knows to run it as 16-bit code!).
Jump to the address listed, and let it do it's thing, when it hits the IRET function, it'd return directly back to the location before the pmode interrupt was called.
Do you think this would work, or would a lot of things be broken because the interrupt is expecting to be in real-mode?
Call a pmode interrupt
Interrupt would read in the ivt at 0h and translate it's address over to a pmode address (it'd be a real-mode address), then jump to this address, which would have a valid 16-bit code/data entry in the GDT (so it knows to run it as 16-bit code!).
Jump to the address listed, and let it do it's thing, when it hits the IRET function, it'd return directly back to the location before the pmode interrupt was called.
Do you think this would work, or would a lot of things be broken because the interrupt is expecting to be in real-mode?