I wrote a while loop that hangs when the keyboard controller is not ready:
while(inb(0x64)!=0){
}
However now qemu restarts everytime I attempt to boot the kernel. Sometimes I can see the vga output for a really short time. I tried to remove the inb, and it still restarts unless I remove it
EDIT:
Here's the complete code:
int *resolution_ptr;
void init_vbe(){
regs16_t vberegister;
vberegister.bx=0x4107;
vberegister.ax=0x4f02;
int32(0x10,&vberegister);
*resolution_ptr=1280;
}
void kernel_main(void)
{
resolution_ptr=(int*)0x2ff0; /*define the address of the resolution, so that the printstring function can draw the letter correctly*/
init_vbe ();
printstring("Kernel sucessfully loaded.");
while(inb(0x64)!=0){ /*code that cause qemu to restart*/
}
}
bochs thrown this error when I try to run my kernel in it:
00096454180e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
Also INT32 is from here:https://gist.github.com/carlosascari/35dba95ee3118ebf61f4bd1625f4fa11