Changeset 97 in xtideuniversalbios


Ignore:
Timestamp:
Jan 30, 2011, 6:43:08 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Inlined some initialization functions.
  • Removed alignment bytes from some initialization functions.
  • Removed creation of compatible DPTs.
Location:
trunk/XTIDE_Universal_BIOS
Files:
2 deleted
8 edited

Legend:

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

    r88 r97  
    4141    .ramVars        resb    RAMVARS_size
    4242    .wSign          resb    2           ; FULLRAMVARS signature for finding segment
    43     .drv80hCompDPT  resb    COMPATIBLE_FDPT_size
    44     .drv81hCompDPT  resb    COMPATIBLE_FDPT_size
    4543endstruc
    4644
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r93 r97  
    1313    .rgbSign        resb    8   ; Signature for XTIDE Configurator Program
    1414    .szTitle        resb    31  ; BIOS title string
    15     .szVersion      resb    23  ; BIOS version string
     15    .szVersion      resb    25  ; BIOS version string
    1616
    1717    .wFlags         resb    2   ; Word for ROM flags
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r86 r97  
    4545DetectDrives_WithIDEVARS:
    4646    push    cx
    47     call    DetectPrint_StartingMasterDetect    ; Print detection string
     47    mov     ax, g_szMaster
     48    call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    4849    call    DetectDrives_DetectMasterDrive      ; Detect and create DPT + BOOTNFO
    4950    call    DetectPrint_DriveNameOrNotFound     ; Print found or not found string
    5051
    51     call    DetectPrint_StartingSlaveDetect
     52    mov     ax, g_szSlave
     53    call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    5254    call    DetectDrives_DetectSlaveDrive
    5355    call    DetectPrint_DriveNameOrNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r96 r97  
    1616;       AX, SI
    1717;--------------------------------------------------------------------
    18 ALIGN JUMP_ALIGN
    1918DetectPrint_RomFoundAtSegment:
    2019    push    bp
    21 
     20    mov     bp, sp
    2221    mov     si, g_szRomAt
    23     mov     bp, sp
    2422    ePUSH_T ax, ROMVARS.szTitle         ; Bios title string
    2523    push    cs                          ; BIOS segment
     
    2826
    2927;--------------------------------------------------------------------
    30 ; Displays IDE drive detection string for specific device.
    31 ;
    32 ; DetectPrint_StartingMasterDetect
    33 ; DetectPrint_StartingSlaveDetect
    34 ;   Parameters:
    35 ;       CS:BP:  Ptr to IDEVARS
    36 ;   Returns:
    37 ;       Nothing
    38 ;   Corrupts registers:
    39 ;       AX, SI
    40 ;--------------------------------------------------------------------
    41 ALIGN JUMP_ALIGN
    42 DetectPrint_StartingMasterDetect:
    43     mov     ax, g_szMaster
    44     jmp     SHORT DetectPrint_StartingDriveDetect
    45 ALIGN JUMP_ALIGN
    46 DetectPrint_StartingSlaveDetect:
    47     mov     ax, g_szSlave
    48     ; Fall to DetectPrint_StartingDriveDetect
    49 
    50 ;--------------------------------------------------------------------
    51 ; Displays IDE drive detection string.
    52 ;
    53 ; DetectPrint_StartingDriveDetect
     28; DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
    5429;   Parameters:
    5530;       CS:AX:  Ptr to "Master" or "Slave" string
     
    6035;       AX, SI
    6136;--------------------------------------------------------------------
    62 ALIGN JUMP_ALIGN
    63 DetectPrint_StartingDriveDetect:
     37DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
    6438    push    bp
    65 
    6639    mov     si, [cs:bp+IDEVARS.wPort]
    6740    mov     bp, sp
     
    8659;       AX, SI
    8760;--------------------------------------------------------------------
    88 ALIGN JUMP_ALIGN
    8961DetectPrint_DriveNameOrNotFound:
    9062    push    di
     
    10173    ret
    10274
    103 ALIGN JUMP_ALIGN
    10475.PrintDriveNotFound:
    10576    mov     si, g_szNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r90 r97  
    1717;       Nothing
    1818;--------------------------------------------------------------------
    19 ALIGN JUMP_ALIGN
    2019Initialize_FromMainBiosRomSearch:
    2120    pushf
     
    5352;       Nothing
    5453;--------------------------------------------------------------------
    55 ALIGN JUMP_ALIGN
    5654Initialize_ShouldSkip:
    5755    sti                                     ; Enable interrupts
     
    6765;       ES:     BDA Segment
    6866;   Returns:
    69 ;       Nothing
     67;       DS:     RAMVARS segment
    7068;   Corrupts registers:
    71 ;       All, including segments
     69;       All
    7270;--------------------------------------------------------------------
    73 ALIGN JUMP_ALIGN
    7471Initialize_AndDetectDrives:
    7572    call    DetectPrint_RomFoundAtSegment
    7673    call    RamVars_Initialize
    77     call    RamVars_GetSegmentToDS
    7874    call    Interrupts_InitializeInterruptVectors
    7975    call    DetectDrives_FromAllIDEControllers
    80     call    CompatibleDPT_CreateForDrives80hAnd81h
     76    ; Fall to .StoreDptPointersToBDA
     77
     78;--------------------------------------------------------------------
     79; .StoreDptPointersToBDA
     80;   Parameters:
     81;       DS:     RAMVARS segment
     82;       ES:     BDA and interrupt vector segment (zero)
     83;   Returns:
     84;       Nothing
     85;   Corrupts registers:
     86;       DX, DI
     87;--------------------------------------------------------------------
     88.StoreDptPointersToBDA:
     89    mov     dl, 80h
     90    call    FindDPT_ForDriveNumber  ; DPT to DS:DI
     91    jnc     SHORT .FindForDrive81h  ; Store nothing if not our drive
     92    mov     [es:INTV_HD0DPT*4], di
     93    mov     [es:INTV_HD0DPT*4+2], ds
     94.FindForDrive81h:
     95    inc     dx
     96    call    FindDPT_ForDriveNumber
     97    jnc     SHORT .ResetDetectedDrives
     98    mov     [es:INTV_HD1DPT*4], di
     99    mov     [es:INTV_HD1DPT*4+2], ds
    81100    ; Fall to .ResetDetectedDrives
    82101
    83102;--------------------------------------------------------------------
    84 ; Resets all hard disks.
    85 ;
    86 ; Initialize_ResetDetectedDrives
     103; .ResetDetectedDrives
    87104;   Parameters:
    88105;       DS:     RAMVARS segment
     
    92109;       AX, BX, CX, DX, DI
    93110;--------------------------------------------------------------------
    94 ;ALIGN JUMP_ALIGN
    95111.ResetDetectedDrives:
    96112    jmp     AH0h_ResetHardDisksHandledByOurBIOS
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r90 r97  
    1515;       All except segments
    1616;--------------------------------------------------------------------
    17 ALIGN JUMP_ALIGN
    1817Interrupts_InitializeInterruptVectors:
    19     call    Interrupts_InitializeInt13hAnd40h
    20     call    Interrupts_InitializeInt19h
    21     jmp     SHORT Interrupts_InitializeHardwareIrqHandlers
    22     ; Maybe all this should be inlined?
    23 
    24 
    25 ;--------------------------------------------------------------------
    26 ; Interrupts_Int13hAnd40h
     18    ; Fall to .InitializeInt13hAnd40h
     19
     20;--------------------------------------------------------------------
     21; .InitializeInt13hAnd40h
    2722;   Parameters:
    2823;       DS:     RAMVARS segment
     
    3328;       AX, BX, CX, DX, SI, DI
    3429;--------------------------------------------------------------------
    35 ALIGN JUMP_ALIGN
    36 Interrupts_InitializeInt13hAnd40h:
     30.InitializeInt13hAnd40h:
    3731    mov     ax, [es:INTV_DISK_FUNC*4]           ; Load old INT 13h offset
    3832    mov     dx, [es:INTV_DISK_FUNC*4+2]         ; Load old INT 13h segment
     
    4741    ; 40h from 13h. That system locks to infinite loop if we copy 13h to 40h.
    4842    call    FloppyDrive_IsInt40hInstalled
    49     jc      SHORT .Return
    50     mov     [es:INTV_FLOPPY_FUNC*4], ax     ; Store offset
    51     mov     [es:INTV_FLOPPY_FUNC*4+2], dx   ; Store segment
    52 .Return:
    53     ret
    54 
    55 
    56 ;--------------------------------------------------------------------
    57 ; Interrupts_InitializeInt19h
     43    jc      SHORT .InitializeInt19h
     44    mov     [es:INTV_FLOPPY_FUNC*4], ax     ; Store old INT 13h offset
     45    mov     [es:INTV_FLOPPY_FUNC*4+2], dx   ; Store old INT 13h segment
     46    ; Fall to .InitializeInt19h
     47
     48;--------------------------------------------------------------------
     49; .InitializeInt19h
    5850;   Parameters:
    5951;       DS:     RAMVARS segment
     
    6456;       BX, SI
    6557;--------------------------------------------------------------------
    66 ALIGN JUMP_ALIGN
    67 Interrupts_InitializeInt19h:
     58.InitializeInt19h:
    6859    mov     bx, INTV_BOOTSTRAP
    6960    mov     si, Int19hMenu_BootLoader
    70     jmp     Interrupts_InstallHandlerToVectorInBXFromCSSI
    71 
    72 
    73 ;--------------------------------------------------------------------
    74 ; Interrupts_InitializeHardwareIrqHandlers
     61    call    Interrupts_InstallHandlerToVectorInBXFromCSSI
     62    ; Fall to .InitializeHardwareIrqHandlers
     63
     64;--------------------------------------------------------------------
     65; .InitializeHardwareIrqHandlers
    7566;   Parameters:
    7667;       ES:     BDA and Interrupt Vector segment (zero)
     
    8071;       BX, CX, DX, SI, DI
    8172;--------------------------------------------------------------------
    82 ALIGN JUMP_ALIGN
    83 Interrupts_InitializeHardwareIrqHandlers:
     73.InitializeHardwareIrqHandlers:
    8474    call    RamVars_GetIdeControllerCountToCX
    8575    mov     di, ROMVARS.ideVars0            ; CS:SI points to first IDEVARS
    86 ALIGN JUMP_ALIGN
    8776.IdeControllerLoop:
    8877    eMOVZX  bx, BYTE [cs:di+IDEVARS.bIRQ]
     
    10392;       BX, SI
    10493;--------------------------------------------------------------------
    105 ALIGN JUMP_ALIGN
    10694.InstallLowOrHighIrqHandler:
    10795    test    bl, bl
     
    121109;       BX, SI
    122110;--------------------------------------------------------------------
    123 ;ALIGN JUMP_ALIGN
    124 ;.InstallHighIrqHandler:
     111.InstallHighIrqHandler:
    125112    add     bx, BYTE INTV_IRQ8 - 8          ; Interrupt vector number
    126113    mov     si, HIRQ_InterruptServiceRoutineForIrqs8to15
     
    137124;       BX, SI
    138125;--------------------------------------------------------------------
    139 ALIGN JUMP_ALIGN
    140126.InstallLowIrqHandler:
    141127    add     bx, BYTE INTV_IRQ0              ; Interrupt vector number
     
    155141;       BX
    156142;--------------------------------------------------------------------
    157 ALIGN JUMP_ALIGN
    158143Interrupts_InstallHandlerToVectorInBXFromCSSI:
    159144    eSHL_IM bx, 2                   ; Shift for DWORD offset
     
    172157;       AX, BX, DX
    173158;--------------------------------------------------------------------
    174 ALIGN JUMP_ALIGN
    175159Interrupts_UnmaskInterruptControllerForDriveInDSDI:
    176160    eMOVZX  bx, BYTE [di+DPT.bIdeOff]
     
    191175;       AX, DX
    192176;--------------------------------------------------------------------
    193 ;ALIGN JUMP_ALIGN
    194 ;.UnmaskHighIrqController:
     177.UnmaskHighIrqController:
    195178    sub     al, 8               ; Slave interrupt number
    196179    mov     dx, PORT_8259SL_IMR ; Load Slave Mask Register address
     
    208191;       AX, DX
    209192;--------------------------------------------------------------------
    210 ALIGN JUMP_ALIGN
    211193.UnmaskLowIrqController:
    212194    mov     dx, PORT_8259MA_IMR ; Load Mask Register address
     
    223205;       AX
    224206;--------------------------------------------------------------------
    225 ;ALIGN JUMP_ALIGN
    226207.ClearBitFrom8259MaskRegister:
    227208    push    cx
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r96 r97  
    1212ORG 000h                        ; Code start offset 0000h
    1313
     14
    1415; Included .inc files
    1516%include "AssemblyLibrary.inc"  ; Assembly Library. Must be included first!
     
    2122%include "Int13h.inc"           ; Equates for INT 13h functions
    2223%include "CustomDPT.inc"        ; For Disk Parameter Table
    23 %include "CompatibleDPT.inc"    ; For standard Disk Parameter Tables
    2424%include "RomVars.inc"          ; For ROMVARS and IDEVARS structs
    2525%include "RamVars.inc"          ; For RAMVARS struct
     
    4848        db  " (XT)=-",NULL
    4949%endif
    50     at  ROMVARS.szVersion,  db  "v1.2.0_wip (01/27/11)",NULL    ; mm/dd/yy
     50    at  ROMVARS.szVersion,  db  "v1.2.0_wip (",__DATE__,")",NULL
    5151
    5252;---------------------------;
     
    113113%include "FindDPT.asm"          ; For finding DPTs
    114114%include "AccessDPT.asm"        ; For accessing DPTs
    115 %include "CompatibleDPT.asm"    ; For creating compatible DPTs
    116115%include "BootInfo.asm"         ; For creating BOOTNFO structs
    117116%include "AtaID.asm"            ; For ATA Identify Device information
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r90 r97  
    1313;       Nothing
    1414;   Returns:
    15 ;       Nothing
    16 ;   Corrupts registers:
    17 ;       AX, CX, DI, DS
    18 ;--------------------------------------------------------------------
    19 ALIGN JUMP_ALIGN
     15;       DS:     RAMVARS segment
     16;   Corrupts registers:
     17;       AX, CX, DI
     18;--------------------------------------------------------------------
    2019RamVars_Initialize:
    2120    push    es
    22     call    .StealMemoryForRAMVARS  ; Get RAMVARS segment to DS even if no stealing
    23     call    .ClearRamvarsFromDS
    24     pop     es
    25     jmp     DriveXlate_Reset
     21    ; Fall to .StealMemoryForRAMVARS
    2622
    2723;--------------------------------------------------------------------
     
    3430;       AX
    3531;--------------------------------------------------------------------
    36 ALIGN JUMP_ALIGN
    3732.StealMemoryForRAMVARS:
    3833    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    39     jz      SHORT RamVars_GetSegmentToDS
    40 
    41     LOAD_BDA_SEGMENT_TO ds, ax      ; Zero AX
     34    jz      SHORT .InitializeRamvars    ; No need to steal RAM
     35
     36    LOAD_BDA_SEGMENT_TO ds, ax          ; Zero AX
    4237    mov     al, [cs:ROMVARS.bStealSize]
    4338    sub     [BDA.wBaseMem], ax
    4439    mov     ax, [BDA.wBaseMem]
    45     eSHL_IM ax, 6                   ; Segment to first stolen kB (*=40h)
     40    eSHL_IM ax, 6                       ; Segment to first stolen kB (*=40h)
    4641    mov     ds, ax
    47     ret
    48 
    49 ;--------------------------------------------------------------------
    50 ; .ClearRamvarsFromDS
    51 ;   Parameters:
    52 ;       DS:     RAMVARS segment
    53 ;   Returns:
    54 ;       Nothing
     42    mov     WORD [FULLRAMVARS.wSign], W_SIGN_FULLRAMVARS
     43    ; Fall to .InitializeRamvarsFromDS
     44
     45;--------------------------------------------------------------------
     46; .InitializeRamvars
     47;   Parameters:
     48;       Nothing
     49;   Returns:
     50;       DS:     RAMVARS segment
    5551;   Corrupts registers:
    5652;       AX, CX, DI, ES
    5753;--------------------------------------------------------------------
    58 ALIGN JUMP_ALIGN
    59 .ClearRamvarsFromDS:
    60     call    FindDPT_PointToFirstDPT ; Get RAMVARS/FULLRAMVARS size to DI
    61     mov     cx, di                  ; Copy byte count to CX
     54.InitializeRamvars:
     55    call    RamVars_GetSegmentToDS
     56    mov     cx, RAMVARS_size
     57    xor     di, di
    6258    push    ds
    6359    pop     es
    64     xor     di, di                  ; ES:DI now points to RAMVARS/FULLRAMVARS
    65     xor     ax, ax                  ; Store zeroes
    66     rep stosb
    67     mov     WORD [FULLRAMVARS.wSign], W_SIGN_FULLRAMVARS
    68     ret
     60    call    Memory_ZeroESDIwithSizeInCX
     61    ; Fall to .InitializeDriveTranslationAndReturn
     62
     63;--------------------------------------------------------------------
     64; .InitializeDriveTranslationAndReturn
     65;   Parameters:
     66;       DS:     RAMVARS segment
     67;   Returns:
     68;       Nothing
     69;   Corrupts registers:
     70;       AX
     71;--------------------------------------------------------------------
     72.InitializeDriveTranslationAndReturn:
     73    pop     es
     74    jmp     DriveXlate_Reset
    6975
    7076
Note: See TracChangeset for help on using the changeset viewer.