CODE:
/****************************************************************/
/*这是以前找工作的时候写的一个小程序, 可以将boot.img或dos.img等
烧到软盘或硬盘,只支持写FAT12和FAT16,而且有个bug,写太后面的磁
盘时会溢出.也懒的改了. */
/* */
/* test.c */
/* */
/* written by Liu Songling */
/* */
/* liusongling@gmail.com */
/* */
/* Match, 2006 */
/* */
/* */
/****************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
/*
* function for error
*/
void Error(int ErrorNum)
{
if (ErrorNum == 0)
fprintf(stderr,"Error opening source file\n");
if (ErrorNum == 1)
fprintf(stderr,"Error reading source file\n");
if (ErrorNum == 2)
fprintf(stderr,"Error accessing disk\n");
if (ErrorNum == 3)
fprintf(stderr,"Error writing disk\n");
if (ErrorNum == 4)
fprintf(stderr,"Error location the position,overflowed\n");
if (ErrorNum == 5)
fprintf(stderr,"I can not find the partion table,\
Please fix it fist,or the source file could not been writing to your disk\n");
if (ErrorNum == 6)
fprintf(stderr,"This program only support FAT16\n");
if (ErrorNum == 7)
fprintf(stderr,"There is no such a disk\n");
if (ErrorNum == 8)
fprintf(stderr,"The source file is not a valid img file\n");
if (ErrorNum == 9)
fprintf(stderr,"I can not find any DOS partion\n");
return ;
}
/*
* function for help
*/
void help()
{
printf("Usage:test
阅读(1631) | 评论(0) | 转发(0) |