haosheng
驱动牛犊
驱动牛犊
  • 注册日期2003-10-22
  • 最后登录2011-02-17
  • 粉丝1
  • 关注1
  • 积分5分
  • 威望21点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:948回复:0

谁能帮我看看这个fat16引导区的填写错误呀

楼主#
更多 发布于:2003-11-10 17:35
bs.jmpinst[0] = 0xEB;
bs.jmpinst[1] = 0x5A;
bs.jmpinst[2] = 0x90;
memcpy(bs.vendid, \"WALTONEY\", 8);
bs.secsize = 512; // each sector is 512 bytes long
bs.clustsize = 8; // one sector per cluster
bs.numrsv = 8; // no reserved sectors besides this one
bs.numfat = 2; // one FAT should be enough
bs.numfiles = (WORD)128; // more than enough to prove the point!
bs.numsectors = 0; // fill in totsectors instead
bs.media = 0xF8; // claim we\'re a fixed disk
    bs.fatsectors =(WORD)128; //(ncluster + ncluster + 511) / 512;
bs.tracksectors = (WORD) 63; // only 1 track, so all sectors are on it
bs.numtracks = 16; // 1 track
bs.numhidden = 0; // no hidden sectors
bs.totsectors = nsec; // this many sectors
bs.drive = 0x80; // flag for a hard drive
bs.xboot = 0x29; // flag as extended boot sector
bs.volid = (DWORD) hFile;

memcpy(bs.label, \"NO NAME    \", 11);
memcpy(bs.fattype, \"FAT16   \", 8);
 
bs.part[0].indicator = 0x00;
bs.part[0].parttype = 6; // DOS 16-bit FAT
bs.part[0].bias = 0;
bs.part[0].partsize = nsec;

bs.signature = 0xAA55;
游客

返回顶部