Changeset 630 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Dec 31, 2024, 3:38:24 PM (9 days ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r625 r630 4 4 ; 5 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-202 3by XTIDE Universal BIOS Team.6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team. 7 7 ; 8 8 ; This program is free software; you can redistribute it and/or modify … … 39 39 mov al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN 40 40 ; --- 41 %define IO_SEQUENCE ; Do not modify DX while this is in effect! 41 42 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 42 43 mov ax, HSR0_RESET_WAIT_US … … 52 53 ; --- 53 54 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 55 %undef IO_SEQUENCE ; DX can be freely modified again. 54 56 mov ax, HSR1_RESET_WAIT_US 55 57 call Timer_DelayMicrosecondsFromAX … … 277 279 ALIGN JUMP_ALIGN 278 280 OutputSectorCountAndAddress: 281 %define IO_SEQUENCE ; Do not modify DX while this is in effect! 279 282 OUTPUT_AL_TO_IDE_REGISTER SECTOR_COUNT_REGISTER 280 283 … … 287 290 mov al, ch 288 291 OUTPUT_AL_TO_IDE_REGISTER LBA_HIGH_REGISTER 292 %undef IO_SEQUENCE ; DX can be freely modified again. 289 293 ret 290 294 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r625 r630 4 4 ; 5 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-202 3by XTIDE Universal BIOS Team.6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team. 7 7 ; 8 8 ; This program is free software; you can redistribute it and/or modify … … 264 264 265 265 ; Convert ES:SI to physical address 266 %ifdef USE_386 267 mov dx, es 268 xor ax, ax 269 shld ax, dx, 4 270 shl dx, 4 271 add si, dx 272 adc al, ah 273 mov es, ax 274 275 %elifdef USE_186 276 %ifdef USE_NEC_V 277 mov dx, es 278 xor ax, ax 279 eROL4 dl 280 eROL4 dh 281 add si, dx 282 adc al, ah 283 mov es, ax 284 285 %else 286 mov ax, es 287 rol ax, 4 288 mov dx, ax 289 and ax, 0Fh 290 xor dx, ax 291 add si, dx 292 adc al, ah 293 mov es, ax 294 295 %endif 266 %ifdef USE_386 ; 17 bytes 267 mov dx, es ; 2 268 xor ax, ax ; 2 269 shld ax, dx, 4 ; 3 270 shl dx, 4 ; 3 271 add si, dx ; 2 272 adc al, ah ; 2 273 mov es, ax ; 2 274 ;------ 275 ; 16 cycles on 386 276 %elifdef USE_186 ; 17 bytes 277 mov ax, es ; 2 278 rol ax, 4 ; 3 279 mov dx, ax ; 2 280 and al, 0F0h ; 2 281 xor dx, ax ; 2 282 add si, ax ; 2 283 adc dl, dh ; 2 284 mov es, dx ; 2 285 ;------ 286 ; 17 cycles on 386 296 287 %else ; 808x 297 288 mov al, 4 … … 301 292 mov cx, dx 302 293 xchg cx, ax 303 and a x, 0Fh294 and al, 0F0h 304 295 xor dx, ax 305 add si, dx306 adc al, ah307 mov es, ax296 add si, ax 297 adc dl, dh 298 mov es, dx 308 299 309 300 %endif -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r597 r630 4 4 ; 5 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-20 13by XTIDE Universal BIOS Team.6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team. 7 7 ; 8 8 ; This program is free software; you can redistribute it and/or modify … … 28 28 ; Returns: 29 29 ; ES:BX: Ptr to boot sector (if successful) 30 ; CF: Set if boot sector loaded successfully 31 ; Cleared if failed to load boot sector 30 ; CF: Cleared if boot sector loaded successfully 31 ; (only matters when jumping to 32 ; Int19h_JumpToBootSectorInESBXOrRomBoot) 32 33 ; Corrupts registers: 33 ; AX, CX, DH, SI, DI , (DL if failed to read boot sector)34 ; AX, CX, DH, SI, DI 34 35 ;-------------------------------------------------------------------- 35 36 BootSector_TryToLoadFromDriveDL_AndBoot: 36 37 call DetectPrint_TryToBootFromDL 37 38 call BootSector_LoadFirstSectorFromDriveDL 39 inc dx ; Determine if hard drive or floppy drive without changing the CF 40 dec dl 38 41 jnc SHORT .FirstSectorLoadedToESBX 39 42 … … 42 45 ; display error code every time user intends to boot from hard disk 43 46 ; when A then C boot order is used. 44 test dl, dl 45 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 47 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 46 48 cmp ah, RET_HD_TIMEOUT 47 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector49 je SHORT BootSector_LoadFirstSectorFromDriveDL.Return 48 50 cmp ah, RET_HD_NOMEDIA 49 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector51 je SHORT BootSector_LoadFirstSectorFromDriveDL.Return 50 52 .PrintFailedToLoadErrorCode: 51 call DetectPrint_FailedToLoadFirstSector 52 jmp SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 53 53 jmp DetectPrint_FailedToLoadFirstSector 54 54 55 55 .FirstSectorLoadedToESBX: 56 test dl, dl 57 jns SHORT .AlwaysBootFromFloppyDriveForBooterGames 58 cmp WORD [es:bx+510], 0AA55h ; Valid boot sector? 59 jne SHORT .FirstHardDiskSectorNotBootable 60 .AlwaysBootFromFloppyDriveForBooterGames: 61 clc ; Boot Sector loaded successfully 62 jmp SHORT Int19h_JumpToBootSectorInESBXOrRomBoot 63 64 .FirstHardDiskSectorNotBootable: 56 jns SHORT Int19h_JumpToBootSectorInESBXOrRomBoot ; Don't check for boot sector signature for floppy booter games 57 cmp WORD [es:bx+510], 0AA55h ; Valid boot sector? 58 je SHORT Int19h_JumpToBootSectorInESBXOrRomBoot ; With CF cleared 65 59 mov si, g_szBootSectorNotFound 66 call DetectPrint_NullTerminatedStringFromCSSI 67 .ReturnWithCFclearSinceFailedToLoadBootSector: 68 clc 69 ret 60 jmp DetectPrint_NullTerminatedStringFromCSSI 70 61 71 62 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r593 r630 4 4 ; 5 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-20 13by XTIDE Universal BIOS Team.6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team. 7 7 ; 8 8 ; This program is free software; you can redistribute it and/or modify … … 141 141 AccessDPT_GetPointerToDRVPARAMStoCSBX: 142 142 call AccessDPT_GetIdevarsToCSBX 143 add bx, BYTE IDEVARS.drvParamsMaster ; CS:BX points to MasterDrive DRVPARAMS143 add bx, BYTE IDEVARS.drvParamsMaster+DRVPARAMS_size ; CS:BX points to Slave Drive DRVPARAMS 144 144 test BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE 145 j z SHORT .ReturnPointerToDRVPARAMS146 add bx, BYTE DRVPARAMS_size ; CS:BX points to SlaveDrive DRVPARAMS147 .Return PointerToDRVPARAMS:145 jnz SHORT .Return 146 sub bx, BYTE DRVPARAMS_size ; CS:BX points to Master Drive DRVPARAMS 147 .Return: 148 148 ret 149 149
Note:
See TracChangeset
for help on using the changeset viewer.