Home arrow Forums
OSDEV Forums  


luckydog
User

Fresh Osdever
Posts: 2
graphgraph
Karma: 0  
How to Copy my Bootsector to a Floppy with dd command - 2005/03/24 23:53 hi,
i'm working on the bochs under lredhat9. i 've compiled a bootsector and created a floppy image with the bximage.
now i don't know how to copy the bootsector to the floppy image.
thang you!

<span class='smallblacktext'>[ Edited ]</span>
  | | The administrator has disabled public write access.
OSDEV
Community
Advertisement
   
root
Moderator

Moderator
Posts: 121
graphgraph
Karma: 1  
Re: How to Copy my Bootsector to a Floppy with dd command - 2005/03/25 02:30 Hello,

You can stay in the Linux shell and execute:
Code:

$ dd if=my-boot-sector of=/dev/fd0 bs=512 count=1


Or if you'd like to make a floppy image
Code:

$ dd if=/dev/zero of=my-image.bin bs=512 count=2880
$ mkfs.msdos my-image.bin
$ dd if=my-boot-sector of=my-image.bin bs=512 count=1


The first line will create a zero filled file with 512 * 2880 bytes, which is exactly the size of a floppy. The 2nd will create FAT12 structures in the image and the last, as above, will copy the bootsector.

The 2nd command might be rewritten on some system, as it first shoud be mounted as a loop device (/dev/lo*), but it should work this way.

Good luck!
  | | The administrator has disabled public write access.
luckydog
User

Fresh Osdever
Posts: 2
graphgraph
Karma: 0  
Re: How to Copy my Bootsector to a Floppy with dd command - 2005/04/01 03:36 really cool! thank you !
  | | The administrator has disabled public write access.
indes
User

Fresh Osdever
Posts: 1
graphgraph
Karma: 0  
Re: How to Copy my Bootsector to a Floppy with dd command - 2005/06/15 16:29 I found using the loopback devices work the best...

dd if=/dev/zero of=myimage.img count=1440
losetup /dev/loop0 myimage.img
dd if=myimage.img of=/dev/loop0 bs=512 count=1
  | | The administrator has disabled public write access.
root
Moderator

Moderator
Posts: 121
graphgraph
Karma: 1  
Re: How to Copy my Bootsector to a Floppy with dd command - 2005/06/15 17:09 Very true regarding disk imagining.

For bootsector writing there's just one dd way
Thanks for posting
  | | The administrator has disabled public write access.

A WebArticles site. Sponsored by Evoleto. Motorola V525 / Business Directory / Delaware Incorporation / Home Made Bazaar