Changeset 98 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Jan 30, 2011, 7:15:06 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Some more initialization optimizations.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
4 edited

Legend:

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

    r96 r98  
    326326;       CF:     Set since menu event was handled successfully
    327327;   Corrupts registers:
    328 ;       AX, DI
     328;       AX
    329329;--------------------------------------------------------------------
    330330ALIGN JUMP_ALIGN
    331331BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
     332    push    di
    332333    CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
     334    pop     di
    333335    stc
    334336    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r97 r98  
    1717;       All (not segments)
    1818;--------------------------------------------------------------------
    19 ALIGN JUMP_ALIGN
    2019DetectDrives_FromAllIDEControllers:
    2120    call    RamVars_GetIdeControllerCountToCX
    2221    mov     bp, ROMVARS.ideVars0            ; CS:BP now points to first IDEVARS
    23 ALIGN JUMP_ALIGN
    2422.DriveDetectLoop:
    2523    call    DetectDrives_WithIDEVARS        ; Detect Master and Slave
     
    4240;       AX, BX, DX, SI, DI
    4341;--------------------------------------------------------------------
    44 ALIGN JUMP_ALIGN
    4542DetectDrives_WithIDEVARS:
    4643    push    cx
    4744    mov     ax, g_szMaster
    48     call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    49     call    DetectDrives_DetectMasterDrive      ; Detect and create DPT + BOOTNFO
    50     call    DetectPrint_DriveNameOrNotFound     ; Print found or not found string
     45    mov     bh, MASK_IDE_DRVHD_SET                              ; Select Master drive
     46    call    StartDetectionWithDriveSelectByteInBHandStringInAX  ; Detect and create DPT + BOOTNFO
    5147
    5248    mov     ax, g_szSlave
    53     call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    54     call    DetectDrives_DetectSlaveDrive
    55     call    DetectPrint_DriveNameOrNotFound
     49    mov     bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV
     50    call    StartDetectionWithDriveSelectByteInBHandStringInAX
    5651    pop     cx
    5752    ret
     
    5954
    6055;--------------------------------------------------------------------
    61 ; Detects IDE Master or Slave drive.
    62 ;
    63 ; DetectDrives_DetectMasterDrive
    64 ; DetectDrives_DetectSlaveDrive
     56; StartDetectionWithDriveSelectByteInBHandStringInAX
    6557;   Parameters:
    66 ;       CS:BP:  Ptr to IDEVARS
    67 ;       DS:     RAMVARS segment
    68 ;       ES:     Zero (BDA segment)
    69 ;   Returns:
    70 ;       ES:BX:  Ptr to BOOTNFO (if successful)
    71 ;       CF:     Cleared if drive detected successfully
    72 ;               Set if any drive not found or other error
    73 ;   Corrupts registers:
    74 ;       AX, CX, DX, SI, DI
    75 ;--------------------------------------------------------------------
    76 ALIGN JUMP_ALIGN
    77 DetectDrives_DetectMasterDrive:
    78     mov     bh, MASK_IDE_DRVHD_SET      ; Select Master drive
    79     SKIP2B  ax                          ; mov ax, <next instruction>
    80 DetectDrives_DetectSlaveDrive:
    81     mov     bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV
    82     ; Fall to DetectDrives_StartDetection
    83 
    84 ;--------------------------------------------------------------------
    85 ; Detects IDE Master or Slave drive.
    86 ;
    87 ; DetectDrives_StartDetection
    88 ;   Parameters:
     58;       AX:     Offset to "Master" or "Slave" string
    8959;       BH:     Drive Select byte for Drive and Head Register
    9060;       CS:BP:  Ptr to IDEVARS for the drive
     
    9262;       ES:     Zero (BDA segment)
    9363;   Returns:
    94 ;       ES:BX:  Ptr to BOOTNFO (if successful)
    95 ;       CF:     Cleared if drive detected successfully
    96 ;               Set if any drive not found or other error
     64;       Nothing
    9765;   Corrupts registers:
    98 ;       AX, CX, DX, SI, DI
     66;       AX, BX, CX, DX, SI, DI
    9967;--------------------------------------------------------------------
    100 ALIGN JUMP_ALIGN
    101 DetectDrives_StartDetection:
    102     call    DetectDrives_ReadAtaInfoFromDrive   ; Assume hard disk
    103     jnc     SHORT DetectDrives_CreateBiosTablesForHardDisk
    104     call    DetectDrives_ReadAtapiInfoFromDrive ; Assume CD-ROM
    105     jnc     SHORT DetectDrives_CreateBiosTablesForCDROM
    106     ret
     68StartDetectionWithDriveSelectByteInBHandStringInAX:
     69    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
    10775
    10876
    10977;--------------------------------------------------------------------
    110 ; Reads ATA information from the drive (for hard disks).
    111 ;
    112 ; DetectDrives_ReadAtaInfoFromDrive
     78; ReadAtaInfoFromDrive
    11379;   Parameters:
    11480;       BH:     Drive Select byte for Drive and Head Register
     
    12389;       AX, BL, CX, DX, DI
    12490;--------------------------------------------------------------------
    125 ALIGN JUMP_ALIGN
    126 DetectDrives_ReadAtaInfoFromDrive:
     91ReadAtaInfoFromDrive:
    12792    mov     bl, [cs:bp+IDEVARS.bBusType]; Load BUS type
    12893    mov     dx, [cs:bp+IDEVARS.wPort]   ; Load IDE Base Port address
     
    13499
    135100;--------------------------------------------------------------------
    136 ; Creates all BIOS tables for detected hard disk.
    137 ;
    138 ; DetectDrives_CreateBiosTablesForHardDisk
     101; CreateBiosTablesForHardDisk
    139102;   Parameters:
    140103;       BH:     Drive Select byte for Drive and Head Register
     
    142105;       ES:SI   Ptr to ATA information for the drive
    143106;       DS:     RAMVARS segment
     107;       ES:     BDA/Bootnfo segment
    144108;   Returns:
    145 ;       ES:BX:  Ptr to BOOTNFO (if successful)
    146 ;       CF:     Cleared if BIOS tables created succesfully
    147 ;               Set if any error
     109;       Nothing
    148110;   Corrupts registers:
    149 ;       AX, CX, DX, SI, DI
     111;       AX, BX, CX, DX, SI, DI
    150112;--------------------------------------------------------------------
    151 ALIGN JUMP_ALIGN
    152 DetectDrives_CreateBiosTablesForHardDisk:
     113CreateBiosTablesForHardDisk:
    153114    call    CreateDPT_FromAtaInformation
    154115    jc      SHORT .InvalidAtaInfo
    155116    call    BootInfo_CreateForHardDisk
    156     ;jc     SHORT .InvalidAtaInfo
    157     ; Call to search for BIOS partitions goes here
    158     ;clc
     117    jmp     DetectPrint_DriveNameFromBootnfoInESBX
    159118.InvalidAtaInfo:
    160     ret
    161 
    162 
    163 ;--------------------------------------------------------------------
    164 ; Reads ATAPI information from the drive (for CD/DVD-ROMs).
    165 ;
    166 ; DetectDrives_ReadAtapiInfoFromDrive
    167 ;   Parameters:
    168 ;       BH:     Drive Select byte for Drive and Head Register
    169 ;       CS:BP:  Ptr to IDEVARS for the drive
    170 ;       DS:     RAMVARS segment
    171 ;       ES:     Zero (BDA segment)
    172 ;   Returns:
    173 ;       ES:SI   Ptr to ATAPI information (read with IDENTIFY PACKET DEVICE command)
    174 ;       CF:     Cleared if ATAPI-information read successfully
    175 ;               Set if any error
    176 ;   Corrupts registers:
    177 ;       AX, BL, CX, DX, DI
    178 ;--------------------------------------------------------------------
    179 ALIGN JUMP_ALIGN
    180 DetectDrives_ReadAtapiInfoFromDrive:
    181     ;stc
    182     ;ret
    183     ; Fall through to DetectDrives_CreateBiosTablesForCDROM
    184 
    185 
    186 ;--------------------------------------------------------------------
    187 ; Creates all BIOS tables for detected CD/DVD-ROM.
    188 ;
    189 ; DetectDrives_CreateBiosTablesForCDROM
    190 ;   Parameters:
    191 ;       BH:     Drive Select byte for Drive and Head Register
    192 ;       CS:BP:  Ptr to IDEVARS for the drive
    193 ;       ES:SI   Ptr to ATAPI information for the drive
    194 ;       DS:     RAMVARS segment
    195 ;   Returns:
    196 ;       ES:BX:  Ptr to BOOTNFO (if successful)
    197 ;       CF:     Cleared if BIOS tables created succesfully
    198 ;               Set if any error
    199 ;   Corrupts registers:
    200 ;       AX, CX, DX, SI, DI
    201 ;--------------------------------------------------------------------
    202 ALIGN JUMP_ALIGN
    203 DetectDrives_CreateBiosTablesForCDROM:
    204     stc
    205     ret
     119    jmp     DetectPrint_DriveNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r97 r98  
    4646
    4747;--------------------------------------------------------------------
    48 ; Displays Detected Drive Name from BOOTVARS or
    49 ; drive not found string if no drive was found.
    50 ;
    51 ; DetectPrint_DriveNameOrNotFound
     48; DetectPrint_DriveNameFromBootnfoInESBX
    5249;   Parameters:
    5350;       ES:BX:  Ptr to BOOTNFO (if drive found)
    54 ;       CF:     Cleared if drive found
    55 ;               Set it drive not found
    5651;   Returns:
    5752;       Nothing
     
    5954;       AX, SI
    6055;--------------------------------------------------------------------
    61 DetectPrint_DriveNameOrNotFound:
     56DetectPrint_DriveNameFromBootnfoInESBX:
    6257    push    di
    63     jc      SHORT .PrintDriveNotFound
    6458    push    bx
    6559
     
    7367    ret
    7468
    75 .PrintDriveNotFound:
     69
     70;--------------------------------------------------------------------
     71; DetectPrint_DriveNotFound
     72;   Parameters:
     73;       Nothing
     74;   Returns:
     75;       Nothing
     76;   Corrupts registers:
     77;       AX, SI
     78;--------------------------------------------------------------------
     79DetectPrint_DriveNotFound:
    7680    mov     si, g_szNotFound
    77     call    BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
    78     pop     di
    79     ret
     81    jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r97 r98  
    7474    call    Interrupts_InitializeInterruptVectors
    7575    call    DetectDrives_FromAllIDEControllers
    76     ; Fall to .StoreDptPointersToBDA
     76    ; Fall to .StoreDptPointersToIntVectors
    7777
    7878;--------------------------------------------------------------------
    79 ; .StoreDptPointersToBDA
     79; .StoreDptPointersToIntVectors
    8080;   Parameters:
    8181;       DS:     RAMVARS segment
     
    8686;       DX, DI
    8787;--------------------------------------------------------------------
    88 .StoreDptPointersToBDA:
     88.StoreDptPointersToIntVectors:
    8989    mov     dl, 80h
    9090    call    FindDPT_ForDriveNumber  ; DPT to DS:DI
Note: See TracChangeset for help on using the changeset viewer.