Changeset 86 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Jan 25, 2011, 9:13:56 PM (14 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HError.asm
r35 r86 1 ; File name : HError.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 30.11.20074 ; Last update : 24.8.20105 ; Author : Tomi Tilli6 2 ; Description : Error checking functions for BIOS Hard disk functions. 7 3 … … 34 30 ALIGN JUMP_ALIGN 35 31 HError_ProcessErrorsAfterPollingBSY: 32 %ifndef USE_186 36 33 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 37 34 jmp SHORT GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 35 %else 36 push GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 37 ; Fall through to HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 38 %endif 38 39 39 40 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm
r35 r86 1 ; File name : HIRQ.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 11.12.20094 ; Last update : 24.8.20105 ; Author : Tomi Tilli6 2 ; Description : Interrupt handling related functions. 7 3 … … 41 37 LOAD_BDA_SEGMENT_TO ds, ax ; Zero AX 42 38 cli ; Disable interrupts 43 cmp al, [ ds:BDA.bHDTaskFlg] ; Task flag already set?39 cmp al, [BDA.bHDTaskFlg] ; Task flag already set? 44 40 jc SHORT .ReturnFromWaitNotify ; If so, skip OS notification 45 41 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HPIO.asm
r28 r86 1 ; File name : HPIO.asm2 1 ; Project name : IDE BIOS 3 ; Created date : 14.12.20074 ; Last update : 1.8.20105 ; Author : Tomi Tilli6 2 ; Description : PIO transfer functions. 7 3 8 4 ; Structure containing variables for PIO transfer functions 9 struc PIOVARS 5 struc PIOVARS, -6 10 6 .fnXfer resb 2 ; Offset to transfer function 11 7 .wBlockSize resb 2 ; Block size in WORDs … … 63 59 ; Create PIOVARS to stack 64 60 eENTER PIOVARS_size, 0 65 sub bp, BYTE PIOVARS_size ; SS:BP now points to PIOVARS 61 66 62 push si 67 63 mov si, g_rgfnPioRead ; Offset to read function lookup … … 75 71 76 72 ; Destroy stack frame 77 rcl al, 1 ; CF to AL bit 078 add bp, BYTE PIOVARS_size79 73 eLEAVE 80 rcr al, 1 ; Restore CF81 74 mov di, bx ; Restore DI 82 75 pop es … … 158 151 .BlockLoop: 159 152 call HStatus_WaitIrqOrDrq ; Wait until ready to transfer 160 jc SHORT .RetError; Return if error (code in AH)153 jc SHORT HPIO_WriteToDrive.RetError ; Return if error (code in AH) 161 154 mov cx, [bp+PIOVARS.wBlockSize] ; Load block size 162 155 sub [bp+PIOVARS.wWordsLeft], cx ; Transferring last (possibly partial) block? … … 169 162 call [bp+PIOVARS.fnXfer] ; Transfer possibly partial block 170 163 jmp HStatus_WaitBsyDefTime ; Check for errors 171 .RetError:172 ret173 164 174 165 … … 195 186 ; Create PIOVARS to stack 196 187 eENTER PIOVARS_size, 0 197 sub bp, BYTE PIOVARS_size ; SS:BP now points to PIOVARS 188 198 189 mov si, g_rgfnPioWrite ; Offset to write function lookup 199 190 call HPIO_InitializePIOVARS ; Store word count and block size … … 205 196 206 197 ; Destroy stack frame 207 rcl al, 1 ; CF to AL bit 0208 add bp, BYTE PIOVARS_size209 198 eLEAVE 210 rcr al, 1 ; Restore CF 199 211 200 pop si 212 201 pop es 213 202 ret 203 214 204 215 205 ;-------------------------------------------------------------------- … … 243 233 jnc SHORT .BlockLoop ; If no error, loop while blocks left 244 234 .RetError: 245 ret 235 ret ; This ret is shared with HPIO_ReadFromDrive 246 236 ALIGN JUMP_ALIGN 247 237 .XferLastBlock: -
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 -
trunk/XTIDE_Universal_BIOS/Src/Libraries/menu/menucrsr.asm
r3 r86 1 ; File name : menucrsr.asm2 1 ; Project name : Menu library 3 ; Created date : 10.11.20094 ; Last update : 17.1.20105 ; Author : Tomi Tilli6 2 ; Description : ASM library to menu system. 7 3 ; Contains menu cursor functions. … … 160 156 ALIGN JUMP_ALIGN 161 157 MenuCrsr_SetCursor: 162 xor bx, bx ; Zero page163 158 mov ah, 02h ; Set Cursor Position and Size 164 int 10h165 ret159 SKIP2B bx ; mov bx, <next instruction> 160 ; Fall through to MenuCrsr_GetCursor 166 161 167 162 … … 178 173 ; AX, BX 179 174 ;-------------------------------------------------------------------- 180 ALIGN JUMP_ALIGN175 ;ALIGN JUMP_ALIGN 181 176 MenuCrsr_GetCursor: 177 mov ah, 03h ; Get Cursor Position and Size 182 178 xor bx, bx ; Zero page 183 mov ah, 03h ; Get Cursor Position and Size184 179 int 10h 185 180 ret -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r61 r86 1 ; File name : Main.asm2 1 ; Project name : XTIDE Universal BIOS 3 ; Created date : 28.7.2007 4 ; Last update : 28.11.2010 5 ; Author : Tomi Tilli 2 ; Authors : Tomi Tilli 3 ; : aitotat@gmail.com 4 ; : 5 ; : Krister Nordvall 6 ; : krille_n_@hotmail.com 7 ; : 6 8 ; Description : Main file for BIOS. This is the only file that needs 7 9 ; to be compiled since other files are included to this 8 10 ; file (so no linker needed, Nasm does it all). 9 ;10 ; Tomi Tilli11 ; aitotat@gmail.com12 11 13 12 ORG 000h ; Code start offset 0000h … … 15 14 ; Included .inc files 16 15 %include "emulate.inc" ; Must be included first! 16 %include "macros.inc" ; For generic macros 17 17 %include "BiosData.inc" ; For BIOS Data area equates 18 18 %include "Interrupts.inc" ; For interrupt equates
Note:
See TracChangeset
for help on using the changeset viewer.