I usually use the DD command. Today I'm curious. I 've searched some methods to find out how to do this in win ....
1. Use debug in DOSWrite floppy. IMG to disk
Debug floppy. img
-W 100 0 0 1
-Q
Write floppy. IMG to disk B
Debug floppy. img
-W 100 1 0 1
-Q
Here we will floppy. change IMG to boot. bin 2. use winhex to enable boot with winhex. BIN file, press Ctrl + A to select all content, right click-> edit-> copy all-> hex values, and use winhex to create a new file, in the displayed window, select 1.44 MB. Paste the copied hexadecimal value to the new file. Save as boot. IMG. 3. Use this Python script
# Make floppy img
Import sys
If Len (SYS. argv )! = 3:
Print 'usage: ', SYS. argv [0], 'binfilename imgfilename'
SYS. Exit ()
Fin = file (SYS. argv [1], 'rb ')
Bufbin = fin. Read (512)
Fin. Close ()
Bufbin + = ('/0' * (1474560-512 ))
Fout = file (SYS. argv [2], 'wb ')
Fout. Write (bufbin)
Fout. Close ()
4. I use the ultraedit32 and winimage tools to complete this task. Of course, you can use other similar tools in the same way.
- First, use winimage to create a m floppy disk imgfile.
- Use ultraedit32 to open the imgfile you just created, place the cursor on the first line of the file, and use ctrl-D to delete 512 bytes.
- In the [advanced]-[configuration]-[general] dialog box in ultraedit32, select "allow Edit Hex 00 text files without converting them to spaces.
- Use ultraedit32 to open the boot. binfile in the <write your own operating system> book. Copy all of its content and insert it into the beginning of the imgfile. Save it.
5.Dd commands in Linux, my favorite
1. Create a disk image file diska. img
Command: dd If =/dev/Zero of = diska. img bs = 512 COUNT = 2880
2. Copy boot. bin to boot. IMG.
Command: dd If = boot. bin of = boot. img bs = 512 COUNT = 1
3. Copy the content in diska. IMG from 512nd bytes to boot. IMG (this is the most brilliant part of DD)
Command: dd If = diska. IMG of = boot. IMG skip = 1 seek = 1 bs = 512 COUNT = 2879