I want to call a real mode interrupt from SMM. SMM is essentially flat real mode (4GB limit instead of 64k).
How do I go about executing the BIOS interrupts? I don't know if I have to switch back to real mode and execute the code, or set up an IDT. I've tried to execute the code directly by pushing EFLAGS, CS, and IP on the stack, jumping to the memory address, but this locks up (unless I'm doing it wrong).
Example code is the best. The problem with SMM is that the processor initiates the mode, so I don't have tables of GDT etc. to play with, and don't know if it's safe to modify the SMM GDT.