BIOS interrupts in C
Posted: Mon Jun 11, 2007 7:46 am
Hello,
Firstly sorry for a stupid question, I just can't seem to find a definitive answer anywhere...
I gather that I am allowed to call a limited subset of BIOS interrupts when in protected mode.
So far, I have set up a basic kernel with an idt, gdt, and isr (not edited much from the 'standard' routines). They appear to work fine, since I am able to access all the physical memory, set up and handle interrupts for the keyboard and PIC, etc...
Now I would like to call a BIOS interrupt (for example to get VBA modes).
So I call the following asm function from my C code:
However, instead of whatever data I should be receiving, I receive my own error message set up in isr interrupt callback function (ie: kernel panic [message])...
So the question is mainly: how do I get the interrupt to reach the BIOS, or is that not possible?
Thanks for any help!
Franchie.
Firstly sorry for a stupid question, I just can't seem to find a definitive answer anywhere...
I gather that I am allowed to call a limited subset of BIOS interrupts when in protected mode.
So far, I have set up a basic kernel with an idt, gdt, and isr (not edited much from the 'standard' routines). They appear to work fine, since I am able to access all the physical memory, set up and handle interrupts for the keyboard and PIC, etc...
Now I would like to call a BIOS interrupt (for example to get VBA modes).
So I call the following asm function from my C code:
Code: Select all
call_interrupt:
cli ; clear interrupts (so that nothing interferes, who knows)
mov eax, 0x4F00 ; value of AX...
int 10h ; actually call the interrupt!
sti ; start the interrupts again!
retSo the question is mainly: how do I get the interrupt to reach the BIOS, or is that not possible?
Thanks for any help!
Franchie.