使用BIOSDISK函数的C程序,用于系统附带的可移动磁盘。检查它是否准备好访问。读取驱动器参数

C program using BIOSDISK function for a removable disk attached with system. Check whether it is ready for access or not. Read the drive parameters

使用BIOSDISK函数编写C语言程序完成以下三项任务。 假设您的系统附有一张可移动磁盘。检查它是否准备好访问。在任何一种情况下都显示适当的消息。 读取系统第一个可移动磁盘的驱动参数。 (驱动器参数将在作为参数传递的缓冲区中返回)。读取后,将缓冲区的内容写入文件。 格式化 Track number 1 并设置系统第一个可移动磁盘的坏扇区标志(如果存在坏扇区)。其余参数应如下所示: 磁头号 = 0,扇区号 = 1,扇区总数 (nSect) = 1

使用biosdisk(int command No, int drive No, int head No, int track No, int sector No, void *buffer);
Drive 是一个数字,指定要使用的磁盘驱动器:

0 for the first floppy disk drive, 1 for the second floppy disk drive, 2 for the third, and so on.
For hard disk drives, a drive value of 0x80 specifies the first drive, 0x81 specifies the second, 0x82 the third, and so forth.