Does not work under grub

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
yanix

Does not work under grub

Post by yanix »

I compiled my new kernel image .
It includes 2 files :
boot.S - boot sector
kernel.c - contain 1 function , that prints string '123'.
It works under bochs 2.2.1 and vmware 5.0 ,
but does not work under grub ...

>:( >:( >:(
AR

Re:Does not work under grub

Post by AR »

What? GRUB is a bootloader. It LOADs kernels, it is not an emulator.

The BareBones in the Wiki has an example multiboot header if you are trying to use GRUB as the bootloader.
yanix

Re:Does not work under grub

Post by yanix »

There is makefile :
arebones.img: barebones bootfloppy.img menu.cfg ...

What is a bootfloppy.img and how i can take it for hard hisk image ?
AR

Re:Does not work under grub

Post by AR »

Ok, I have no idea what you're talking about. You install GRUB on a floppy (something along the lines of [Gentoo Linux]: "mount /dev/fd0 /boot; emerge grub") then configure menu.lst to boot the kernel:

Code: Select all

default 0
timeout 0

title My OS
kernel /MyOS/krnl.elf
Then reboot the computer with the floppy still in the drive to boot the OS. Alternatively, you can mount a loopback device to create a floppy image instead. With Bochs, the only difference between a harddrive and floppy image is whether you set it to be a floppy or harddrive in the settings file.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Does not work under grub

Post by Pype.Clicker »

http://www.osdev.org/osfaq2/index.php/W ... k%20Images

might help (just updated).

"A disk image is nothing more than a file whose content reflects the layout of a disk and that the tool will use as if it was a physical device. E.g. A floppy image typically is 1.44MB large and its 512 first bytes consist of the 'floppy's boot sector. The different sub-pages should tell you how to create such images from real disks and use them under the most common operating systems."
Post Reply