This file declares OS-independent structures and symbol names used in function of Basic Input Output System BIOS.
bioss HEAD ; Start of interface block includable to other programs.
; Predefined static values are typical for 1.44MB floppy disk. |[BPB_FAT16]| BPB_FAT16 STRUC ; Base BPB_FAT16. Size=0x19=25. |7C0B:0002 | .BytesPerSector D WORD 0x0200 ; Size of HW sector, usualy 512. |7C0D:01 | .SectorsPerCluster D BYTE 0x01 ; Valid values 1,2,4,8,16,32,64,128. |7C0E:0100 | .ReservedSectors D WORD 0x0001 ; NrOfSectors preceding FAT. |7C10:02 | .NumberOfFats D BYTE 0x02 ; |7C11:E000 | .RootEntries D WORD 0x00E0 ; Max number of YWORD entries in the root dir. |7C13:400B | .SmallSectors D WORD 0x0B40 ; See also .LargeSectors. |7C15:F0 | .MediaDescriptor D BYTE 0xF0 ; 0xF0 floppy disk, 0xF8 hard disk. |7C16:0900 | .SectorsPerFat D WORD 0x0009 ; |7C18:1200 | .SectorsPerTrack D WORD 0x0012 ; |7C1A:0200 | .NumberOfHeads D WORD 0x0002 ; |7C1C:0000~~| .HiddenSectors D DWORD 0x00000000 |7C20:0000~~| .LargeSectors D DWORD 0x00000000 |7C24: | ; Extended BPB_FAT16. Size=0x1A=26. |7C24:00 | .PhysicalDriveNumber D BYTE 0x00 ; 0x00 floppy disk, 0x80 hard disk. |7C25:00 | .Reserved D BYTE 0x00 ; |7C26:29 | .ExtBootSignature D BYTE 0x29 ; Or 0x28. |7C27:1122~~| .VolumeSerialNumber D DWORD %^TIME ; Randomly generated number. |7C2B:4E4F~~| .VolumeLabel D B "NO NAME " ; Space-padded to size=11. |7C36:4641~~| .FileSystemType D B "FAT12 " ; Space-padded to size=8. |7C3E: | ENDSTRUC BPB_FAT16 ; Total BPB_FAT16. Size=0x33=51.
BPB_FAT32.ExtendedFlags
:
┌┬┬┬─┬┬┬┬──┬┬┬──────── reserved
││││ ││││ │││
0000_0000_0000_0000b .ExtendedFlags layout
│ ││││
│ └┴┴┴─── 0..15 zero-based ordinal number of active FAT when mirroring is disabled.
└─────────── 1= FAT mirroring is disabled, use the active one.
; Predefined static values are typical for 8GB flash disk. |[BPB_FAT32]| BPB_FAT32 STRUC ; Base BPB_FAT32. Size=0x35=53. |7C0B:0002 | .BytesPerSector D WORD 0x0200 ; Size of HW sector, usualy 512. |7C0D:08 | .SectorsPerCluster D BYTE 0x08 ; Valid values 1,2,4,8,16,32,64,128. |7C0E:2000 | .ReservedSectors D WORD 0x0020 ; NrOfSectors preceding FAT. |7C10:02 | .NumberOfFats D BYTE 0x02 ; |7C11:0000 | .RootEntries D WORD 0x0000 ; Max number of YWORD entries in the root dir. |7C13:0000 | .SmallSectors D WORD 0x0000 ; See .LargeSectors. |7C15:F0 | .MediaDescriptor D BYTE 0xF8 ; 0xF8 hard disk of flash disk, 0xF0 floppy disk. |7C16:0000 | .SectorsPerFat D WORD 0x0000 ; |7C18:3F00 | .SectorsPerTrack D WORD 0x003F ; |7C1A:FF00 | .NumberOfHeads D WORD 0x00FF ; |7C1C:2000~~| .HiddenSectors D DWORD 0x00000020 |7C20:E0FF~~| .LargeSectors D DWORD 0x00EFFFE0 ; 7.5 GB. |7C24:E33B~~| .SectorsPerFat32 D DWORD 0x00003BE3 |7C28:0000 | .ExtendedFlags D WORD 0x0000 ; Encoding see above. |7C2A:0000 | .FileSystemVersion D WORD 0x0000 ; |7C2C:0200~~| .RootClusterNumber D DWORD 0x00000002 |7C30:0100 | .FsinfoSectorNumber D WORD 0x0001 ; |7C32:0600 | .BackupBootSector D WORD 0x0006 ; |7C34:0000~~| .Reserved D 12*B 0 ; |7C40: | ; Extended BPB_FAT32. Size=0x1A=26. |7C40:00 | .PhysicalDriveNumber D BYTE 0x00 ; 0x00 floppy disk, 0x80 hard disk. |7C41:00 | .ExtReserved D BYTE 0x00 ; |7C42:29 | .ExtBootSignature D BYTE 0x29 ; or 0x28. |7C43:1122 | .VolumeSerialNumber D DWORD %^TIME ; Randomly generated number. |7C47:4E4F~~| .VolumeLabel D B "NO NAME " ; Space-padded to size=11. |7C52:4641~~| .FileSystemType D B "FAT32 " ; Space-padded to size=8. |7C5A: | ENDSTRUC BPB_FAT32 ; Total BPB_FAT32. Size=0x4F=79.
; Predefined static values are typical for 4GB hard disk. |[BPB_NTFS]| BPB_NTFS STRUC ; Base BPB_NTFS. Size=0x19=25. |7C0B:0200 | .BytesPerSector D WORD 0x0200 ; Size of HW sector, usualy 512. |7C0D:08 | .SectorsPerCluster D BYTE 0x08 ; Valid values 1,2,4,8,16,32,64,128. |7C0E:0000 | .ReservedSectors D WORD 0x0000 ; |7C10:00 | .NumberOfFats D BYTE 0x00 ; |7C11:0000 | .RootEntries D WORD 0x0000 ; |7C13:0000 | .SmallSectors D WORD 0x0000 ; |7C15:F8 | .MediaDescriptor D BYTE 0xF8 ; Hard disk. |7C16:0000 | .SectorsPerFat D WORD 0x0000 ; |7C18:3F00 | .SectorsPerTrack D WORD 0x003F ; |7C1A:FF00 | .NumberOfHeads D WORD 0x00FF ; |7C1C:3F00~| .HiddenSectors D DWORD 0x0000003F |7C20:0000~| .LargeSectors D DWORD 0x00000000 |7C24: | ; Extended BPB_NTFS. Size=0x30=48. |7C24:80 | .PhysicalDriveNumber D BYTE 0x80 ; Hard disk. |7C25:00 | .Reserved D BYTE 0x00 |7C26:80 | .ExtBootSignature D BYTE 0x80 |7C27:00 | .NotUsed D BYTE 0x00 |7C28:4AF5~| .TotalSectors D QWORD 0x00000000_007FF54A ; 4 GB. |7C30:0400~| .ClusterNumber D QWORD 0x00000000_00000004 ; Logical cluster number for the file $MFT. |7C38:54FF~| .ClusterNumberMirror D QWORD 0x00000000_0007FF54 ; Logical cluster number for the file $MFTMirr. |7C40:F600~| .ClustersPerFRS D DWORD 0x000000F6 ; Number of clusters per File Record Segment. |7C44:0100~| .ClustersPerIB D DWORD 0x00000001 ; Number of clusters per Index Block. |7C48:1122~| .VolumeSerialNumberr D QWORD %^DATE<<32+%^TIME ; Pseudorandomly generated number. >> |7C50:0000~| .Checksum D DWORD 0x00000000 ; |7C54: | ENDSTRUC BPB_NTFS ; Total BPB_NTFS. Size=0x49=73.
DIR_ENTRY STRUC .abName D 8*B ; File name, left-justified, blank-padded (e.g. 'FILE '). .abExt D 3*B ; File extension, left-justified, blank-padded (e.g. 'EXT'). .bAttr D B ; File attribute. .res D 10*B ; Reserved. .rTime D W ; Time created/last modified in FileTimeRec format. .rDate D W ; Date created/last modified in FileDateRec format. .wClstrNo D W ; Cluster number of start of file (link into FAT). .lSize D D ; File size in bytes. ENDSTRUC DIR_ENTRY ; Size=32.
INT 1Eh
(00078h).
DPT STRUC .rSrtHdUnld D B ; Bits 0-3: SRT step rate time, bits 4-7: head unload time. .rDmaHdLd D B ; Bit 0: 1=use DMA, bits 2-7: head load time. .bMotorOff D B ; 55-ms increments before turning disk motor off. .bSectSize D B ; Sector size (0=128, 1=256, 2=512, 3=1024). .bLastTrack D B ; EOT (last sector on a track). .bGapLen D B ; Gap length for read/write operations. .bDTL D B ; DTL (Data Transfer Length) max transfer when length not set. .bGapFmt D B ; Gap length for format operation. .bFillChar D B ; Fill character for format (normally 0f6H). .bHdSettle D B ; Head-settle time (in milliseconds). .bMotorOn D B ; Motor-startup time (in 1/8th-second intervals) ENDSTRUC DPT ; Size=11.
LBA STRUC ; Address .data D DWORD ; 0x7C49 Number of 1st sector with data, immediately following the root-directory. .cylinder D WORD ; 0c7C4D Translated for INT 0x13. .track D BYTE ; 0c7C4F Translated for INT 0x13.. .root D DWORD ; 0c7C50 Number of 1st sector in root-directory entry. ENDSTRUC LBA ; Size=11.
INT 41h
(00104h).
INT 46h
(00118h).
HDPT STRUC .wMaxCyls D W ; Maximum number of cylinders. .bMaxHds D B ; Maximum number of heads. .wRWCyl D W ; Starting reduced-write current cylinder. .wWPCyl D W ; Starting write precompensation cylinder. .bECCLen D B ; Maximum ECC data burst length. .rOptFlags D B ; Drive step options: bits 2-0: drive option, bit 6: disable ECC, bit 7: disable retries. .bTimeOutStd D B ; Standard timeout value. .bTimeOutFmt D B ; Timeout value for format drive. .bTimeOutChk D B ; Timeout value for check drive. .res D D ; Reserved. ENDSTRUC HDPT ; Size=16.
ENDHEAD bioss ; End of interface block.