Changeset 86 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Jan 25, 2011, 9:13:56 PM (14 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r33 r86 1 ; File name : DetectDrives.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 17.3.20104 ; Last update : 23.8.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for detecting drive for the BIOS. 7 8 3 9 4 ; Section containing code … … 80 75 DetectDrives_DetectMasterDrive: 81 76 mov bh, MASK_IDE_DRVHD_SET ; Select Master drive 82 jmp SHORT DetectDrives_StartDetection 83 ALIGN JUMP_ALIGN 77 SKIP2B ax ; mov ax, <next instruction> 84 78 DetectDrives_DetectSlaveDrive: 85 79 mov bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV … … 134 128 call AH25h_GetDriveInfo 135 129 mov si, di ; ES:SI now points to ATA information 136 ret137 138 139 ;--------------------------------------------------------------------140 ; Reads ATAPI information from the drive (for CD/DVD-ROMs).141 ;142 ; DetectDrives_ReadAtapiInfoFromDrive143 ; Parameters:144 ; BH: Drive Select byte for Drive and Head Register145 ; CS:BP: Ptr to IDEVARS for the drive146 ; DS: RAMVARS segment147 ; ES: Zero (BDA segment)148 ; Returns:149 ; ES:SI Ptr to ATAPI information (read with IDENTIFY PACKET DEVICE command)150 ; CF: Cleared if ATAPI-information read successfully151 ; Set if any error152 ; Corrupts registers:153 ; AX, BL, CX, DX, DI154 ;--------------------------------------------------------------------155 ALIGN JUMP_ALIGN156 DetectDrives_ReadAtapiInfoFromDrive:157 stc158 130 ret 159 131 … … 188 160 189 161 ;-------------------------------------------------------------------- 162 ; Reads ATAPI information from the drive (for CD/DVD-ROMs). 163 ; 164 ; DetectDrives_ReadAtapiInfoFromDrive 165 ; Parameters: 166 ; BH: Drive Select byte for Drive and Head Register 167 ; CS:BP: Ptr to IDEVARS for the drive 168 ; DS: RAMVARS segment 169 ; ES: Zero (BDA segment) 170 ; Returns: 171 ; ES:SI Ptr to ATAPI information (read with IDENTIFY PACKET DEVICE command) 172 ; CF: Cleared if ATAPI-information read successfully 173 ; Set if any error 174 ; Corrupts registers: 175 ; AX, BL, CX, DX, DI 176 ;-------------------------------------------------------------------- 177 ALIGN JUMP_ALIGN 178 DetectDrives_ReadAtapiInfoFromDrive: 179 ;stc 180 ;ret 181 ; Fall through to DetectDrives_CreateBiosTablesForCDROM 182 183 184 ;-------------------------------------------------------------------- 190 185 ; Creates all BIOS tables for detected CD/DVD-ROM. 191 186 ; -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r3 r86 1 ; File name : DetectPrint.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 28.3.20104 ; Last update : 9.4.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for printing drive detection strings. 7 3 … … 25 21 ePUSH_T ax, ROMVARS.szTitle 26 22 mov si, g_szRomAt 27 mov dh, 4 ; 4 bytes pushed to stack 28 jmp PrintString_JumpToFormat 23 jmp SHORT DetectPrint_4BytesPushedToStack 29 24 30 25 … … 67 62 push ax 68 63 mov si, g_szDetect 64 DetectPrint_4BytesPushedToStack: 69 65 mov dh, 4 ; 4 bytes pushed to stack 70 66 jmp PrintString_JumpToFormat -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r39 r86 1 ; File name : FloppyDrive.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 25.3.20104 ; Last update : 13.9.20105 ; Author : Tomi Tilli6 2 ; Description : Various floppy drive related functions that 7 3 ; Boot Menu uses. … … 21 17 ; Corrupts registers: 22 18 ; BX, CX, DI 23 ;-------------------------------------------------------------------- 19 ;-------------------------------------------------------------------- 24 20 ;ALIGN JUMP_ALIGN 25 21 FloppyDrive_IsInt40hInstalled: … … 40 36 ; Corrupts registers: 41 37 ; BX, CX, DI 42 ;-------------------------------------------------------------------- 38 ;-------------------------------------------------------------------- 43 39 ;ALIGN JUMP_ALIGN 44 40 .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h: … … 84 80 ; Corrupts registers: 85 81 ; DH 86 ;-------------------------------------------------------------------- 82 ;-------------------------------------------------------------------- 87 83 ;ALIGN JUMP_ALIGN 88 84 .LoadInt40hVerifyParameters: 89 xor dx, dx ; Floppy drive 0 85 mov ah, 08h ; Get Drive Parameters 86 cwd ; Floppy drive 0 90 87 mov di, dx 91 88 mov es, dx ; ES:DI = 0000:0000h to guard against BIOS bugs 92 mov ah, 08h ; Get Drive Parameters93 89 ret 94 90 … … 171 167 172 168 mov ah, 08h ; Get Drive Parameters 173 xor dx, dx; Floppy Drive 00h169 cwd ; Floppy Drive 00h 174 170 int INTV_FLOPPY_FUNC 175 171 mov cl, dl ; Number of Floppy Drives to CL -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r33 r86 1 ; File name : Interrupts.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 23.8.20104 ; Last update : 23.8.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for initializing the BIOS. 7 3 … … 18 14 ; Corrupts registers: 19 15 ; All except segments 20 ;-------------------------------------------------------------------- 16 ;-------------------------------------------------------------------- 21 17 ALIGN JUMP_ALIGN 22 18 Interrupts_InitializeInterruptVectors: … … 24 20 call Interrupts_InitializeInt19h 25 21 jmp SHORT Interrupts_InitializeHardwareIrqHandlers 22 ; Maybe all this should be inlined? 26 23 27 24 … … 35 32 ; Corrupts registers: 36 33 ; AX, BX, CX, DX, SI, DI 37 ;-------------------------------------------------------------------- 34 ;-------------------------------------------------------------------- 38 35 ALIGN JUMP_ALIGN 39 36 Interrupts_InitializeInt13hAnd40h: … … 50 47 ; 40h from 13h. That system locks to infinite loop if we copy 13h to 40h. 51 48 call FloppyDrive_IsInt40hInstalled 52 jnc SHORT .InitializeInt40h 53 ret 54 55 ;-------------------------------------------------------------------- 56 ; .InitializeInt40h 57 ; Parameters: 58 ; DX:AX: Ptr to old INT 13h handler 59 ; ES: BDA and Interrupt Vector segment (zero) 60 ; Returns: 61 ; Nothing 62 ; Corrupts registers: 63 ; Nothing 64 ;-------------------------------------------------------------------- 65 ALIGN JUMP_ALIGN 66 .InitializeInt40h: 49 jc SHORT .Return 67 50 mov [es:INTV_FLOPPY_FUNC*4], ax ; Store offset 68 51 mov [es:INTV_FLOPPY_FUNC*4+2], dx ; Store segment 52 .Return: 69 53 ret 70 54 … … 79 63 ; Corrupts registers: 80 64 ; BX, SI 81 ;-------------------------------------------------------------------- 65 ;-------------------------------------------------------------------- 82 66 ALIGN JUMP_ALIGN 83 67 Interrupts_InitializeInt19h: … … 116 100 ; Corrupts registers: 117 101 ; BX, CX, DX, SI, DI 118 ;-------------------------------------------------------------------- 102 ;-------------------------------------------------------------------- 119 103 ALIGN JUMP_ALIGN 120 104 Interrupts_InitializeHardwareIrqHandlers: … … 127 111 call .InstallLowOrHighIrqHandler 128 112 loop .IdeControllerLoop 129 ret 113 .Return: 114 ret ; This ret is shared with .InstallLowOrHighIrqHandler 130 115 131 116 ;-------------------------------------------------------------------- … … 138 123 ; Corrupts registers: 139 124 ; BX, SI 140 ;-------------------------------------------------------------------- 125 ;-------------------------------------------------------------------- 141 126 ALIGN JUMP_ALIGN 142 127 .InstallLowOrHighIrqHandler: 128 test bl, bl 129 jz SHORT .Return ; IRQ not used 143 130 cmp bl, 8 144 jae SHORT .InstallHighIrqHandler 145 test bl, bl 146 jnz SHORT .InstallLowIrqHandler 147 ret ; IRQ not used 131 jb SHORT .InstallLowIrqHandler 132 ; Fall through to .InstallHighIrqHandler 148 133 149 134 ;-------------------------------------------------------------------- … … 156 141 ; Corrupts registers: 157 142 ; BX, SI 158 ;-------------------------------------------------------------------- 159 ALIGN JUMP_ALIGN160 .InstallHighIrqHandler:143 ;-------------------------------------------------------------------- 144 ;ALIGN JUMP_ALIGN 145 ;.InstallHighIrqHandler: 161 146 add bx, BYTE INTV_IRQ8 - 8 ; Interrupt vector number 162 147 mov si, HIRQ_InterruptServiceRoutineForIrqs8to15 … … 172 157 ; Corrupts registers: 173 158 ; BX, SI 174 ;-------------------------------------------------------------------- 159 ;-------------------------------------------------------------------- 175 160 ALIGN JUMP_ALIGN 176 161 .InstallLowIrqHandler: … … 190 175 ; Corrupts registers: 191 176 ; BX 192 ;-------------------------------------------------------------------- 177 ;-------------------------------------------------------------------- 193 178 ALIGN JUMP_ALIGN 194 179 Interrupts_InstallHandlerToVectorInBXFromCSSI: … … 212 197 eMOVZX bx, BYTE [di+DPT.bIdeOff] 213 198 mov al, [cs:bx+IDEVARS.bIRQ] 199 test al, al 200 jz SHORT .Return ; Interrupts disabled 214 201 cmp al, 8 215 jae SHORT .UnmaskHighIrqController 216 test al, al 217 jnz SHORT .UnmaskLowIrqController 218 ret ; Interrupts disabled 202 jb SHORT .UnmaskLowIrqController 203 ; Fall through to .UnmaskHighIrqController 219 204 220 205 ;-------------------------------------------------------------------- … … 227 212 ; AX, DX 228 213 ;-------------------------------------------------------------------- 229 ALIGN JUMP_ALIGN230 .UnmaskHighIrqController:214 ;ALIGN JUMP_ALIGN 215 ;.UnmaskHighIrqController: 231 216 sub al, 8 ; Slave interrupt number 232 217 mov dx, PORT_8259SL_IMR ; Load Slave Mask Register address … … 270 255 out dx, al ; Write modified Interrupt Mask Register 271 256 pop cx 272 ret 257 .Return: 258 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/PrintString.asm
r3 r86 1 ; File name : PrintString.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 19.3.20104 ; Last update : 31.3.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for printing strings used in this IDE BIOS. 7 8 3 9 4 ; Section containing code … … 13 8 ; Prints string with formatting parameters. 14 9 ; Do not call PrintString_JumpToFormat!!! Jump there only! 15 ; 10 ; 16 11 ; PrintString_JumpToFormat 17 12 ; Parameters: … … 42 37 ;-------------------------------------------------------------------- 43 38 ; Prints STOP terminated string from wanted segment. 44 ; 39 ; 45 40 ; PrintString_FromCS 46 41 ; PrintString_FromES … … 56 51 PrintString_FromCS: 57 52 push ds 58 push cs ; Push string segment... 59 pop ds ; ...and pop it to DS 60 call PrintString_FromDS 61 pop ds 62 ret 63 64 ALIGN JUMP_ALIGN 53 push cs ; Push string segment here... 54 SKIP2B ax ; mov ax, <next 2 bytes/instructions> 65 55 PrintString_FromES: 66 56 push ds 67 push es ; Push string segment...57 push es ; ...or here... 68 58 pop ds ; ...and pop it to DS 69 59 call PrintString_FromDS
Note:
See TracChangeset
for help on using the changeset viewer.