Hi, I'm new to OS development but not new to programming. I have a question after I've compiled my NASM code, and C code, and link them together to a *.bin file. How do I boot it with GRUB?
PS. I don't have a floppy drive, and the emulator I'm using is Bochs. Also I've attached the Kernel.bin which is compressed as a tarball.
Having trouble booting my kernel in an emulator...
-
- Posts: 20
- Joined: Sun Jan 02, 2011 4:46 pm
Having trouble booting my kernel in an emulator...
- Attachments
-
- Kernel.tar
- This contains the Kernel.
- (12.5 KiB) Downloaded 36 times
Re: Having trouble booting my kernel in an emulator...
If your kernel is multiboot compliant there should be no problem. What happens when Grub tries to load it ?monsterhunter445 wrote:Hi, I'm new to OS development but not new to programming. I have a question after I've compiled my NASM code, and C code, and link them together to a *.bin file. How do I boot it with GRUB?
PS. I don't have a floppy drive, and the emulator I'm using is Bochs. Also I've attached the Kernel.bin which is compressed as a tarball.
If a trainstation is where trains stop, what is a workstation ?
-
- Posts: 20
- Joined: Sun Jan 02, 2011 4:46 pm
Re: Having trouble booting my kernel in an emulator...
Its not that GRUB can't boot my kernel, is just that I don't know how to get GRUB to boot my kernel. I've the GRUB.img which is the floppy disk image that contains GRUB, and I have the binary file that contains my kernel. So, my question is how do I use GRUB to boot my kernel. Do I have to link GRUB with my Kernel, or is it something else, because all the tutorials I've read only teaches you how to write a bootloader and a kernel, but not how to load it in an emulator or in an actual computer.
PS. Sorry for the neophyte question, I also know that the command 'kernel' loads the kernel with GRUB.
PS. Sorry for the neophyte question, I also know that the command 'kernel' loads the kernel with GRUB.
Re: Having trouble booting my kernel in an emulator...
You could read http://wiki.osdev.org/GRUB and http://www.gnu.org/software/grub/manual ... x.html#Top
If a trainstation is where trains stop, what is a workstation ?
-
- Posts: 20
- Joined: Sun Jan 02, 2011 4:46 pm
Re: Having trouble booting my kernel in an emulator...
Thanks for those links they were very helpful, but one more question. No I've decided to boot my kernel in an emulator called QEMU because it comes built with its very own bootloader. So I used the command below:
And I got this error:
So what does this error mean...oh and thanks for the help I appreciate it.
Code: Select all
qemu -L . -kernel Kernel.bin -boot c
Code: Select all
A disk image must be given for 'hda' when booting a Linux kernel
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Having trouble booting my kernel in an emulator...
I'm not sure since I don't use QEMU, but when you pass the option "-boot c", QEMU expects there to be a harddrive with the letter C, which becomes hda under linux.
What you need to do is use a loopback device to mount your grub image, put your kernel on the floppy and edit the menu.cfg to tell GRUB where your kernel is.
In case you are using Windows there are tools to create virtual drives as well. All of this is documented on the wiki.
What you need to do is use a loopback device to mount your grub image, put your kernel on the floppy and edit the menu.cfg to tell GRUB where your kernel is.
In case you are using Windows there are tools to create virtual drives as well. All of this is documented on the wiki.