5 ways to make an IMG image file

Source: Internet
Author: User
Tags python script
I usually use the DD command, today, look at the next win is how to do, search some methods ....
1. Use Debug in DOS

Write floppy.img to a disk
Debug floppy.img
-W 100 0 0 1
-Q

Write floppy.img to B-plate
Debug floppy.img
-W 100 1 0 1
-Q
here we'll replace floppy.img with Boot.bin .   2. Use of Winhex   Open the Boot.bin file with Winhex, press CTRL + A to select all the content, then right-click->edit->copy All->hex values, and then create a new file with Winhex, select the size in the pop-up window c13> 1.44M. Paste the hexadecimal value you just copied into 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,winimage tool to accomplish this task, of course, you can use other similar tools, the truth is the same. First, use WinImage to create a 1.44M floppy disk img file. Use UltraEdit32 to open the img file you just created, place the mouse cursor on the first line of the file, and use ctrl-d to delete 512 bytes. Set the dialog box for Advanced]-[configuration]-[General in UltraEdit32 to allow editing of hex 00 text files without converting them to spaces check. Then use UltraEdit32 to open << write the operating system >> the Boot.bin file in the book. Copy all of its contents and insert it at the beginning of the IMG file and save it.

5. the DD command under Linux, my favorite
1. Make floppy 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. Add diska.img from No. 512 byte to boot.img in replication (this is the best part of DD)
Command: DD if=diska.img of=boot.img skip=1 seek=1 bs=512 count=2879

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.