GRUB not working

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Xunil
Posts: 10
Joined: Thu May 28, 2009 12:20 am

GRUB not working

Post 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?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: GRUB not working

Post 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:

Code: Select all

kernel 200+18
boot
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.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Xunil
Posts: 10
Joined: Thu May 28, 2009 12:20 am

Re: GRUB not working

Post by Xunil »

How would I do that in virtualbox? And on real computers...

EDIT: ah ok I guess that this works the same way :P
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

Re: GRUB not working

Post 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?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: GRUB not working

Post 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.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Post Reply