Page 1 of 1
GRUB not working
Posted: Thu May 28, 2009 12:30 am
by Xunil
I have my kernel.bin file, which I tries to get onto a floppy disk image along with the GRUB bootloader. I've followed the guide on the Wiki and copied the stage1 and stage2 files into my folder and made a pad file with the size of 750 bytes, and using this command:
Code: Select all
cat stage1 stage2 pad kernel.bin > floppy.img
But when I boot it up, it just starts a grub command line and is not booting my kernel.
What do I do wrong?
Re: GRUB not working
Posted: Thu May 28, 2009 1:32 am
by xenos
You're doing everything right, you just expect something wrong. Your kernel will not be booted until you tell GRUB to do so.
http://wiki.osdev.org/Bare_bones#Starting_bochs
It will display a "monitor" with some messages from GRUB, ending in a command promt. Type:
The first command means that the kernel starts at block #200 (see above) and its size is 18 blocks. This just loads the kernel into the memory, but does not start it. The boot command really starts the kernel.
Re: GRUB not working
Posted: Thu May 28, 2009 1:58 am
by Xunil
How would I do that in virtualbox? And on real computers...
EDIT: ah ok I guess that this works the same way
Re: GRUB not working
Posted: Thu May 28, 2009 7:33 pm
by essial
I'm not exactly familiar with the floppy style of GRUB (I do no-emulation CDs and HDs only), but don't you need a menu.lst file to tell grub what it needs to do?
Re: GRUB not working
Posted: Fri May 29, 2009 1:20 am
by xenos
If GRUB does not find a menu.lst file, it simply shows the command prompt and lets the user enter the commands manually, that would normally be listed in the menu.lst file. For the barebones tutorial, no menu.lst file and no even a file system is used, the kernel is simply loaded by entering its sector address into the command prompt.
And yes, it works the same way on real and simulated computers. Just enter the commands I quoted above.