Changeset 567 in xtideuniversalbios for trunk


Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (11 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
Files:
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Delay.inc

    r287 r567  
    3030;
    3131; LOOP instruction uses two bytes so aligned fetching will require:
    32 ;   8088:       8 cycles (two BYTE reads)
    33 ;   8086:       4 cycles (one WORD read)
    34 ;   286:        2 cycles + wait states (usually 1)
    35 ;   386:        ?
     32;   8088:       8 cycles (two BYTE reads)
     33;   8086:       4 cycles (one WORD read)
     34;   286:        2 cycles + wait states (usually 1)
     35;   386:        ?
    3636;   486:        Fetched only once to internal cache
    3737;
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r526 r567  
    6565;   Parameters:
    6666;       DS:     BDA segment (zero)
    67 ;       AX:     Parameter to Format
     67;       AX:     Parameter to Format
    6868;       ES:DI:  Ptr to cursor location in video RAM
    6969;   Returns:
     
    9494DisplayFormatCompressed_Format_5_x:
    9595    mov     si,16                       ; hex output, change base to 16
    96     mov     bx,(04<<8) + 'h'            ; 4 bytes, with postfix character 'h' to emit
     96    mov     bx,(04<<8) + 'h'            ; 4 bytes, with postfix character 'h' to emit
    9797                                        ; (note that the count includes the 'h')
    9898    jmp     DisplayFormatCompressed_Format_u
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r532 r567  
    400400;   Parameters:
    401401;       AL:     Character to display
    402 ;               Zero value is ignored (no character is printed)
     402;               Zero value is ignored (no character is printed)
    403403;       DS:     BDA segment (zero)
    404404;       ES:DI:  Ptr to cursor location in video RAM
  • trunk/Assembly_Library/Src/Serial/SerialServer.asm

    r566 r567  
    2727; SerialServer_SendReceive:
    2828;   Parameters:
    29 ;       DX:     Packed I/O port and baud rate
     29;       DX:     Packed I/O port and baud rate
    3030;       ES:SI:  Ptr to buffer (for data transfer commands)
    3131;       SS:BP:  Ptr to SerialServer_Command structure
    3232;   Returns:
    3333;       AH:     INT 13h Error Code
    34 ;       CX:     Number of 512-byte blocks transferred
     34;       CX:     Number of 512-byte blocks transferred
    3535;       CF:     Cleared if success, Set if error
    3636;   Corrupts registers:
     
    334334;   Returns:
    335335;       BP/SI:  Checksum for written bytes, compared against ACK from server in .readLoop
    336 ;       CX:     Zero
     336;       CX:     Zero
    337337;       DL:     Receive/Transmit Register address
    338 ;       ES:DI:  Ptr to buffer
     338;       ES:DI:  Ptr to buffer
    339339;   Corrupts registers:
    340340;       AX
     
    401401;   Parameters:
    402402;       AH:     UART_LineStatus bit to test (20h for write, or 1h for read)
    403 ;               One entry point fills in AH with 20h for write
     403;               One entry point fills in AH with 20h for write
    404404;       DX:     Port address (OK if already incremented to UART_lineStatus)
    405 ;       BX:
    406 ;       Stack:  2 words on the stack below the command/count word
     405;       BX:
     406;       Stack:  2 words on the stack below the command/count word
    407407;   Returns:
    408 ;       Returns when desired UART_LineStatus bit is cleared
    409 ;       Jumps directly to error exit if timeout elapses (and cleans up stack)
     408;       Returns when desired UART_LineStatus bit is cleared
     409;       Jumps directly to error exit if timeout elapses (and cleans up stack)
    410410;   Corrupts registers:
    411 ;       AX
     411;       AX
    412412;--------------------------------------------------------------------
    413413
  • trunk/Assembly_Library/Src/Serial/SerialServerScan.asm

    r526 r567  
    3131; SerialServerScan_ScanForServer:
    3232;   Parameters:
    33 ;       BH:     Drive Select byte for Drive and Head Select Register
    34 ;               0xAx: Scan for drive, low nibble indicates drive
    35 ;               0x0:  Scan for Server, independent of drives
     33;       BH:     Drive Select byte for Drive and Head Select Register
     34;               0xAx: Scan for drive, low nibble indicates drive
     35;               0x0:  Scan for Server, independent of drives
    3636;       DX:     Port and Baud to Scan for
    3737;               0: Scan a known set of ports and bauds
     
    8989; Note: hardware baud multipliers (2x, 4x) will impact the final baud rate and are not known at this level
    9090;
    91         mov     dh,030h * 2     ; multiply by 2 since we are about to divide by 2
     91        mov     dh,030h * 2     ; multiply by 2 since we are about to divide by 2
    9292        mov     dl,[cs:di]      ; restore single byte port address for scan
    9393
     
    119119; SerialServer_CheckForServer_PortAndBaudInDX:
    120120;   Parameters:
    121 ;       BH:     Drive Select byte for Drive and Head Select Register
    122 ;               0xAx: Scan for drive, low nibble indicates drive
    123 ;               0x0:  Scan for Server, independent of drives
     121;       BH:     Drive Select byte for Drive and Head Select Register
     122;               0xAx: Scan for drive, low nibble indicates drive
     123;               0x0:  Scan for Server, independent of drives
    124124;       DX:     Baud and Port
    125125;       CH:     1: We are doing a scan for the serial server
    126 ;               0: We are working off a specific port given by the user
     126;               0: We are working off a specific port given by the user
    127127;       CL:     1, for one sector to read
    128128;       ES:SI:  Ptr to buffer for return
  • trunk/Assembly_Library/Src/Util/Size.asm

    r526 r567  
    113113    rcr     si, 1                   ; Update remainder
    114114    loop    .ShiftLoop
    115     eSHR_IM si, 6                   ; Remainder to SI beginning
     115%ifdef USE_186
     116    shr     si, 6                   ; Remainder to SI beginning
     117%else
     118    mov     cl, 6
     119    shr     si, cl
     120%endif
    116121    pop     cx
    117122    inc     cx                      ; Increment magnitude
  • trunk/BIOS_Drive_Information_Tool/Src/Print.asm

    r558 r567  
    250250; Print_EbiosVersionFromBXandExtensionsFromCX
    251251;   Parameters:
    252 ;       BX:     Version of extensions
     252;       BX:     Version of extensions
    253253;       CX:     Interface support bit map
    254254;   Returns:
  • 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
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc

    r526 r567  
    4747FLG_MENUITEM_BYTEVALUE      EQU (1<<3)  ; Item value is single byte
    4848FLG_MENUITEM_PROGRAMVAR     EQU (1<<4)  ; Item is for configuring program, not BIOS
    49 FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
     49FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
    5050                                        ; ChoiceToStringLookup table must also be NULL terminated
    5151FLG_MENUITEM_MASKVALUE      EQU (1<<6)  ; Item value is more than one bit among other bits
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm

    r526 r567  
    4343;   Returns:
    4444;       ZF:     Set if supported version of XTIDE Universal BIOS is loaded
    45 ;               Cleared no file or some other file is loaded
     45;               Cleared if no file or some other file is loaded
    4646;   Corrupts registers:
    4747;       CX, SI, DI, ES
     
    5050Buffers_IsXtideUniversalBiosLoaded:
    5151    test    WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
    52     jz      SHORT .NoFileOrBiosLoaded
    53 
    54     call    Buffers_GetFileBufferToESDI
    55     jmp     SHORT Buffers_IsXtideUniversalBiosSignatureInESDI
    56 .NoFileOrBiosLoaded:
     52    jnz     SHORT .FileOrBiosLoaded
    5753    or      cl, 1       ; Clear ZF
    5854    ret
    5955
     56.FileOrBiosLoaded:
     57    call    Buffers_GetFileBufferToESDI
     58    ; Fall to Buffers_IsXtideUniversalBiosSignatureInESDI
     59
    6060
    6161;--------------------------------------------------------------------
     
    6565;   Returns:
    6666;       ZF:     Set if supported version of XTIDE Universal BIOS is loaded
    67 ;               Cleared no file or some other file is loaded
     67;               Cleared if no file or some other file is loaded
    6868;   Corrupts registers:
    6969;       CX, SI
     
    183183    mov     cx, [cs:di+g_rgwEepromTypeToSizeInWords]
    184184    sub     cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]    ; CX = WORDs to append
    185     jle     SHORT .NoNeedToAppendZeroes
     185    jbe     SHORT .NoNeedToAppendZeroes
    186186
    187187    call    Buffers_GetFileBufferToESDI
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm

    r526 r567  
    3838;--------------------------------------------------------------------
    3939IdeAutodetect_DetectIdeDeviceFromPortDXAndReturnControlBlockInSI:
    40     cmp     dx, FIRST_MEMORY_SEGMENT_ADDRESS
     40    cmp     dh, FIRST_MEMORY_SEGMENT_ADDRESS >> 8
    4141    jb      SHORT DetectPortMappedDeviceFromPortDX
    4242    ; Fall to DetectMemoryMappedDeviceFromSegmentDX
     
    5555;--------------------------------------------------------------------
    5656DetectMemoryMappedDeviceFromSegmentDX:
    57     ; *** Try to detect JR-IDE/ISA (only if MODULE_8BIT_IDE_ADVANCED is present) ***
     57    ; *** Try to detect JR-IDE/ISA and ADP50L (only if MODULE_8BIT_IDE_ADVANCED is present) ***
    5858    test    WORD [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED
    59     jz      SHORT NoIdeDeviceFound
     59    stc
     60    jz      SHORT .NoIdeDeviceFound
    6061
    6162    push    ds
    6263    mov     ds, dx
    63     cli                                 ; Disable Interrupts
     64
     65    cli
    6466    mov     ah, [JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET + STATUS_REGISTER_in]
    6567    mov     al, [JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET + ALTERNATE_STATUS_REGISTER_in]
    66     sti                                 ; Enable Interrupts
     68    sti
     69    call    CompareIdeStatusRegistersFromALandAH
     70    mov     al, DEVICE_8BIT_JRIDE_ISA
     71    jnc     .IdeDeviceFound
     72
     73    cli
     74    mov     ah, [ADP50L_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET + (STATUS_REGISTER_in << 1)]
     75    mov     al, [ADP50L_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET + (ALTERNATE_STATUS_REGISTER_in << 1)]
     76    sti
     77    call    CompareIdeStatusRegistersFromALandAH
     78    mov     al, DEVICE_8BIT_ADP50L
     79
     80.IdeDeviceFound:
     81    mov     si, dx                      ; For IDEDTCT.COM
    6782    pop     ds
    68     call    CompareIdeStatusRegistersFromALandAH
    69     mov     al, DEVICE_8BIT_JRIDE_ISA   ; Assume CF was cleared
    70     mov     si, dx                      ; For IDEDTCT.COM
    71     ret                                 ; No need to return Control Block Port
     83.NoIdeDeviceFound:
     84    ret
    7285
    7386
     
    110123
    111124    ; Detect 8-bit devices only if MODULE_8BIT_IDE is available
    112     test    BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE
     125    test    BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE | FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED
    113126    jz      SHORT NoIdeDeviceFound
     127    jpo     SHORT .SkipXTCF             ; Only 1 bit set means no MODULE_8BIT_IDE_ADVANCED
    114128
    115129    ; *** Try to detect XT-CF ***
     
    120134    mov     al, DEVICE_8BIT_XTCF_PIO8
    121135    jnc     SHORT .IdeDeviceFound
    122 
     136    shr     bx, 1
     137.SkipXTCF:
    123138
    124139    ; *** Try to detect 8-bit XT-IDE rev 1 or rev 2 ***
     
    126141    ; Status Register addresses. That is why we need another step
    127142    ; to check is this XT-IDE rev 1 or rev 2.
    128     sub     si, BYTE XTCF_CONTROL_BLOCK_OFFSET >> 1
    129     shr     bx, 1
     143    mov     si, dx
     144    add     si, BYTE XTIDE_CONTROL_BLOCK_OFFSET
    130145    call    DetectIdeDeviceFromPortsDXandSIwithOffsetsInBLandBH
    131146    jc      SHORT NoIdeDeviceFound      ; No XT-IDE rev 1 or rev 2 found
     
    210225    test    al, FLG_STATUS_DRDY
    211226    jz      SHORT NoIdeDeviceFound  ; Device needs to be ready
    212     ret                                     ; Return with CF cleared
     227    ret                             ; Return with CF cleared
    213228
    214229NoIdeDeviceFound:
     
    305320    dw      3C0h
    306321    dw      3E0h
    307     ; JR-IDE/ISA (Memory Segment Addresses)
    308     dw      0C000h
    309     dw      0C400h
    310     dw      0C800h
    311     dw      0CC00h
    312     dw      0D000h
    313     dw      0D400h
    314     dw      0D800h
     322    ; Memory Segment Addresses
     323    dw      0C000h  ; JR-IDE/ISA
     324    dw      0C400h  ; JR-IDE/ISA
     325    dw      0C800h  ; JR-IDE/ISA and ADP50L
     326    dw      0CA00h  ; ADP50L
     327    dw      0CC00h  ; JR-IDE/ISA and ADP50L
     328    dw      0CE00h  ; ADP50L
     329    dw      0D000h  ; JR-IDE/ISA
     330    dw      0D400h  ; JR-IDE/ISA
     331    dw      0D800h  ; JR-IDE/ISA
    315332.wLastIdePort:
    316     dw      0DC00h
     333    dw      0DC00h  ; JR-IDE/ISA
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm

    r526 r567  
    389389    mov     di, g_cfgVars
    390390    ret
     391
     392
     393;--------------------------------------------------------------------
     394; EnableMenuitemFromCSBX
     395; DisableMenuitemFromCSBX
     396;   Parameters:
     397;       CS:BX:  Ptr to MENUITEM
     398;   Returns:
     399;       Nothing
     400;   Corrupts registers:
     401;       Nothing
     402;--------------------------------------------------------------------
     403ALIGN JUMP_ALIGN
     404EnableMenuitemFromCSBX:
     405    or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
     406    ret
     407
     408ALIGN JUMP_ALIGN
     409DisableMenuitemFromCSBX:
     410    and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
     411    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm

    r526 r567  
    235235ALIGN JUMP_ALIGN
    236236.EnableMenuitemFromCSBX:
    237     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    238     ret
     237    jmp     EnableMenuitemFromCSBX
    239238
    240239ALIGN JUMP_ALIGN
    241240.DisableMenuitemFromCSBX:
    242     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    243     ret
     241    jmp     DisableMenuitemFromCSBX
    244242
    245243
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm

    r526 r567  
    217217.DisableAllIdeControllerMenuitems:
    218218    mov     cx, MAX_ALLOWED_IDE_CONTROLLERS-1
    219     mov     bx, g_MenuitemConfigurationSecondaryIdeController
    220 ALIGN JUMP_ALIGN
    221 .DisableNextIdeControllerMenuitem:
    222     call    .DisableMenuitemFromCSBX
    223     add     bx, BYTE MENUITEM_size
    224     loop    .DisableNextIdeControllerMenuitem
    225     ret
     219    mov     ax, DisableMenuitemFromCSBX
     220    jmp     SHORT .Go
    226221
    227222ALIGN JUMP_ALIGN
     
    230225    dec     cx          ; Primary always enabled
    231226    jz      SHORT .PrimaryControllerAlreadyEnabled
     227    mov     ax, EnableMenuitemFromCSBX
     228.Go:
    232229    mov     bx, g_MenuitemConfigurationSecondaryIdeController
    233230ALIGN JUMP_ALIGN
    234 .EnableNextIdeControllerMenuitem:
    235     call    .EnableMenuitemFromCSBX
     231.EnableOrDisableNextIdeControllerMenuitem:
     232    call    ax
    236233    add     bx, BYTE MENUITEM_size
    237     loop    .EnableNextIdeControllerMenuitem
     234    loop    .EnableOrDisableNextIdeControllerMenuitem
    238235.PrimaryControllerAlreadyEnabled:
    239236    ret
     
    288285    call    Buffers_GetRomvarsFlagsToAX
    289286    mov     bx, g_MenuitemConfigurationIdleTimeout
    290     test    ax, FLG_ROMVARS_MODULE_FEATURE_SETS
     287    test    ax, FLG_ROMVARS_MODULE_POWER_MANAGEMENT
    291288    jz      SHORT .DisableMenuitemFromCSBX
    292289    ; Fall to .EnableMenuitemFromCSBX
     
    305302ALIGN JUMP_ALIGN
    306303.EnableMenuitemFromCSBX:
    307     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    308     ret
     304    jmp     EnableMenuitemFromCSBX
    309305
    310306ALIGN JUMP_ALIGN
    311307.DisableMenuitemFromCSBX:
    312     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    313     ret
    314 
     308    jmp     DisableMenuitemFromCSBX
    315309
    316310
     
    419413    jnz     .next
    420414    mov     si, di
    421     jmp     .next
     415    SKIP2B  f
    422416
    423417.notSerial:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r546 r567  
    242242    dw  NULL
    243243
    244 SERIAL_DEFAULT_CUSTOM_PORT   EQU        300h           ; can't be any of the pre-defined COM values
    245 
    246 PackedCOMPortAddresses:             ; COM1 - COMC (or COM12)
    247     db      SERIAL_COM1_IOADDRESS >> 2
     244SERIAL_DEFAULT_CUSTOM_PORT      EQU     300h        ; can't be any of the pre-defined COM values
     245SERIAL_DEFAULT_COM              EQU     '1'
     246SERIAL_DEFAULT_BAUD             EQU     ((115200 / 9600)    & 0xff)
     247
     248PackedCOMPortAddresses:                             ; COM1 - COMC (or COM12)
     249    db      SERIAL_COM1_IOADDRESS >> 2
    248250    db      SERIAL_COM2_IOADDRESS >> 2
    249251    db      SERIAL_COM3_IOADDRESS >> 2
     
    258260    db      SERIAL_COMC_IOADDRESS >> 2
    259261    db      SERIAL_DEFAULT_CUSTOM_PORT >> 2         ; must be last entry (see reader/writer routines)
    260 SERIAL_DEFAULT_COM          EQU     '1'
    261262
    262263g_rgbChoiceToValueLookupForBaud:
     
    279280    dw      g_szValueCfgBaud2400
    280281    dw      NULL
    281 SERIAL_DEFAULT_BAUD         EQU     ((115200 / 9600)    & 0xff)
    282282
    283283; Section containing code
     
    339339    push    cs
    340340    pop     ds
     341    call    .EnableOrDisableCommandBlockPort
    341342    call    .EnableOrDisableControlBlockPort
    342343    call    .DisableIRQchannelSelection
     
    345346    mov     si, g_MenupageForIdeControllerMenu
    346347    jmp     Menupage_ChangeToNewMenupageInDSSI
     348
     349
     350;--------------------------------------------------------------------
     351; .EnableOrDisableCommandBlockPort
     352;   Parameters:
     353;       SS:BP:  Menu handle
     354;   Returns:
     355;       Nothing
     356;   Corrupts registers:
     357;       AX, BX
     358;--------------------------------------------------------------------
     359ALIGN JUMP_ALIGN
     360.EnableOrDisableCommandBlockPort:
     361    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     362    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     363    mov     bx, g_MenuitemIdeControllerCommandBlockAddress
     364    cmp     al, DEVICE_SERIAL_PORT
     365    je      SHORT .DisableMenuitemFromCSBX
     366    jmp     SHORT .EnableMenuitemFromCSBX
    347367
    348368
     
    385405    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    386406    mov     bx, g_MenuitemIdeControllerEnableInterrupt
    387     cmp     al, DEVICE_8BIT_XTIDE_REV2
     407    cmp     al, DEVICE_8BIT_XTCF_PIO8
    388408    jae     SHORT .DisableMenuitemFromCSBX
    389409
    390     call    .EnableMenuitemFromCSBX
     410    call    EnableMenuitemFromCSBX
    391411    ; Fall to .EnableOrDisableIRQchannelSelection
    392412
     
    424444ALIGN JUMP_ALIGN
    425445.DisableMenuitemFromCSBX:
    426     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    427     ret
     446    jmp     DisableMenuitemFromCSBX
    428447
    429448ALIGN JUMP_ALIGN
    430449.EnableMenuitemFromCSBX:
    431     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    432     ret
     450    jmp     EnableMenuitemFromCSBX
    433451
    434452
    435453.EnableOrDisableSerial:
    436454    mov     bx, g_MenuitemIdeControllerSerialBaud
    437     call    .DisableMenuitemFromCSBX
     455    call    DisableMenuitemFromCSBX
    438456
    439457    mov     bx, g_MenuitemIdeControllerSerialCOM
    440     call    .DisableMenuitemFromCSBX
     458    call    DisableMenuitemFromCSBX
    441459
    442460    mov     bx, g_MenuitemIdeControllerSerialPort
    443     call    .DisableMenuitemFromCSBX
     461    call    DisableMenuitemFromCSBX
    444462
    445463    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    446464    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    447465    cmp     al, DEVICE_SERIAL_PORT
    448     jnz     .DisableAllSerial
     466    jne     .DisableAllSerial
    449467
    450468    mov     bx, g_MenuitemIdeControllerSerialCOM
    451     call    .EnableMenuitemFromCSBX
     469    call    EnableMenuitemFromCSBX
    452470
    453471    mov     bx, g_MenuitemIdeControllerSerialBaud
    454     call    .EnableMenuitemFromCSBX
     472    call    EnableMenuitemFromCSBX
    455473
    456474    mov     bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    457475    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    458476    mov     bx, g_MenuitemIdeControllerSerialPort
    459     cmp     al,'x'
    460     jz      .EnableMenuitemFromCSBX
    461     jmp     .DisableMenuitemFromCSBX
     477    cmp     al, 'x'
     478    je      SHORT .EnableMenuitemFromCSBX
     479    jmp     SHORT .DisableMenuitemFromCSBX
    462480.DisableAllSerial:
    463481    ret
     
    485503DisplayMasterSlaveMenu:
    486504;
    487 ; block mode is not supported on serial drives, disable/enable the option as appropriate
     505; "Block Mode Transfers" and "Internal Write Cache" are not supported on serial drives, disable/enable the options as appropriate
    488506;
    489507    push    bx
     
    491509    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    492510    mov     bx, g_MenuitemMasterSlaveBlockModeTransfers
    493     cmp     al,DEVICE_SERIAL_PORT
    494     jz      .isSerial
    495     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
     511
     512    cmp     al, DEVICE_SERIAL_PORT
     513    je      .isSerial
     514
     515    call    EnableMenuitemFromCSBX
     516    mov     bx, g_MenuitemMasterSlaveWriteCache
     517    call    EnableMenuitemFromCSBX
    496518    jmp     .isDone
     519
    497520.isSerial:
    498     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
     521    call    DisableMenuitemFromCSBX
     522    mov     bx, g_MenuitemMasterSlaveWriteCache
     523    call    DisableMenuitemFromCSBX
     524
    499525.isDone:
    500526    pop     bx
     
    515541; Writers:
    516542;   Parameters:
    517 ;       AX:     Value that the MENUITEM system was interacting with
    518 ;       ES:DI:  ROMVARS location where the value is to be stored
    519 ;       DS:SI:  MENUITEM pointer
     543;       AX:     Value that the MENUITEM system was interacting with
     544;       ES:DI:  ROMVARS location where the value is to be stored
     545;       DS:SI:  MENUITEM pointer
    520546;   Returns:
    521547;       AX:     Value to actually write to ROMVARS
     
    525551; Readers:
    526552;   Parameters:
    527 ;       AX:     Value read from the ROMVARS location
    528 ;       ES:DI:  ROMVARS location where the value was just read from
    529 ;       DS:SI:  MENUITEM pointer
     553;       AX:     Value read from the ROMVARS location
     554;       ES:DI:  ROMVARS location where the value was just read from
     555;       DS:SI:  MENUITEM pointer
    530556;   Returns:
    531557;       AX:     Value that the MENUITEM system will interact with and display
     
    535561ALIGN JUMP_ALIGN
    536562WriterForXTCFwindow:
    537     mov     al, ah
     563    xor     al, al
     564    SKIP2B  f
     565ReaderForXTCFwindow:
    538566    xor     ah, ah
    539     ret
    540 
    541 ALIGN JUMP_ALIGN
    542 ReaderForXTCFwindow:
    543     mov     ah, al
    544     xor     al, al
     567    xchg    al, ah
    545568    ret
    546569
     
    552575ALIGN JUMP_ALIGN
    553576IdeControllerMenu_WriteDevice:
    554         push    bx
    555         push    di
    556         push    di
    557         push    ax
    558 
    559         ; Note! AL is the choice index, not device code
    560         shl     ax, 1                               ; Selection to device code
    561         mov     bl, [es:di]                         ; what is the current Device we are changing from?
    562         sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
    563         cmp     al, DEVICE_SERIAL_PORT
    564         je      SHORT .changingToSerial
    565         cmp     al, DEVICE_8BIT_JRIDE_ISA
    566         je      SHORT .ChangingToJrIdeIsa
    567         cmp     al, DEVICE_8BIT_ADP50L
    568         je      SHORT .ChangingToADP50L
    569 
    570         ; Restore ports to default values
    571         cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
    572         mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
    573         mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
    574         jbe     SHORT .writeNonSerial
    575 
    576         mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
    577         mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
    578 
    579 .writeNonSerial:
    580         stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
    581         xchg    bx, ax
    582         stosw
    583         jmp     SHORT .done
     577    push    bx
     578    push    di
     579    push    ax
     580
     581    ; Note! AL is the choice index, not device code
     582    shl     ax, 1                               ; Selection to device code
     583    mov     bl, [es:di]                         ; what is the current Device we are changing from?
     584    sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
     585    cmp     al, DEVICE_SERIAL_PORT
     586    je      SHORT .ChangingToSerial
     587    cmp     al, DEVICE_8BIT_JRIDE_ISA
     588    je      SHORT .ChangingToJrIdeIsa
     589    cmp     al, DEVICE_8BIT_ADP50L
     590    je      SHORT .ChangingToADP50L
     591
     592    ; Restore ports to default values
     593    cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
     594    mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
     595    mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
     596    jbe     SHORT .WriteNonSerial
     597
     598    mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
     599    mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
     600
     601.WriteNonSerial:
     602    stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
     603    xchg    bx, ax
     604    stosw
     605    jmp     SHORT .Done
    584606
    585607.ChangingToJrIdeIsa:
    586         mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
    587         SKIP2B  bx
     608    mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
     609    SKIP2B  bx
    588610
    589611.ChangingToADP50L:
    590         mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
    591         xor     al, al
    592         xor     bx, bx
    593         jmp     SHORT .writeNonSerial
    594 
    595 .changingToSerial:
    596         cmp     bl, DEVICE_SERIAL_PORT
    597         je      SHORT .done                         ; if we were already serial, nothing to do
    598 
    599         mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
    600 
    601         mov     al, SERIAL_DEFAULT_COM
    602         sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
    603         call    IdeControllerMenu_SerialWriteCOM
    604         stosb
    605 
    606 .done:
    607         pop     ax
    608         pop     di          ; IDEVARS.bDevice
    609         pop     di
    610         pop     bx
    611         ret
     612    mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
     613    xor     al, al
     614    xor     bx, bx
     615    jmp     SHORT .WriteNonSerial
     616
     617.ChangingToSerial:
     618    cmp     bl, DEVICE_SERIAL_PORT
     619    je      SHORT .Done                         ; if we were already serial, nothing to do
     620
     621    mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
     622
     623    mov     al, SERIAL_DEFAULT_COM
     624    sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
     625    call    IdeControllerMenu_SerialWriteCOM
     626    stosb
     627
     628.Done:
     629    pop     ax
     630    pop     di          ; IDEVARS.bDevice
     631    pop     bx
     632    ret
    612633
    613634;
     
    617638ALIGN JUMP_ALIGN
    618639IdeControllerMenu_SerialWriteCOM:
    619         push    ax
    620         push    bx
    621         push    si
    622 
    623         mov     si,g_rgbChoiceToValueLookupForCOM
    624         mov     bx,PackedCOMPortAddresses
     640    push    ax
     641    push    bx
     642    push    si
     643
     644    mov     si, g_rgbChoiceToValueLookupForCOM
     645    mov     bx, PackedCOMPortAddresses
    625646
    626647.loop:
    627         mov     ah,[bx]
    628 
    629         cmp     ah,(SERIAL_DEFAULT_CUSTOM_PORT >> 2)
    630         jz      .notFound
    631 
    632         cmp     al,[si]
    633         jz      .found
    634 
    635         inc     si
    636         inc     si
    637         inc     bx
    638 
    639         jmp     .loop
     648    mov     ah, [bx]
     649
     650    cmp     ah, (SERIAL_DEFAULT_CUSTOM_PORT >> 2)
     651    je      .notFound
     652
     653    cmp     al, [si]
     654    je      .found
     655
     656    inc     si
     657    inc     si
     658    inc     bx
     659
     660    jmp     .loop
    640661
    641662.notFound:
    642         mov     al, 'x'
     663    mov     al, 'x'
    643664
    644665.found:
    645         mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
    646 
    647         pop     si
    648         pop     bx
    649         pop     ax
    650 
    651         ret
     666    mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
     667
     668    pop     si
     669    pop     bx
     670    pop     ax
     671
     672    ret
    652673
    653674
     
    657678ALIGN JUMP_ALIGN
    658679IdeControllerMenu_SerialReadPort:
    659         xor     ah,ah
    660         eSHL_IM ax, 2
    661         ret
     680    xor     ah, ah
     681    eSHL_IM ax, 2
     682    ret
    662683
    663684;
     
    667688ALIGN JUMP_ALIGN
    668689IdeControllerMenu_SerialWritePort:
    669         push    bx
    670         push    si
    671 
    672         eSHR_IM ax, 2
    673         and     al,0feh         ; force 8-byte boundary
    674 
    675         mov     si,g_rgbChoiceToValueLookupForCOM
    676         mov     bx,PackedCOMPortAddresses           ; loop, looking for port address in known COM address list
     690    push    bx
     691    push    si
     692
     693    eSHR_IM ax, 2
     694    and     al, 0feh            ; force 8-byte boundary
     695
     696    mov     si, g_rgbChoiceToValueLookupForCOM
     697    mov     bx, PackedCOMPortAddresses          ; loop, looking for port address in known COM address list
    677698
    678699.loop:
    679         mov     ah,[si]
    680         cmp     ah,'x'
    681         jz      .found
    682 
    683         cmp     al,[bx]
    684         jz      .found
    685 
    686         inc     si
    687         inc     si
    688         inc     bx
    689 
    690         jmp     .loop
     700    mov     ah, [si]
     701    cmp     ah, 'x'
     702    je      .found
     703
     704    cmp     al, [bx]
     705    je      .found
     706
     707    inc     si
     708    inc     si
     709    inc     bx
     710
     711    jmp     .loop
    691712
    692713.found:
    693         mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
    694 
    695         pop     si
    696         pop     bx
    697 
    698         ret
    699 
     714    mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
     715
     716    pop     si
     717    pop     bx
     718
     719    ret
     720
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm

    r548 r567  
    290290    ; Enable both
    291291    mov     bx, g_MenuitemMasterSlaveUserCHS
    292     call    .EnableMenuitemFromCSBX
     292    call    EnableMenuitemFromCSBX
    293293    mov     bx, g_MenuitemMasterSlaveUserLBA
    294     jmp     .EnableMenuitemFromCSBX
     294    jmp     SHORT .EnableMenuitemFromCSBX
    295295
    296296ALIGN JUMP_ALIGN
    297297.EnableCHSandDisableLBA:
    298298    mov     bx, g_MenuitemMasterSlaveUserCHS
    299     call    .EnableMenuitemFromCSBX
     299    call    EnableMenuitemFromCSBX
    300300    mov     bx, g_MenuitemMasterSlaveUserLBA
    301     jmp     .DisableMenuitemFromCSBX
     301    jmp     SHORT .DisableMenuitemFromCSBX
    302302
    303303ALIGN JUMP_ALIGN
    304304.DisableCHSandEnableLBA:
    305305    mov     bx, g_MenuitemMasterSlaveUserLBA
    306     call    .EnableMenuitemFromCSBX
     306    call    EnableMenuitemFromCSBX
    307307    mov     bx, g_MenuitemMasterSlaveUserCHS
    308     jmp     .DisableMenuitemFromCSBX
     308    jmp     SHORT .DisableMenuitemFromCSBX
    309309
    310310
     
    328328
    329329    mov     bx, g_MenuitemMasterSlaveCylinders
    330     call    .EnableMenuitemFromCSBX
     330    call    EnableMenuitemFromCSBX
    331331    mov     bx, g_MenuitemMasterSlaveHeads
    332     call    .EnableMenuitemFromCSBX
     332    call    EnableMenuitemFromCSBX
    333333    mov     bx, g_MenuitemMasterSlaveSectors
    334334    jmp     SHORT .EnableMenuitemFromCSBX
     
    337337.DisableCHandS:
    338338    mov     bx, g_MenuitemMasterSlaveCylinders
    339     call    .DisableMenuitemFromCSBX
     339    call    DisableMenuitemFromCSBX
    340340    mov     bx, g_MenuitemMasterSlaveHeads
    341     call    .DisableMenuitemFromCSBX
     341    call    DisableMenuitemFromCSBX
    342342    mov     bx, g_MenuitemMasterSlaveSectors
    343343    jmp     SHORT .DisableMenuitemFromCSBX
     
    377377ALIGN JUMP_ALIGN
    378378.EnableMenuitemFromCSBX:
    379     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    380     ret
     379    jmp     EnableMenuitemFromCSBX
    381380
    382381ALIGN JUMP_ALIGN
    383382.DisableMenuitemFromCSBX:
    384     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    385     ret
     383    jmp     DisableMenuitemFromCSBX
    386384
    387385
     
    407405
    408406    xchg    ax, dx              ; SHR 16
    409     eSHIFT_IM ax, 4, shr        ; SHR 4 => AX = DX:AX / (1024*1024)
     407    eSHR_IM ax, 4               ; SHR 4 => AX = DX:AX / (1024*1024)
    410408
    411409    pop     dx
     
    429427
    430428    xor     dx, dx
    431     eSHIFT_IM ax, 4, shl
     429    eSHL_IM ax, 4
    432430    xchg    dx, ax          ; DX:AX now holds AX * 1024 * 1024
    433431
     
    445443ALIGN JUMP_ALIGN
    446444MasterSlaveMenu_WriteCHSFlag:
    447         test    word [es:di], FLG_DRVPARAMS_USERCHS
    448         jnz     .alreadySet
    449 
    450         push    ax
    451         push    di
    452         push    si
    453 
    454         mov     ax, MASTERSLAVE_CYLINDERS_DEFAULT
    455         mov     si, g_MenuitemMasterSlaveCylinders
    456         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    457 
    458         mov     ax, MASTERSLAVE_HEADS_DEFAULT
    459         mov     si, g_MenuitemMasterSlaveHeads
    460         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    461 
    462         mov     ax, MASTERSLAVE_SECTORS_DEFAULT
    463         mov     si, g_MenuitemMasterSlaveSectors
    464         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    465 
    466         pop     si
    467         pop     di
    468         pop     ax
     445    test    word [es:di], FLG_DRVPARAMS_USERCHS
     446    jnz     .alreadySet
     447
     448    push    ax
     449    push    di
     450    push    si
     451
     452    mov     ax, MASTERSLAVE_CYLINDERS_DEFAULT
     453    mov     si, g_MenuitemMasterSlaveCylinders
     454    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     455
     456    mov     ax, MASTERSLAVE_HEADS_DEFAULT
     457    mov     si, g_MenuitemMasterSlaveHeads
     458    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     459
     460    mov     ax, MASTERSLAVE_SECTORS_DEFAULT
     461    mov     si, g_MenuitemMasterSlaveSectors
     462    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     463
     464    pop     si
     465    pop     di
     466    pop     ax
    469467
    470468.alreadySet:
    471         ret
     469    ret
    472470
    473471;
     
    477475ALIGN JUMP_ALIGN
    478476MasterSlaveMenu_WriteLBAFlag:
    479         test    word [es:di], FLG_DRVPARAMS_USERLBA
    480         jnz     .alreadySet
    481 
    482         push    ax
    483         push    di
    484         push    si
    485 
    486         mov     ax, MASTERSLAVE_USERLBA_DEFAULT
    487         mov     si, g_MenuitemMasterSlaveUserLbaValue
    488         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    489 
    490         pop     si
    491         pop     di
    492         pop     ax
     477    test    word [es:di], FLG_DRVPARAMS_USERLBA
     478    jnz     .alreadySet
     479
     480    push    ax
     481    push    di
     482    push    si
     483
     484    mov     ax, MASTERSLAVE_USERLBA_DEFAULT
     485    mov     si, g_MenuitemMasterSlaveUserLbaValue
     486    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     487
     488    pop     si
     489    pop     di
     490    pop     ax
    493491
    494492.alreadySet:
    495         ret
     493    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r565 r567  
    6969g_szItemMainFlash:      db  "Flash EEPROM",NULL
    7070g_szItemMainSave:       db  "Save BIOS back to original file",NULL
    71 g_szItemMainLicense:    db  "Copyright and License Information",NULL
    72 g_szItemMainHomePage:   db  "Web Links",NULL
     71g_szItemMainLicense:    db  "Copyright and License Information",NULL
     72g_szItemMainHomePage:   db  "Web Links",NULL
    7373
    7474g_szDlgMainLoadROM:     db  "Successfully loaded XTIDE Universal BIOS from EEPROM.",NULL
     
    128128g_szNfoCfgIdleTimeout:  db  "Enable Power Management to set the harddrive(s) to spin down after idling a certain amount of time.",NULL
    129129
    130 g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list."
     130g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list."
    131131                        db  " No further action is required. Serial Controllers must be placed at the end of the list.",NULL
    132132
     
    294294g_szValueCfgDeviceSerial:                   db  "Serial",NULL
    295295
    296 g_szSerialCOMChoice:    db  "COM1 - address 3F8h",LF
     296g_szSerialCOMChoice:    db  "COM1 - address 3F8h",LF
    297297                        db  "COM2 - address 2F8h",LF
    298                         db  "COM3 - address 3E8h",LF
    299                         db  "COM4 - address 2E8h",LF
    300                         db  "COM5 - address 2F0h",LF
    301                         db  "COM6 - address 3E0h",LF
     298                        db  "COM3 - address 3E8h",LF
     299                        db  "COM4 - address 2E8h",LF
     300                        db  "COM5 - address 2F0h",LF
     301                        db  "COM6 - address 3E0h",LF
    302302                        db  "COM7 - address 2E0h",LF
    303303                        db  "COM8 - address 260h",LF
     
    306306                        db  "COMB - address 360h",LF
    307307                        db  "COMC - address 270h",LF
    308                         db  "COMx - Custom address",NULL
     308                        db  "COMx - Custom address",NULL
    309309
    310310g_szValueCfgCOM1:       db  "COM1",NULL
     
    322322g_szValueCfgCOMx:       db  "Custom",NULL
    323323
    324 g_szSerialBaudChoice:   db  "115.2K baud",LF
    325                         db  "57.6K baud",LF
     324g_szSerialBaudChoice:   db  "115.2K baud",LF
     325                        db  "57.6K baud",LF
    326326                        db  "38.4K baud",LF
    327                         db  "28.8K baud",LF
    328                         db  "19.2K baud",LF
     327                        db  "28.8K baud",LF
     328                        db  "19.2K baud",LF
    329329                        db  "9600 baud",LF
    330                         db  "4800 baud",LF
    331                         db  "2400 baud",NULL
     330                        db  "4800 baud",LF
     331                        db  "2400 baud",NULL
    332332
    333333g_szValueCfgBaud115_2:  db  "115.2K",NULL
     
    377377                        db  " least one drive with buggy Block Mode implementation.",NULL
    378378
    379 g_szHelpDrvWriteCache:  db  "Modern Hard Drives have large internal write cache."
    380                         db  " The cache will speed up writes since the drive can free the bus right after data has been written in cache."
    381                         db  " The drive then starts to write the data from cache by itself."
    382                         db  " That can be dangerous since all unwritten data in cache is lost if power is turned off or the system is reset."
     379g_szHelpDrvWriteCache:  db  "Modern Hard Drives have a large amount of internal write cache."
     380                        db  " The cache will speed up writes since the drive can free the bus right after data has been written to cache."
     381                        db  " The drive then starts to write the data from cache to disk by itself."
     382                        db  " This can be dangerous since all unwritten data in cache is lost if power is turned off or the system is reset."
    383383                        db  " Modern operating systems will flush the cache when user shuts down the system."
    384384                        db  " DOS does not have that sort of protection so it is up to the user to make sure cache is flushed."
Note: See TracChangeset for help on using the changeset viewer.