Changeset 97 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Jan 30, 2011, 6:43:08 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r86 r97 45 45 DetectDrives_WithIDEVARS: 46 46 push cx 47 call DetectPrint_StartingMasterDetect ; Print detection string 47 mov ax, g_szMaster 48 call DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP 48 49 call DetectDrives_DetectMasterDrive ; Detect and create DPT + BOOTNFO 49 50 call DetectPrint_DriveNameOrNotFound ; Print found or not found string 50 51 51 call DetectPrint_StartingSlaveDetect 52 mov ax, g_szSlave 53 call DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP 52 54 call DetectDrives_DetectSlaveDrive 53 55 call DetectPrint_DriveNameOrNotFound -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r96 r97 16 16 ; AX, SI 17 17 ;-------------------------------------------------------------------- 18 ALIGN JUMP_ALIGN19 18 DetectPrint_RomFoundAtSegment: 20 19 push bp 21 20 mov bp, sp 22 21 mov si, g_szRomAt 23 mov bp, sp24 22 ePUSH_T ax, ROMVARS.szTitle ; Bios title string 25 23 push cs ; BIOS segment … … 28 26 29 27 ;-------------------------------------------------------------------- 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 54 29 ; Parameters: 55 30 ; CS:AX: Ptr to "Master" or "Slave" string … … 60 35 ; AX, SI 61 36 ;-------------------------------------------------------------------- 62 ALIGN JUMP_ALIGN 63 DetectPrint_StartingDriveDetect: 37 DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP: 64 38 push bp 65 66 39 mov si, [cs:bp+IDEVARS.wPort] 67 40 mov bp, sp … … 86 59 ; AX, SI 87 60 ;-------------------------------------------------------------------- 88 ALIGN JUMP_ALIGN89 61 DetectPrint_DriveNameOrNotFound: 90 62 push di … … 101 73 ret 102 74 103 ALIGN JUMP_ALIGN104 75 .PrintDriveNotFound: 105 76 mov si, g_szNotFound -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r90 r97 17 17 ; Nothing 18 18 ;-------------------------------------------------------------------- 19 ALIGN JUMP_ALIGN20 19 Initialize_FromMainBiosRomSearch: 21 20 pushf … … 53 52 ; Nothing 54 53 ;-------------------------------------------------------------------- 55 ALIGN JUMP_ALIGN56 54 Initialize_ShouldSkip: 57 55 sti ; Enable interrupts … … 67 65 ; ES: BDA Segment 68 66 ; Returns: 69 ; Nothing67 ; DS: RAMVARS segment 70 68 ; Corrupts registers: 71 ; All , including segments69 ; All 72 70 ;-------------------------------------------------------------------- 73 ALIGN JUMP_ALIGN74 71 Initialize_AndDetectDrives: 75 72 call DetectPrint_RomFoundAtSegment 76 73 call RamVars_Initialize 77 call RamVars_GetSegmentToDS78 74 call Interrupts_InitializeInterruptVectors 79 75 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 81 100 ; Fall to .ResetDetectedDrives 82 101 83 102 ;-------------------------------------------------------------------- 84 ; Resets all hard disks. 85 ; 86 ; Initialize_ResetDetectedDrives 103 ; .ResetDetectedDrives 87 104 ; Parameters: 88 105 ; DS: RAMVARS segment … … 92 109 ; AX, BX, CX, DX, DI 93 110 ;-------------------------------------------------------------------- 94 ;ALIGN JUMP_ALIGN95 111 .ResetDetectedDrives: 96 112 jmp AH0h_ResetHardDisksHandledByOurBIOS -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r90 r97 15 15 ; All except segments 16 16 ;-------------------------------------------------------------------- 17 ALIGN JUMP_ALIGN18 17 Interrupts_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 27 22 ; Parameters: 28 23 ; DS: RAMVARS segment … … 33 28 ; AX, BX, CX, DX, SI, DI 34 29 ;-------------------------------------------------------------------- 35 ALIGN JUMP_ALIGN 36 Interrupts_InitializeInt13hAnd40h: 30 .InitializeInt13hAnd40h: 37 31 mov ax, [es:INTV_DISK_FUNC*4] ; Load old INT 13h offset 38 32 mov dx, [es:INTV_DISK_FUNC*4+2] ; Load old INT 13h segment … … 47 41 ; 40h from 13h. That system locks to infinite loop if we copy 13h to 40h. 48 42 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 58 50 ; Parameters: 59 51 ; DS: RAMVARS segment … … 64 56 ; BX, SI 65 57 ;-------------------------------------------------------------------- 66 ALIGN JUMP_ALIGN 67 Interrupts_InitializeInt19h: 58 .InitializeInt19h: 68 59 mov bx, INTV_BOOTSTRAP 69 60 mov si, Int19hMenu_BootLoader 70 jmpInterrupts_InstallHandlerToVectorInBXFromCSSI71 72 73 ;-------------------------------------------------------------------- 74 ; Interrupts_InitializeHardwareIrqHandlers61 call Interrupts_InstallHandlerToVectorInBXFromCSSI 62 ; Fall to .InitializeHardwareIrqHandlers 63 64 ;-------------------------------------------------------------------- 65 ; .InitializeHardwareIrqHandlers 75 66 ; Parameters: 76 67 ; ES: BDA and Interrupt Vector segment (zero) … … 80 71 ; BX, CX, DX, SI, DI 81 72 ;-------------------------------------------------------------------- 82 ALIGN JUMP_ALIGN 83 Interrupts_InitializeHardwareIrqHandlers: 73 .InitializeHardwareIrqHandlers: 84 74 call RamVars_GetIdeControllerCountToCX 85 75 mov di, ROMVARS.ideVars0 ; CS:SI points to first IDEVARS 86 ALIGN JUMP_ALIGN87 76 .IdeControllerLoop: 88 77 eMOVZX bx, BYTE [cs:di+IDEVARS.bIRQ] … … 103 92 ; BX, SI 104 93 ;-------------------------------------------------------------------- 105 ALIGN JUMP_ALIGN106 94 .InstallLowOrHighIrqHandler: 107 95 test bl, bl … … 121 109 ; BX, SI 122 110 ;-------------------------------------------------------------------- 123 ;ALIGN JUMP_ALIGN 124 ;.InstallHighIrqHandler: 111 .InstallHighIrqHandler: 125 112 add bx, BYTE INTV_IRQ8 - 8 ; Interrupt vector number 126 113 mov si, HIRQ_InterruptServiceRoutineForIrqs8to15 … … 137 124 ; BX, SI 138 125 ;-------------------------------------------------------------------- 139 ALIGN JUMP_ALIGN140 126 .InstallLowIrqHandler: 141 127 add bx, BYTE INTV_IRQ0 ; Interrupt vector number … … 155 141 ; BX 156 142 ;-------------------------------------------------------------------- 157 ALIGN JUMP_ALIGN158 143 Interrupts_InstallHandlerToVectorInBXFromCSSI: 159 144 eSHL_IM bx, 2 ; Shift for DWORD offset … … 172 157 ; AX, BX, DX 173 158 ;-------------------------------------------------------------------- 174 ALIGN JUMP_ALIGN175 159 Interrupts_UnmaskInterruptControllerForDriveInDSDI: 176 160 eMOVZX bx, BYTE [di+DPT.bIdeOff] … … 191 175 ; AX, DX 192 176 ;-------------------------------------------------------------------- 193 ;ALIGN JUMP_ALIGN 194 ;.UnmaskHighIrqController: 177 .UnmaskHighIrqController: 195 178 sub al, 8 ; Slave interrupt number 196 179 mov dx, PORT_8259SL_IMR ; Load Slave Mask Register address … … 208 191 ; AX, DX 209 192 ;-------------------------------------------------------------------- 210 ALIGN JUMP_ALIGN211 193 .UnmaskLowIrqController: 212 194 mov dx, PORT_8259MA_IMR ; Load Mask Register address … … 223 205 ; AX 224 206 ;-------------------------------------------------------------------- 225 ;ALIGN JUMP_ALIGN226 207 .ClearBitFrom8259MaskRegister: 227 208 push cx
Note:
See TracChangeset
for help on using the changeset viewer.