Changeset 421 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Inc


Ignore:
Timestamp:
May 9, 2012, 7:12:53 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Addressing modes are now NORMAL, LARGE and LBA.
  • L-CHS parameters are now generated differently for drives with 8192 or less cylinders.
Location:
trunk/XTIDE_Universal_BIOS/Inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc

    r413 r421  
    6666                            resb    2   ; Zero word (ensures string terminates)
    6767    .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
    7478endstruc
    7579
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r411 r421  
    2323
    2424; Base DPT for all device types
    25 struc DPT   ; 10 bytes
     25struc DPT   ; 8 or 18 bytes
    2626    ; General Disk Parameter Table related
    2727    .wFlags:
     
    3030    .bIdevarsOffset         resb    1   ; Offset to IDEVARS for this drive
    3131
    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)
    3637
    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
    4244endstruc
    4345
    4446    ; 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
    4851%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!)
    5057%endif
    5158
     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
    5266    ; 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!)
    5468%ifdef MODULE_SERIAL
    55     FLGH_DPT_SERIAL_DEVICE                      EQU (1<<2)  ; Serial Port Device
     69    FLGH_DPT_SERIAL_DEVICE              EQU (1<<2)  ; Bit 2, Serial Port Device
    5670%endif
    5771%ifdef MODULE_IRQ
    58     FLGH_DPT_INTERRUPT_IN_SERVICE               EQU (1<<3)  ; Set when waiting for IRQ
     72    FLGH_DPT_INTERRUPT_IN_SERVICE       EQU (1<<3)  ; Bit 3, Set when waiting for IRQ
    5973%endif
    6074%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
    6276%endif
    63 
    64     ; IDE device only
    6577%ifdef MODULE_ADVANCED_ATA
    66     FLGH_DPT_IORDY                              EQU (1<<7)  ; Controller and Drive supports IORDY
     78    FLGH_DPT_IORDY                      EQU (1<<7)  ; Bit 5, Controller and Drive supports IORDY
    6779%endif
    6880
     
    7486%endif
    7587
    76     ; Addressing modes for DPT.wFlags
    77     ADDRESSING_MODE_FIELD_POSITION              EQU     5
    78     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 Mode
    81 %ifdef MODULE_EBIOS
    82     ADDRESSING_MODE_LBA48                       EQU     3   ; 48-bit LBA Addressing Mode
    83 %endif
    8488
    8589
    8690; DPT for ATA devices
    87 struc DPT_ATA   ; 10 + 2 bytes = 12 bytes
     91struc DPT_ATA   ; 8/18 bytes + 2 bytes = 10/20 bytes
    8892    .dpt                    resb    DPT_size
    8993    .bBlockSize             resb    1   ; Current block size in sectors (do not set to zero!)
     
    9296
    9397
     98
    9499; Additional variables needed to initialize and reset Advanced IDE Controllers.
    95100; EBDA must be reserved for DPTs when using these!
    96101%ifdef MODULE_ADVANCED_ATA
    97 struc DPT_ADVANCED_ATA
     102struc DPT_ADVANCED_ATA  ; 10/20 bytes + 8 bytes = 18/28 bytes
    98103    .dpt_ata                resb    DPT_ATA_size
    99104    .wControllerID          resb    2   ; Controller specific ID WORD (from Advanced Controller detection)
     
    117122; DPT for Serial devices
    118123%ifdef MODULE_SERIAL
    119 struc DPT_SERIAL
     124struc DPT_SERIAL    ; 8/18 bytes + 2 bytes = 10/20 bytes
    120125    .dpt                    resb    DPT_size
    121126    .wSerialPortAndBaud:
     
    140145
    141146
    142 ;--------------------------------------------------------------------
    143 ; LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS
    144 ;   Parameters:
    145 ;       DX:AX:  Number of LBA cylinders
    146 ;   Returns:
    147 ;       AX:     Number of L-CHS cylinders
    148 ;   Corrupts registers:
    149 ;       Nothing
    150 ;--------------------------------------------------------------------
    151 %macro LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS 0
    152     test    dx, dx
    153     jnz     SHORT %%LoadMaxValueToAX
    154     cmp     ax, MAX_LCHS_CYLINDERS
    155     jb      SHORT %%NoNeedToModify
    156 %%LoadMaxValueToAX:
    157     mov     ax, MAX_LCHS_CYLINDERS
    158 %%NoNeedToModify:
    159 %endmacro
    160 
    161 
    162147%endif ; CUSTOMDPT_INC
Note: See TracChangeset for help on using the changeset viewer.