creating the floppy image and booting with bochs.
Posted: Fri Dec 19, 2008 1:49 pm
I'm trying to create a floppy image in order to boot my kernel (and not used a pre-made floppy image!)
I've created a new directory named /mnt and a new image called floppy.img and did the following:
bochsrc.txt is supposed to tell Bochs to load floppy.img,
but apparently this is not working! Bochs tries to boot from floppy and then it says that there's no bootable device!
(i also tried qemu -fda floppy.img, and still it said "No bootable device.")
Please help out guys, thanks.
(I've gotta mention that i've created a grub directory in the mnt dir and put stage 1, stage 2 in it...and i also installed grub in /dev/loop0 this way:
)
I've created a new directory named /mnt and a new image called floppy.img and did the following:
Code: Select all
dd if=/dev/zero of=floppy.img bs=1024 count=1440
sudo /sbin/losetup /dev/loop0 floppy.img
sudo mkfs -t ext2 /dev/loop0
sudo mount -t ext2 /dev/loop0 /home/executer/Desktop/paging/mnt
sudo cp src/kernel /home/executer/Desktop/paging/mnt/kernel
cd mnt
sudo mkdir grub
sudo cp /usr/lib/grub/i386-pc/stage[12] /home/executer/Desktop/paging/mnt/grub
sudo grub --device-map=/dev/null
sudo umount /dev/loop0
sudo /sbin/losetup -d /dev/loop0
sudo bochs -f bochsrc.txt
Code: Select all
megs: 32
romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0x00000
vgaromimage: /usr/share/bochs/VGABIOS-elpin-2.40
floppya: 1_44=floppy.img, status=inserted
boot: a
log: bochsout.txt
mouse: enabled=0
clock: sync=realtime
cpu: ips=500000
(i also tried qemu -fda floppy.img, and still it said "No bootable device.")
Please help out guys, thanks.
(I've gotta mention that i've created a grub directory in the mnt dir and put stage 1, stage 2 in it...and i also installed grub in /dev/loop0 this way:
Code: Select all
grub --device-map=/dev/null
grub> device (fd0) /dev/loop0
grub>root (fd0)
// root(fd0) produced: Unknown partition table signature
grub> setup (fd0)
// setup(fd0) produced:
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... no
Running "install /grub/stage1 (fd0) /grub/stage2 p /grub/menu.lst "... succeed
ed
Done.