Changeset 120 in xtideuniversalbios


Ignore:
Timestamp:
Feb 28, 2011, 4:41:41 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Display library now gets initialized.
  • Small optimizations.
  • Something is still broken.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r98 r120  
    4848;       Nothing
    4949;   Corrupts registers:
    50 ;       AX, DX, SI
     50;       AX, DX, SI, DI
    5151;--------------------------------------------------------------------
    5252ALIGN JUMP_ALIGN
     
    282282;   Parameters:
    283283;       CS:SI:  Ptr to string to format
    284 ;       SS:BP:  Ptr to format parameters
     284;       BP:     SP before pushing parameters
    285285;   Returns:
    286286;       BP:     Popped from stack
    287287;   Corrupts registers:
    288 ;       AX
     288;       AX, DI
    289289;--------------------------------------------------------------------
    290290ALIGN JUMP_ALIGN
    291291BootMenuPrint_FormatCSSIfromParamsInSSBP:
    292     push    di
    293292    CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    294293    stc             ; Successfull return from menu event
    295     pop     di
    296294    pop     bp
    297295    ret
     
    394392;       Nothing
    395393;   Corrupts registers:
    396 ;       AX, CX, DX, SI
     394;       AX, CX, DX, SI, DI
    397395;--------------------------------------------------------------------
    398396.PrintHotkeyString:
     
    431429;       Nothing
    432430;   Corrupts registers:
    433 ;       AX, SI
     431;       AX, SI, DI
    434432;--------------------------------------------------------------------
    435433.PrintRomBootHotkey:
     
    449447;       Nothing
    450448;   Corrupts registers:
    451 ;       AX, SI
     449;       AX, SI, DI
    452450;--------------------------------------------------------------------
    453451ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm

    r95 r120  
    1313;       Nothing
    1414;   Corrupts registers:
    15 ;       AX, SI
     15;       AX, SI, DI
    1616;--------------------------------------------------------------------
    1717ALIGN JUMP_ALIGN
     
    4141;       Nothing
    4242;   Corrupts registers:
    43 ;       AX, SI
     43;       AX, SI, DI
    4444;--------------------------------------------------------------------
    4545ALIGN JUMP_ALIGN
     
    6060;       Nothing
    6161;   Corrupts registers:
    62 ;       AX, BX, SI
     62;       AX, BX, SI, DI
    6363;--------------------------------------------------------------------
    6464ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm

    r116 r120  
    8080    out     dx, al                      ; Select Master or Slave drive
    8181    sub     dx, BYTE REG_IDE_DRVHD      ; Back to IDE Base port
    82     call    AH25h_GetDriveDetectionTimeoutValue
     82
     83    ; Wait until ready to accept commands
     84    xor     bh, bh                      ; BX now contains bus type
     85    mov     cl, B_TIMEOUT_DRVINFO       ; Load short timeout
     86    cmp     [RAMVARS.bDrvCnt], bh       ; Detecting first drive?
     87    eCMOVE  cl, B_TIMEOUT_RESET         ;  If so, load long timeout
    8388    call    HStatus_WaitRdy             ; Wait until ready to accept commands
    8489    jc      SHORT .Return               ; Return if error
     
    9297    ; Transfer data
    9398    sub     dx, BYTE REGR_IDE_ST        ; DX to IDE Data Reg
    94     xor     bh, bh                      ; BX now contains bus type
    9599    mov     cx, 256                     ; Transfer 256 words (single sector)
    96100    cld                                 ; INSW to increment DI
     
    98102    call    HStatus_WaitRdyDefTime      ; Wait until drive ready
    99103
    100     ; Return
    101104.Return:
    102105    pop     bx
     
    104107    pop     di
    105108    ret
    106 
    107 
    108 ;--------------------------------------------------------------------
    109 ; Returns timeout value for drive detection.
    110 ; Long timeout is required for detecting first drive to make sure it is
    111 ; ready after power-on (ATA specification says up to 31 seconds).
    112 ; Short timeout is used for additional drives to prevent long boot time
    113 ; when drive has failed or it is not present.
    114 ;
    115 ; AH25h_GetDriveDetectionTimeoutValue
    116 ;   Parameters:
    117 ;       DS:     Segment to RAMVARS
    118 ;   Returns:
    119 ;       CL:     Timeout value
    120 ;   Corrupts registers:
    121 ;       Nothing
    122 ;--------------------------------------------------------------------
    123 ALIGN JUMP_ALIGN
    124 AH25h_GetDriveDetectionTimeoutValue:
    125     mov     cl, B_TIMEOUT_RESET         ; Load long timeout (assume first drive)
    126     cmp     BYTE [RAMVARS.bDrvCnt], 0   ; Detecting first drive?
    127     je      SHORT .Return
    128     mov     cl, B_TIMEOUT_DRVINFO       ; Load short timeout
    129 ALIGN JUMP_ALIGN, ret   ; This speed optimization may be unnecessary
    130 .Return:
    131     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm

    r88 r120  
    249249;       DS:     Segment to RAMVARS
    250250;   Returns:
    251 ;       Nothing
     251;       CF:     Set if timeout
     252;               Cleared if time left
    252253;   Corrupts registers:
    253254;       CX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r98 r120  
    6868StartDetectionWithDriveSelectByteInBHandStringInAX:
    6969    call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    70     call    ReadAtaInfoFromDrive    ; Assume hard disk
    71     jnc     SHORT CreateBiosTablesForHardDisk
    72     ;call   ReadAtapiInfoFromDrive  ; Assume CD-ROM (not yet implemented)
    73     ;jnc    SHORT _CreateBiosTablesForCDROM
    74     jmp     DetectPrint_DriveNotFound
    75 
     70    ; Fall to .ReadAtaInfoFromHardDisk
    7671
    7772;--------------------------------------------------------------------
    78 ; ReadAtaInfoFromDrive
     73; .ReadAtaInfoFromHardDisk
    7974;   Parameters:
    8075;       BH:     Drive Select byte for Drive and Head Register
     
    8984;       AX, BL, CX, DX, DI
    9085;--------------------------------------------------------------------
    91 ReadAtaInfoFromDrive:
     86.ReadAtaInfoFromHardDisk:
    9287    mov     bl, [cs:bp+IDEVARS.bBusType]; Load BUS type
    9388    mov     dx, [cs:bp+IDEVARS.wPort]   ; Load IDE Base Port address
    9489    mov     di, BOOTVARS.rgbAtaInfo     ; ES:DI now points to ATA info location
    9590    call    AH25h_GetDriveInfo
    96     mov     si, di                      ; ES:SI now points to ATA information
    97     ret
     91    jnc     SHORT CreateBiosTablesForHardDisk
     92    ; Fall to .ReadAtapiInfoFromDrive
     93
     94.ReadAtapiInfoFromDrive:                ; Not yet implemented
     95    ;call   ReadAtapiInfoFromDrive      ; Assume CD-ROM
     96    ;jnc    SHORT _CreateBiosTablesForCDROM
     97    jmp     DetectPrint_DriveNotFound
    9898
    9999
     
    103103;       BH:     Drive Select byte for Drive and Head Register
    104104;       CS:BP:  Ptr to IDEVARS for the drive
    105 ;       ES:SI   Ptr to ATA information for the drive
     105;       ES:DI   Ptr to ATA information for the drive
    106106;       DS:     RAMVARS segment
    107107;       ES:     BDA/Bootnfo segment
     
    112112;--------------------------------------------------------------------
    113113CreateBiosTablesForHardDisk:
     114    mov     si, di                  ; ES:SI now points to ATA information
    114115    call    CreateDPT_FromAtaInformation
    115116    jc      SHORT .InvalidAtaInfo
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r98 r120  
    1414;       Nothing
    1515;   Corrupts registers:
    16 ;       AX, SI
     16;       AX, SI, DI
    1717;--------------------------------------------------------------------
    1818DetectPrint_RomFoundAtSegment:
     
    3333;       Nothing
    3434;   Corrupts registers:
    35 ;       AX, SI
     35;       AX, SI, DI
    3636;--------------------------------------------------------------------
    3737DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r98 r120  
    7070;--------------------------------------------------------------------
    7171Initialize_AndDetectDrives:
     72    CALL_DISPLAY_LIBRARY InitializeDisplayContext
    7273    call    DetectPrint_RomFoundAtSegment
    7374    call    RamVars_Initialize
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r97 r120  
    142142;--------------------------------------------------------------------
    143143Interrupts_InstallHandlerToVectorInBXFromCSSI:
    144     eSHL_IM bx, 2                   ; Shift for DWORD offset
     144    shl     bx, 1
     145    shl     bx, 1                   ; Shift for DWORD offset
    145146    mov     [es:bx], si             ; Store offset
    146147    mov     [es:bx+2], cs           ; Store segment
Note: See TracChangeset for help on using the changeset viewer.