Changeset 567 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
Location:
trunk/XTIDE_Universal_BIOS
Files:
40 edited

Legend:

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

    r526 r567  
    8686    .strModel   resb 40 ; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
    8787    .bBlckSize  resb 1  ; 47[0-7]F, Maximum number of sectors that can be transferred
    88                         ;          per interrupt on read and write multiple commands
    89                         ;          (00h=Read/write multiple commands not implemented)
     88                        ;           per interrupt on read and write multiple commands
     89                        ;           (00h=Read/write multiple commands not implemented)
    9090                resb 1  ; 47[8-15]X
    9191    .wDWIO      resw 1  ; 48F, Can perform doubleword I/O (boolean)
     
    106106    ; Words 59-63 are always valid
    107107    .bBlockSel  resb 1  ; 59[0-7]V, Current setting for number of sectors that
    108                         ;           can be transferred per interrupt on R/W multiple command
     108                        ;           can be transferred per interrupt on R/W multiple command
    109109    .bBlockFlgs resb 1  ; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
    110110    .dwLBACnt   resd 1  ; 60...61F, Total number of user addressable sectors (LBA mode only)
     
    168168    .strModel   resb 40 ; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
    169169    .bBlckSize  resb 1  ; 47[0-7]F, Maximum number of sectors that can be transferred
    170                         ;          per interrupt on read and write multiple commands
    171                         ;          (00h=Read/write multiple commands not implemented)
     170                        ;           per interrupt on read and write multiple commands
     171                        ;           (00h=Read/write multiple commands not implemented)
    172172                resb 1  ; 47[8-15]X
    173173                resw 1  ; 48R
     
    188188    ; Words 59-63 are always valid
    189189    .bBlockSel  resb 1  ; 59[0-7]V, Current setting for number of sectors that
    190                         ;           can be transferred per interrupt on R/W multiple command
     190                        ;           can be transferred per interrupt on R/W multiple command
    191191    .bBlockFlgs resb 1  ; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
    192192    .dwLBACnt   resd 1  ; 60...61F, Total number of user addressable sectors (LBA mode only)
     
    253253    .strModel   resb 40 ; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
    254254    .bBlckSize  resb 1  ; 47[0-7]F, Maximum number of sectors that can be transferred
    255                         ;           per interrupt on read and write multiple commands
    256                         ;           (00h=Read/write multiple commands not implemented)
     255                        ;           per interrupt on read and write multiple commands
     256                        ;           (00h=Read/write multiple commands not implemented)
    257257                resb 1  ; 47[8-15]F, 80h
    258258                resw 1  ; 48R
     
    271271    ; Words 59-63 are always valid
    272272    .bBlockSel  resb 1  ; 59[0-7]V, Current setting for number of sectors that
    273                         ;           can be transferred per interrupt on R/W multiple command
     273                        ;           can be transferred per interrupt on R/W multiple command
    274274    .bBlockFlgs resb 1  ; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
    275275    .dwLBACnt   resd 1  ; 60...61F, Total number of user addressable sectors (LBA-28)
  • trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc

    r558 r567  
    11; Project name  :   XTIDE Universal BIOS
    2 ; Description   :   Lo-tech XT-CFv2 board specifications.
     2; Description   :   Lo-tech XT-CF board specifications.
    33;
    44; More information at http://www.lo-tech.co.uk/XT-CF
     
    1919; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2020;
    21 
    22 ; Modified by JJP for XT-CFv3 support, Mar-13
    23 
    2421
    2522%ifndef XTCF_INC
     
    5653; For XT-CFv3 adapter, DMA transfers are also supported via channel 3.
    5754;
    58 ; XT-CFv3 cannot be distinguised by software, so user must decide and set
     55; XT-CFv3 cannot be distinguished by software, so user must decide and set
    5956; the mode via a call to Int 13h function 1Eh accordingly (see AH1E_XTCF.asm).
    6057;
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r550 r567  
    6161    FLGL_DPT_LBA                        EQU FLG_DRVNHEAD_LBA    ; Bit 6, Drive supports LBA and so EBIOS functions can be supported
    6262%ifdef MODULE_EBIOS
    63     FLGL_DPT_LBA48                      EQU (1<<7)              ; Bit 7, Drive supports 48-bit LBA (Must be bit 7!)
     63    FLGL_DPT_LBA48                      EQU (1<<7)              ; Bit 7, Drive supports 48-bit LBA (must be bit 7!)
    6464%endif
    6565
    6666
    6767    ; Bit definitions for DPT.bFlagsHigh
    68     FLGH_DPT_USE_BLOCK_MODE_COMMANDS    EQU (1<<1)  ; Bit 1, Use block transfer commands (must be bit 1!)
     68    FLGH_DPT_USE_BLOCK_MODE_COMMANDS    EQU (1<<1)              ; Bit 1, Use block transfer commands (must be bit 1!)
    6969%ifdef MODULE_SERIAL
    70     FLGH_DPT_SERIAL_DEVICE              EQU (1<<2)  ; Bit 2, Serial Port Device
     70    FLGH_DPT_SERIAL_DEVICE              EQU (1<<2)              ; Bit 2, Serial Port Device
    7171%endif
    72 %ifdef MODULE_FEATURE_SETS
    73     FLGH_DPT_POWER_MANAGEMENT_SUPPORTED EQU (1<<5)  ; Bit 5, Drive supports power management
     72%ifdef MODULE_POWER_MANAGEMENT
     73    FLGH_DPT_POWER_MANAGEMENT_SUPPORTED EQU (1<<3)              ; Bit 3, Drive supports power management (must be bit 3!)
    7474%endif
    7575%ifdef MODULE_ADVANCED_ATA
    76     FLGH_DPT_IORDY                      EQU (1<<7)  ; Bit 7, Controller and Drive supports IORDY
     76    FLGH_DPT_IORDY                      EQU (1<<7)              ; Bit 7, Controller and Drive supports IORDY
    7777%endif
    7878
    7979    ; Serial device only
    8080%ifdef MODULE_SERIAL_FLOPPY
    81     FLGH_DPT_SERIAL_FLOPPY                      EQU (1<<4)
    82     FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK            EQU 0e0h
    83     FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION  EQU 5
     81    FLGH_DPT_SERIAL_FLOPPY                      EQU (1<<4)      ; Bit 4, Drive is a serial floppy drive
     82    FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION  EQU 5           ; Bits 7...5, Serial floppy drive type
    8483%endif
    8584
  • trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc

    r526 r567  
    3131TIMEOUT_MAXIMUM         EQU     255         ; We would actually want 31 seconds here but I don't think there are so slow drives
    3232
    33 %ifdef MODULE_FEATURE_SETS
     33%ifdef MODULE_POWER_MANAGEMENT
    3434    TIMEOUT_BSY         EQU     TIMEOUT_MOTOR_STARTUP
    3535    TIMEOUT_DRDY        EQU     TIMEOUT_MOTOR_STARTUP
  • trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc

    r550 r567  
    130130%endif
    131131
    132 %ifdef MODULE_FEATURE_SETS
    133     MAIN_FLG_MODULE_FEATURE_SETS    EQU FLG_ROMVARS_MODULE_FEATURE_SETS
     132%ifdef MODULE_POWER_MANAGEMENT
     133    MAIN_FLG_MODULE_POWER_MANAGEMENT    EQU FLG_ROMVARS_MODULE_POWER_MANAGEMENT
    134134%else
    135     MAIN_FLG_MODULE_FEATURE_SETS    EQU 0
     135    MAIN_FLG_MODULE_POWER_MANAGEMENT    EQU 0
    136136%endif
    137137
     
    142142%endif
    143143
    144 MASK_ROMVARS_INCLUDED_MODULES   EQU MAIN_FLG_MODULE_8BIT_IDE | MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_IRQ | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED | MAIN_FLG_MODULE_FEATURE_SETS | MAIN_FLG_MODULE_8BIT_IDE_ADVANCED
     144MASK_ROMVARS_INCLUDED_MODULES   EQU MAIN_FLG_MODULE_8BIT_IDE | MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_IRQ | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED | MAIN_FLG_MODULE_POWER_MANAGEMENT | MAIN_FLG_MODULE_8BIT_IDE_ADVANCED
    145145
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r558 r567  
    7272
    7373; Here in case the configuration needs to know functionality is present
    74 FLG_ROMVARS_MODULE_FEATURE_SETS         EQU (1<<5)
     74FLG_ROMVARS_MODULE_POWER_MANAGEMENT     EQU (1<<5)
    7575FLG_ROMVARS_MODULE_8BIT_IDE             EQU (1<<6)
    7676FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED    EQU (1<<7)
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm

    r564 r567  
    3434IdeDPT_Finalize:
    3535
    36 %ifdef MODULE_FEATURE_SETS
     36%ifdef MODULE_POWER_MANAGEMENT
    3737;--------------------------------------------------------------------
    3838; .DetectPowerManagementSupport
     
    4343;       Nothing
    4444;   Corrupts registers:
    45 ;       Nothing
     45;       AL
    4646;--------------------------------------------------------------------
    4747.DetectPowerManagementSupport:
    48     test    BYTE [es:si+ATA6.wSetSup82], A6_wSetSup82_POWERMAN
    49     jz      SHORT .NoPowerManagementSupport
    50     or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
    51 .NoPowerManagementSupport:
    52 %endif ; MODULE_FEATURE_SETS
     48    mov     al, [es:si+ATA6.wSetSup82]
     49    and     al, A6_wSetSup82_POWERMAN   ; A6_wSetSup82_POWERMAN (bit 3) is the same
     50    or      [di+DPT.bFlagsHigh], al     ; bit as FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
     51%endif ; MODULE_POWER_MANAGEMENT
    5352
    5453
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm

    r558 r567  
    22; Description   :   IDE Read/Write functions for transferring block using DMA.
    33;                   These functions should only be called from IdeTransfer.asm.
    4 
    5 ; Modified JJP 05-Jun-13
    64
    75;
     
    9189    ; Calculate bytes for first page
    9290    mov     ax, di
    93     neg     ax          ; 2s compliment
     91    neg     ax          ; 2s complement
    9492
    9593    ; If DI was zero carry flag will be cleared (and set otherwise)
     
    187185    jz      SHORT .TransferNextBlock    ; All bytes transferred?
    188186%else   ; Fast DMA code - perform computed number of transfers, then check DMA status register to be sure
    189     add     cx, BYTE 15                 ; We'll divide transfers in 16-byte atomic transfers,
    190     eSHR_IM cx, 4                       ; so include any partial block, which will be terminated
    191 ALIGN JUMP_ALIGN                        ; by the DMA controller raising T/C
     187    ; We'll divide transfers in 16-byte atomic transfers, so include any partial block, which will be terminated by the DMA controller raising T/C
     188    add     cx, BYTE 15
     189
     190%ifdef USE_186
     191    shr     cx, 4
     192%else
     193    xchg    cx, ax
     194    mov     cl, 4
     195    shr     ax, cl
     196    xchg    cx, ax
     197%endif
     198
     199ALIGN JUMP_ALIGN
    192200.TransferNextDmaBlock:
    193201    out     dx, al                      ; Transfer up to 16 bytes to/from XT-CF card
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm

    r566 r567  
    2020; Section containing code
    2121SECTION .text
     22
     23%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
     24    %if $ <> PollBsyOnly.End
     25        %error "IdeError.asm must come immediately after IdeWait.asm (PollBsyOnly falls into IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL)!"
     26    %endif
     27%endif
    2228
    2329;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm

    r558 r567  
    1818; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1919;
    20 
    21 ; Modified by JJP for XT-CFv3 support, Mar-13
    2220
    2321; Section containing code
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r558 r567  
    228228
    229229    ; Get transfer function based on bus type
    230     xchg    ax, bx                              ; Lookup table offset to AX
    231     mov     bl, [di+DPT_ATA.bDevice]
     230    mov     al, [di+DPT_ATA.bDevice]
     231    add     bx, ax
    232232%ifdef MODULE_8BIT_IDE_ADVANCED
    233     mov     dl, bl
    234 %endif
    235     add     bx, ax
     233    cmp     al, DEVICE_8BIT_XTCF_DMA
     234%endif
    236235    mov     ax, [cs:bx]                         ; Load offset to transfer function
    237236    mov     [bp+PIOVARS.fnXfer], ax
     
    239238    ; Normalize pointer for PIO-transfers and convert to physical address for DMA transfers
    240239%ifdef MODULE_8BIT_IDE_ADVANCED
    241     cmp     dl, DEVICE_8BIT_XTCF_DMA
    242240    jb      SHORT IdeTransfer_NormalizePointerInESSI
    243241
    244242    ; Convert ES:SI to physical address
    245 %ifdef USE_186          ; Bytes EU Cycles(286)
     243%ifdef USE_186
     244                        ; Bytes EU Cycles(286)
    246245    mov     ax, es      ; 2     2
    247246    rol     ax, 4       ; 3     9
     
    255254                        ; 18    24
    256255%else ; 808x
    257 
    258 %if 0
    259256                        ; Bytes EU Cycles(808x)
    260257    mov     al, 4       ; 2     4
     
    279276; In other words, we could use a real world test here.
    280277;
    281 %endif ; 0
     278%if 0
    282279                        ; Bytes EU Cycles(808x/286)
    283280    xor     dx, dx      ; 2     3/2
     
    291288    mov     es, dx      ; 2     2/2
    292289    ;------------------------------------
    293 %endif                  ; 26    29/26
    294     clc
    295     ret
     290                        ; 26    29/26
     291%endif ; 0
     292%endif
     293
     294    ret     ; With CF cleared (taken care of by the physical address conversion)
    296295%endif ; MODULE_8BIT_IDE_ADVANCED
    297296    ; Fall to IdeTransfer_NormalizePointerInESSI if no MODULE_8BIT_IDE_ADVANCED
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm

    r532 r567  
    130130    call    Timer_SetCFifTimeout                ; Update timeout counter
    131131    jnc     SHORT .PollLoop                     ; Loop if time left (sets CF on timeout)
    132     jmp     SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
     132.End:                                           ; Label used for sanity check during assembly
     133    ; Fall to IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
     134
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r558 r567  
    2828;   Parameters:
    2929;       BH:     Non-zero if 48-bit addressing used
    30 ;               (ignored at present as 48-bit addressing is not supported)
     30;               (ignored at present as 48-bit addressing is not supported)
    3131;       BL:     IDE Status Register bit to poll after command
    32 ;               (ignored at present, since there is no IDE status register to poll)
     32;               (ignored at present, since there is no IDE status register to poll)
    3333;       ES:SI:  Ptr to buffer (for data transfer commands)
    3434;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     
    122122;          wSerialPortAndBaud Non-Zero:           -> Continue with wSerialPortAndBaud (1)
    123123;          wSerialPortAndBaud Zero:
    124 ;              previous serial drive not found:   -> Scan (2)
    125 ;              previous serial drive found:       -> Continue with previous serial drive info (3)
     124;              previous serial drive not found:   -> Scan (2)
     125;              previous serial drive found:       -> Continue with previous serial drive info (3)
    126126;
    127127;    Slave:
    128128;          wSerialPortAndBaud Non-Zero:
    129 ;              previous serial drive not found:   -> Error - Not Found (4)
     129;              previous serial drive not found:   -> Error - Not Found (4)
    130130;              previous serial drive found:       -> Continue with wSerialPackedAndBaud (5)
    131 ;          wSerialPortAndBaud Zero:
    132 ;              previous serial drive not found:   -> Error - Not Found (4)
     131;          wSerialPortAndBaud Zero:
     132;              previous serial drive not found:   -> Error - Not Found (4)
    133133;              previous serial drive found:       -> Continue with previous serial drive info (6)
    134134;
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm

    r547 r567  
    2828;   Returns:
    2929;       CF:     Set, indicates that this is a floppy disk
    30 ;               Clear, indicates that this is a hard disk
     30;               Clear, indicates that this is a hard disk
    3131;   Corrupts registers:
    3232;       AX
     
    4949%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    5050    %ifdef MODULE_SERIAL_FLOPPY
    51         %if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK != 0xe0 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
     51        %if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
    5252            %error "The serial server passes FLGH values into SerialDPT_Finalize directly.  If the flag positions are changed, corresponding changes will need to be made in the serial server, and likely a version check put in to deal with servers talking to incompatible clients"
    5353        %endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r561 r567  
    309309;   Returns:
    310310;       Depends on function
    311 ;       NOTE: ES:DI needs to be returned from the previous interrupt
    312 ;             handler, for floppy DPT in function 08h
     311;       NOTE: ES:DI needs to be returned from the previous interrupt
     312;             handler, for floppy DPT in function 08h
    313313;   Corrupts registers:
    314314;       None
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r555 r567  
    119119    mov     dl, ROMVARS.ideVars0                        ; starting Idevars offset
    120120
    121     ; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd,
    122     ; but it catches the .ideVarsSerialAuto structure, which would not be scanned if the count from
     121    ; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd,
     122    ; but it catches the .ideVarsSerialAuto structure, which would not be scanned if the count from
    123123    ; RamVars_GetIdeControllerCountToCX was used.  Unused controllers won't make a difference, since no DPT
    124124    ; will point to them.  Performance isn't an issue, as this is a reset operation.
    125     ;
     125    ;
    126126    mov     cx, NUMBER_OF_IDEVARS
    127127
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r547 r567  
    3737;       If successful:
    3838;           AH:     Hard Disk: 3 (Hard disk accessible)
    39 ;                   Floppy:    1 (Floppy disk, without change detection)
     39;                   Floppy:    1 (Floppy disk, without change detection)
    4040;           CX:DX:  Total number of sectors
    4141;           CF:     0
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm

    r558 r567  
    1919; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2020;
    21 
    22 ; Modified by JJP for XT-CFv3 support, Mar-13
    2321
    2422; Section containing code
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r545 r567  
    3131;       SS:BP:  Ptr to IDEPACK
    3232;   Returns with INTPACK:
    33 ;       BL:     Drive Type (for floppies only)
     33;       BL:     Drive Type (for serial floppies only)
    3434;       CH:     Maximum cylinder number, bits 7...0
    3535;       CL:     Bits 7...6: Cylinder number bits 9...8
     
    3737;       DH:     Maximum head number (0...254)
    3838;       DL:     Number of drives!!!
    39 ;       ES:DI:  Floppy DPT (for floppies only)
     39;       ES:DI:  Floppy DPT (for serial floppies only)
    4040;       AH:     Int 13h/40h floppy return status
    4141;       CF:     0 if successful, 1 if error
     
    5757    call    RamVars_GetCountOfKnownDrivesToAX       ; assume hard disk for now, will discard if for floppies
    5858
    59     test    byte [bp+IDEPACK.intpack+INTPACK.dl], 080h
     59    test    BYTE [bp+IDEPACK.intpack+INTPACK.dl], 80h
    6060    jnz     SHORT .CalledForHardDrive
    6161
     
    9393;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    9494;   Returns:
     95;       BL:     Drive Type (for serial floppies only)
    9596;       CH:     Maximum cylinder number, bits 7...0
    9697;       CL:     Bits 7...6: Cylinder number bits 9...8
     
    9899;       DH:     Maximum head number (0...254)
    99100;   Corrupts registers:
    100 ;       AX, BX
     101;       AX, BH
    101102;--------------------------------------------------------------------
    102103AH8h_GetDriveParameters:
     
    115116;       DS:     RAMVARS segment
    116117;   Returns:
     118;       BL:     Drive Type (for serial floppies only)
    117119;       CH:     Maximum cylinder number, bits 7...0
    118120;       CL:     Bits 7...6: Cylinder number bits 9...8
     
    120122;       DH:     Maximum head number (0...254)
    121123;   Corrupts registers:
    122 ;       AX, BX
     124;       AX, BH
    123125;--------------------------------------------------------------------
    124126.PackReturnValues:
     
    172174
    173175    db      1h << 1 | 0             ; Offset 1: Typical values of 1 for head load time
    174                                     ;           DMA used (although it actually is not, but is more restrictive)
     176                                    ;           DMA used (although it actually is not, but is more restrictive)
    175177    db      25h                     ; Offset 2: Inactivity motor turn-off delay,
    176178                                    ;           Typical value of 25h for 2 second delay
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r566 r567  
    194194
    195195
    196 %ifdef MODULE_FEATURE_SETS
     196%ifdef MODULE_POWER_MANAGEMENT
    197197;;; InitStandbyTimer
    198198    ; Initialize the standby timer (if supported)
     
    206206    STORE_ERROR_FLAG_TO_DPT     FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER
    207207.NoPowerManagementSupport:
    208 %endif ; MODULE_FEATURE_SETS
     208%endif ; MODULE_POWER_MANAGEMENT
    209209
    210210
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm

    r550 r567  
    3939AH41h_HandlerForCheckIfExtensionsPresent:
    4040    cmp     WORD [bp+IDEPACK.intpack+INTPACK.bx], 55AAh
     41%ifdef USE_386
     42    jne     Int13h_DirectCallToAnotherBios
     43%else
    4144    jne     SHORT .EbiosNotSupported
     45%endif
    4246
    4347    mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION
     
    5357    and     BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF  ; Return with CF cleared
    5458    jmp     Int13h_ReturnFromHandlerWithoutStoringErrorCode
     59
     60%ifndef USE_386
    5561.EbiosNotSupported:
    5662    jmp     Int13h_DirectCallToAnotherBios
     63%endif
    5764
    5865
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r558 r567  
    113113; Prepare_ByValidatingSectorsInALforOldInt13h
    114114;   Parameters:
    115 ;       AL:     Number of sectors to transfer
     115;       AL:     Number of sectors to transfer (1...128 is valid)
    116116;   Returns:
    117117;       Exits INT 13h if invalid number of sectors in AL
     
    120120;--------------------------------------------------------------------
    121121Prepare_ByValidatingSectorsInALforOldInt13h:
    122     test    al, al
    123     js      SHORT .CheckZeroOffsetFor128Sectors     ; 128 or more
    124     jz      SHORT InvalidNumberOfSectorsRequested   ; Zero not allowed for old INT 13h
     122    test    al, al                              ; Check if 0 < AL < 128 (Clears OF)
     123    jle     SHORT .CheckIf128Sectors            ; Jump if not
    125124    ret     ; Continue with transfer
    126125
    127126ALIGN JUMP_ALIGN
    128 .CheckZeroOffsetFor128Sectors:
     127.CheckIf128Sectors:
    129128    cmp     al, 128
    130     ja      SHORT InvalidNumberOfSectorsRequested
     129    jne     SHORT InvalidNumberOfSectorsRequested
    131130    test    si, si                              ; Offset must be zero to xfer 128 sectors
    132131    jnz     SHORT CannotAlignPointerProperly
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r561 r567  
    3131    sti                                         ; Enable interrupts
    3232    cld                                         ; String instructions to increment pointers
    33 %ifdef MODULE_VERY_LATE_INITIALIZATION
     33%ifdef MODULE_VERY_LATE_INIT
    3434    LOAD_BDA_SEGMENT_TO ds, ax                  ; Load BDA segment (zero) to DS
    3535    les     ax, [TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4]
     
    214214;   Parameters:
    215215;       DL:     Drive to boot from (translated, 00h or 80h)
    216 ;       CF:     Set for Boot Sector Boot
    217 ;               Clear for ROM Boot
    218 ;       ES:BX:  (if CF set) Ptr to boot sector
     216;       CF:     Set for Boot Sector Boot
     217;               Clear for ROM Boot
     218;       ES:BX:  (if CF set) Ptr to boot sector
    219219;
    220220;   Returns:
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm

    r564 r567  
    8888    call    AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI
    8989    call    Vision_InitializeWithIDinAHandConfigInAL
     90    xor     ax, ax                      ; Success
    9091
    9192    pop     si
     
    9394
    9495.NoAdvancedController:
    95     xor     ax, ax                      ; Success
    9696    ret
    9797
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r550 r567  
    2727;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    2828;   Returns:
    29 ;       CF:     Set if failed to verify ATA-ID
    30 ;               Cleared if ATA-ID verified successfully
     29;       ZF:     Set if ATA-ID verified successfully
     30;               Cleared if failed to verify ATA-ID
    3131;   Corrupts registers:
    3232;       AX, BX, CX
     
    4141    ; Verify P-CHS cylinders
    4242    mov     bx, ATA1.wCylCnt
    43     mov     cx, MAX_VALID_PCHS_CYLINDERS
    44     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     43    mov     ax, MAX_VALID_PCHS_CYLINDERS
     44    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4545
    4646    mov     bl, ATA1.wHeadCnt & 0FFh
    47     mov     cx, MAX_VALID_PCHS_HEADS
    48     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     47    mov     ax, MAX_VALID_PCHS_HEADS
     48    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4949
    5050    mov     bl, ATA1.wSPT & 0FFh
    51     mov     cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
    52     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     51    mov     al, MAX_VALID_PCHS_SECTORS_PER_TRACK
     52    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    5353
    5454    ; Check signature byte. It is only found on ATA-5 and later. It should be zero on
     
    6262    ; Check checksum byte since signature was present
    6363    mov     cx, ATA6_size
    64     call    Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
    65     jnz     SHORT .FailedToVerifyAtaID
    66 
    67     ; ATA-ID is now verified to be valid
    68 .AtaIDverifiedSuccessfully:
    69     clc
    70     ret
    71 
    72 ;--------------------------------------------------------------------
    73 ; .CompareCHorSfromOffsetBXtoMaxValueInCX
    74 ;   Parameters:
     64    jmp     Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
     65
     66;--------------------------------------------------------------------
     67; .CompareCHorSfromOffsetBXtoMaxValueInAX
     68;   Parameters:
     69;       AX:     Maximum valid C, H or S value
    7570;       BX:     C, H or S offset to ATA-ID
    76 ;       CX:     Maximum valid C, H or S value
    77 ;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    78 ;   Returns:
    79 ;       Exits from AtaID_VerifyFromESSI with CF set if invalid value
    80 ;   Corrupts registers:
    81 ;       AX
    82 ;--------------------------------------------------------------------
    83 .CompareCHorSfromOffsetBXtoMaxValueInCX:
    84     mov     ax, [es:bx+si]
    85     test    ax, ax
    86     jz      SHORT .InvalidPCHorSinOffsetBX
    87     cmp     ax, cx          ; Compare to max valid value
     71;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     72;   Returns:
     73;       Exits from AtaID_VerifyFromESSI with ZF cleared if invalid value
     74;   Corrupts registers:
     75;       CX
     76;--------------------------------------------------------------------
     77.CompareCHorSfromOffsetBXtoMaxValueInAX:
     78    mov     cx, [es:bx+si]
     79    jcxz    .InvalidPCHorSinOffsetBX
     80    cmp     cx, ax          ; Compare to max valid value
    8881    jbe     SHORT .ValidPCHorSinOffsetBX
    8982.InvalidPCHorSinOffsetBX:
    90     add     sp, BYTE 2      ; Clear return address for this function
     83    pop     cx              ; Clear return address for this function
     84    inc     cx              ; Clear ZF to indicate invalid ATA-ID (safe to do since return address in CX will never be FFFFh)
     85.AtaIDverifiedSuccessfully:
    9186.FailedToVerifyAtaID:
    92     stc                     ; Set carry to indicate invalid ATA-ID
    9387.ValidPCHorSinOffsetBX:
    9488    ret
     
    9791;--------------------------------------------------------------------
    9892; Writes user defined limits from ROMVARS to ATA ID read from the drive.
    99 ; Modifying the ATA ID reduces code and possibilites for bugs since
    100 ; only little furher checks are needed elsewhere.
     93; Modifying the ATA ID reduces code and possibilities for bugs since
     94; only little further checks are needed elsewhere.
    10195;
    10296; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r558 r567  
    6262; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
    6363;
    64     call    FindDPT_ToDSDIforSerialDevice   ; does not modify AX
     64    call    FindDPT_ToDSDIforSerialDevice   ; Does not modify AX
    6565    jnc     .AddHardDisks
    6666
     
    6868
    6969%ifdef MODULE_HOTKEYS
    70     cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
     70    cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
    7171    je      .DriveDetectLoop
    7272%endif
     
    134134    mov     [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
    135135%endif
    136 
    137 %ifdef MODULE_8BIT_IDE_ADVANCED
    138 NoSlaveDriveAvailable:
    139 %endif
    140136    ret
    141137
     
    156152;       ES:     Zero (BDA segment)
    157153;   Returns:
    158 ;       Nothing
     154;       Nothing
    159155;   Corrupts registers:
    160156;       AX, BL, CX, DX, SI, DI
    161157;--------------------------------------------------------------------
    162158StartDetectionWithDriveSelectByteInBHandStringInCX:
    163 %ifdef MODULE_8BIT_IDE_ADVANCED
    164     mov     al, [cs:bp+IDEVARS.bDevice]
    165     cmp     al, DEVICE_8BIT_XTCF_PIO8
    166     jb      SHORT .DoNotSkipSlaveDriveDetection
    167     cmp     al, DEVICE_8BIT_XTCF_DMA
    168     ja      SHORT .DoNotSkipSlaveDriveDetection
    169 
    170     ; XT-CF do not support slave drives so skip detection
    171     test    bh, FLG_DRVNHEAD_DRV
    172     jnz     SHORT NoSlaveDriveAvailable
    173 .DoNotSkipSlaveDriveDetection:
    174 %endif ; MODULE_8BIT_IDE_ADVANCED
    175 
    176159    call    DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
    177160
     
    221204;       Nothing
    222205;   Returns:
    223 ;       CF:     Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
     206;       CF:     Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
    224207;   Corrupts registers:
    225208;       AX, SI
     
    248231    call    AtaID_VerifyFromESSI
    249232    pop     bx
    250     jc      SHORT DetectDrives_DriveNotFound
     233    jnz     SHORT DetectDrives_DriveNotFound
    251234    call    CreateDPT_FromAtaInformation
    252235    jc      SHORT DetectDrives_DriveNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r547 r567  
    6060;--------------------------------------------------------------------
    6161DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
    62     mov     ax, [cs:bp+IDEVARS.wBasePort]   ; for IDE: AX=port address, DH=.bDevice
    63     ; fall through to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
     62    mov     ax, [cs:bp+IDEVARS.wBasePort]   ; For IDE: AX=port address, DH=.bDevice
     63    ; Fall to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
    6464
    6565;--------------------------------------------------------------------
     
    7575;--------------------------------------------------------------------
    7676DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP:
    77     mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
     77    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; For Serial: AL=port address>>2, AH=baud rate
    7878                                            ;             DL=COM number character, DH=.bDevice
    79     push    bp                              ; setup stack for call to
     79    push    bp                              ; Setup stack for call to
    8080    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
    8181
     
    8989
    9090%ifdef MODULE_SERIAL
    91     cmp     dh, DEVICE_SERIAL_PORT          ; Check if this is a serial device
     91    cmp     dh, DEVICE_SERIAL_PORT          ; Check if this is a serial device
    9292
    9393    jnz     .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r551 r567  
    161161;--------------------------------------------------------------------
    162162FloppyDrive_GetCountFromBIOS_or_BDA:
    163     push    es
    164 
     163%ifdef USE_AT
    165164; Reads Floppy Drive Count from BIOS.
    166165; Does not work on most XT systems. Call .GetCountFromBDA
    167166; if this function fails.
    168 %ifdef USE_AT
     167
     168    push    es
    169169    push    di
    170170    push    bx
     
    181181    pop     bx
    182182    pop     di
    183 
     183    pop     es
     184
     185%else ; ifndef USE_AT
    184186; Reads Floppy Drive Count (0...4) from BIOS Data Area.
    185187; This function should be used only if .GetCountFromBIOS fails.
    186 %else ; ifndef USE_AT
    187     LOAD_BDA_SEGMENT_TO es, ax
    188     mov     al, [es:BDA.wEquipment] ; Load Equipment WORD low byte
     188
     189    push    ds
     190    LOAD_BDA_SEGMENT_TO ds, ax
     191    mov     al, [BDA.wEquipment]    ; Load Equipment WORD low byte
     192    pop     ds
    189193
    190194%ifdef USE_UNDOC_INTEL
     
    200204%endif ; USE_AT
    201205
    202     pop     es
    203     ret
     206    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r561 r567  
    4747    mov     [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs
    4848
    49 %ifdef MODULE_VERY_LATE_INITIALIZATION
     49%ifdef MODULE_VERY_LATE_INIT
    5050    push    es
    51     ; Install special INT 13h hander that initializes XTIDE Universal BIOS
     51    ; Install special INT 13h handler that initializes XTIDE Universal BIOS
    5252    ; when our INT 19h is not called
    5353    les     ax, [BIOS_DISK_INTERRUPT_13h*4] ; Load system INT 13h handler
     
    9595;       Nothing
    9696;   Corrupts registers:
    97 ;       AX, CX, DX, SI, DI
     97;       AX, BX, CX, DX, SI, DI
    9898;--------------------------------------------------------------------
    9999%ifdef MODULE_COMPATIBLE_TABLES
     
    101101%ifndef USE_AT
    102102    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    103     jz      SHORT .CompatibleDPTsCreated    ; Only Full operating mode has extra RAM to spare
     103    jz      SHORT .SkipToReturn             ; Only Full operating mode has extra RAM to spare
    104104%endif
    105105
     106    mov     bx, HD0_DPT_POINTER_41h * 4
    106107    mov     dl, 80h
    107     call    FindDPT_ForDriveNumberInDL  ; DPT to DS:DI
    108     jc      SHORT .FindForDrive81h      ; Store nothing if not our drive
     108.FindForNextDrive:
     109    call    FindDPT_ForDriveNumberInDL      ; DPT to DS:DI
     110    jc      SHORT .NextDrive                ; Store nothing if not our drive
    109111
     112    push    dx
    110113    call    CompatibleDPT_CreateToAXSIforDriveDL
    111     mov     [es:HD0_DPT_POINTER_41h*4], si
    112     mov     [es:HD0_DPT_POINTER_41h*4+2], ax
     114    pop     dx
    113115
    114 .FindForDrive81h:
    115     mov     dl, 81h
    116     call    FindDPT_ForDriveNumberInDL
    117     jc      SHORT .CompatibleDPTsCreated
     116    mov     [es:bx], si
     117    mov     [es:bx+2], ax
    118118
    119     call    CompatibleDPT_CreateToAXSIforDriveDL
    120     mov     [es:HD1_DPT_POINTER_46h*4], si
    121     mov     [es:HD1_DPT_POINTER_46h*4+2], ax
    122 .CompatibleDPTsCreated:
     119.NextDrive:
     120    inc     dx
     121    add     bx, (HD1_DPT_POINTER_46h - HD0_DPT_POINTER_41h) * 4
     122    cmp     dl, 82h
     123    jb      SHORT .FindForNextDrive
     124
     125.SkipToReturn:
    123126%endif ; MODULE_COMPATIBLE_TABLES
    124127    ret
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r560 r567  
    3434%define EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; Exclude unused library functions
    3535%ifdef MODULE_BOOT_MENU
    36     %define MENUEVENT_INLINE_OFFSETS        ; Only one menu required, save space and inline offsets
     36    %define MENUEVENT_INLINE_OFFSETS        ; Only one menu required, save space and inline offsets
    3737    %define INCLUDE_MENU_LIBRARY
    38     %define MENU_NO_ESC                     ; User cannot 'esc' out of the menu
     38    %define MENU_NO_ESC                     ; User cannot 'esc' out of the menu
    3939%else   ; If no boot menu included
    4040    %define INCLUDE_DISPLAY_LIBRARY
     
    128128    at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
    129129%endif
    130     at  ROMVARS.bIdeCnt,        db  1
     130    at  ROMVARS.bIdeCnt,        db  1
    131131    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
    132132    at  ROMVARS.bMinFddCnt,     db  0                       ; Do not force minimum number of floppy drives
     
    218218
    219219    ; Boot loader
    220 %ifdef MODULE_VERY_LATE_INITIALIZATION
     220%ifdef MODULE_VERY_LATE_INIT
    221221    %include "Int13hBiosInit.asm"
    222222%endif
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm

    r526 r567  
    5555;   Returns:
    5656;       DX:     Drive number to be used for booting
    57 ;       CF:     Set: There is a selected menu item, DL is valid
    58 ;               Clear: The item selected is Rom Boot, DL is not valid
     57;       CF:     Set: There is a selected menu item, DL is valid
     58;               Clear: The item selected is Rom Boot, DL is not valid
    5959;   Corrupts registers:
    6060;       AX, BX
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm

    r562 r567  
    6666    ret
    6767
    68 MENUEVENT_InitializeMenuinitFromDSSI equ  (EventInitializeMenuinitFromSSBP - FirstEvent)
    69 MENUEVENT_ExitMenu equ  (BootMenuEvent_Completed - FirstEvent)
    70 MENUEVENT_ItemHighlightedFromCX equ (EventItemHighlightedFromCX - FirstEvent)
    71 MENUEVENT_KeyStrokeInAX equ (EventKeyStrokeInAX - FirstEvent)
    72 MENUEVENT_ItemSelectedFromCX equ (EventItemSelectedFromCX - FirstEvent)
    73 MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - FirstEvent)
    74 MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - FirstEvent)
    75 MENUEVENT_RefreshItemFromCX equ (BootMenuPrint_RefreshItem - FirstEvent)
     68MENUEVENT_InitializeMenuinitFromDSSI    equ (EventInitializeMenuinitFromSSBP    - FirstEvent)
     69MENUEVENT_ExitMenu                      equ (BootMenuEvent_Completed            - FirstEvent)
     70MENUEVENT_ItemHighlightedFromCX         equ (EventItemHighlightedFromCX         - FirstEvent)
     71MENUEVENT_KeyStrokeInAX                 equ (EventKeyStrokeInAX                 - FirstEvent)
     72MENUEVENT_ItemSelectedFromCX            equ (EventItemSelectedFromCX            - FirstEvent)
     73MENUEVENT_RefreshTitle                  equ (BootMenuPrint_TitleStrings         - FirstEvent)
     74MENUEVENT_RefreshInformation            equ (BootMenuPrint_RefreshInformation   - FirstEvent)
     75MENUEVENT_RefreshItemFromCX             equ (BootMenuPrint_RefreshItem          - FirstEvent)
    7676;
    7777; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined,
     
    9595    dw      EventNotHandled                     ; MENUEVENT.IdleProcessing
    9696    dw      EventItemHighlightedFromCX          ; MENUEVENT.ItemHighlightedFromCX
    97    
     97
    9898    dw      EventItemSelectedFromCX             ; MENUEVENT.ItemSelectedFromCX
    9999    dw      EventKeyStrokeInAX                  ; MENUEVENT.KeyStrokeInAX
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm

    r526 r567  
    125125.around:
    126126
    127     mov     ax, g_szFddSizeOr                           ; .PrintXTFloppyType
     127    mov     ax, g_szFddSizeOr                           ; .PrintXTFloppyType
    128128    test    bl, bl                                      ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
    129129    jz      SHORT .PushAXAndOutput
    130130
    131     mov     al, (g_szFddUnknown - $$) & 0xff            ; .PrintUnknownFloppyType
     131    mov     al, (g_szFddUnknown - $$) & 0xff            ; .PrintUnknownFloppyType
    132132    cmp     bl, FLOPPY_TYPE_35_ED
    133133    ja      SHORT .PushAXAndOutput
     
    146146; Floppy Drive Types:
    147147;
    148 ;   0  Handled above
    149 ;   1  FLOPPY_TYPE_525_DD          5 1/4   360K
    150 ;   2  FLOPPY_TYPE_525_HD          5 1/4   1.2M
    151 ;   3  FLOPPY_TYPE_35_DD           3 1/2   720K
    152 ;   4  FLOPPY_TYPE_35_HD           3 1/2   1.44M
    153 ;   5  3.5" ED on some BIOSes      3 1/2   2.88M
    154 ;   6  FLOPPY_TYPE_35_ED           3 1/2   2.88M
    155 ;   >6 Unknown, handled above
     148;   0  Handled above
     149;   1  FLOPPY_TYPE_525_DD          5 1/4   360K
     150;   2  FLOPPY_TYPE_525_HD          5 1/4   1.2M
     151;   3  FLOPPY_TYPE_35_DD           3 1/2   720K
     152;   4  FLOPPY_TYPE_35_HD           3 1/2   1.44M
     153;   5  3.5" ED on some BIOSes      3 1/2   2.88M
     154;   6  FLOPPY_TYPE_35_ED           3 1/2   2.88M
     155;   >6 Unknown, handled above
    156156;
    157157;--------------------------------------------------------------------
     
    169169    xor     bh, bh
    170170    mov     al,FloppyTypes.rgbCapacityMultiplier
    171     mul     BYTE [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
     171    mul     BYTE [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
    172172
    173173.PushAXAndOutput:
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r547 r567  
    372372;       ES:     BDA segment (zero)
    373373;   Returns:
    374 ;       AL:     Last scancode seen
     374;       AL:     Last scancode seen
    375375;       CF:     Set if valid hotkey in AL
    376376;               Clear if scancode in AL is not for any hotkey
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r545 r567  
    173173;   Returns:
    174174;       AX:     Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)
    175 ;               unshifted (still shifted where it is in bFlagsLow)
    176 ;       ZF:     Set based on value in AL
     175;               unshifted (still shifted where it is in bFlagsLow)
     176;       ZF:     Set based on value in AL
    177177;   Corrupts registers:
    178178;       Nothing
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r549 r567  
    199199    dec     cx      ; CX = 15
    200200    div     cx      ; AX = (Cylinders * 16) / 15
    201     ; Fall to ConvertPCHfromAXBXtoEnhancedCHinAXBX
     201    ; Fall to ConvertPCHfromAXBLtoEnhancedCHinAXBL
    202202
    203203
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r558 r567  
    109109    call    AtaGeometry_GetPCHStoAXBLBHfromAtaInfoInESSI
    110110    dec     dl                      ; Set ZF if TRANSLATEMODE_LARGE, SF if TRANSLATEMODE_NORMAL
    111     js      SHORT .NothingToChange
    112     jz      SHORT .LimitHeadsForLargeAddressingMode
     111    jle     SHORT .JumpOverSetBitForAssistedLBA
    113112
    114113    ; Set LBA bit for Assisted LBA
    115114    or      cl, FLGL_DPT_LBA
    116     jmp     SHORT .NothingToChange
     115.JumpOverSetBitForAssistedLBA:
     116    jnz     SHORT .NothingToChange
    117117
    118118.LimitHeadsForLargeAddressingMode:
     
    218218;    Since the floppy DPT's come after the hard disk DPT's, without expensive (code size) code to relocate a DPT,
    219219;    this was necessary.  Now, this situation shouldn't happen in normal operation, for a couple of reasons:
    220 ;       A. xtidecfg always puts configured serial ports at the end of the IDEVARS list
    221 ;       B. the auto serial code is always executed last
    222 ;       C. the serial server always returns floppy drives last
     220;       A. xtidecfg always puts configured serial ports at the end of the IDEVARS list
     221;       B. the auto serial code is always executed last
     222;       C. the serial server always returns floppy drives last
    223223;
    224224    adc     byte [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r526 r567  
    7575    jb      SHORT .DiskIsNotHandledByThisBIOS
    7676%endif
    77     ; fall-through to CalcDPTForDriveNumber
     77    ; Fall to .CalcDPTForDriveNumber
    7878
    7979;--------------------------------------------------------------------
     
    8181; Not intended to be called except by FindDPT_ForDriveNumberInDL
    8282;
    83 ; CalcDPTForDriveNumber
     83; .CalcDPTForDriveNumber
    8484;   Parameters:
    8585;       DL:     Drive number
    8686;       DS:     RAMVARS segment
    87 ;       DI:     Saved copy of AX from entry at FindDPT_ForDriveNumberInDL
     87;       DI:     Saved copy of AX from entry at FindDPT_ForDriveNumberInDL
    8888;   Returns:
    8989;       DS:DI:  Ptr to DPT
    90 ;       CF:     Clear
     90;       CF:     Clear
    9191;   Corrupts registers:
    9292;       Nothing
     
    136136
    137137;--------------------------------------------------------------------
    138 ; FindDPT_MasterOrSingleForIdevarsOffsetInDL
    139 ;   Parameters:
    140 ;       DL:     Offset to IDEVARS to search for
    141 ;       DS:     RAMVARS segment
    142 ;   Returns:
    143 ;       DS:DI:      Ptr to first DPT with same IDEVARS as in DL
    144 ;       CF:         Clear if wanted DPT found
    145 ;                   Set if DPT not found, or no DPTs present
    146 ;   Corrupts registers:
    147 ;       SI
    148 ;--------------------------------------------------------------------
    149 FindDPT_MasterOrSingleForIdevarsOffsetInDL:
    150     mov     si, IterateFindFirstDPTforIdevars           ; iteration routine (see below)
    151     jmp     SHORT FindDPT_IterateAllDPTs                ; look for the first drive on this controller, if any
    152 
    153 ;--------------------------------------------------------------------
    154 ; FindDPT_SlaveForIdevarsOffsetInDL
    155 ;   Parameters:
    156 ;       DL:     Offset to IDEVARS to search for
    157 ;       DS:     RAMVARS segment
    158 ;   Returns:
    159 ;       DS:DI:      Ptr to second DPT with same IDEVARS as in DL
    160 ;       CF:         Clear if wanted DPT found
    161 ;                   Set if DPT not found, or no DPTs present
    162 ;   Corrupts registers:
    163 ;       SI
    164 ;--------------------------------------------------------------------
    165 FindDPT_SlaveForIdevarsOffsetInDL:
    166     mov     si, IterateFindSecondDPTforIdevars          ; iteration routine (see below)
    167     jmp     SHORT FindDPT_IterateAllDPTs                ; look for the second drive on this controller, if any
    168 
    169 ;--------------------------------------------------------------------
    170138; Iteration routines for FindDPT_MasterOrSingleForIdevarsOffsetInDL and
    171139; FindDPT_SlaveForIdevarsOffsetInDL, for use with IterateAllDPTs
     
    175143; IterateFindSecondDPTforIdevars
    176144; IterateFindFirstDPTforIdevars
    177 ;       DL:     Offset to IDEVARS to search from DPTs
     145;       DL:     Offset to IDEVARS to search from DPTs
    178146;       SI:     Offset to this callback function
    179147;       DS:DI:  Ptr to DPT to examine
    180148;   Returns:
    181 ;       CF:     Clear if wanted DPT found
     149;       CF:     Cleared if wanted DPT found
    182150;               Set if wrong DPT
    183151;--------------------------------------------------------------------
     
    192160IterateFindFirstDPTforIdevars:
    193161    cmp     dl, [di+DPT.bIdevarsOffset]         ; Clears CF if matched
    194     je      .done
     162    je      .Done
    195163    stc                                         ; Set CF for not found
    196 .done:
     164.Done:
    197165    ret
    198166
     
    221189%endif
    222190
    223     jmp     short FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive
     191    jmp     SHORT FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive
    224192
    225193;--------------------------------------------------------------------
     
    227195;   Parameters:
    228196;       DS:DI:  Ptr to DPT to examine
    229 ;       BL:     Bit(s) to test in DPT.bFlagsHigh
    230 ;   Returns:
    231 ;       CF:     Clear if wanted DPT found
     197;       BL:     Bit(s) to test in DPT.bFlagsHigh
     198;   Returns:
     199;       CF:     Cleared if wanted DPT found
    232200;               Set if wrong DPT
    233201;   Corrupts registers:
    234202;       Nothing
    235203;--------------------------------------------------------------------
     204%ifdef MODULE_SERIAL
    236205ALIGN JUMP_ALIGN
    237206IterateToDptWithFlagsHighInBL:
     
    241210.ReturnRightDPT:
    242211    ret
     212%endif
    243213
    244214;--------------------------------------------------------------------
     
    248218;   Returns:
    249219;       DS:DI:  Ptr to DPT
    250 ;       CF:     Set if wanted DPT found
    251 ;               Cleared if DPT not found
     220;       CF:     Cleared if wanted DPT found
     221;               Set if DPT not found, or no DPTs present
    252222;   Corrupts registers:
    253223;       SI
     
    257227FindDPT_ToDSDIforSerialDevice:
    258228    mov     bl, FLGH_DPT_SERIAL_DEVICE
    259 ; fall-through
    260 %endif
    261 
    262 ;--------------------------------------------------------------------
    263 ; FindDPT_ToDSDIforFlagsHigh
    264 ;   Parameters:
    265 ;       DS:     RAMVARS segment
    266 ;       BL:     Bit(s) to test in DPT.bFlagsHigh
     229    ; Fall to FindDPT_ToDSDIforFlagsHighInBL
     230%endif
     231
     232;--------------------------------------------------------------------
     233; FindDPT_ToDSDIforFlagsHighInBL
     234;   Parameters:
     235;       DS:     RAMVARS segment
     236;       BL:     Bit(s) to test in DPT.bFlagsHigh
    267237;   Returns:
    268238;       DS:DI:  Ptr to DPT
    269 ;       CF:     Set if wanted DPT found
    270 ;               Cleared if DPT not found
     239;       CF:     Cleared if wanted DPT found
     240;               Set if DPT not found, or no DPTs present
    271241;   Corrupts registers:
    272242;       SI
    273243;--------------------------------------------------------------------
    274 %ifdef MODULE_IRQ
    275 ALIGN JUMP_ALIGN
    276 FindDPT_ToDSDIforFlagsHighInBL:
    277 %endif
     244%ifdef MODULE_SERIAL
     245;%ifdef MODULE_IRQ
     246;ALIGN JUMP_ALIGN
     247;FindDPT_ToDSDIforFlagsHighInBL:    ; This label is unused
     248;%endif
    278249    mov     si, IterateToDptWithFlagsHighInBL
    279     ; Fall to IterateAllDPTs
     250    jmp     SHORT FindDPT_IterateAllDPTs
     251%endif
     252
     253;--------------------------------------------------------------------
     254; FindDPT_MasterOrSingleForIdevarsOffsetInDL
     255;   Parameters:
     256;       DL:     Offset to IDEVARS to search for
     257;       DS:     RAMVARS segment
     258;   Returns:
     259;       DS:DI:  Ptr to first DPT with same IDEVARS as in DL
     260;       CF:     Cleared if wanted DPT found
     261;               Set if DPT not found, or no DPTs present
     262;   Corrupts registers:
     263;       SI
     264;--------------------------------------------------------------------
     265FindDPT_MasterOrSingleForIdevarsOffsetInDL:
     266    mov     si, IterateFindFirstDPTforIdevars
     267    jmp     SHORT FindDPT_IterateAllDPTs
     268
     269;--------------------------------------------------------------------
     270; FindDPT_SlaveForIdevarsOffsetInDL
     271;   Parameters:
     272;       DL:     Offset to IDEVARS to search for
     273;       DS:     RAMVARS segment
     274;   Returns:
     275;       DS:DI:  Ptr to second DPT with same IDEVARS as in DL
     276;       CF:     Cleared if wanted DPT found
     277;               Set if DPT not found, or no DPTs present
     278;   Corrupts registers:
     279;       SI
     280;--------------------------------------------------------------------
     281FindDPT_SlaveForIdevarsOffsetInDL:
     282    mov     si, IterateFindSecondDPTforIdevars
     283    ; Fall to FindDPT_IterateAllDPTs
    280284
    281285;--------------------------------------------------------------------
     
    286290;       AX,BX,DX:   Parameters to callback function
    287291;       CS:SI:      Ptr to callback function
    288 ;                   Callback routine should return CF=clear if found
     292;                   Callback routine should return CF=clear if found
    289293;       DS:         RAMVARS segment
    290294;   Returns:
    291295;       DS:DI:      Ptr to wanted DPT (if found)
    292296;                   If not found, points to first empty DPT
    293 ;       CF:         Clear if wanted DPT found
     297;       CF:         Cleared if wanted DPT found
    294298;                   Set if DPT not found, or no DPTs present
    295299;   Corrupts registers:
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r556 r567  
    4444;       DS:     RAMVARS segment
    4545;   Corrupts registers:
    46 ;       AX
     46;       AX, CL
    4747;--------------------------------------------------------------------
    4848.StealMemoryForRAMVARS:
     
    5656    mov     al, [cs:ROMVARS.bStealSize]
    5757    sub     [BDA.wBaseMem], ax
    58     mov     ax, [BDA.wBaseMem]          ; We can save a byte here by using INT 12h instead
    59     eSHL_IM ax, 6                       ; Segment to first stolen kB (*=40h)
     58    mov     ax, [BDA.wBaseMem]
     59%ifdef USE_186
     60    shl     ax, 6                       ; Segment to first stolen kB (*=40h)
     61%else
     62    mov     cl, 6
     63    shl     ax, cl
     64%endif
    6065    ; Fall to .InitializeRamvars
    6166
     
    186191;   Returns:
    187192;       AL:     First floppy drive number supported
    188 ;       CF:     Number of floppy drives supported (clear = 1, set = 2)
     193;       CF:     Number of floppy drives supported (clear = 1, set = 2)
    189194;       SF:     Emulating drives (clear = yes, set = no)
    190195;   Corrupts registers:
  • trunk/XTIDE_Universal_BIOS/makefile

    r561 r567  
    2727# MODULE_SERIAL_FLOPPY        Virtual floppy drives using serial port (requires MODULE_SERIAL)     #
    2828# MODULE_STRINGS_COMPRESSED   Use compressed strings to save space                                 #
    29 # MODULE_VERY_LATE_INITIALIZATION Initialize on INT 13h if our INT 19h handler is not called       #
    30 # MODULE_FEATURE_SETS         Power Management support                                             #
     29# MODULE_VERY_LATE_INIT       Initialize on INT 13h if our INT 19h handler is not called           #
     30# MODULE_POWER_MANAGEMENT     Power Management support                                             #
    3131#                                                                                                  #
    3232# Not modules but these affect the assembly:                                                       #
     
    101101# Assembler preprocessor defines.                               #
    102102#################################################################
    103 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER
     103DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER
    104104DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES
    105105
    106 DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED MODULE_VERY_LATE_INITIALIZATION
     106DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED
    107107DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
    108108DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA MODULE_COMPATIBLE_TABLES
     
    115115DEFINES_386_8K = $(DEFINES_AT) USE_386
    116116
    117 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS MODULE_COMPATIBLE_TABLES
     117DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_POWER_MANAGEMENT MODULE_COMPATIBLE_TABLES
    118118DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER
    119119
Note: See TracChangeset for help on using the changeset viewer.