Changeset 181 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Nov 13, 2011, 3:38:40 PM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r179 r181 5 5 %define ROMVARS_INC 6 6 7 ; ROM Variables. There are written toROM image before flashing.7 ; ROM Variables. Written to the ROM image before flashing. 8 8 struc ROMVARS 9 .wRomSign resb 2 ; ROM Signature (AA55h)10 .bRomSize resb 1 ; ROM size in 512 byte blocks11 .rgbJump resb 3 ; First instruction to ROM init (jmp)9 .wRomSign resb 2 ; ROM Signature (AA55h) 10 .bRomSize resb 1 ; ROM size in 512 byte blocks 11 .rgbJump resb 3 ; First instruction to ROM init (jmp) 12 12 13 .rgbSign resb 8 ; Signature for XTIDE Configurator Program14 .szTitle resb 31 ; BIOS title string15 .szVersion resb 25 ; BIOS version string13 .rgbSign resb 8 ; Signature for XTIDE Configurator Program 14 .szTitle resb 31 ; BIOS title string 15 .szVersion resb 25 ; BIOS version string 16 16 17 .wFlags resb 2 ; Word for ROM flags18 .wDisplayMode resb 2 ; Display mode for boot menu19 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks20 .bIdeCnt resb 1 ; Number of available IDE controllers21 .bBootDrv resb 1 ; Boot Menu default drive22 .bMinFddCnt resb 1 ; Minimum number of Floppy Drives23 .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM17 .wFlags resb 2 ; Word for ROM flags 18 .wDisplayMode resb 2 ; Display mode for boot menu 19 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks 20 .bIdeCnt resb 1 ; Number of available IDE controllers 21 .bBootDrv resb 1 ; Boot Menu default drive 22 .bMinFddCnt resb 1 ; Minimum number of Floppy Drives 23 .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM 24 24 25 .ideVars0 resb IDEVARS_size26 .ideVars1 resb IDEVARS_size27 .ideVars2 resb IDEVARS_size28 .ideVars3 resb IDEVARS_size25 .ideVars0 resb IDEVARS_size 26 .ideVars1 resb IDEVARS_size 27 .ideVars2 resb IDEVARS_size 28 .ideVars3 resb IDEVARS_size 29 29 30 30 %ifdef MODULE_SERIAL … … 34 34 35 35 ; Bit defines for ROMVARS.wFlags 36 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.)37 FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation36 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) 37 FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation 38 38 FLG_ROMVARS_MODULE_SERIAL EQU (1<<3) 39 39 FLG_ROMVARS_MODULE_EBIOS EQU (1<<4) -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm
r165 r181 125 125 mul bl ; AX = Offset inside BOOTNFO array 126 126 add ax, BOOTVARS.rgBootNfo ; Add offset to BOOTNFO array 127 xchg bx, ax ; Copyresult to BX127 xchg bx, ax ; Move result to BX 128 128 ret -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r130 r181 102 102 CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH 103 103 sub ah, MENU_SCREEN_BOTTOM_LINES*2 ; Leave space for bottom info 104 MIN_U ah, cl 104 cmp ah, cl 105 jb SHORT .Return 106 mov ah, cl 107 ALIGN JUMP_ALIGN, ret 108 .Return: 105 109 ret 106 110 … … 148 152 call FloppyDrive_GetCountToCX 149 153 add cl, 'A' 150 MAX_U cl, 'C' 154 cmp cl, 'C' 155 ja .Return 156 mov cl, 'C' 157 ALIGN JUMP_ALIGN, ret 158 .Return: 151 159 ret 152 160 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r158 r181 85 85 ; AX, DX 86 86 ;-------------------------------------------------------------------- 87 PushBusType: 87 ;PushBusType: 88 cwd ; Clear DX using sign extension 88 89 xchg ax, bx ; Store BX to AX 89 90 eMOVZX bx, BYTE [cs:si+IDEVARS.bDevice] 90 91 mov bx, [cs:bx+rgwBusTypeValues] ; Char to BL, Int to BH 91 eMOVZX dx, bh92 mov dl, bh 92 93 push bx ; Push character 93 94 push dx ; Push 1, 8, 16 or 32 -
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r175 r181 16 16 ; AX, BX, CX, DX 17 17 ;-------------------------------------------------------------------- 18 %ifdef MODULE_SERIAL 18 19 Device_FinalizeDPT: 19 %ifdef MODULE_SERIAL20 20 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 21 21 jnz SHORT .FinalizeDptForSerialPortDevice 22 jmp IdeDPT_Finalize 23 24 .FinalizeDptForSerialPortDevice: 25 jmp SerialDPT_Finalize 26 %else 27 Device_FinalizeDPT EQU IdeDPT_Finalize 22 28 %endif 23 jmp IdeDPT_Finalize 24 %ifdef MODULE_SERIAL 25 .FinalizeDptForSerialPortDevice: 26 jmp SerialDPT_Finalize 27 %endif 29 28 30 29 31 ;-------------------------------------------------------------------- … … 37 39 ; AL, BX, CX, DX 38 40 ;-------------------------------------------------------------------- 41 %ifdef MODULE_SERIAL 39 42 Device_ResetMasterAndSlaveController: 40 %ifdef MODULE_SERIAL41 43 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 42 44 jnz SHORT ReturnSuccessForSerialPort 45 jmp IdeCommand_ResetMasterAndSlaveController 46 %else 47 Device_ResetMasterAndSlaveController EQU IdeCommand_ResetMasterAndSlaveController 43 48 %endif 44 jmp IdeCommand_ResetMasterAndSlaveController45 49 46 50 … … 58 62 ; AL, BL, CX, DX, SI, DI, ES 59 63 ;-------------------------------------------------------------------- 64 %ifdef MODULE_SERIAL 60 65 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH: 61 %ifdef MODULE_SERIAL62 66 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 63 67 je SHORT .IdentifyDriveFromSerialPort 64 %endif65 68 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 66 %ifdef MODULE_SERIAL 69 67 70 .IdentifyDriveFromSerialPort: 68 71 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 72 %else 73 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH EQU IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 69 74 %endif 75 70 76 71 77 ;-------------------------------------------------------------------- … … 83 89 ; AL, BX, CX, DX, (ES:SI for data transfer commands) 84 90 ;-------------------------------------------------------------------- 91 %ifdef MODULE_SERIAL 85 92 ALIGN JUMP_ALIGN 86 93 Device_OutputCommandWithParameters: 87 %ifdef MODULE_SERIAL88 94 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 89 95 jnz SHORT .OutputCommandToSerialPort 90 %endif91 96 jmp IdeCommand_OutputWithParameters 92 %ifdef MODULE_SERIAL 97 93 98 ALIGN JUMP_ALIGN 94 99 .OutputCommandToSerialPort: 95 100 jmp SerialCommand_OutputWithParameters 101 %else 102 Device_OutputCommandWithParameters EQU IdeCommand_OutputWithParameters 96 103 %endif 104 97 105 98 106 ;-------------------------------------------------------------------- … … 107 115 ; AL, BX, CX, DX 108 116 ;-------------------------------------------------------------------- 117 %ifdef MODULE_SERIAL 109 118 ALIGN JUMP_ALIGN 110 119 Device_SelectDrive: 111 %ifdef MODULE_SERIAL112 120 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 113 121 jnz SHORT ReturnSuccessForSerialPort 114 %endif115 122 jmp IdeCommand_SelectDrive 116 %ifdef MODULE_SERIAL 123 117 124 ReturnSuccessForSerialPort: 118 125 xor ax, ax 119 126 ret 127 %else 128 Device_SelectDrive EQU IdeCommand_SelectDrive 120 129 %endif 130 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
r160 r181 7 7 ;-------------------------------------------------------------------- 8 8 ; IdeIO_OutputALtoIdeRegisterInDL 9 ; IdeIO_OutputALtoIdeControlBlockRegisterInDL 9 10 ; Parameters: 10 11 ; AL: Byte to output 11 ; DL: IDE Register 12 ; DL: IDE Register (IdeIO_OutputALtoIdeRegisterInDL) 13 ; IDE Control Block Register (IdeIO_OutputALtoIdeControlBlockRegisterInDL) 12 14 ; DS:DI: Ptr to DPT (in RAMVARS segment) 13 15 ; Returns: … … 18 20 ALIGN JUMP_ALIGN 19 21 IdeIO_OutputALtoIdeRegisterInDL: 20 mov bx, IDEVARS.wPort 21 call GetPortToDXandTranslateA0andA3ifNecessary 22 out dx, al 23 ret 22 mov bl, IDEVARS.wPort 23 SKIP2B f ; cmp ax, <next instruction> 24 ; Fall to IdeIO_OutputALtoIdeControlBlockRegisterInDL 24 25 25 26 ;--------------------------------------------------------------------27 ; IdeIO_OutputALtoIdeControlBlockRegisterInDL28 ; Parameters:29 ; AL: Byte to output30 ; DL: IDE Control Block Register31 ; DS:DI: Ptr to DPT (in RAMVARS segment)32 ; Returns:33 ; Nothing34 ; Corrupts registers:35 ; BX, DX36 ;--------------------------------------------------------------------37 ALIGN JUMP_ALIGN38 26 IdeIO_OutputALtoIdeControlBlockRegisterInDL: 39 mov b x, IDEVARS.wPortCtrl27 mov bl, IDEVARS.wPortCtrl 40 28 call GetPortToDXandTranslateA0andA3ifNecessary 41 29 out dx, al … … 55 43 ALIGN JUMP_ALIGN 56 44 IdeIO_InputToALfromIdeRegisterInDL: 57 mov b x, IDEVARS.wPort45 mov bl, IDEVARS.wPort 58 46 call GetPortToDXandTranslateA0andA3ifNecessary 59 47 in al, dx … … 64 52 ; GetPortToDXandTranslateA0andA3ifNecessary 65 53 ; Parameters: 66 ; B X: Offset to port in IDEVARS (IDEVARS.wPort or IDEVARS.wPortCtrl)54 ; BL: Offset to port in IDEVARS (IDEVARS.wPort or IDEVARS.wPortCtrl) 67 55 ; DL: IDE Register 68 56 ; DS:DI: Ptr to DPT (in RAMVARS segment) … … 74 62 ALIGN JUMP_ALIGN 75 63 GetPortToDXandTranslateA0andA3ifNecessary: 64 xor bh, bh 76 65 xor dh, dh ; DX now has IDE register offset 77 66 add bl, [di+DPT.bIdevarsOffset] ; CS:BX now points port address -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r171 r181 230 230 ALIGN JUMP_ALIGN 231 231 DualByteReadForXtide: 232 %ifdef USE_186 233 shr cx, 2 ; Smaller but slower on 186/286 234 %else 235 times 2 shr cx, 1 ; Loop unrolling 236 %endif 232 eSHR_IM cx, 2 ; Loop unrolling 237 233 mov bx, 8 ; Bit mask for toggling data low/high reg 238 234 ALIGN JUMP_ALIGN … … 322 318 push ds 323 319 push bx 324 %ifdef USE_186 325 shr cx, 2 ; Smaller but slower on 186/286 326 %else 327 times 2 shr cx, 1 ; Loop unrolling 328 %endif 320 eSHR_IM cx, 2 ; Loop unrolling 329 321 mov bx, 8 ; Bit mask for toggling data low/high reg 330 322 push es ; Copy ES... … … 372 364 WordWriteForXTIDEmod: 373 365 push ds 374 %ifdef USE_186 375 shr cx, 2 ; Smaller but slower on 186/286 376 %else 377 times 2 shr cx, 1 ; Loop unrolling 378 %endif 366 eSHR_IM cx, 2 ; Loop unrolling 379 367 push es ; Copy ES... 380 368 pop ds ; ...to DS -
trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm
r180 r181 20 20 jmp ax 21 21 22 %ifdef MODULE_EBIOS 22 23 23 ;-------------------------------------------------------------------- 24 24 ; Idepack_ConvertDapToIdepackAndIssueCommandFromAH … … 36 36 ; AL, BX, CX, DX, SI, ES 37 37 ;-------------------------------------------------------------------- 38 %ifdef MODULE_EBIOS 38 39 ALIGN JUMP_ALIGN 39 40 Idepack_ConvertDapToIdepackAndIssueCommandFromAH: … … 60 61 %endif 61 62 63 62 64 ;-------------------------------------------------------------------- 63 65 ; Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH … … 83 85 Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH: 84 86 mov [bp+IDEPACK.bCommand], ah 85 test al, al 86 eCSETZ ah 87 88 xor ah, ah 89 cmp ah, al 90 cmc 91 adc ah, ah 92 87 93 mov [bp+IDEPACK.bSectorCount], al 88 94 mov [bp+IDEPACK.bSectorCountHighExt], ah … … 100 106 call AccessDPT_GetDeviceControlByteToAL 101 107 mov [bp+IDEPACK.bDeviceControl], al 102 jmp Device_OutputCommandWithParameters 108 jmp Device_OutputCommandWithParameters 103 109 104 110 -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
r179 r181 10 10 ; http://en.wikibooks.org/wiki/Serial_Programming 11 11 ; 12 12 13 13 SerialCommand_UART_base EQU 0 14 14 SerialCommand_UART_transmitByte EQU 0 15 15 SerialCommand_UART_receiveByte EQU 0 16 16 SerialCommand_UART_divisorLow EQU 0 17 ; Values for UART_divisorLow: 17 ; Values for UART_divisorLow: 18 18 ; 60h = 1200, 30h = 2400, 18h = 4800, 0ch = 9600, 6 = 19200, 3 = 38400, 2 = 57600, 1 = 115200 19 19 … … 23 23 ; Note: hardware baud multipliers (2x, 4x) will impact the final baud rate and are not known at this level 24 24 25 SerialCommand_UART_interruptEnable EQU 1 25 SerialCommand_UART_interruptEnable EQU 1 26 26 SerialCommand_UART_divisorHigh EQU 1 27 27 ; UART_divisorHigh is zero for all speeds including and above 1200 baud … … 31 31 32 32 SerialCommand_UART_lineControl EQU 3 33 33 34 34 SerialCommand_UART_modemControl EQU 4 35 35 … … 40 40 SerialCommand_UART_scratch EQU 7 41 41 42 SerialCommand_PackedPortAndBaud_StartingPort EQU 240h 42 SerialCommand_PackedPortAndBaud_StartingPort EQU 240h 43 43 SerialCommand_PackedPortAndBaud_PortMask EQU 0fch ; upper 6 bits - 240h through 438h 44 44 SerialCommand_PackedPortAndBaud_BaudMask EQU 3 ; lower 2 bits - 4 baud rates … … 48 48 SerialCommand_Protocol_Inquire EQU 0 49 49 SerialCommand_Protocol_Header EQU 0a0h 50 50 51 51 ;-------------------------------------------------------------------- 52 52 ; SerialCommand_OutputWithParameters … … 65 65 ; AL, BX, CX, DX, (ES:SI for data transfer commands) 66 66 ;-------------------------------------------------------------------- 67 68 67 ALIGN JUMP_ALIGN 69 68 SerialCommand_OutputWithParameters: 70 69 71 70 mov ah,(SerialCommand_Protocol_Header | SerialCommand_Protocol_Read) 72 71 73 72 mov al,[bp+IDEPACK.bCommand] 74 73 … … 78 77 cmp al,30h ; Write Sectors IDE command 79 78 jz .readOrWrite 80 79 81 80 ; all other commands return success 82 81 ; including function 0ech which should return drive information, this is handled with the identify functions 83 82 xor ah,ah ; also clears carry 84 83 ret 85 86 .readOrWrite: 84 85 .readOrWrite: 87 86 mov [bp+IDEPACK.bFeatures],ah ; store protocol command 88 89 mov dl, byte [d s:di+DPT.bSerialPortAndBaud]90 87 88 mov dl, byte [di+DPT.bSerialPortAndBaud] 89 91 90 ; fall-through 92 91 … … 94 93 ; SerialCommand_OutputWithParameters_DeviceInDL 95 94 ; Parameters: 96 ; AH: Protocol Command 95 ; AH: Protocol Command 97 96 ; DL: Packed I/O port and baud rate 98 97 ; ES:SI: Ptr to buffer (for data transfer commands) … … 103 102 ; Corrupts registers: 104 103 ; AL, BX, CX, DX, (ES:SI for data transfer commands) 105 ;-------------------------------------------------------------------- 104 ;-------------------------------------------------------------------- 106 105 SerialCommand_OutputWithParameters_DeviceInDL: 107 106 108 107 push si 109 108 push di … … 111 110 push es 112 111 113 ; 112 ; 114 113 ; Unpack I/O port and baud from DPT 115 114 ; Port to DX more or less for the remainder of the routine … … 117 116 ; 118 117 mov cl, dl 119 118 120 119 and cl, SerialCommand_PackedPortAndBaud_BaudMask 121 120 shl cl, 1 … … 125 124 126 125 and dl, SerialCommand_PackedPortAndBaud_PortMask 127 mov dh, 0 126 mov dh, 0 128 127 shl dx, 1 129 128 add dx, SerialCommand_PackedPortAndBaud_StartingPort … … 131 130 ; 132 131 ; Buffer is referenced through ES:DI throughout, since we need to store faster than we read 133 ; 132 ; 134 133 mov di,si 135 134 … … 138 137 ; 139 138 ; Command byte and sector count live at the top of the stack, pop/push are used to access 140 ; 139 ; 141 140 push ax 142 143 cld 141 142 ; cld ; Shouldn't be needed. DF has already been cleared (line 24, Int13h.asm) 144 143 145 144 ;---------------------------------------------------------------------- … … 147 146 ; Initialize UART 148 147 ; 149 ; We do this each time since DOS (at boot) or another program may have 148 ; We do this each time since DOS (at boot) or another program may have 150 149 ; decided to reprogram the UART 151 150 ; 152 151 push dx 153 152 154 153 mov al,83h 155 154 add dl,SerialCommand_UART_lineControl … … 167 166 mov al,047h 168 167 inc dx ; fifo 169 out dx,al 168 out dx,al 170 169 171 170 mov al,03h … … 192 191 push es ; save off real buffer location 193 192 push di 194 195 mov di,bp ; point to IDEREGS for command dispatch; 193 194 mov di,bp ; point to IDEREGS for command dispatch; 196 195 push ss 197 196 pop es 198 197 199 198 xor si,si ; initialize checksum for write 200 dec si 199 dec si 201 200 mov bp,si 202 201 203 202 mov bl,03h ; writing 3 words 204 203 205 204 call SerialCommand_WriteProtocol 206 205 … … 213 212 ; 214 213 ; Top of the read/write loop, one iteration per sector 215 ; 214 ; 216 215 .nextSector: 217 216 xor si,si ; initialize checksum for read or write … … 220 219 221 220 mov bx,0100h 222 221 223 222 shr ah,1 ; command byte, are we doing a write? 224 223 jnc .readSector 225 224 call SerialCommand_WriteProtocol 226 225 227 226 xor bx,bx 228 227 … … 230 229 mov cx,bx 231 230 inc cx 232 231 233 232 mov bl,dl ; setup bl with proper values for read loop (bh comes later) 234 233 … … 246 245 push cx 247 246 xor cx,cx 248 .readTimeoutLoop: 247 .readTimeoutLoop: 249 248 push dx 250 249 or dl,SerialCommand_UART_lineStatus … … 257 256 mov bh,1 258 257 call SerialCommand_WaitAndPoll_Init 259 cli 258 cli 260 259 .readTimeoutComplete: 261 260 mov bh,bl 262 261 or bh,SerialCommand_UART_lineStatus 263 262 264 263 pop cx 265 264 test dl,1 … … 271 270 ; Read Block (without interrupts, used when there is a FIFO, high speed) 272 271 ; 273 ; NOTE: This loop is very time sensitive. Literally, another instruction 272 ; NOTE: This loop is very time sensitive. Literally, another instruction 274 273 ; cannot be inserted into this loop without us falling behind at high 275 ; speed (460.8K baud) on a 4.77Mhz 8088, making it hard to receive 274 ; speed (460.8K baud) on a 4.77Mhz 8088, making it hard to receive 276 275 ; a full 512 byte block. 277 276 ; 278 .readLoop: 277 .readLoop: 278 stosw ; store word in caller's data buffer 279 279 280 add bp, ax ; update Fletcher's checksum 280 281 adc bp, 0 … … 282 283 adc si, 0 283 284 284 stosw ; store word in caller's data buffer 285 286 mov dl,bh 287 in al,dx 285 mov dl,bh 286 in al,dx 288 287 shr al,1 ; data ready (byte 1)? 289 mov dl,bl ; get ready to read data 288 mov dl,bl ; get ready to read data 290 289 jnc .readTimeout ; nope not ready, update timeouts 291 292 ; 290 291 ; 293 292 ; Entry point after initial timeout. We enter here so that the checksum word 294 293 ; is not stored (and is left in AX after the loop is complete). 295 ; 296 .readByte1Ready: 294 ; 295 .readByte1Ready: 297 296 in al, dx ; read data byte 1 298 297 299 298 mov ah, al ; store byte in ah for now 300 301 ; 302 ; note the placement of this reset of dl to bh, and that it is 303 ; before the return, which is assymetric with where this is done 304 ; above for byte 1. The value of dl is used by the timeout routine 305 ; to know which byte to return to (.read_byte1_ready or 299 300 ; 301 ; note the placement of this reset of dl to bh, and that it is 302 ; before the return, which is assymetric with where this is done 303 ; above for byte 1. The value of dl is used by the timeout routine 304 ; to know which byte to return to (.read_byte1_ready or 306 305 ; .read_byte2_ready) 307 306 ; 308 mov dl,bh 309 307 mov dl,bh 308 310 309 in al,dx 311 310 shr al,1 ; data ready (byte 2)? 312 311 jnc .readTimeout 313 .readByte2Ready: 314 mov dl,bl 312 .readByte2Ready: 313 mov dl,bl 315 314 in al, dx ; read data byte 2 316 315 317 316 xchg al, ah ; ah was holding byte 1, reverse byte order 318 317 319 318 loop .readLoop 320 319 320 sti ; interrupts back on ASAP, if we turned them off 321 321 322 ; 322 323 ; Compare checksums 323 ; 324 ; 324 325 xor bp,si 325 326 cmp ax,bp 326 327 jnz SerialCommand_OutputWithParameters_Error 327 328 328 sti ; interrupts back on ASAP, if we turned them off 329 329 330 330 ;---------------------------------------------------------------------- 331 ; 331 ; 332 332 ; Clear read buffer 333 333 ; 334 334 ; In case there are extra characters or an error in the FIFO, clear it out. 335 ; In theory the initialization of the UART registers above should have 335 ; In theory the initialization of the UART registers above should have 336 336 ; taken care of this, but I have seen cases where this is not true. 337 337 ; 338 338 .clearBuffer: 339 mov dl,bh 339 mov dl,bh 340 340 in al,dx 341 mov dl,bl 341 mov dl,bl 342 342 test al,08fh 343 343 jz .clearBufferComplete 344 344 shr al,1 345 in al,dx 345 in al,dx 346 346 jc .clearBuffer ; note CF from shr above 347 347 jmp SerialCommand_OutputWithParameters_Error 348 349 .clearBufferComplete: 348 349 .clearBufferComplete: 350 350 pop ax ; sector count and command byte 351 351 dec al ; decrememnt sector count 352 352 push ax ; save 353 353 jz SerialCommand_OutputWithParameters_ReturnCodeInALCF ; CF clear from .clearBuffer test above 354 354 355 355 cli ; interrupts back off for ACK byte to host 356 356 ; (host could start sending data immediately) 357 357 out dx,al ; ACK with next sector number 358 358 359 359 jmp .nextSector ; all is well, time for next sector 360 360 … … 363 363 ; Cleanup, error reporting, and exit 364 364 ; 365 366 ; 365 366 ; 367 367 ; Used in situations where a call is underway, such as with SerialCommand_WaitAndPoll 368 ; 368 ; 369 369 SerialCommand_OutputWithParameters_ErrorAndPop2Words: 370 370 pop ax 371 371 pop ax 372 372 373 SerialCommand_OutputWithParameters_Error: 373 SerialCommand_OutputWithParameters_Error: 374 stc 374 375 mov al,1 375 stc 376 377 SerialCommand_OutputWithParameters_ReturnCodeInALCF: 376 377 SerialCommand_OutputWithParameters_ReturnCodeInALCF: 378 sti 378 379 mov ah,al 379 sti380 380 381 381 pop bp ; recover ax from stack, throw away … … 398 398 ; Returns when desired UART_LineStatus bit is cleared 399 399 ; Jumps directly to error exit if timeout elapses (and cleans up stack) 400 ; Corrupts registers: 400 ; Corrupts registers: 401 401 ; CX, flags 402 402 ;-------------------------------------------------------------------- … … 404 404 SerialCommand_WaitAndPoll_SoftDelayTicks EQU 20 405 405 406 ALIGN JUMP_ALIGN 406 ALIGN JUMP_ALIGN 407 407 SerialCommand_WaitAndPoll_Init: 408 408 mov cl,SerialCommand_WaitAndPoll_SoftDelayTicks 409 409 call Timer_InitializeTimeoutWithTicksInCL 410 410 ; fall-through 411 411 412 412 SerialCommand_WaitAndPoll: 413 413 call Timer_SetCFifTimeout … … 422 422 jz SerialCommand_WaitAndPoll 423 423 ; fall-through 424 425 SerialCommand_WaitAndPoll_Done: 424 425 SerialCommand_WaitAndPoll_Done: 426 426 ret 427 427 … … 442 442 SerialCommand_WriteProtocol: 443 443 mov bh,20h 444 444 445 445 .writeLoop: 446 446 test bh,1 447 447 jnz SerialCommand_WaitAndPoll_Done 448 448 449 449 mov ax,[es:di] ; fetch next word 450 450 inc di 451 451 inc di 452 452 453 453 add bp,ax ; update checksum 454 454 adc bp,0 … … 458 458 .writeLoopChecksum: 459 459 call SerialCommand_WaitAndPoll_Init 460 460 461 461 out dx,al ; output first byte 462 462 463 463 call SerialCommand_WaitAndPoll 464 464 465 465 mov al,ah ; output second byte 466 466 out dx,al … … 468 468 dec bl 469 469 jnz .writeLoop 470 470 471 471 inc bh 472 472 473 473 mov ax,bp ; merge checksum for possible write (last loop) 474 xor ax,si 475 474 xor ax,si 475 476 476 jmp .writeLoopChecksum 477 477 … … 501 501 mov dx,[cs:bp+IDEVARS.wPortCtrl] 502 502 inc dx 503 dec dx 503 dec dx 504 504 jz SerialCommand_AutoSerial 505 505 506 506 ; fall-through 507 SerialCommand_IdentifyDeviceInDL_DriveInBH: 507 SerialCommand_IdentifyDeviceInDL_DriveInBH: 508 508 509 509 push bp ; setup fake IDEREGS_AND_INTPACK … … 516 516 mov bl,0a0h ; protocol command to ah and onto stack with bh 517 517 mov ah,bl 518 518 519 519 push bx 520 520 … … 524 524 525 525 pop bx 526 527 pop cx 526 527 pop cx 528 528 pop dx 529 529 530 530 pop bp 531 531 532 ; place packed port/baud in vendor area of packet, read by FinalizeDPT 533 mov byte [es:si+SerialCommand_IdentifyDevice_PackedPortAndBaud], dl 532 ; place packed port/baud in vendor area of packet, read by FinalizeDPT 533 mov byte [es:si+SerialCommand_IdentifyDevice_PackedPortAndBaud], dl 534 534 535 535 ret … … 540 540 ; 541 541 ; When the SerialAuto IDEVARS entry is used, scans the COM ports on the machine for a possible serial connection. 542 ; 543 542 ; 543 544 544 SerialCommand_ScanPortAddresses: db 0b8h, 0f8h, 0bch, 0bah, 0fah, 0beh, 0feh, 0 545 545 ; Corresponds to I/O port: 3f8, 2f8, 3e8, 2e8, 2f0, 3e0, 2e0, 260, 368, 268, 360, 270 546 546 ; COM Assignments: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 547 547 548 ALIGN JUMP_ALIGN 549 SerialCommand_AutoSerial: 548 ALIGN JUMP_ALIGN 549 SerialCommand_AutoSerial: 550 550 mov di,SerialCommand_ScanPortAddresses-1 551 551 552 552 .nextPort: 553 553 inc di ; load next port address 554 554 mov dl,[cs:di] 555 555 556 556 mov dh,0 ; shift from one byte to two 557 shl dx,1 558 shl dx,1 557 eSHL_IM dx, 2 559 558 jz .exitNotFound 560 559 561 560 ; 562 561 ; Test for COM port presence, write to and read from registers 563 ; 564 push dx 562 ; 563 push dx 565 564 add dl,SerialCommand_UART_lineControl 566 565 mov al, 09ah … … 569 568 pop dx 570 569 cmp al, 09ah 571 jnz .nextPort 570 jnz .nextPort 572 571 573 572 mov al, 0ch … … 579 578 ; 580 579 ; Pack into dl, baud rate starts at 0 581 ; 580 ; 582 581 add dx,-(SerialCommand_PackedPortAndBaud_StartingPort) 583 582 shr dx,1 584 583 585 584 jmp .testFirstBaud 586 585 587 586 ; 588 587 ; Walk through 4 possible baud rates 589 ; 590 .nextBaud: 588 ; 589 .nextBaud: 591 590 inc dx 592 591 test dl,3 593 592 jz .nextPort 594 595 .testFirstBaud: 593 594 .testFirstBaud: 596 595 call SerialCommand_IdentifyDeviceInDL_DriveInBH 597 596 jc .nextBaud 598 597 599 598 ret 600 599 601 600 .exitNotFound: 601 stc 602 602 mov ah,1 603 stc604 603 605 604 ret -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm
r179 r181 18 18 or byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 19 19 mov al, byte [es:si+SerialCommand_IdentifyDevice_PackedPortAndBaud] 20 mov byte [d s:di+DPT.bSerialPortAndBaud], al20 mov byte [di+DPT.bSerialPortAndBaud], al 21 21 ret 22 22 23 -
trunk/XTIDE_Universal_BIOS/Src/Device/Timer.asm
r155 r181 59 59 %ifndef USE_AT 60 60 mov ax, 2 61 ; Fall to Delay_TimerTicksFromAX61 ; Fall to Timer_DelayTimerTicksFromAX 62 62 %else 63 63 push dx … … 68 68 mov ah, EVENT_WAIT 69 69 int BIOS_SYSTEM_INTERRUPT_15h 70 sti ; XT BIOSes return with interrupt disabled70 sti ; XT BIOSes return with interrupts disabled. TODO: Maybe we can remove this since it's in an AT-only block? 71 71 72 72 pop cx -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r176 r181 53 53 cmp ah, 48h 54 54 ja SHORT Int13h_UnsupportedFunction 55 sub b x, 41h<<1 ; BX = Offset to eINT 13h jump table56 j lSHORT Int13h_UnsupportedFunction55 sub bl, 41h<<1 ; BX = Offset to eINT 13h jump table 56 jb SHORT Int13h_UnsupportedFunction 57 57 jmp [cs:bx+g_rgwEbiosFunctionJumpTable] 58 58 %endif … … 169 169 mov di, [RAMVARS.fpOldI13h+2] 170 170 xchg di, [es:BIOS_DISK_INTERRUPT_13h*4+2] 171 sti 171 172 mov [RAMVARS.fpOldI13h+2], di 172 sti173 173 pop es 174 174 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
r170 r181 60 60 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 61 61 pop bx 62 j c SHORT .DisableBlockMode63 64 ; Store new block size to DPT and return65 mov [di+DPT_ATA.bSetBlock], bl ; Store new block size62 jnc .StoreBlockSize 63 mov bl, 1 ; Disable block mode 64 .StoreBlockSize: ; Store new block size to DPT and return 65 mov [di+DPT_ATA.bSetBlock], bl 66 66 ret 67 .DisableBlockMode:68 mov BYTE [di+DPT_ATA.bSetBlock], 1 ; Disable block mode69 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm
r176 r181 5 5 SECTION .text 6 6 7 %ifdef MODULE_EBIOS8 7 ;-------------------------------------------------------------------- 9 8 ; CommandLookup_GetEbiosIndexToBX … … 16 15 ; AX, DX 17 16 ;-------------------------------------------------------------------- 17 %ifdef MODULE_EBIOS 18 18 ALIGN JUMP_ALIGN 19 19 CommandLookup_GetEbiosIndexToBX: … … 29 29 ret 30 30 %endif 31 31 32 32 ;-------------------------------------------------------------------- 33 33 ; CommandLookup_GetOldInt13hIndexToBX … … 63 63 db COMMAND_VERIFY_SECTORS_EXT 64 64 db COMMAND_VERIFY_SECTORS 65 db COMMAND_VERIFY_SECTORS_EXT 65 db COMMAND_VERIFY_SECTORS_EXT 66 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r174 r181 121 121 ;-------------------------------------------------------------------- 122 122 AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI: 123 call Registers_ExchangeDSSIwithESDI ; ATA info now in DSDI 123 mov bx, Registers_ExchangeDSSIwithESDI 124 call bx ; ATA info now in DS:DI 125 push bx ; We will return via Registers_ExchangeDSSIwithESDI 124 126 xor bx, bx 125 127 test BYTE [di+ATA1.wCaps+1], A1_wCaps_LBA>>8 … … 133 135 ; Parameters: 134 136 ; BX: Zero 135 ; DS: SI: Ptr to 512-byte ATA information read from the drive137 ; DS:DI: Ptr to 512-byte ATA information read from the drive 136 138 ; Returns: 137 139 ; BX:DX:AX: 48-bit sector count … … 145 147 mov dx, [di+ATA6.qwLBACnt+2] 146 148 mov bx, [di+ATA6.qwLBACnt+4] 147 jmp SHORT .ExchangePtrAndReturn149 ret 148 150 149 151 .GetLba28SectorCount: 150 152 mov ax, [di+ATA1.dwLBACnt] 151 153 mov dx, [di+ATA1.dwLBACnt+2] 152 jmp SHORT .ExchangePtrAndReturn154 ret 153 155 154 156 .GetChsSectorCount: … … 156 158 mul BYTE [di+ATA1.wHeadCnt] ; AX=Sectors per track * number of heads 157 159 mul WORD [di+ATA1.wCylCnt] ; DX:AX=Sectors per track * number of heads * number of cylinders 158 .ExchangePtrAndReturn: 159 jmp Registers_ExchangeDSSIwithESDI 160 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm
r148 r181 55 55 ; DL: Translated drive number 56 56 ; Corrupts registers: 57 ; Nothing57 ; AL 58 58 ;-------------------------------------------------------------------- 59 59 ALIGN JUMP_ALIGN … … 62 62 je SHORT .SwapToXXhInAL 63 63 cmp al, dl ; Swap DL from xxh to 00h/80h? 64 je SHORT .SwapTo00hOr80hInAH 65 ret 66 ALIGN JUMP_ALIGN 67 .SwapTo00hOr80hInAH: 68 mov dl, ah 69 ret 64 jne SHORT .Return 65 mov al, ah 70 66 ALIGN JUMP_ALIGN 71 67 .SwapToXXhInAL: 72 68 mov dl, al 69 ALIGN JUMP_ALIGN, ret 70 .Return: 73 71 ret 74 72 … … 83 81 ; Nothing 84 82 ; Corrupts registers: 85 ; AX83 ; Nothing 86 84 ;-------------------------------------------------------------------- 87 85 ALIGN JUMP_ALIGN -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r152 r181 136 136 call GetCountFromBDA 137 137 %endif 138 MAX_U cl, [cs:ROMVARS.bMinFddCnt] 138 mov ch, [cs:ROMVARS.bMinFddCnt] 139 MAX_U cl, ch 140 pop es 139 141 xor ch, ch 140 pop es141 142 ret 142 143 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r162 r181 29 29 ;-------------------------------------------------------------------- 30 30 .InitializeInt13hAnd40h: 31 mov ax, [es:BIOS_DISK_INTERRUPT_13h*4+2]; Load old INT 13h segment 32 mov [RAMVARS.fpOldI13h+2], ax ; Store old INT 13h segment 33 xchg dx, ax 31 34 mov ax, [es:BIOS_DISK_INTERRUPT_13h*4] ; Load old INT 13h offset 32 mov dx, [es:BIOS_DISK_INTERRUPT_13h*4+2]; Load old INT 13h segment33 35 mov [RAMVARS.fpOldI13h], ax ; Store old INT 13h offset 34 mov [RAMVARS.fpOldI13h+2], dx ; Store old INT 13h segment 36 35 37 mov bx, BIOS_DISK_INTERRUPT_13h ; INT 13h interrupt vector offset 36 38 mov si, Int13h_DiskFunctionsHandler ; Interrupt handler offset -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r179 r181 3 3 ; : aitotat@gmail.com 4 4 ; : 5 ; : Greg Lindhorst 6 ; : gregli@hotmail.com 7 ; ; 5 8 ; : Krister Nordvall 6 9 ; : krille_n_@hotmail.com … … 13 16 14 17 15 ; Included .inc files16 %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!17 %include "IntController.inc" ; For Interrupt Controller equates18 %include "ATA_ID.inc" ; For ATA Drive Information structs19 %include "IdeRegisters.inc" ; For ATA Registers, flags and commands20 %include "Int13h.inc" ; Equates for INT 13h functions18 ; Included .inc files 19 %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first! 20 %include "IntController.inc" ; For Interrupt Controller equates 21 %include "ATA_ID.inc" ; For ATA Drive Information structs 22 %include "IdeRegisters.inc" ; For ATA Registers, flags and commands 23 %include "Int13h.inc" ; Equates for INT 13h functions 21 24 %ifdef MODULE_EBIOS 22 %include "EBIOS.inc" ; Equates for EBIOS functions23 %endif 24 %include "CustomDPT.inc" ; For Disk Parameter Table25 %include "RomVars.inc" ; For ROMVARS and IDEVARS structs26 %include "RamVars.inc" ; For RAMVARS struct27 %include "BootVars.inc" ; For BOOTVARS and BOOTNFO structs28 %include "BootMenu.inc" ; For Boot Menu29 %include "IDE_8bit.inc" ; For IDE 8-bit data port macros30 %include "DeviceIDE.inc" ; For IDE device equates25 %include "EBIOS.inc" ; Equates for EBIOS functions 26 %endif 27 %include "CustomDPT.inc" ; For Disk Parameter Table 28 %include "RomVars.inc" ; For ROMVARS and IDEVARS structs 29 %include "RamVars.inc" ; For RAMVARS struct 30 %include "BootVars.inc" ; For BOOTVARS and BOOTNFO structs 31 %include "BootMenu.inc" ; For Boot Menu 32 %include "IDE_8bit.inc" ; For IDE 8-bit data port macros 33 %include "DeviceIDE.inc" ; For IDE device equates 31 34 32 35 … … 39 42 at ROMVARS.wRomSign, dw 0AA55h ; PC ROM signature 40 43 at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks 41 at ROMVARS.rgbJump, 44 at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch 42 45 at ROMVARS.rgbSign, db "XTIDE120" ; Signature for flash program 43 46 at ROMVARS.szTitle … … 53 56 54 57 ;;; For OR'ing into wFlags below 55 ;;; 58 ;;; 56 59 %ifdef MODULE_SERIAL 57 MAIN_FLG_MODULE_SERIAL equFLG_ROMVARS_MODULE_SERIAL58 %else 59 MAIN_FLG_MODULE_SERIAL equ060 MAIN_FLG_MODULE_SERIAL equ FLG_ROMVARS_MODULE_SERIAL 61 %else 62 MAIN_FLG_MODULE_SERIAL equ 0 60 63 %endif 61 64 62 65 %ifdef MODULE_EBIOS 63 MAIN_FLG_MODULE_EBIOS equFLG_ROMVARS_MODULE_EBIOS64 %else 65 MAIN_FLG_MODULE_EBIOS equ066 MAIN_FLG_MODULE_EBIOS equ FLG_ROMVARS_MODULE_EBIOS 67 %else 68 MAIN_FLG_MODULE_EBIOS equ 0 66 69 %endif 67 70 … … 109 112 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT 110 113 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 111 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 112 %endif 114 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 115 %endif 113 116 %else 114 117 ;-----------------------------------; … … 142 145 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT 143 146 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 144 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 145 %endif 147 at ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE 148 %endif 146 149 %endif 147 150 iend 148 151 149 152 150 ; Libraries and data151 %include "AssemblyLibrary.asm"152 %include "Strings.asm" ; For BIOS message strings153 154 ; Initialization and drive detection155 %include "Initialize.asm" ; For BIOS initialization156 %include "Interrupts.asm" ; For Interrupt initialization157 %include "RamVars.asm" ; For RAMVARS initialization and access158 %include "CreateDPT.asm" ; For creating DPTs159 %include "FindDPT.asm" ; For finding DPTs160 %include "AccessDPT.asm" ; For accessing DPTs161 %include "BootInfo.asm" ; For creating BOOTNFO structs162 %include "AtaID.asm" ; For ATA Identify Device information163 %include "DetectDrives.asm" ; For detecting IDE drives164 %include "DetectPrint.asm" ; For printing drive detection strings165 166 ; Boot menu167 %include "BootMenu.asm" ; For Boot Menu operations168 %include "BootMenuEvent.asm" ; For menu library event handling169 %include "FloppyDrive.asm" ; Floppy Drive related functions170 %include "BootSector.asm" ; For loading boot sector171 %include "BootPrint.asm" ; For printing boot information172 %include "BootMenuPrint.asm" ; For printing Boot Menu strings173 %include "BootMenuPrintCfg.asm" ; For printing hard disk configuration174 175 ; Boot loader153 ; Libraries and data 154 %include "AssemblyLibrary.asm" 155 %include "Strings.asm" ; For BIOS message strings 156 157 ; Initialization and drive detection 158 %include "Initialize.asm" ; For BIOS initialization 159 %include "Interrupts.asm" ; For Interrupt initialization 160 %include "RamVars.asm" ; For RAMVARS initialization and access 161 %include "CreateDPT.asm" ; For creating DPTs 162 %include "FindDPT.asm" ; For finding DPTs 163 %include "AccessDPT.asm" ; For accessing DPTs 164 %include "BootInfo.asm" ; For creating BOOTNFO structs 165 %include "AtaID.asm" ; For ATA Identify Device information 166 %include "DetectDrives.asm" ; For detecting IDE drives 167 %include "DetectPrint.asm" ; For printing drive detection strings 168 169 ; Boot menu 170 %include "BootMenu.asm" ; For Boot Menu operations 171 %include "BootMenuEvent.asm" ; For menu library event handling 172 %include "FloppyDrive.asm" ; Floppy Drive related functions 173 %include "BootSector.asm" ; For loading boot sector 174 %include "BootPrint.asm" ; For printing boot information 175 %include "BootMenuPrint.asm" ; For printing Boot Menu strings 176 %include "BootMenuPrintCfg.asm" ; For printing hard disk configuration 177 178 ; Boot loader 176 179 %ifndef USE_AT 177 %include "Int19hLate.asm" ; For late initialization 178 %endif 179 %include "Int19hMenu.asm" ; For Int 19h, Boot Loader for Boot Menu 180 181 ; For all device types 182 %include "Device.asm" 183 %include "Idepack.asm" 184 %include "Timer.asm" ; For timeout and delay 185 186 ; IDE Device support 187 %include "IdeCommand.asm" 188 %include "IdeTransfer.asm" ; Must be included after IdeCommand.asm 189 %include "IdeDPT.asm" 190 %include "IdeIO.asm" 191 %include "IdeIrq.asm" 192 %include "IdeWait.asm" 193 %include "IdeError.asm" ; Must be included after IdeWait.asm 194 195 %ifdef MODULE_SERIAL 196 ; Serial Port Device support 197 %include "SerialCommand.asm" 198 %include "SerialDPT.asm" 199 %endif 200 201 ; INT 13h Hard Disk BIOS functions 202 %include "DriveXlate.asm" ; For swapping drive numbers 203 %include "Address.asm" ; For sector address translations 204 %include "CommandLookup.asm" ; For getting correct transfer command 205 %include "Int13h.asm" ; For Int 13h, Disk functions 206 %include "AH0h_HReset.asm" ; Required by Int13h_Jump.asm 207 %include "AH1h_HStatus.asm" ; Required by Int13h_Jump.asm 208 %include "AH2h_HRead.asm" ; Required by Int13h_Jump.asm 209 %include "AH3h_HWrite.asm" ; Required by Int13h_Jump.asm 210 %include "AH4h_HVerify.asm" ; Required by Int13h_Jump.asm 211 %include "AH8h_HParams.asm" ; Required by Int13h_Jump.asm 212 %include "AH9h_HInit.asm" ; Required by Int13h_Jump.asm 213 %include "AHCh_HSeek.asm" ; Required by Int13h_Jump.asm 214 %include "AHDh_HReset.asm" ; Required by Int13h_Jump.asm 215 %include "AH10h_HReady.asm" ; Required by Int13h_Jump.asm 216 %include "AH11h_HRecal.asm" ; Required by Int13h_Jump.asm 217 %include "AH15h_HSize.asm" ; Required by Int13h_Jump.asm 218 %include "AH23h_HFeatures.asm" ; Required by Int13h_Jump.asm 219 %include "AH24h_HSetBlocks.asm" ; Required by Int13h_Jump.asm 220 %include "AH25h_HDrvID.asm" ; Required by Int13h_Jump.asm 180 %include "Int19hLate.asm" ; For late initialization 181 %endif 182 %include "Int19hMenu.asm" ; For Int 19h, Boot Loader for Boot Menu 183 184 ; For all device types 185 %include "Device.asm" 186 %include "Idepack.asm" 187 %include "Timer.asm" ; For timeout and delay 188 189 ; IDE Device support 190 %include "IdeCommand.asm" 191 %include "IdeTransfer.asm" ; Must be included after IdeCommand.asm 192 %include "IdeDPT.asm" 193 %include "IdeIO.asm" 194 %include "IdeIrq.asm" 195 %include "IdeWait.asm" 196 %include "IdeError.asm" ; Must be included after IdeWait.asm 197 198 %ifdef MODULE_SERIAL ; Serial Port Device support 199 %include "SerialCommand.asm" 200 %include "SerialDPT.asm" 201 %endif 202 203 ; INT 13h Hard Disk BIOS functions 204 %include "DriveXlate.asm" ; For swapping drive numbers 205 %include "Address.asm" ; For sector address translations 206 %include "CommandLookup.asm" ; For getting correct transfer command 207 %include "Int13h.asm" ; For Int 13h, Disk functions 208 %include "AH0h_HReset.asm" ; Required by Int13h_Jump.asm 209 %include "AH1h_HStatus.asm" ; Required by Int13h_Jump.asm 210 %include "AH2h_HRead.asm" ; Required by Int13h_Jump.asm 211 %include "AH3h_HWrite.asm" ; Required by Int13h_Jump.asm 212 %include "AH4h_HVerify.asm" ; Required by Int13h_Jump.asm 213 %include "AH8h_HParams.asm" ; Required by Int13h_Jump.asm 214 %include "AH9h_HInit.asm" ; Required by Int13h_Jump.asm 215 %include "AHCh_HSeek.asm" ; Required by Int13h_Jump.asm 216 %include "AHDh_HReset.asm" ; Required by Int13h_Jump.asm 217 %include "AH10h_HReady.asm" ; Required by Int13h_Jump.asm 218 %include "AH11h_HRecal.asm" ; Required by Int13h_Jump.asm 219 %include "AH15h_HSize.asm" ; Required by Int13h_Jump.asm 220 %include "AH23h_HFeatures.asm" ; Required by Int13h_Jump.asm 221 %include "AH24h_HSetBlocks.asm" ; Required by Int13h_Jump.asm 222 %include "AH25h_HDrvID.asm" ; Required by Int13h_Jump.asm 221 223 %ifdef MODULE_EBIOS 222 %include "AH41h_CheckIfExtensionsPresent.asm"223 %include "AH42h_ExtendedReadSectors.asm"224 %include "AH43h_ExtendedWriteSectors.asm"225 %include "AH44h_ExtendedVerifySectors.asm"226 %include "AH47h_ExtendedSeek.asm"227 %include "AH48h_GetExtendedDriveParameters.asm"224 %include "AH41h_CheckIfExtensionsPresent.asm" 225 %include "AH42h_ExtendedReadSectors.asm" 226 %include "AH43h_ExtendedWriteSectors.asm" 227 %include "AH44h_ExtendedVerifySectors.asm" 228 %include "AH47h_ExtendedSeek.asm" 229 %include "AH48h_GetExtendedDriveParameters.asm" 228 230 %endif 229 231 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r173 r181 78 78 ; Only need to limit sectors for LBA assist 79 79 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 80 j nz SHORT .ReturnLbaAssistedLCHS80 jz SHORT AccessDPT_ShiftPCHinBXDXtoLCH 81 81 82 ; P-CHS to L-CHS translation when necessary83 j mp SHORT AccessDPT_ShiftPCHinBXDXtoLCH82 cmp WORD [di+DPT.dwCylinders+2], BYTE 0 83 jnz SHORT .Return_MAX_LCHS_CYLINDERS 84 84 85 .ReturnLbaAssistedLCHS: 86 cmp WORD [di+DPT.dwCylinders+2], BYTE 0 87 jz SHORT .LimitCylindersTo1024 85 ; Limit cylinders to 1024 86 cmp bx, MAX_LCHS_CYLINDERS 87 jb SHORT .Return 88 ALIGN JUMP_ALIGN 89 .Return_MAX_LCHS_CYLINDERS: 88 90 mov bx, MAX_LCHS_CYLINDERS 89 .LimitCylindersTo1024: 90 MIN_U bx, MAX_LCHS_CYLINDERS 91 ALIGN JUMP_ALIGN, ret 92 .Return: 91 93 ret 92 94 … … 114 116 jmp SHORT .ShiftLoop 115 117 .LimitHeadsTo255: ; DOS does not support drives with 256 heads 116 sub dl, dh ; BH set only when 256 logical heads118 sub dl, dh ; DH set only when 256 logical heads 117 119 xor dh, dh 118 120 ret -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
r175 r181 66 66 %ifdef MODULE_SERIAL 67 67 cmp byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 68 jnz . around68 jnz .StoreAddressing 69 69 or byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 70 .around: 71 %endif 72 70 %endif 73 71 ; Fall to .StoreAddressing 74 72 … … 117 115 118 116 ; We need to get number of bits to shift for translation 119 push bx120 117 push ax 121 118 eMOVZX dx, bl ; Heads now in DX 122 xchg bx, ax ; Sectors now in BX 123 call AccessDPT_ShiftPCHinBXDXtoLCH 119 xchg bx, ax ; Cylinders now in BX 120 call AccessDPT_ShiftPCHinBXDXtoLCH ; Leaves AX untouched 121 xchg bx, ax ; Restore HeadsAndSectors to BX 124 122 or cl, ADDRESSING_MODE_PCHS<<ADDRESSING_MODE_FIELD_POSITION 125 123 or [di+DPT.bFlagsLow], cl ; Store bits to shift 126 124 pop ax 127 pop bx128 125 ; Fall to .StoreChsFromAXBX 129 126 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r161 r181 167 167 ; CF: Set if wanted DPT found 168 168 ; Cleared if DPT not found 169 ; Unchanged if no drives 169 170 ; Corrupts registers: 170 171 ; Nothing unless corrupted by callback function -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r155 r181 93 93 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE 94 94 jnz SHORT .GetStolenSegmentToDS 95 %ifndef USE_186 95 96 mov di, LITE_MODE_RAMVARS_SEGMENT 96 97 mov ds, di 98 %else 99 push LITE_MODE_RAMVARS_SEGMENT 100 pop ds 101 %endif 97 102 ret 98 103 … … 183 188 LOAD_BDA_SEGMENT_TO es, cx, ! ; Zero CX 184 189 call RamVars_GetCountOfKnownDrivesToDL 185 MAX_U dl, [es:BDA.bHDCount]186 movcl, dl190 mov cl, [es:BDA.bHDCount] 191 MAX_U cl, dl 187 192 188 193 pop dx -
trunk/XTIDE_Universal_BIOS/makefile
r176 r181 65 65 # Assembler preprocessor defines. # 66 66 ################################################################# 67 DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS 67 DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS MODULE_SERIAL 68 68 DEFINES_XT = ELIMINATE_CGA_SNOW 69 69 DEFINES_XTPLUS = ELIMINATE_CGA_SNOW USE_186
Note:
See TracChangeset
for help on using the changeset viewer.