Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I asked this question over on SO. I have tried

dd if=kernel.sys of=/dev/fd0 bs=512 seek=1

to get this file to write to the floppy. It is a kernel shell that must be written to the sector immediately following the bootsector of a disk to boot the PC. No matter what I've tried, for some reason, kernel.sys is not writing to the floppy. I know the bootstrap loader is being written and executed. However, it cannot find the kernel to load the shell.

Any ideas on what I am doing wrong? I mean, really, how is it so difficult to get this file written to a floppy?

OpenSUSE 11.2

share|improve this question

2 Answers 2

up vote 1 down vote accepted

In order to get the bootstrap loader and the kernel onto the floppy, we had to use qemu. Looking at the section on FAT disk images, we wrote a shell script:

# first create a raw empty floppy image
dd if=/dev/zero of=bootimage.img bs=512 count=2880

# our bootstrap contains the MBR for the floppy (i.e. it actually formats it to our specs, in this case FAT12)
dd if=bootup.bin of=bootimage.img bs=512 count=1 conv=notrunc

# mount into 'media/floppy'
losetup /dev/loop0 bootimage.img
mount -o loop bootimage.img /media/floppy

# we can actually list all files that we need to copy to disk here
cp bootsys.sys /media/floppy

# make sure we unmount, otherwise nothing gets written !!
umount /media/floppy
losetup -d /dev/loop0

# run QEmu
qemu -fda bootimage.img

I believe, that if you do not have a physical floppy drive, you are able to emulate a floppy by substituting /media/floppy for /mnt/floppy.

share|improve this answer
    
Clever workaround for what I'm sure was an irritating problem! –  DaveParillo Apr 10 '10 at 5:19
    
You wouldn't believe the level of irritation. About 1 1/2 weeks trying every example we could find on the Internet. Nothing was working. Then, over the next week and a half, we finally decided to start hammering out our own ideas. –  IAbstract Apr 14 '10 at 11:43

Looks as if you are trying to make a bootable dos disk. Not sure seek=1 is correct, but I have no idea. I think you would have to have command.com as well as kernel.sys to get a working boot floopy. Have you considered FreeDos? You can download it and follow the instructions to create a boot disk.

share|improve this answer
    
Yes, making a bootable disk but with our own bootstrap and kernel. I don't need command.com on the floppy. I do know that our bootstrap and kernel work as it was tested in bochs, and we have a successful boot floppy. The way we wrote kernel.sys to the disk was to use WindowsXP and mess with the file system. Should the floppy be formatted to DOS instead of ext2 (Linux)? –  IAbstract Mar 29 '10 at 12:01
    
I must say I have not tried what you are doing, but if I was putting a dos kernel.sys on a floppy, then yes, I'd make it dos format. –  DaveParillo Mar 31 '10 at 3:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.