How to Use the programming method-several methods to create a 1.44 MB Floppy disk image... (One C language method)

Source: Internet
Author: User

First, analyze the number of bytes occupied by the following 1.44 MB Floppy disk image. The data I found is 1474560. However, I still don't understand how this is calculated? If anyone knows, please advise. In fact, a floppy image is a 1.44 MB file. As long as you have a way to generate a 1.44 MB file. Then a floppy disk image is complete. Understand the principles. Next, let's implement it.

Method 1: C Language

# Include <stdio. h>

Int main ()
{
Long I;
For (I = 0; I <1474560; I ++)
Printf ("0 ");
Return 0;
}

 

Save the above program as disk. C. (Note: take the file name as needed .)

Compile it. This should not be a problem... A compilation method is provided.

If you have a GCC compiler, You can compile it like this: GCC disk. C-o disk.exe

Run the command line cmd to perform the following operations:

Disk.exe> fkix. img

The preparation of the floppy disk is complete. The following is a demonstration of my actual operations on my machine.
:/Documents ents and settings/Administrator> GCC disk. C-o disk. e

:/Documents ents and settings/Administrator> dir disk.exe
Volume in drive C is WINXP
Volume serial number is 0c65-8236

Directory of C:/Documents ents and settings/Administrator

010-04-30 15,663 disk.exe
1 file (s) 15,663 bytes
0 Dir (s) 3,743,170,560 bytes free

:/Documents and Settings/Administrator> disk.exe> fkix. img

:/Documents and Settings/Administrator> dir fkix. img
Volume in drive C is WINXP
Volume serial number is 0c65-8236

Directory of C:/Documents ents and settings/Administrator

010-04-30 1,474,560 fkix. img
1 file (s) 1,474,560 bytes
0 Dir (s) 3,741,696,000 bytes free

:/Documents and Settings/Administrator>

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.