Re: C code rebooting for no reason
Posted: Wed Oct 26, 2016 12:10 am
We can safely assume it's not the code that enables protected mode, since he's using GRUB which handles all of that.
The Place to Start for Operating System Developers
http://f.osdev.org/
i changed to GRUB now. And it worked. Also got the bonus of not having to reinstall GRUB (just do the grub-mkrescue step in the Bare Bones tutorial, lol).FusT wrote:We can safely assume it's not the code that enables protected mode, since he's using GRUB which handles all of that.
I used QEMU on the above picture, and i already got GRUB on the USB (i really have to use grub-mkrescue). It works on real hardware and emulators.ziggyfish2 wrote:So firstly use QEMU as this will give you access to some debugging information, that you can use to identify what the problem is. Use either the qemu -d , or the QEMU monitor to checkout what problems you are facing ( http://wiki.qemu.org/download/qemu-doc.html for more information on how to use it correctly).
Secondly, can you provide the qemu log file so we can tell you exactly what your problem is (I will not detail how to fix it though). Also provide your boot loader, as 0x07E00 address looks suspicious.
From what you have posted it looks like a problem with your interrupts, it seems you haven't disabled interrupts before you jump into protected mode. This needs to be done as the default interrupts that the BIOS provides are only 16bit, and will not work in 32 bit mode.
Thanks. Now i'm making a I/O keyboard output, and i swear i'll probably use a library for this..iansjack wrote:Congratulations. You have configured a GRUB menu.
Code: Select all
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
Then I think that you should consider rewriting the code.NunoLava1998 wrote:Finally wrote the tty.h file. This is the ending ); parts of my file. Seriously:Code: Select all
-snip