[99] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 2 | ; Description : Defines for DPT structs containing custom
|
---|
| 3 | ; Disk Parameter Table used by this BIOS.
|
---|
| 4 | %ifndef CUSTOMDPT_INC
|
---|
| 5 | %define CUSTOMDPT_INC
|
---|
| 6 |
|
---|
[150] | 7 | ; Base DPT for all device types
|
---|
[173] | 8 | struc DPT ; 10 bytes
|
---|
[3] | 9 | ; General Disk Parameter Table related
|
---|
[158] | 10 | .wFlags:
|
---|
| 11 | .bFlagsLow resb 1
|
---|
| 12 | .bFlagsHigh resb 1
|
---|
[150] | 13 | .bIdevarsOffset resb 1 ; Offset to IDEVARS for this drive
|
---|
[226] | 14 | resb 1 ; alignment byte
|
---|
[3] | 15 |
|
---|
[150] | 16 | ; IDE Drive related
|
---|
[173] | 17 | .dwCylinders resb 4 ; Number of Cylinders
|
---|
| 18 | .wHeadsAndSectors:
|
---|
| 19 | .bHeads resb 1 ; Number of Heads (1...255)
|
---|
| 20 | .bSectors resb 1 ; Number of Sectors per Track (1...63)
|
---|
[150] | 21 | endstruc
|
---|
[3] | 22 |
|
---|
[150] | 23 | ; DPT for ATA devices
|
---|
[173] | 24 | struc DPT_ATA ; 10 + 2 bytes = 12 bytes
|
---|
[150] | 25 | .dpt resb DPT_size
|
---|
| 26 |
|
---|
| 27 | ; Block size is specified in sectors (1, 2, 4, 8, 16, 32 or 64).
|
---|
| 28 | ; 128 is not allowed to prevent offset overflow during data transfer.
|
---|
[3] | 29 | .wSetAndMaxBlock:
|
---|
[150] | 30 | .bSetBlock resb 1 ; Current block size (at least 1)
|
---|
| 31 | .bMaxBlock resb 1 ; Maximum block size, 0 = block mode not supported
|
---|
[3] | 32 | endstruc
|
---|
| 33 |
|
---|
[226] | 34 | %ifdef MODULE_SERIAL
|
---|
| 35 | ; DPT for Serial devices
|
---|
| 36 | struc DPT_SERIAL
|
---|
| 37 | .dpt resb DPT_size
|
---|
| 38 |
|
---|
| 39 | .bSerialPortAndBaud resb 1 ; Packed I/O port and baud rate for serial drives
|
---|
| 40 | resb 1 ; unused alignment
|
---|
| 41 | endstruc
|
---|
| 42 | %endif
|
---|
| 43 |
|
---|
[150] | 44 | LARGEST_DPT_SIZE EQU DPT_ATA_size
|
---|
[3] | 45 |
|
---|
| 46 |
|
---|
[158] | 47 | ; Bit definitions for DPT.bFlagsLow
|
---|
| 48 | MASKL_DPT_CHS_SHIFT_COUNT EQU (7<<0) ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4)
|
---|
| 49 | FLGL_DPT_SLAVE EQU FLG_DRVNHEAD_DRV ; (1<<4), Drive is slave drive
|
---|
| 50 | MASKL_DPT_ADDRESSING_MODE EQU (3<<5) ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA)
|
---|
| 51 | FLGL_DPT_ENABLE_IRQ EQU (1<<7)
|
---|
[3] | 52 |
|
---|
[158] | 53 | ; Bit definitions for DPT.bFlagsHigh
|
---|
| 54 | FLGH_DPT_REVERSED_A0_AND_A3 EQU (1<<0) ; XTIDE mod, Address lines 0 and 3 reversed
|
---|
[165] | 55 | FLGH_DPT_BLOCK_MODE_SUPPORTED EQU (1<<1) ; Use block transfer commands (must be bit 1!)
|
---|
[175] | 56 | %ifdef MODULE_SERIAL
|
---|
[165] | 57 | FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ; Serial Port Device
|
---|
[175] | 58 | %endif
|
---|
[158] | 59 | FLGH_DPT_INTERRUPT_IN_SERVICE EQU (1<<3) ; Set when waiting for IRQ
|
---|
| 60 | FLGH_DPT_RESET_nDRDY EQU (1<<4) ; Drive ready to accept commands
|
---|
| 61 | FLGH_DPT_RESET_nINITPRMS EQU (1<<5) ; Initialize Device Parameters successfull
|
---|
| 62 | FLGH_DPT_RESET_nRECALIBRATE EQU (1<<6) ; Recalibrate successfull
|
---|
| 63 | FLGH_DPT_RESET_nSETBLOCK EQU (1<<7) ; Initialize Block Mode successfull
|
---|
| 64 | MASKH_DPT_RESET EQU 0F0h
|
---|
| 65 |
|
---|
[150] | 66 | ; Addressing modes for DPT.wFlags
|
---|
| 67 | ADDRESSING_MODE_FIELD_POSITION EQU 5
|
---|
| 68 | ADDRESSING_MODE_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes)
|
---|
| 69 | ADDRESSING_MODE_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes)
|
---|
| 70 | ADDRESSING_MODE_LBA28 EQU 2 ; 28-bit LBA Addressing Mode
|
---|
| 71 | ADDRESSING_MODE_LBA48 EQU 3 ; 48-bit LBA Addressing Mode
|
---|
[3] | 72 |
|
---|
[173] | 73 | ; Number of Sectors per Track is fixed to 63 for LBA assist calculation.
|
---|
| 74 | ; 1024 cylinders, 256 heads, 63 sectors = 8.4 GB limit (but DOS does not support more than 255 heads)
|
---|
| 75 | MAX_LCHS_CYLINDERS EQU 1024
|
---|
| 76 | LBA_ASSIST_SPT EQU 63
|
---|
[3] | 77 |
|
---|
[173] | 78 |
|
---|
[3] | 79 | %endif ; CUSTOMDPT_INC
|
---|