Boot Floppy

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
roodee

Boot Floppy

Post by roodee »

I've written a basic bootsector and am trying to figure out how to get it into a usable form by bochs. dd if=bootsect of=floppy.img bs=512 count=1 creates the image, but doesn't bochs want a floppy sized image? How do I create an image with just the 512 byte boot sector and the rest of the space empty for now?
Curufir

Re:Boot Floppy

Post by Curufir »

Bochs will happily run a 512 byte file, it doesn't have to be a full disk image.
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:Boot Floppy

Post by Pype.Clicker »

if you really want to insert padding in your disk image, you still can use

Code: Select all

head --bytes=4096 /dev/zero >>floppy.img
of course, if you need more than 4096 zero bytes, just change the value ...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Boot Floppy

Post by Candy »

You can also pad up your floppy disk by seeking to the last sector last byte and then writing 1 zero byte. It's slightly more flexible (just pads your disk image to 1457664 bytes).

dd if=/dev/zero of=floppy.img seek=1457663 count=1 bs=1

On windows this may also be possible, but I don't know the tool for it.
Post Reply