FAT 12实施 [英] FAT 12 Implementation
问题描述
我一直在 http://www.brokenthorn.com 上关注操作系统开发教程.现在,我正在尝试使用以下代码设置BIOS参数块:
I have been following the Operating System development tutorial on http://www.brokenthorn.com. Right now I'm trying to setup the BIOS parameter block with this code:
jmp loader
bpbName db "NubOS",0,0,0
bpbBytesPerSector: DW 512
bpbSectorsPerCluster: DB 1
bpbReservedSectors: DW 1
bpbNumberOfFATs: DB 2
bpbRootEntries: DW 224
bpbTotalSectors: DW 2880
bpbMedia: DB 0xF0
bpbSectorsPerFAT: DW 9
bpbSectorsPerTrack: DW 18
bpbHeadsPerCylinder: DW 2
bpbHiddenSectors: DD 0
bpbTotalSectorsBig: DD 0
bsDriveNumber: DB 0
bsUnused: DB 0
bsExtBootSignature: DB 0x29
bsSerialNumber: DD 0xa0a1a2a3
bsVolumeLabel: DB "MOS FLOPPY "
bsFileSystem: DB "FAT12 "
但是,当我尝试使用 ImDisk驱动程序打开磁盘时虚拟软盘,它表示驱动器需要格式化.我使用的代码正确吗?
However, when I try to open the disk using the ImDisk driver for virtual floppies, it says that the drive needs to be formatted. Is the code I'm using correct?
推荐答案
尝试短跳转:该扇区以jmp short loader
开头,然后是nop
,然后通过bpbName
c3>,然后是loader:
和所有代码,然后是512字节扇区的最后2个字节为0x55
和0xAA
.这两个必须分别在偏移量510
和511
处.
Try a short jump: the sector begins with jmp short loader
, followed by nop
, then go bpbName
through bsFileSystem
, then loader:
and all your code and then the last 2 bytes of the 512-byte sector being 0x55
and 0xAA
. These two must be at offsets 510
and 511
respectively.
这篇关于FAT 12实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!