1 | ; File name : CustomDPT.inc |
---|
2 | ; Project name : IDE BIOS |
---|
3 | ; Created date : 23.3.2010 |
---|
4 | ; Last update : 10.4.2010 |
---|
5 | ; Author : Tomi Tilli |
---|
6 | ; Description : Defines for DPT structs containing custom |
---|
7 | ; Disk Parameter Table used by this BIOS. |
---|
8 | %ifndef CUSTOMDPT_INC |
---|
9 | %define CUSTOMDPT_INC |
---|
10 | |
---|
11 | |
---|
12 | ; Base Disk Parameter Table for all hard disk drives. |
---|
13 | ; DPT might have extensions for specific functions. |
---|
14 | struc DPT |
---|
15 | ; General Disk Parameter Table related |
---|
16 | .bSize resb 1 ; Size of DPT (with extensions) in bytes |
---|
17 | .bDrvNum resb 1 ; Drive number |
---|
18 | .bFlags resb 1 ; DPT and Drive related flags |
---|
19 | .bReset resb 1 ; Drive reset status (for debugging) |
---|
20 | .bIdeOff resb 1 ; Offset to IDEVARS for this drive |
---|
21 | |
---|
22 | ; Lookup values for L-CHS to P-CHS and L-CHS to LBA28 conversions |
---|
23 | .bShLtoP resb 1 ; Bit shift count for L-CHS to P-CHS conversion |
---|
24 | .wLHeads resb 2 ; Number of L-CHS Heads (1...256) |
---|
25 | |
---|
26 | ; IDE related |
---|
27 | .wPCyls resb 2 ; Number of P-CHS (IDE) Cylinders (1...16383) |
---|
28 | .bPHeads resb 1 ; Number of P-CHS (IDE) Heads (1...16) |
---|
29 | .bPSect resb 1 ; Number of P-CHS (IDE) Sectors per Track (1...63) |
---|
30 | .bDrvSel resb 1 ; Drive Selection byte for Device/Head Register |
---|
31 | .bDrvCtrl resb 1 ; Drive Control byte for Device Control Register |
---|
32 | |
---|
33 | ; Related to Block Mode transfers. |
---|
34 | ; Block size is specified in sectors (1, 2, 4, 8, 16, 32, 64 or 128). |
---|
35 | .wSetAndMaxBlock: |
---|
36 | .bSetBlock resb 1 ; Currect block size (at least 1) |
---|
37 | .bMaxBlock resb 1 ; Maximum block size, 0 = block mode not supported |
---|
38 | endstruc |
---|
39 | |
---|
40 | ; Bit definitions for DPT.bFlags |
---|
41 | MASK_DPT_ADDR EQU 110b ; Bits 1..2, Addressing Mode |
---|
42 | FLG_DPT_EBIOS EQU (1<<0) ; EBIOS functions supported for this drive |
---|
43 | FLG_DPT_FIRSTPART EQU (1<<3) ; First BIOS Partition of the drive (drive reset allowed) |
---|
44 | FLG_DPT_PARTITION EQU (1<<4) ; BIOS Partition |
---|
45 | FLG_DPT_USERCHS EQU (1<<5) ; User has specified P-CHS parameters |
---|
46 | |
---|
47 | ; Values for different addressing modes (MASK_DPT_ADDR for DPT.bFlags) |
---|
48 | ADDR_DPT_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes) |
---|
49 | ADDR_DPT_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes) |
---|
50 | ADDR_DPT_LBA28 EQU 2 ; 28-bit LBA Addressing Mode |
---|
51 | ADDR_DPT_LBA48 EQU 3 ; 48-bit LBA Addressing Mode |
---|
52 | |
---|
53 | ; Bit definitions for DPT.bReset (inverted) |
---|
54 | FLG_RESET_nDRDY EQU (1<<0) ; Drive ready to accept commands |
---|
55 | FLG_RESET_nINITPRMS EQU (1<<1) ; Initialize Device Parameters successfull |
---|
56 | FLG_RESET_nRECALIBRATE EQU (1<<2) ; Recalibrate successfull |
---|
57 | FLG_RESET_nSETBLOCK EQU (1<<3) ; Initialize Block Mode successfull |
---|
58 | MASK_RESET_ALL EQU (FLG_RESET_nDRDY | FLG_RESET_nINITPRMS | FLG_RESET_nRECALIBRATE | FLG_RESET_nSETBLOCK) |
---|
59 | |
---|
60 | |
---|
61 | ; Extended DPT for XTIDE Universal BIOS partitioned drive. |
---|
62 | ; This struct cannot exist with EDPT (EBIOS support). |
---|
63 | struc PART_DPT |
---|
64 | .dpt resb DPT_size |
---|
65 | .dwStartLBA: |
---|
66 | .twStartLBA resb 6 ; Starting 28- or 48-bit LBA for BIOS partition |
---|
67 | endstruc |
---|
68 | |
---|
69 | |
---|
70 | ; Extended DPT for EBIOS support. |
---|
71 | ; This struct cannot exist with PDPT (XTIDE Universal BIOS partitioned drive). |
---|
72 | struc EBDPT |
---|
73 | .dpt resb DPT_size |
---|
74 | .dwCapacity: |
---|
75 | .twCapacity resb 6 ; Total drive capacity in sectors |
---|
76 | endstruc |
---|
77 | |
---|
78 | |
---|
79 | %endif ; CUSTOMDPT_INC |
---|