Changeset 285 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Feb 29, 2012, 7:20:36 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Some minor optimizations.
  • Boot menu now displays JR-IDE/ISA bus type (M8).
  • Drive detection now displays ROM segment as JR-IDE/ISA Device address.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r281 r285  
    129129
    130130    ; Output Sector Address High (only used by LBA48)
     131%ifdef MODULE_EBIOS
    131132    eMOVZX  ax, BYTE [bp+IDEPACK.bLbaLowExt]    ; Zero sector count
    132133    mov     cx, [bp+IDEPACK.wLbaMiddleAndHighExt]
    133134    call    IDEDEVICE%+OutputSectorCountAndAddress
     135%endif
    134136
    135137    ; Output Sector Address Low
     
    186188    eCMOVE  bh, TIMEOUT_IDENTIFY_DEVICE
    187189    call    IDEDEVICE%+Wait_PollStatusFlagInBLwithTimeoutInBH
    188     jc      SHORT .ErrorWhenSelectingMasterOrSlave
    189     ret
    190190
    191191    ; Ignore errors from IDE Error Register (set by previous command)
    192 .ErrorWhenSelectingMasterOrSlave:
    193     cmp     ah, RET_HD_TIMEOUT      ; Do not ignore timeout
     192    cmp     ah, RET_HD_TIMEOUT
     193    je      SHORT .FailedToSelectDrive
     194    xor     ax, ax                  ; Always success unless timeout
     195    ret
     196.FailedToSelectDrive:
    194197    stc
    195     je      SHORT .ReturnWithErrorCodeInAHandCF
    196     xor     ah, ah                  ; No errors
    197 .ReturnWithErrorCodeInAHandCF:
    198198    ret
    199199
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r283 r285  
    7777ConvertAH08hReturnValuesToSectorCount:
    7878    call    Address_ExtractLCHSparametersFromOldInt13hAddress
    79 
    80     mov     al, bl      ; Get sector value
    81     mul     bh          ; Multiply by heads-1 (since bh is zero based, and could be 255 and overflow)
    82     xor     bh, bh      ; Clear upper byte for following addition...
    83     add     ax, bx      ; Add in one more sector value, since heads was off by one
    84     inc     cx          ; Max cylinder number to cylinder count (again, zero based)
    85     mul     cx          ; Multiply in cylinders
    86     xor     bx, bx      ; Zero upper 16-bits, sector count will not be that large
    87        
     79    mov     al, bh      ; AL = Max head number
     80    inc     cx          ; Max cylinder number to cylinder count
     81    inc     ax          ; Max head number to head count (AH=8h returns max 254 so no overflow to AH)
     82    mul     bl          ; AX = Head count * Sectors per track
     83    mul     cx          ; DX:AX = Total sector count for AH=0xh transfer functions
     84    xor     bx, bx
    8885    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r262 r285  
    1818;       CL:     Bits 7...6: Cylinder number bits 9...8
    1919;               Bits 5...0: Maximum sector number (1...63)
    20 ;       DH:     Maximum head number (0...255)
     20;       DH:     Maximum head number (0...254)
    2121;       DL:     Number of drives
    2222;       ES:DI:  Floppy DPT (for floppies only)
     
    7979;       CL:     Bits 7...6: Cylinder number bits 9...8
    8080;               Bits 5...0: Maximum sector number (1...63)
    81 ;       DH:     Maximum head number (0...255)
     81;       DH:     Maximum head number (0...254)
    8282;   Corrupts registers:
    8383;       AX, BX
     
    9393;   Parameters:
    9494;       AX:     Number of L-CHS cylinders available (1...1024)
    95 ;       BL:     Number of L-CHS heads (1...256)
     95;       BL:     Number of L-CHS heads (1...255)
    9696;       BH:     Number of L-CHS sectors per track (1...63)
    9797;       DS:     RAMVARS segment
     
    100100;       CL:     Bits 7...6: Cylinder number bits 9...8
    101101;               Bits 5...0: Maximum sector number (1...63)
    102 ;       DH:     Maximum head number (0...255)
     102;       DH:     Maximum head number (0...254)
    103103;   Corrupts registers:
    104104;       AX, BX
     
    112112    or      cl, bh                  ; CL bits 0...5 = Sectors per track
    113113    mov     dh, bl                  ; DH = Maximum head number
    114        
     114
    115115%ifdef MODULE_SERIAL_FLOPPY
    116116    mov     bl,[di+DPT.bFlagsHigh]
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r277 r285  
    3939;--------------------------------------------------------------------
    4040DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
    41 
    4241    mov     ax, [cs:bp+IDEVARS.wPort]       ; for IDE: AX=port address, DH=.bDevice
    4342    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
    4443                                            ;             DL=COM number character, DH=.bDevice
    45        
     44%ifdef MODULE_JRIDE
     45    cmp     dh, DEVICE_JRIDE_ISA
     46    eCMOVE  ax, cs                          ; Use segment address for JR-IDE/ISA
     47%endif
     48
    4649    mov     si, g_szDetectOuter             ; Load SI with default wrapper string "IDE %s at %s: "
    4750       
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r277 r285  
    136136    at  ROMVARS.bStealSize,     db  1                       ; Steal 1kB from base memory in full mode
    137137
     138    at  ROMVARS.ideVars0+IDEVARS.wPort,         dw  DEVICE_XTIDE_DEFAULT_PORT           ; Controller Command Block base port
     139    at  ROMVARS.ideVars0+IDEVARS.wPortCtrl,     dw  DEVICE_XTIDE_DEFAULT_PORTCTRL       ; Controller Control Block base port
    138140%ifdef MODULE_JRIDE
    139141    at  ROMVARS.ideVars0+IDEVARS.bDevice,       db  DEVICE_JRIDE_ISA
    140142%else
    141     at  ROMVARS.ideVars0+IDEVARS.wPort,         dw  DEVICE_XTIDE_DEFAULT_PORT           ; Controller Command Block base port
    142     at  ROMVARS.ideVars0+IDEVARS.wPortCtrl,     dw  DEVICE_XTIDE_DEFAULT_PORTCTRL       ; Controller Control Block base port
    143143    at  ROMVARS.ideVars0+IDEVARS.bDevice,       db  DEVICE_8BIT_DUAL_PORT_XTIDE
    144144%endif
     
    167167    %include "Interrupts.asm"       ; For Interrupt initialization
    168168    %include "RamVars.asm"          ; For RAMVARS initialization and access
     169    %include "CreateDPT.asm"        ; For creating DPTs
     170    %include "FindDPT.asm"          ; For finding DPTs
    169171%ifdef MODULE_STRINGS_COMPRESSED
    170172    %include "StringsCompressed.asm"
     
    172174    %include "Strings.asm"          ; For BIOS message strings
    173175%endif
    174     %include "CreateDPT.asm"        ; For creating DPTs
    175     %include "FindDPT.asm"          ; For finding DPTs
    176176    %include "AccessDPT.asm"        ; For accessing DPTs
    177177    %include "BootMenuInfo.asm"     ; For creating BOOTMENUINFO structs
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r277 r285  
    4949g_szBusTypeValues_32:           db      " 32",NULL
    5050g_szBusTypeValues_Serial:       db      "SER",NULL
     51g_szBusTypeValues_8MemMapped:   db      "M8 ",NULL
    5152g_szBusTypeValues_Displacement equ (g_szBusTypeValues_8Reversed - g_szBusTypeValues)
    5253;
     
    7172    %if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
    7273        %error "g_szBusTypeValues Displacement Incorrect 6"
     74    %endif
     75    %if g_szBusTypeValues_8MemMapped <> g_szBusTypeValues_Serial + g_szBusTypeValues_Displacement
     76        %error "g_szBusTypeValues Displacement Incorrect 7"
    7377    %endif
    7478%endif
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm

    r277 r285  
    102102                                  db         59h,  4bh,  98h          ; compressed
    103103
     104g_szBusTypeValues_8MemMapped:   ; db        "M8 ",NULL
     105                                ; db         4dh,  38h,  20h,  00h    ; uncompressed
     106                                  db         53h,  31h,  00h          ; compressed
     107
    104108g_szBusTypeValues_Displacement equ (g_szBusTypeValues_8Reversed - g_szBusTypeValues)
    105109;
     
    124128%if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
    125129%error "g_szBusTypeValues Displacement Incorrect 6"
     130%endif
     131%if g_szBusTypeValues_8MemMapped <> g_szBusTypeValues_Serial + g_szBusTypeValues_Displacement
     132%error "g_szBusTypeValues Displacement Incorrect 7"
    126133%endif
    127134%endif
     
    189196                          db     4fh,  4ah, 0cbh,  3eh,  20h,  67h, 0fah,  3eh,  40h,  00h                                  ; compressed
    190197
    191 %ifdef MODULE_SERIAL        ;%%; is stripped off after string compression, %ifdef won't compress properly
     198;%%; %ifdef MODULE_SERIAL       ;%%; is stripped off after string compression, %ifdef won't compress properly
    192199g_szDetectOuterSerial:  ; db    "Serial %s on %s: ",NULL
    193200                        ; db     53h,  65h,  72h,  69h,  61h,  6ch,  20h,  25h,  73h,  20h,  6fh,  6eh,  20h,  25h,  73h,  3ah,  20h,  00h    ; uncompressed
     
    210217                          db     2ah,  37h,  29h,  37h,  91h                      ; compressed
    211218
    212 %endif                      ;%%; is stripped off after string compression, %ifdef won't compress properly
     219;%%; %endif                     ;%%; is stripped off after string compression, %ifdef won't compress properly
    213220g_szDetectEnd:
    214221g_szDetectPort:         ; db    "%x",NULL                       ; IDE Master at 1F0h:
     
    426433;; translated usage stats
    427434;; 33:1
    428 ;; 32:32
     435;; 32:33
    429436;; 181:1
    430437;; 53:2
     
    441448;; 34:3
    442449;; 49:1
    443 ;; 56:5
     450;; 56:6
    444451;; 45:3
    445452;; 175:1
     
    482489;; 75,K:1
    483490;; 76,L:3
    484 ;; 77,M:3
     491;; 77,M:4
    485492;; 78,N:
    486493;; 79,O:2
Note: See TracChangeset for help on using the changeset viewer.