today I have got alot of "Error 13: Invalid or unsupported executable format" from GRUB when I have added a few lines to my kernel code just recently I added this timer_phase I found in a tutorial
Code: Select all
void timer_phase(int hz)
{
int divisor = 1193180 / hz; /* Calculate our divisor */
outportb(0x43, 0x36); /* Set our command byte 0x36 */
outportb(0x40, divisor & 0xFF); /* Set low byte of divisor */
outportb(0x40, divisor >> 8); /* Set high byte of divisor */
}
well that was no problem but then I added the line
into my kernel main and then GRUB said it was an invalid executable again, I have done a few minor changes to some functions here and there mostly extended my Error messages so they have a little bit more information but when I tried to create a nice "frame" around the message with stars (*) like this:
Code: Select all
******************
* Error message *
******************
GRUB didn't like that I had a loop to fill out the spaces so the * after error message got at the end of the star line above so I removed that for loop and have no star at the end of the message and then it works.
But WHY does my kernel become invalid just by adding a little bit of code? My kernel compiles without any warnings.