bootinst.c

来自「用于制作启动软盘!」· C语言 代码 · 共 42 行

C
42
字号
/*

 * Boot installator.

 * Author: Serge Vakulenko, <vak@kiae.su>

 */



#include <stdio.h>

#include <fcntl.h>

#include <dos.h>



#define BOOTFILE	"boot.bin"

#define SAVEFILE	"bootsav.bin"

#define SAVE2FILE	"boot2sav.bin"



#define PartAddr        0x1be	/* Offset to partition table */

#define ValidationAddr  0x1fe	/* Offset to validation bytes */

#define MAGIC		0xaa55	/* Validation tag */



#define DISK1		0

#define DISK2		1

#define READ		0

#define WRITE		1



typedef struct PartitionEntry {

	unsigned char	bootIndicator;

	unsigned char	beginHead;

	unsigned char	beginSector;

	unsigned char	beginCyl;

	unsigned char	systemId;

	unsigned char	endHead;

	unsigned char	endSector;

	unsigned char	endCyl;

	unsigned short	relSectorLow;

	unsigned short	relSectorHigh;

	unsigned short	numSectorsLow;

	unsigned short	numSectorsHigh;

} PartitionEntry;



unsigned char bootRecord [512];

unsigned char bootProg [512];



char head1 [] =	"谀履哪哪哪哪履哪穆哪哪履哪哪哪哪哪哪哪履哪哪哪哪哪哪哪履哪哪哪哪履哪哪哪哪縗n";

char head2 [] =	"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?