Changeset 421 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Inc
- Timestamp:
- May 9, 2012, 7:12:53 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r413 r421 66 66 resb 2 ; Zero word (ensures string terminates) 67 67 .wInitErrorFlags resb 2 ; Errors during initialization 68 69 %ifdef MODULE_ADVANCED_ATA 70 resb 6 ; padding to make DRVDETECTINFO size an even multiple of DPT size 71 %else 72 resb 2 ; padding to make DRVDETECTINFO size an even multiple of DPT size 73 %endif 68 69 %if LARGEST_DPT_SIZE == 28 70 resb 22 ; padding to make DRVDETECTINFO size an even multiple of DPT size 71 %elif LARGEST_DPT_SIZE == 20 72 resb 6 73 %elif LARGEST_DPT_SIZE == 18 74 resb 2 75 %else ; LARGEST_DPT_SIZE == 10 76 resb 6 77 %endif 74 78 endstruc 75 79 -
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r411 r421 23 23 24 24 ; Base DPT for all device types 25 struc DPT ; 10bytes25 struc DPT ; 8 or 18 bytes 26 26 ; General Disk Parameter Table related 27 27 .wFlags: … … 30 30 .bIdevarsOffset resb 1 ; Offset to IDEVARS for this drive 31 31 32 ; IDE Drive related 33 ; .bLbaHeads and .twLbaSectors are used for LBA addressing only. 34 .bLbaHeads: resb 1 ; Number of LBA assisted heads (1...255) 35 .twLbaSectors resb 2 ; 48-bit sector count for LBA addressing 32 .bPchsHeads resb 1 ; (1...16) 33 .wLchsCylinders resb 2 ; (1...1027, yes 1027) 34 .wLchsHeadsAndSectors: 35 .bLchsHeads resb 1 ; (1...255) 36 .bLchsSectorsPerTrack resb 1 ; (1...63) 36 37 37 ; .wPchsCylinders and .bPchsSectors are used for CHS addressing only. 38 .wPchsCylinders resb 2 ; Number of P-CHS Cylinders (1...16383) 39 .wPchsHeadsAndSectors: 40 .bPchsHeads resb 1 ; Number of P-CHS heads (1...16) 41 .bPchsSectors resb 1 ; Number of P-CHS Sectors per Track (1...63) 38 %ifdef MODULE_EBIOS 39 .twLbaSectors resb 6 ; 48-bit sector count for LBA addressing 40 .wPchsCylinders resb 2 41 .bPchsSectorsPerTrack resb 1 42 resb 1 43 %endif 42 44 endstruc 43 45 44 46 ; Bit definitions for DPT.bFlagsLow 45 MASKL_DPT_CHS_SHIFT_COUNT EQU (7<<0) ; Bits 0...2, P-CHS to L-CHS bit shift count (0...4) 46 FLGL_DPT_SLAVE EQU FLG_DRVNHEAD_DRV ; (1<<4), Drive is slave drive 47 MASKL_DPT_ADDRESSING_MODE EQU (3<<ADDRESSING_MODE_FIELD_POSITION) ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA) 47 MASKL_DPT_CHS_SHIFT_COUNT EQU (3<<0) ; Bits 0...1, P-CHS to L-CHS bit shift count (0...3) 48 MASKL_DPT_ADDRESSING_MODE EQU (3<<ADDRESSING_MODE_FIELD_POSITION) ; Bits 2...3, NORMAL, LARGE or Assisted LBA addressing mode 49 FLGL_DPT_ASSISTED_LBA EQU (1<<(ADDRESSING_MODE_FIELD_POSITION+1)) 50 FLGL_DPT_SLAVE EQU FLG_DRVNHEAD_DRV ; Bit 4, Drive is a Slave Drive 48 51 %ifdef MODULE_IRQ 49 FLGL_DPT_ENABLE_IRQ EQU (1<<7) 52 FLGL_DPT_ENABLE_IRQ EQU (1<<5) ; Bit 5, Enable IRQ 53 %endif 54 %ifdef MODULE_EBIOS 55 FLGL_DPT_LBA_AND_EBIOS_SUPPORTED EQU FLG_DRVNHEAD_LBA ; Bit 6, Drive supports LBA and so EBIOS functions can be supported 56 FLGL_DPT_LBA48 EQU (1<<7) ; Bit 7, Drive supports 48-bit LBA (Must be bit 7!) 50 57 %endif 51 58 59 ; Addressing modes for DPT.bFlagsLow 60 ADDRESSING_MODE_FIELD_POSITION EQU 2 61 ADDRESSING_MODE_NORMAL EQU 0 62 ADDRESSING_MODE_LARGE EQU 1 63 ADDRESSING_MODE_ASSISTED_LBA EQU 2 ; 28-bit or 48-bit LBA 64 65 52 66 ; Bit definitions for DPT.bFlagsHigh 53 FLGH_DPT_BLOCK_MODE_SUPPORTED EQU (1<<1) ;Use block transfer commands (must be bit 1!)67 FLGH_DPT_BLOCK_MODE_SUPPORTED EQU (1<<1) ; Bit 1, Use block transfer commands (must be bit 1!) 54 68 %ifdef MODULE_SERIAL 55 FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ;Serial Port Device69 FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ; Bit 2, Serial Port Device 56 70 %endif 57 71 %ifdef MODULE_IRQ 58 FLGH_DPT_INTERRUPT_IN_SERVICE EQU (1<<3) ;Set when waiting for IRQ72 FLGH_DPT_INTERRUPT_IN_SERVICE EQU (1<<3) ; Bit 3, Set when waiting for IRQ 59 73 %endif 60 74 %ifdef MODULE_FEATURE_SETS 61 FLGH_DPT_POWER_MANAGEMENT_SUPPORTED EQU (1<<5)75 FLGH_DPT_POWER_MANAGEMENT_SUPPORTED EQU (1<<5) ; Bit 4, Drive supports power management 62 76 %endif 63 64 ; IDE device only65 77 %ifdef MODULE_ADVANCED_ATA 66 FLGH_DPT_IORDY EQU (1<<7) ;Controller and Drive supports IORDY78 FLGH_DPT_IORDY EQU (1<<7) ; Bit 5, Controller and Drive supports IORDY 67 79 %endif 68 80 … … 74 86 %endif 75 87 76 ; Addressing modes for DPT.wFlags77 ADDRESSING_MODE_FIELD_POSITION EQU 578 ADDRESSING_MODE_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes)79 ADDRESSING_MODE_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes)80 ADDRESSING_MODE_LBA28 EQU 2 ; 28-bit LBA Addressing Mode81 %ifdef MODULE_EBIOS82 ADDRESSING_MODE_LBA48 EQU 3 ; 48-bit LBA Addressing Mode83 %endif84 88 85 89 86 90 ; DPT for ATA devices 87 struc DPT_ATA ; 10 + 2 bytes = 12bytes91 struc DPT_ATA ; 8/18 bytes + 2 bytes = 10/20 bytes 88 92 .dpt resb DPT_size 89 93 .bBlockSize resb 1 ; Current block size in sectors (do not set to zero!) … … 92 96 93 97 98 94 99 ; Additional variables needed to initialize and reset Advanced IDE Controllers. 95 100 ; EBDA must be reserved for DPTs when using these! 96 101 %ifdef MODULE_ADVANCED_ATA 97 struc DPT_ADVANCED_ATA 102 struc DPT_ADVANCED_ATA ; 10/20 bytes + 8 bytes = 18/28 bytes 98 103 .dpt_ata resb DPT_ATA_size 99 104 .wControllerID resb 2 ; Controller specific ID WORD (from Advanced Controller detection) … … 117 122 ; DPT for Serial devices 118 123 %ifdef MODULE_SERIAL 119 struc DPT_SERIAL 124 struc DPT_SERIAL ; 8/18 bytes + 2 bytes = 10/20 bytes 120 125 .dpt resb DPT_size 121 126 .wSerialPortAndBaud: … … 140 145 141 146 142 ;--------------------------------------------------------------------143 ; LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS144 ; Parameters:145 ; DX:AX: Number of LBA cylinders146 ; Returns:147 ; AX: Number of L-CHS cylinders148 ; Corrupts registers:149 ; Nothing150 ;--------------------------------------------------------------------151 %macro LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS 0152 test dx, dx153 jnz SHORT %%LoadMaxValueToAX154 cmp ax, MAX_LCHS_CYLINDERS155 jb SHORT %%NoNeedToModify156 %%LoadMaxValueToAX:157 mov ax, MAX_LCHS_CYLINDERS158 %%NoNeedToModify:159 %endmacro160 161 162 147 %endif ; CUSTOMDPT_INC
Note:
See TracChangeset
for help on using the changeset viewer.