Changeset 414 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- May 3, 2012, 12:56:04 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc
r410 r414 22 22 23 23 ; Reset delays 24 HSR0_RESET_WAIT_US EQU 5 ; Delay at least 5us25 HSR1_RESET_WAIT_US EQU 2 000 ; Delay at least 2ms24 HSR0_RESET_WAIT_US EQU 6 ; Delay must be at least 5 us 25 HSR1_RESET_WAIT_US EQU 2100 ; Delay must be at least 2 ms 26 26 27 27 ; Polling timeout delays (system timer ticks, 1 tick = 54.9 ms) … … 34 34 TIMEOUT_DRDY EQU TIMEOUT_MOTOR_STARTUP 35 35 %else 36 TIMEOUT_BSY EQU (2 500/55) ; 2500 ms37 TIMEOUT_DRDY EQU (2 500/55) ; 2500 ms36 TIMEOUT_BSY EQU (2600/55) ; 2600 ms 37 TIMEOUT_DRDY EQU (2600/55) ; 2600 ms 38 38 %endif 39 39 -
trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
r413 r414 26 26 %endif 27 27 28 29 ; Variables for translating drive numbers.30 struc XLATEVARS31 %ifdef MODULE_SERIAL_FLOPPY32 .bFlopCreateCnt:33 .bFlopCntAndFirst resb 1 ; Normally, packed starting floppy drive number (high order 7 bits)34 ; and number of drives (low order bit, max 2 drives supported).35 ; During initialization, until the end of DetectDrives_FromAllIDEControllers,36 ; this byte contains the raw number of floppy drives seen (using .bFlopCreateCnt)37 %else38 resb 1 ; alignment39 %endif40 .bXlatedDrv resb 1 ; Drive number after translation41 .wFDandHDswap:42 .bFDSwap resb 1 ; Floppy Drive to swap to 00h and vice versa43 .bHDSwap resb 1 ; Hard Drive to swap to 80h and vice versa44 endstruc45 46 28 ; RAM Variables. 47 29 ; Variables should be kept to minimum since they might be located … … 60 42 61 43 ; Variables for drive number translation 62 .xlateVars resb XLATEVARS_size 44 %ifdef MODULE_HOTKEYS 45 .xlateVars resb XLATEVARS_size 46 %endif 63 47 endstruc 48 49 50 ; Variables for translating drive numbers. 51 %ifdef MODULE_HOTKEYS 52 struc XLATEVARS 53 %ifdef MODULE_SERIAL_FLOPPY 54 .bFlopCreateCnt: 55 .bFlopCntAndFirst resb 1 ; Normally, packed starting floppy drive number (high order 7 bits) 56 ; and number of drives (low order bit, max 2 drives supported). 57 ; During initialization, until the end of DetectDrives_FromAllIDEControllers, 58 ; this byte contains the raw number of floppy drives seen (using .bFlopCreateCnt) 59 %else 60 resb 1 ; alignment 61 %endif 62 .bXlatedDrv resb 1 ; Drive number after translation 63 .wFDandHDswap: 64 .bFDSwap resb 1 ; Floppy Drive to swap to 00h and vice versa 65 .bHDSwap resb 1 ; Hard Drive to swap to 80h and vice versa 66 endstruc 67 %endif 68 64 69 65 70 %ifdef MODULE_SERIAL_FLOPPY … … 77 82 ; wire for MODULE_SERIAL, please do not change the order or insert other members. 78 83 ; 79 struc IDEPACK 84 struc IDEPACK ; PIOVARS and MEMPIOVARS overwrite the first 7 bytes 80 85 .bFeatures resb 1 81 86 .bDrvAndHead resb 1 ; LBA28 27...24 … … 92 97 93 98 .bCommand resb 1 94 .bDeviceControl resb 1 ; Offset 7 shared with PIOVARS 95 resb 1 99 .bDeviceControl resb 1 ; Offset 7 shared with PIOVARS and MEMPIOVARS 100 resb 1 ; Used by PIOVARS and MEMPIOVARS 96 101 97 102 %ifdef MODULE_EBIOS … … 102 107 .bLbaHighExt resb 1 ; LBA48 47...40 103 108 %endif 109 104 110 .intpack resb INTPACK_size 105 111 endstruc -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
r412 r414 33 33 ;-------------------------------------------------------------------- 34 34 IdeIO_OutputALtoIdeControlBlockRegisterInDL: 35 %ifdef MODULE_8BIT_IDE36 mov dh, [di+DPT_ATA.bDevice]37 %ifdef MODULE_JRIDE38 test dh, dh39 jnz SHORT .OutputToIoMappedIde40 41 add dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET42 jmp SHORT OutputToJrIdeRegister43 .OutputToIoMappedIde:44 %endif ; MODULE_JRIDE45 %endif ; MODULE_8BIT_IDE35 %ifdef MODULE_8BIT_IDE 36 mov dh, [di+DPT_ATA.bDevice] 37 %ifdef MODULE_JRIDE 38 test dh, dh 39 jnz SHORT .OutputToIoMappedIde 40 41 add dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET 42 jmp SHORT OutputToJrIdeRegister 43 .OutputToIoMappedIde: 44 %endif ; MODULE_JRIDE 45 %endif ; MODULE_8BIT_IDE 46 46 47 47 mov bl, IDEVARS.wPortCtrl … … 62 62 ALIGN JUMP_ALIGN 63 63 IdeIO_OutputALtoIdeRegisterInDL: 64 %ifdef MODULE_8BIT_IDE65 mov dh, [di+DPT_ATA.bDevice]66 %ifdef MODULE_JRIDE67 test dh, dh68 jnz SHORT OutputALtoIOmappedIdeRegisterInDL69 70 %if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 071 mov dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 872 %else73 add dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET74 %endif75 OutputToJrIdeRegister:76 mov bx, dx77 mov [cs:bx], al78 ret79 ALIGN JUMP_ALIGN80 OutputALtoIOmappedIdeRegisterInDL:81 %endif ; MODULE_JRIDE82 %endif ; MODULE_8BIT_IDE64 %ifdef MODULE_8BIT_IDE 65 mov dh, [di+DPT_ATA.bDevice] 66 %ifdef MODULE_JRIDE 67 test dh, dh 68 jnz SHORT OutputALtoIOmappedIdeRegisterInDL 69 70 %if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0 71 mov dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8 72 %else 73 add dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET 74 %endif 75 OutputToJrIdeRegister: 76 mov bx, dx 77 mov [cs:bx], al 78 ret 79 ALIGN JUMP_ALIGN 80 OutputALtoIOmappedIdeRegisterInDL: 81 %endif ; MODULE_JRIDE 82 %endif ; MODULE_8BIT_IDE 83 83 84 84 mov bl, IDEVARS.wPort … … 114 114 ;-------------------------------------------------------------------- 115 115 IdeIO_InputToALfromIdeRegisterInDL: 116 %ifdef MODULE_8BIT_IDE117 mov dh, [di+DPT_ATA.bDevice]118 %ifdef MODULE_JRIDE119 test dh, dh120 jnz SHORT .InputToALfromIOmappedIdeRegisterInDL121 122 %if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0123 mov dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8124 %else125 add dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET126 %endif127 mov bx, dx128 mov al, [cs:bx]129 ret130 .InputToALfromIOmappedIdeRegisterInDL:131 %endif ; MODULE_JRIDE132 %endif ; MODULE_8BIT_IDE116 %ifdef MODULE_8BIT_IDE 117 mov dh, [di+DPT_ATA.bDevice] 118 %ifdef MODULE_JRIDE 119 test dh, dh 120 jnz SHORT .InputToALfromIOmappedIdeRegisterInDL 121 122 %if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0 123 mov dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8 124 %else 125 add dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET 126 %endif 127 mov bx, dx 128 mov al, [cs:bx] 129 ret 130 .InputToALfromIOmappedIdeRegisterInDL: 131 %endif ; MODULE_JRIDE 132 %endif ; MODULE_8BIT_IDE 133 133 mov bl, IDEVARS.wPort 134 134 call GetIdePortToDX -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r402 r414 20 20 ; Structure containing variables for PIO transfer functions. 21 21 ; This struct must not be larger than IDEPACK without INTPACK. 22 struc PIOVARS 23 .wDataPort resb 2 ; 0 , IDE Data Port24 .fnXfer resb 2 ; 2 , Offset to transfer function25 .wSectorsInBlock resb 2 ; 4 , Block size in sectors22 struc PIOVARS ; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc. 23 .wDataPort resb 2 ; 0-1, IDE Data Port 24 .fnXfer resb 2 ; 2-3, Offset to transfer function 25 .wSectorsInBlock resb 2 ; 4-5, Block size in sectors 26 26 .bSectorsLeft resb 1 ; 6, Sectors left to transfer 27 27 resb 1 ; 7, IDEPACK.bDeviceControl -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
r412 r414 20 20 ; Structure containing variables for PIO transfer functions. 21 21 ; This struct must not be larger than IDEPACK without INTPACK. 22 struc MEMPIOVARS 23 .wSectorsInBlock resb 2 ; 0, Block size in sectors 24 .bSectorsLeft resb 1 ; 2, Sectors left to transfer 25 .bSectorsDone resb 1 ; 3, Number of sectors xferred 26 resb 3 ; 4, 5, 6 22 struc MEMPIOVARS ; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc. 23 .wSectorsInBlock resb 2 ; 0-1, Block size in sectors 24 .fpDPT resb 4 ; 2-5, Far pointer to DPT 25 .bSectorsLeft resb 1 ; 6, Sectors left to transfer 27 26 resb 1 ; 7, IDEPACK.bDeviceControl 28 . fpDPT resb 4 ; 8, Far pointer to DPT27 .bSectorsDone resb 1 ; 8, Number of sectors xferred 29 28 endstruc 30 29 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r395 r414 45 45 %ifdef MODULE_HOTKEYS 46 46 call DriveXlate_ToOrBack 47 %endif48 47 mov [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl 48 %endif 49 49 50 50 call FindDPT_ForDriveNumberInDL ; DS:DI points to our DPT, or NULL if not our drive … … 129 129 mov [bp+IDEPACK.intpack+INTPACK.si], si 130 130 mov [bp+IDEPACK.intpack+INTPACK.bx], bx 131 %ifdef MODULE_HOTKEYS 131 132 mov [bp+IDEPACK.intpack+INTPACK.dh], dh 133 %else 134 mov [bp+IDEPACK.intpack+INTPACK.dx], dx 135 %endif 132 136 mov [bp+IDEPACK.intpack+INTPACK.cx], cx 133 137 mov [bp+IDEPACK.intpack+INTPACK.ax], ax … … 135 139 pop WORD [bp+IDEPACK.intpack+INTPACK.flags] 136 140 call RamVars_GetSegmentToDS 137 cmp dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv] 141 142 %ifdef MODULE_HOTKEYS 143 cmp dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv] ; DL is still drive number? 138 144 je SHORT .ExchangeInt13hHandlers 139 mov [bp+IDEPACK.intpack+INTPACK.dl], dl 145 mov [bp+IDEPACK.intpack+INTPACK.dl], dl ; Something is returned in DL 140 146 ALIGN JUMP_ALIGN 141 147 .ExchangeInt13hHandlers: 148 %endif 149 142 150 %ifdef USE_186 143 151 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH … … 192 200 Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber: 193 201 call Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber 202 194 203 %else 195 204 call Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 196 205 %endif 206 197 207 Int13h_ReturnFromHandlerWithoutStoringErrorCode: 198 208 or WORD [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_IF ; Return with interrupts enabled … … 265 275 mov bx, BDA.bHDLastSt 266 276 test al, al 267 js .HardDisk277 js SHORT .HardDisk 268 278 mov bl, BDA.bFDRetST & 0xff 269 279 .HardDisk: -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r413 r414 29 29 ;-------------------------------------------------------------------- 30 30 Int19h_BootLoaderHandler: 31 sti ; Allow timer interrupts 32 LOAD_BDA_SEGMENT_TO es, ax ; Load BDA segment (zero) to ES 31 sti ; Enable interrupts 32 cld ; String instructions to increment pointers 33 LOAD_BDA_SEGMENT_TO es, ax ; Load BDA segment (zero) to ES 33 34 ; Fall to .PrepareBootLoaderStack 34 35
Note:
See TracChangeset
for help on using the changeset viewer.