Changeset 116 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Feb 26, 2011, 11:55:06 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/Boot/BootMenuPrintCfg.asm
r96 r116 99 99 xchg ax, bx ; Store BX to AX 100 100 eMOVZX bx, BYTE [cs:si+IDEVARS.bBusType] 101 mov bx, [cs:bx+.rgwBusTypeValues] ; Char to BL, Int to BH 101 mov bx, [cs:bx+.rgwBusTypeValues] ; Char to BL, Int to BH 102 102 eMOVZX dx, bh 103 103 push bx ; Push character … … 191 191 mov dl, [di+DPT.bDrvNum] ; Load Drive number to DL 192 192 call BootInfo_GetOffsetToBX ; ES:BX now points... 193 LOAD_BDA_SEGMENT_TO es, ax 193 LOAD_BDA_SEGMENT_TO es, ax, ! ; ...to BOOTNFO 194 194 mov al, [di+DPT.bIdeOff] 195 195 xchg si, ax ; CS:SI now points to IDEVARS -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm
r96 r116 28 28 ; POST stack is not large enough when DPTs are stored to 30:0h. 29 29 ; 30 ; Note regarding LOAD_BDA_SEGMENT_TO: If you force the use of SP 31 ; then you also have to unconditionally enable the CLI/STI pair. 32 ; The reason for this is that only some buggy 808x CPU:s need the 33 ; CLI/STI instruction pair when changing stacks. Other CPU:s disable 34 ; interrupts automatically when SS is modified for the duration of 35 ; the immediately following instruction to give time to change SP. 36 ; 30 37 ; BootVars_SwitchToBootMenuStack 31 38 ; Parameters: … … 39 46 BootVars_SwitchToBootMenuStack: 40 47 pop ax ; Pop return address 48 %ifndef USE_186 41 49 cli ; Disable interrupts 50 %endif 42 51 LOAD_BDA_SEGMENT_TO ss, sp 43 52 mov sp, BOOTVARS.rgbMnuStack ; Load offset to stack 53 %ifndef USE_186 44 54 sti ; Enable interrupts 55 %endif 45 56 jmp ax 46 57 … … 48 59 ;-------------------------------------------------------------------- 49 60 ; Restores SS and SP to initial boot loader values. 61 ; 62 ; Before doing any changes, see the note regarding 63 ; LOAD_BDA_SEGMENT_TO in BootVars_SwitchToBootMenuStack 50 64 ; 51 65 ; BootVars_SwitchBackToPostStack … … 60 74 BootVars_SwitchBackToPostStack: 61 75 pop ax ; Pop return address 76 %ifndef USE_186 62 77 cli ; Disable interrupts 78 %endif 63 79 LOAD_BDA_SEGMENT_TO ss, sp 64 80 %ifndef USE_386 … … 68 84 lss sp, [ss:BOOTVARS.dwPostStack] 69 85 %endif 86 %ifndef USE_186 70 87 sti ; Enable interrupts 88 %endif 71 89 jmp ax -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm
r35 r116 1 ; File name : AH1h_HStatus.asm 2 ; Project name : IDE BIOS 3 ; Created date : 27.9.2007 4 ; Last update : 24.8.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Int 13h function AH=1h, Read Disk Status. 7 3 … … 30 26 31 27 LOAD_BDA_SEGMENT_TO ds, di 32 xor ah, ah ; Zero AH33 cmp ah, [BDA.bHDLastSt] ; Set CF if error code is non-zero34 28 mov ah, [BDA.bHDLastSt] ; Last error to AH 29 cmp ah, 1 ; Set CF if error code is zero 30 cmc ; Invert CF 35 31 36 32 pop ds -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
r88 r116 108 108 ;-------------------------------------------------------------------- 109 109 ; Returns timeout value for drive detection. 110 ; Long timeout is required for detec ing first drive to make sure it is110 ; Long timeout is required for detecting first drive to make sure it is 111 111 ; ready after power-on (ATA specification says up to 31 seconds). 112 112 ; Short timeout is used for additional drives to prevent long boot time … … 123 123 ALIGN JUMP_ALIGN 124 124 AH25h_GetDriveDetectionTimeoutValue: 125 mov cl, B_TIMEOUT_RESET ; Load long timeout (assume first drive) 125 126 cmp BYTE [RAMVARS.bDrvCnt], 0 ; Detecting first drive? 126 je SHORT . GetLongDelayForInitialDetection127 je SHORT .Return 127 128 mov cl, B_TIMEOUT_DRVINFO ; Load short timeout 129 ALIGN JUMP_ALIGN, ret ; This speed optimization may be unnecessary 130 .Return: 128 131 ret 129 ALIGN JUMP_ALIGN130 .GetLongDelayForInitialDetection:131 mov cl, B_TIMEOUT_RESET ; Load long timeout132 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm
r84 r116 1 ; File name : AHCh_HSeek.asm 2 ; Project name : IDE BIOS 3 ; Created date : 13.12.2007 4 ; Last update : 14.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 1 ; Project name : XTIDE Universal BIOS 7 2 ; Description : Int 13h function AH=Ch, Seek. 8 3 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r88 r116 100 100 ; HSR2: Check_status 101 101 mov cl, B_TIMEOUT_RESET ; Reset timeout delay 102 mov dx, [RAMVARS.wIdeBase] ; Load base port address 103 jmp HStatus_WaitBsyBase 102 jmp HStatus_WaitBsy 104 103 105 104 … … 125 124 call AH9h_InitializeDriveForUse 126 125 mov cl, ah ; Copy error code to CL 127 ALIGN JUMP_ALIGN128 126 .InitializeSlave: 129 127 pop dx ; Restore base port address … … 132 130 call AH9h_InitializeDriveForUse 133 131 mov ch, ah ; Copy error code to CH 134 ALIGN JUMP_ALIGN135 132 .CombineErrors: 136 133 or cl, ch ; OR error codes, clear CF 137 jnz SHORT .ReturnError 138 ret 139 .ReturnError: 134 jz SHORT .Return 140 135 mov ah, RET_HD_RESETFAIL ; Load Reset Failed error code 141 136 stc 137 .Return: 142 138 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm
r86 r116 1 ; Project name : IDEBIOS1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : Interrupt handling related functions. 3 3 … … 35 35 push ds 36 36 37 LOAD_BDA_SEGMENT_TO ds, ax 37 LOAD_BDA_SEGMENT_TO ds, ax, ! ; Zero AX 38 38 cli ; Disable interrupts 39 39 cmp al, [BDA.bHDTaskFlg] ; Task flag already set? … … 68 68 HIRQ_ClearTaskFlag: 69 69 push ds 70 LOAD_BDA_SEGMENT_TO ds, ax ; Also zero AX70 LOAD_BDA_SEGMENT_TO ds, ax, ! ; Also zero AX 71 71 mov [BDA.bHDTaskFlg], al 72 72 pop ds -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HPIO.asm
r86 r116 1 ; Project name : IDEBIOS1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : PIO transfer functions. 3 3 … … 15 15 16 16 ;-------------------------------------------------------------------- 17 ; Normalizes far pointer to that offset overflows won't happen18 ; when transferring data using PIO.19 ;20 ; HPIO_NORMALIZE_PTR21 ; Parameters:22 ; %1:%2: Far pointer to normalize23 ; %3: Scratch register24 ; %4: Scratch register25 ; Returns:26 ; %1:%2: Normalized far pointer27 ; Corrupts registers:28 ; %3, %429 ;--------------------------------------------------------------------30 %macro HPIO_NORMALIZE_PTR 431 mov %4, %2 ; Copy offset to scratch reg32 and %2, BYTE 0Fh ; Clear offset bits 15...433 eSHR_IM %4, 4 ; Divide offset by 1634 mov %3, %1 ; Copy segment to scratch reg35 add %3, %4 ; Add shifted offset to segment36 mov %1, %3 ; Set normalized segment37 %endmacro38 39 40 ;--------------------------------------------------------------------41 17 ; Reads sectors from hard disk using PIO transfer mode. 42 18 ; … … 110 86 mov [bp+PIOVARS.fnXfer], bx ; Store offset to transfer function 111 87 xchg bx, ax 112 ; Fall to HPIO_NormalizePtr 113 114 ;-------------------------------------------------------------------- 115 ; Initializes PIOVARS members. 116 ; 117 ; HPIO_InitializePIOVARS 88 ; Fall to HPIO_NormalizeDataPointer 89 90 ;-------------------------------------------------------------------- 91 ; Normalizes far pointers so that offset overflows won't happen 92 ; when transferring data using PIO. 93 ; 94 ; HPIO_NormalizeDataPointer 118 95 ; Parameters: 119 96 ; ES:BX: Ptr to source or destination data buffer … … 125 102 ;ALIGN JUMP_ALIGN 126 103 HPIO_NormalizeDataPointer: 127 HPIO_NORMALIZE_PTRes, bx, ax, cx104 NORMALIZE_FAR_POINTER es, bx, ax, cx 128 105 ret 129 106 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r112 r116 15 15 ; Included .inc files 16 16 %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first! 17 %include "BiosData.inc" ; For BIOS Data area equates18 17 %include "Interrupts.inc" ; For interrupt equates 19 18 %include "ATA_ID.inc" ; For ATA Drive Information structs -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r99 r116 34 34 jz SHORT .InitializeRamvars ; No need to steal RAM 35 35 36 LOAD_BDA_SEGMENT_TO ds, ax 36 LOAD_BDA_SEGMENT_TO ds, ax, ! ; Zero AX 37 37 mov al, [cs:ROMVARS.bStealSize] 38 38 sub [BDA.wBaseMem], ax … … 197 197 ; Corrupts registers: 198 198 ; Nothing 199 ;-------------------------------------------------------------------- 199 ;-------------------------------------------------------------------- 200 200 ALIGN JUMP_ALIGN 201 201 RamVars_GetHardDiskCountFromBDAtoCX: … … 203 203 push dx 204 204 205 LOAD_BDA_SEGMENT_TO es, cx 205 LOAD_BDA_SEGMENT_TO es, cx, ! ; Zero CX 206 206 call RamVars_GetCountOfKnownDrivesToDL 207 207 MAX_U dl, [es:BDA.bHDCount] … … 220 220 ; Corrupts registers: 221 221 ; Nothing 222 ;-------------------------------------------------------------------- 222 ;-------------------------------------------------------------------- 223 223 ALIGN JUMP_ALIGN 224 224 RamVars_GetCountOfKnownDrivesToDL: … … 237 237 ; Corrupts registers: 238 238 ; Nothing 239 ;-------------------------------------------------------------------- 239 ;-------------------------------------------------------------------- 240 240 RamVars_GetIdeControllerCountToCX: 241 241 eMOVZX cx, BYTE [cs:ROMVARS.bIdeCnt]
Note:
See TracChangeset
for help on using the changeset viewer.