Changeset 589 in xtideuniversalbios
- Timestamp:
- May 22, 2016, 12:26:57 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 74 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/CgaSnow.inc
r52 r589 1 ; File name : CgaSnow.inc 2 ; Project name : AssemblyLibrary 3 ; Created date : 8.10.2010 4 ; Last update : 11.10.2010 5 ; Author : Tomi Tilli 1 ; Project name : Assembly Library 6 2 ; Description : Macros for preventing CGA snow. 7 3 %ifndef CGASNOW_INC … … 9 5 10 6 ;-------------------------------------------------------------------- 11 ; WAIT_RETRACE_IF_NECESSARY_THEN 7 ; CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN 8 ; JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN 12 9 ; Parameters: 13 10 ; %1: Instruction that accessed CGA memory … … 22 19 ; AX, DX 23 20 ;-------------------------------------------------------------------- 24 %macro WAIT_RETRACE_IF_NECESSARY_THEN 121 %macro CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN 1 25 22 %ifdef ELIMINATE_CGA_SNOW 26 23 %ifidn %1, stosb … … 31 28 call CgaSnow_RepMovsb 32 29 %else 33 %error "Invalid instruction passed to WAIT_RETRACE_IF_NECESSARY_THEN"30 %error "Invalid instruction passed to CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN" 34 31 %endif 35 32 %else ; No CGA snow prevention … … 38 35 %else 39 36 %1 ; Single instruction 37 %endif 38 %endif 39 %endmacro 40 41 %macro JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN 1 42 %ifdef ELIMINATE_CGA_SNOW 43 %ifidn %1, stosb 44 jmp CgaSnow_Stosb 45 %elifidn %1, stosw 46 jmp CgaSnow_Stosw 47 %elifidn %1, rep movsb 48 jmp CgaSnow_RepMovsb 49 %else 50 %error "Invalid instruction passed to JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN" 51 %endif 52 %else ; No CGA snow prevention 53 %ifidn %1, rep movsb 54 eSEG_STR rep, es, movsb 55 ret 56 %else 57 %1 ; Single instruction 58 ret 40 59 %endif 41 60 %endif -
trunk/Assembly_Library/Inc/DosFunctions.inc
r446 r589 9 9 DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh 10 10 11 ; DOS drive and file functions 12 SELECT_DEFAULT_DRIVE EQU 0Eh 13 GET_CURRENT_DEFAULT_DRIVE EQU 19h 14 GET_DISK_TRANSFER_AREA_ADDRESS EQU 2Fh 15 GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE EQU 32h 16 SET_CURRENT_DIRECTORY EQU 3Bh 17 CREATE_OR_TRUNCATE_FILE EQU 3Ch 18 OPEN_EXISTING_FILE EQU 3Dh 19 CLOSE_FILE EQU 3Eh 20 READ_FROM_FILE_OR_DEVICE EQU 3Fh 21 WRITE_TO_FILE_OR_DEVICE EQU 40h 22 SET_CURRENT_FILE_POSITION EQU 42h 23 GET_CURRENT_DIRECTORY EQU 47h 24 FIND_FIRST_MATCHING_FILE EQU 4Eh 25 FIND_NEXT_MATCHING_FILE EQU 4Fh 26 27 ; DOS functions for TSRs 28 SET_INTERRUPT_VECTOR EQU 25h 29 GET_INTERRUPT_VECTOR EQU 35h 11 ; DOS functions 12 WRITE_CHARACTER_TO_STANDARD_OUTPUT EQU 02h ; DOS 1+ 13 WRITE_STRING_TO_STANDARD_OUTPUT EQU 09h ; DOS 1+ 14 SELECT_DEFAULT_DRIVE EQU 0Eh ; DOS 1+ 15 GET_CURRENT_DEFAULT_DRIVE EQU 19h ; DOS 1+ 16 SET_INTERRUPT_VECTOR EQU 25h ; DOS 1+ 17 GET_DISK_TRANSFER_AREA_ADDRESS EQU 2Fh ; DOS 2+ 18 GET_DOS_VERSION EQU 30h ; DOS 2+ 19 GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE EQU 32h ; DOS 2+ 20 GET_INTERRUPT_VECTOR EQU 35h ; DOS 2+ 21 SET_CURRENT_DIRECTORY EQU 3Bh ; DOS 2+ 22 CREATE_OR_TRUNCATE_FILE EQU 3Ch ; DOS 2+ 23 OPEN_EXISTING_FILE EQU 3Dh ; DOS 2+ 24 CLOSE_FILE EQU 3Eh ; DOS 2+ 25 READ_FROM_FILE_OR_DEVICE EQU 3Fh ; DOS 2+ 26 WRITE_TO_FILE_OR_DEVICE EQU 40h ; DOS 2+ 27 SET_CURRENT_FILE_POSITION EQU 42h ; DOS 2+ 28 CHECK_IF_BLOCK_DEVICE_REMOTE EQU 4409h ; DOS 3.1+ 29 GET_CURRENT_DIRECTORY EQU 47h ; DOS 2+ 30 TERMINATE_WITH_RETURN_CODE EQU 4Ch ; DOS 2+ 31 FIND_FIRST_MATCHING_FILE EQU 4Eh ; DOS 2+ 32 FIND_NEXT_MATCHING_FILE EQU 4Fh ; DOS 2+ 30 33 31 34 ; DOS errors 35 ERR_DOS_FUNCTION_NUMBER_INVALID EQU 01h 36 ERR_DOS_INVALID_DRIVE EQU 0Fh 32 37 ERR_DOS_DRIVE_NOT_READY EQU 15h 33 34 38 35 39 -
trunk/Assembly_Library/Inc/Emulate.inc
r586 r589 579 579 580 580 %macro eRCL_IM 2 581 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 582 %ifdef USE_386 583 %if %2 = 1 584 adc %1, %1 ; Same size but faster on 386 and 486. Fails if %1 is a memory operand. 585 %else 586 eSHIFT_IM %1, %2, rcl 587 %endif 588 %else 581 589 eSHIFT_IM %1, %2, rcl 590 %endif 591 %endif 582 592 %endmacro 583 593 -
trunk/Assembly_Library/Inc/Math.inc
r445 r589 80 80 .ShiftNextBit: 81 81 eSHL_IM ax, 1 82 rcldx, 182 eRCL_IM dx, 1 83 83 loop .ShiftNextBit 84 84 %endmacro -
trunk/Assembly_Library/Inc/SystemTimer.inc
r287 r589 1 1 ; Project name : Assembly Library 2 ; Description : System Timer (8254) relate sequates and macros.2 ; Description : System Timer (8254) related equates and macros. 3 3 %ifndef SYSTEMTIMER_INC 4 4 %define SYSTEMTIMER_INC … … 34 34 CONTROL_WORD_REGISTER_out EQU 43h 35 35 36 ; Timer 2 is connected to PC Speaker that can be controlle rfrom port 61h.36 ; Timer 2 is connected to PC Speaker that can be controlled from port 61h. 37 37 SPEAKER_CONTROL_REGISTER EQU 61h 38 38 FLG_TIMER_2_OUTPUT_in EQU (1<<5) ; AT+ only -
trunk/Assembly_Library/Src/Display/DisplayCharOut.asm
r526 r589 41 41 cmp al, ' ' ; Printable character? 42 42 jb SHORT DisplayCharOut_BiosTeletypeOutput 43 WAIT_RETRACE_IF_NECESSARY_THEN stosw 44 ret 43 JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN stosw 45 44 46 45 ALIGN DISPLAY_JUMP_ALIGN … … 96 95 xchg al, ah ; Swap character and attribute 97 96 inc di ; Skip character 98 WAIT_RETRACE_IF_NECESSARY_THEN stosb 99 ret 97 JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN stosb 100 98 101 99 ALIGN DISPLAY_JUMP_ALIGN 102 100 DisplayCharOut_Character: 103 WAIT_RETRACE_IF_NECESSARY_THEN stosb101 CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN stosb 104 102 inc di ; Skip attribute 105 103 ret … … 107 105 ALIGN DISPLAY_JUMP_ALIGN 108 106 DisplayCharOut_CharacterWithAttribute: 109 WAIT_RETRACE_IF_NECESSARY_THEN stosw 110 ret 107 JMP_WAIT_FOR_RETRACE_IF_NECESSARY_THEN stosw 111 108 112 109 -
trunk/Assembly_Library/Src/Display/DisplayFormat.asm
r526 r589 269 269 jz SHORT .CopyWithoutDisplayProcessing 270 270 271 WAIT_RETRACE_IF_NECESSARY_THEN rep movsb271 CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN rep movsb 272 272 dec di ; Point to preceeding character instead of attribute 273 273 ret 274 274 275 ALIGN DISPLAY_JUMP_ALIGN 275 276 .CopyWithoutDisplayProcessing: -
trunk/Assembly_Library/Src/Display/DisplayPage.asm
r526 r589 43 43 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 44 44 %define EXCLUDE 45 %ifdef MODULE_HOTKEYS 46 %undef EXCLUDE 47 %endif 48 %ifdef MODULE_BOOT_MENU 45 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU 49 46 %undef EXCLUDE 50 47 %endif -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r580 r589 296 296 %undef EXCLUDE 297 297 %endif 298 %ifdef MODULE_HOTKEYS 299 %undef EXCLUDE 300 %endif 301 %ifdef MODULE_BOOT_MENU 298 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU 302 299 %undef EXCLUDE 303 300 %endif -
trunk/Assembly_Library/Src/File/Drive.asm
r526 r589 86 86 xchg dx, ax ; Default drive to DL 87 87 call Drive_SetDefaultFromDL 88 eMOVZX cx, al; Number of potentially valid drive letters available89 cmp cl,3290 jb SHORT .Return91 mov cl, 32 92 ALIGN JUMP_ALIGN, ret 93 .Return: 88 cmp al, 32 ; Number of potentially valid drive letters available 89 jb SHORT .Below32 90 mov al, 32 91 .Below32: 92 cbw 93 xchg cx, ax 94 94 ret 95 95 … … 133 133 134 134 inc dx ; Default drive is 00h and first drive is 01h 135 mov ax, CHECK_IF_BLOCK_DEVICE_REMOTE ; Needs DOS 3.1+ 136 mov bx, dx 137 push dx 138 int DOS_INTERRUPT_21h 139 pop dx 140 jnc SHORT .DriveIsValid 141 cmp ax, ERR_DOS_INVALID_DRIVE 142 je SHORT .DriveIsNotValid 143 ; Fall back to old method if ERR_DOS_FUNCTION_NUMBER_INVALID 144 135 145 mov ah, GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE 136 146 int DOS_INTERRUPT_21h 147 .DriveIsValid: 148 .DriveIsNotValid: 137 149 dec dx 138 150 test al, al -
trunk/Assembly_Library/Src/Keyboard/Keyboard.asm
r581 r589 291 291 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 292 292 %define EXCLUDE 293 %ifdef MODULE_HOTKEYS 294 %undef EXCLUDE 295 %endif 296 %ifdef MODULE_BOOT_MENU 293 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU 297 294 %undef EXCLUDE 298 295 %endif -
trunk/Assembly_Library/Src/Menu/CharOutLineSplitter.asm
r526 r589 162 162 push si 163 163 push cx 164 WAIT_RETRACE_IF_NECESSARY_THEN rep movsb164 CALL_WAIT_FOR_RETRACE_IF_NECESSARY_THEN rep movsb 165 165 pop cx 166 166 pop si -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r568 r589 239 239 ; AppendFileFromDTAinDSSItoOffScreenBuffer 240 240 ; Parameters: 241 ; CX: Files/director es found241 ; CX: Files/directories found 242 242 ; DL: Zero if root directory selected 243 243 ; DS:SI: Ptr to DTA containing file information -
trunk/Assembly_Library/Src/Menu/MenuLoop.asm
r581 r589 106 106 %ifndef MENU_NO_ESC 107 107 cmp al, ESC 108 je SHORT .LeaveMenuWithoutSelectingItem 109 %endif 110 cmp al, CR 111 je SHORT .SelectItem 112 113 test BYTE [bp+MENU.bFlags], FLG_MENU_USER_HANDLES_SCROLLING 114 jz SHORT MenuLoop_ProcessScrollingKeysFromAX 115 ret ; Return with CF cleared since keystroke not processed 116 117 %ifndef MENU_NO_ESC 118 ALIGN MENU_JUMP_ALIGN 119 .LeaveMenuWithoutSelectingItem: 108 jne SHORT .NotEscape 109 110 ; Leave menu without selecting item 120 111 call MenuEvent_ExitMenu 121 112 jnc SHORT .CancelMenuExit … … 128 119 129 120 ALIGN MENU_JUMP_ALIGN 130 .SelectItem: 121 .NotEscape: 122 cmp al, CR 123 jne SHORT .NotCarriageReturn 124 125 ; Select item 131 126 mov cx, [bp+MENUINIT.wHighlightedItem] 132 127 call MenuEvent_ItemSelectedFromCX 133 128 stc 134 ret 129 .Return: 130 ret 131 132 ALIGN MENU_JUMP_ALIGN 133 .NotCarriageReturn: 134 test BYTE [bp+MENU.bFlags], FLG_MENU_USER_HANDLES_SCROLLING 135 jnz SHORT .Return ; With CF cleared since keystroke not processed 136 ; Fall to MenuLoop_ProcessScrollingKeysFromAX 135 137 136 138 … … 172 174 .ChangeToPreviousPage: 173 175 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 174 xchg ax, cx 175 neg ax 176 mov cx, [bp+MENUINIT.wHighlightedItem] 177 add cx, ax 176 neg cx 177 mov ax, cx 178 add cx, [bp+MENUINIT.wHighlightedItem] 178 179 jge SHORT .MoveHighlightedItemByAX ; No rotation for PgUp 179 180 ; Fall to .SelectFirstItem … … 187 188 .ChangeToNextPage: 188 189 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 189 xchg ax, cx 190 mov cx, [bp+MENUINIT.wHighlightedItem] 191 add cx, ax 190 mov ax, cx 191 add cx, [bp+MENUINIT.wHighlightedItem] 192 192 cmp cx, [bp+MENUINIT.wItems] 193 193 jb SHORT .MoveHighlightedItemByAX ; No rotation for PgDn -
trunk/Assembly_Library/Src/Serial/SerialServerScan.asm
r567 r589 46 46 47 47 test dx, dx 48 jnz shortSerialServerScan_CheckForServer_PortAndBaudInDX48 jnz SHORT SerialServerScan_CheckForServer_PortAndBaudInDX 49 49 50 mov di, .scanPortAddresses-151 mov ch, 1 ; tell server that we are scanning50 mov di, .scanPortAddresses-1 51 mov ch, 1 ; tell server that we are scanning 52 52 53 53 .nextPort: 54 54 inc di ; load next port address 55 xor dh, dh56 mov dl, [cs:di]55 mov dh, 40h ; Clear DH and make sure CF is set if error 56 mov dl, [cs:di] 57 57 eSHL_IM dx, 2 ; shift from one byte to two 58 stc ; setup error code for exit 59 jz .error 58 jz SHORT .error 60 59 61 60 ; … … 63 62 ; 64 63 push dx 65 add dl, Serial_UART_lineControl66 mov al, 09ah64 add dl, Serial_UART_lineControl 65 mov al, 9Ah 67 66 out dx, al 68 67 in al, dx 69 68 pop dx 70 cmp al, 09ah71 jn z.nextPort69 cmp al, 9Ah 70 jne SHORT .nextPort 72 71 73 mov al, 0 ch72 mov al, 0Ch 74 73 out dx, al 75 74 in al, dx 76 cmp al, 0 ch77 jn z.nextPort75 cmp al, 0Ch 76 jne SHORT .nextPort 78 77 79 78 ; … … 84 83 ; *on the server side* if the client side had a 4x clock multiplier, a 2x clock multiplier, or no clock multiplier. 85 84 ; 86 ; Starting with 30h, that means 30h (2400 baud), 18h (4800 baud), 0 ch (9600 baud), and85 ; Starting with 30h, that means 30h (2400 baud), 18h (4800 baud), 0Ch (9600 baud), and 87 86 ; 04h (28800 baud), 02h (57600 baud), 01h (115200 baud) 88 87 ; 89 ; Note: hardware baud multipliers (2x, 4x ) will impact the final baud rate and are not known at this level88 ; Note: hardware baud multipliers (2x, 4x, 8x) will impact the final baud rate and are not known at this level 90 89 ; 91 mov dh, 030h * 2 ; multiply by 2 since we are about to divide by 292 mov dl, [cs:di] ; restore single byte port address for scan90 mov dh, 30h * 2 ; multiply by 2 since we are about to divide by 2 91 mov dl, [cs:di] ; restore single byte port address for scan 93 92 94 93 .nextBaud: 95 shr dh, 196 jz .nextPort97 cmp dh, 6 ; skip from 6 to 4, to move from the top of the 9600 baud range98 jn z .testBaud; to the bottom of the 115200 baud range99 mov dh, 494 shr dh, 1 95 jz SHORT .nextPort 96 cmp dh, 6 ; skip from 6 to 4, to move from the top of the 9600 baud range 97 jne SHORT .testBaud ; to the bottom of the 115200 baud range 98 mov dh, 4 100 99 101 100 .testBaud: 102 101 call SerialServerScan_CheckForServer_PortAndBaudInDX 103 jc .nextBaud102 jc SHORT .nextBaud 104 103 105 104 .error: … … 135 134 SerialServerScan_CheckForServer_PortAndBaudInDX: 136 135 push bp ; setup fake SerialServer_Command 137 138 136 push dx ; send port baud and rate, returned in inquire packet 139 137 ; (and possibly returned in the drive identification string) 140 141 138 push cx ; send number of sectors, and if it is on a scan or not 142 143 mov bl,SerialServer_Command_Inquire ; protocol command onto stack with bh 139 mov bl, SerialServer_Command_Inquire ; protocol command onto stack with bh 144 140 push bx 145 141 146 mov bp,sp 147 142 mov bp, sp 148 143 call SerialServer_SendReceive 149 144 -
trunk/Assembly_Library/Src/Util/Math.asm
r526 r589 36 36 ALIGN JUMP_ALIGN 37 37 Math_DivQWatSSBPbyCX: 38 %if 1 38 39 xor dx, dx 39 40 mov ax, [bp+6] ; Load highest divident WORD to DX:AX … … 53 54 mov [bp], ax 54 55 ret 56 %else ; ~1 57 ; This is about half the size compared to the above code but it's not tested which is why it's commented away. 58 push di 59 mov di, 6 60 xor dx, dx 61 .Next: 62 mov ax, [bp+di] 63 div cx 64 mov [bp+di], ax 65 dec di 66 dec di 67 jns .Next 68 pop di 69 ret 70 %endif ; 1 55 71 %endif 56 72 -
trunk/BIOS_Drive_Information_Tool/Src/Bios.asm
r566 r589 146 146 mov bx, 55AAh 147 147 int BIOS_DISK_INTERRUPT_13h 148 jc SHORT .NoEbiosPresent 149 cmp bx, 0AA55h 150 jne SHORT .NoEbiosPresent 151 eMOVZX bx, ah ; Copy version to BX 152 xor ah, ah 153 ret 154 .NoEbiosPresent: 155 mov ah, RET_HD_INVALID 156 stc 148 jc SHORT ReturnInvalidErrorCodeInAH ; No EBIOS present 149 xor bx, 0AA55h 150 jnz SHORT ReturnInvalidErrorCodeInAH ; No EBIOS present 151 xchg bl, ah ; Version to BX, BIOS error code to AH 157 152 ret 158 153 -
trunk/BIOS_Drive_Information_Tool/Src/Main.asm
r558 r589 60 60 mov si, g_szProgramName 61 61 call Print_NullTerminatedStringFromSI 62 63 call ReadAndDisplayAllHardDrives 64 65 ; Exit to DOS 66 mov ax, 4C00h ; Exit to DOS 67 int 21h 62 ; Fall to ReadAndDisplayAllHardDrives 68 63 69 64 … … 112 107 loop .DisplayNextDriveFromDL 113 108 .NoDrivesAvailable: 114 ret 109 ret ; Exit to DOS 115 110 116 111 -
trunk/BIOS_Drive_Information_Tool/Src/Print.asm
r567 r589 42 42 ; Parameters: 43 43 ; AL: Character to output 44 ; DS: BDA segment (zero) 45 ; ES:DI: Ptr to video memory where to output 46 ; Returns: 47 ; DI: Incremented for next character 44 ; Returns: 45 ; Nothing 48 46 ; Corrupts registers: 49 47 ; AX, DX … … 51 49 DosCharOut: 52 50 xchg dx, ax 53 mov ah, 02h ; DOS 1+ - WRITE CHARACTER TO STANDARDOUTPUT54 int 21h ; Call DOS51 mov ah, WRITE_CHARACTER_TO_STANDARD_OUTPUT 52 int DOS_INTERRUPT_21h 55 53 ret 56 54 -
trunk/Serial_Server/library/Checksum.cpp
r526 r589 3 3 // Project: XTIDE Universal BIOS, Serial Port Server 4 4 // 5 // File: checksum.cpp - Checksum function and test routines5 // File: Checksum.cpp - Checksum function and test routines 6 6 7 7 // … … 39 39 // 40 40 41 #include " library.h"41 #include "Library.h" 42 42 43 43 unsigned short checksum( unsigned short *wbuff, int wlen ) -
trunk/Serial_Server/library/File.h
r526 r589 3 3 // Project: XTIDE Universal BIOS, Serial Port Server 4 4 // 5 // File: file.h - File access via standard "stdio.h" routines5 // File: File.h - File access via standard "stdio.h" routines 6 6 // 7 7 // Routines for accessing the file system using generic routines, which -
trunk/Serial_Server/library/FlatImage.h
r526 r589 22 22 // 23 23 24 #include " library.h"24 #include "Library.h" 25 25 26 26 class FlatImage : public Image -
trunk/Serial_Server/library/Image.cpp
r526 r589 3 3 // Project: XTIDE Universal BIOS, Serial Port Server 4 4 // 5 // File: image.cpp - Abstract base class for disk image support5 // File: Image.cpp - Abstract base class for disk image support 6 6 // 7 7 … … 22 22 // 23 23 24 #include " library.h"24 #include "Library.h" 25 25 #include <memory.h> 26 26 #include <stdlib.h> -
trunk/Serial_Server/library/Library.h
r526 r589 3 3 // Project: XTIDE Universal BIOS, Serial Port Server 4 4 // 5 // File: library.h - Include file for users of the library5 // File: Library.h - Include file for users of the library 6 6 // 7 7 … … 87 87 88 88 #ifdef WIN32 89 #include "../win32/ win32serial.h"89 #include "../win32/Win32Serial.h" 90 90 #else 91 91 // there is no standard way to read/write and configure the serial port, OS specific only … … 93 93 94 94 #ifdef WIN32 95 #include "../win32/ win32file.h"95 #include "../win32/Win32File.h" 96 96 #else 97 #include " file.h"97 #include "File.h" 98 98 #endif 99 99 -
trunk/Serial_Server/library/Process.cpp
r526 r589 3 3 // Project: XTIDE Universal BIOS, Serial Port Server 4 4 // 5 // File: process.cpp - Processes commands received over the serial port5 // File: Process.cpp - Processes commands received over the serial port 6 6 // 7 7 … … 22 22 // 23 23 24 #include " library.h"24 #include "Library.h" 25 25 #include <memory.h> 26 26 #include <string.h> -
trunk/Serial_Server/library/Serial.cpp
r526 r589 22 22 // 23 23 24 #include " library.h"24 #include "Library.h" 25 25 #include <stdlib.h> 26 26 #include <string.h> -
trunk/Serial_Server/makefile
r344 r589 11 11 # 12 12 13 HEADERS = library/ library.h win32/win32file.h win32/win32serial.h library/file.h library/flatimage.h13 HEADERS = library/Library.h win32/Win32File.h win32/Win32Serial.h library/File.h library/FlatImage.h 14 14 15 15 CXX = cl … … 21 21 @$(CXX) /Febuild/serdrive.exe $(WIN32OBJS) 22 22 23 build/win32.obj: win32/ win32.cpp $(HEADERS)24 @$(CXX) /c $(CXXFLAGS) win32/ win32.cpp /Fobuild/win32.obj23 build/win32.obj: win32/Win32.cpp $(HEADERS) 24 @$(CXX) /c $(CXXFLAGS) win32/Win32.cpp /Fobuild/win32.obj 25 25 26 build/checksum.obj: library/ checksum.cpp $(HEADERS)27 @$(CXX) /c $(CXXFLAGS) library/ checksum.cpp /Fobuild/checksum.obj26 build/checksum.obj: library/Checksum.cpp $(HEADERS) 27 @$(CXX) /c $(CXXFLAGS) library/Checksum.cpp /Fobuild/checksum.obj 28 28 29 build/serial.obj: library/ serial.cpp $(HEADERS)30 @$(CXX) /c $(CXXFLAGS) library/ serial.cpp /Fobuild/serial.obj29 build/serial.obj: library/Serial.cpp $(HEADERS) 30 @$(CXX) /c $(CXXFLAGS) library/Serial.cpp /Fobuild/serial.obj 31 31 32 build/process.obj: library/ process.cpp $(HEADERS)33 @$(CXX) /c $(CXXFLAGS) library/ process.cpp /Fobuild/process.obj32 build/process.obj: library/Process.cpp $(HEADERS) 33 @$(CXX) /c $(CXXFLAGS) library/Process.cpp /Fobuild/process.obj 34 34 35 build/image.obj: library/ image.cpp $(HEADERS)36 @$(CXX) /c $(CXXFLAGS) library/ image.cpp /Fobuild/image.obj35 build/image.obj: library/Image.cpp $(HEADERS) 36 @$(CXX) /c $(CXXFLAGS) library/Image.cpp /Fobuild/image.obj 37 37 38 38 … … 46 46 47 47 48 build/checksum_test.exe: library/ checksum.cpp49 @$(CXX) /Febuild/checksum_test.exe /Ox library/ checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST48 build/checksum_test.exe: library/Checksum.cpp 49 @$(CXX) /Febuild/checksum_test.exe /Ox library/Checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST 50 50 -
trunk/Serial_Server/win32/Win32.cpp
r526 r589 30 30 #include <stdarg.h> 31 31 32 #include "../library/ library.h"33 #include "../library/ flatimage.h"34 35 #include "../../XTIDE_Universal_BIOS/ inc/version.inc"32 #include "../library/Library.h" 33 #include "../library/FlatImage.h" 34 35 #include "../../XTIDE_Universal_BIOS/Inc/Version.inc" 36 36 37 37 char *bannerStrings[] = { -
trunk/Serial_Server/win32/Win32File.h
r526 r589 29 29 #include <windows.h> 30 30 #include <stdio.h> 31 #include "../library/ library.h"31 #include "../library/Library.h" 32 32 33 33 class FileAccess -
trunk/Serial_Server/win32/Win32Serial.h
r568 r589 24 24 #include <stdio.h> 25 25 #include "windows.h" 26 #include "../library/ library.h"26 #include "../library/Library.h" 27 27 28 28 #define PIPENAME "\\\\.\\pipe\\xtide" -
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r545 r589 41 41 .dwPostStack resb 4 ; POST stack pointer when entering INT 19h 42 42 %ifdef MODULE_HOTKEYS 43 .hotkeyVars 43 .hotkeyVars resb HOTKEYVARS_size 44 44 %endif 45 45 .rgDrvDetectInfo: ; Array containing DRVDETECTINFO structs -
trunk/XTIDE_Universal_BIOS/Inc/Controllers/AdvancedID.inc
r588 r589 32 32 ; Vision 33 33 ; QDI Vision Controller Identification nibbles used by hardware so do not modify these 34 ID_QD6580_ALTERNATE EQU 535 ID_QD6580 EQU 1 036 ID_QD6500 EQU 1 234 ID_QD6580_ALTERNATE EQU 80 35 ID_QD6580 EQU 160 36 ID_QD6500 EQU 192 37 37 38 38 -
trunk/XTIDE_Universal_BIOS/Inc/Controllers/PDC20x30.inc
r587 r589 2 2 ; Description : Promise PDC 20230-C and 20630 VLB IDE controller 3 3 ; specifications. 4 ;5 ; Specifications can be found at6 4 7 5 ; -
trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc
r588 r589 56 56 ; the mode via a call to Int 13h function 1Eh accordingly (see AH1Eh_XTCF.asm). 57 57 ; 58 XTCF_8BIT_PIO_MODE EQU 0 ; XT-CF using 8-bit PIO mode59 XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD EQU 1 ; XT-CF using 8-bit PIO mode, but with 16-bit instructions60 XTCF_16BIT_PIO_ WITH_BIU_OFFLOADEQU 2 ; Lo-tech 8-bit IDE Adapter61 XTCF_DMA_MODE EQU 3 ; XT-CFv3 using DMA58 XTCF_8BIT_PIO_MODE EQU 0 ; XT-CF using 8-bit PIO mode 59 XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD EQU 1 ; XT-CF using 8-bit PIO mode, but with 16-bit instructions 60 XTCF_16BIT_PIO_MODE_WITH_BIU_OFFLOAD EQU 2 ; Lo-tech 8-bit IDE Adapter 61 XTCF_DMA_MODE EQU 3 ; XT-CFv3 using DMA 62 62 63 63 -
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r584 r589 84 84 85 85 86 ; Flags for DPT _ADVANCED_ATA.bInitError86 ; Flags for DPT.bInitError 87 87 FLG_INITERROR_FAILED_TO_SELECT_DRIVE EQU (1<<0) 88 88 FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS EQU (1<<1) -
trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc
r526 r589 21 21 %ifndef IDE_8BIT_INC 22 22 %define IDE_8BIT_INC 23 24 ;--------------------------------------------------------------------25 ; UNROLL_SECTORS_IN_CX_TO_DWORDS26 ; UNROLL_SECTORS_IN_CX_TO_QWORDS27 ; UNROLL_SECTORS_IN_CX_TO_OWORDS28 ; Parameters:29 ; CX: Number of sectors in block30 ; Returns:31 ; CX: Number of DWORDs, QWORDs or OWORDs in block32 ; Corrupts registers:33 ; Nothing34 ;--------------------------------------------------------------------35 %macro UNROLL_SECTORS_IN_CX_TO_DWORDS 036 %ifdef USE_18637 shl cx, 738 %else39 xchg cl, ch ; Sectors to WORDs (SHL CX, 8)40 shr cx, 141 %endif42 %endmacro43 44 %macro UNROLL_SECTORS_IN_CX_TO_QWORDS 045 %ifdef USE_18646 shl cx, 647 %else48 UNROLL_SECTORS_IN_CX_TO_DWORDS49 shr cx, 150 %endif51 %endmacro52 53 %macro UNROLL_SECTORS_IN_CX_TO_OWORDS 054 %ifdef USE_18655 shl cx, 556 %else57 ; UNROLL_SECTORS_IN_CX_TO_QWORDS58 ; shr cx, 159 mov ch, cl ; 2 bytes shorter but possibly slower60 mov cl, 361 shr cx, cl62 %endif63 %endmacro64 65 23 66 24 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Inc/IdeIO.inc
r526 r589 105 105 106 106 107 ;-------------------------------------------------------------------- 108 ; UNROLL_SECTORS_IN_CX_TO_DWORDS 109 ; UNROLL_SECTORS_IN_CX_TO_QWORDS 110 ; UNROLL_SECTORS_IN_CX_TO_OWORDS 111 ; Parameters: 112 ; CX: Number of sectors in block 113 ; Returns: 114 ; CX: Number of DWORDs, QWORDs or OWORDs in block 115 ; Corrupts registers: 116 ; Nothing 117 ;-------------------------------------------------------------------- 118 %macro UNROLL_SECTORS_IN_CX_TO_DWORDS 0 119 %ifdef USE_186 120 shl cx, 7 121 %else 122 xchg cl, ch ; Sectors to WORDs (SHL CX, 8) 123 shr cx, 1 124 %endif 125 %endmacro 126 127 %macro UNROLL_SECTORS_IN_CX_TO_QWORDS 0 128 %ifdef USE_186 129 shl cx, 6 130 %else 131 UNROLL_SECTORS_IN_CX_TO_DWORDS 132 shr cx, 1 133 %endif 134 %endmacro 135 136 %macro UNROLL_SECTORS_IN_CX_TO_OWORDS 0 137 %ifdef USE_186 138 shl cx, 5 139 %else 140 ; UNROLL_SECTORS_IN_CX_TO_QWORDS 141 ; shr cx, 1 142 mov ch, cl ; 2 bytes shorter but possibly slower 143 mov cl, 3 144 shr cx, cl 145 %endif 146 %endmacro 147 148 107 149 %endif ; IDE_IO_INC -
trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
r587 r589 26 26 %endif 27 27 28 29 28 %ifdef MODULE_SERIAL_FLOPPY 30 29 %ifndef MODULE_SERIAL … … 41 40 %endif 42 41 43 ; Include module specific .INC files44 42 %ifdef MODULE_8BIT_IDE 45 43 %include "IDE_8bit.inc" ; For IDE 8-bit data port macros … … 47 45 48 46 %ifdef MODULE_ADVANCED_ATA 47 %ifndef USE_386 48 %error "MODULE_ADVANCED_ATA requires USE_386!" 49 %endif 49 50 %include "AdvancedID.inc" 50 51 %include "PDC20x30.inc" ; For Promise PDC 20230-C and 20630 controllers … … 79 80 ; Included modules for ROMVARS.wFlags 80 81 %ifdef MODULE_8BIT_IDE 81 MAIN_FLG_MODULE_8BIT_IDE EQU FLG_ROMVARS_MODULE_8BIT_IDE82 MAIN_FLG_MODULE_8BIT_IDE EQU FLG_ROMVARS_MODULE_8BIT_IDE 82 83 %else 83 MAIN_FLG_MODULE_8BIT_IDE EQU 084 MAIN_FLG_MODULE_8BIT_IDE EQU 0 84 85 %endif 85 86 86 87 %ifdef MODULE_ADVANCED_ATA 87 MAIN_FLG_MODULE_ADVANCED_ATA EQU FLG_ROMVARS_MODULE_ADVANCED_ATA88 MAIN_FLG_MODULE_ADVANCED_ATA EQU FLG_ROMVARS_MODULE_ADVANCED_ATA 88 89 %else 89 MAIN_FLG_MODULE_ADVANCED_ATA EQU 090 MAIN_FLG_MODULE_ADVANCED_ATA EQU 0 90 91 %endif 91 92 92 93 %ifdef MODULE_BOOT_MENU 93 MAIN_FLG_MODULE_BOOT_MENU EQU FLG_ROMVARS_MODULE_BOOT_MENU94 MAIN_FLG_MODULE_BOOT_MENU EQU FLG_ROMVARS_MODULE_BOOT_MENU 94 95 %else 95 MAIN_FLG_MODULE_BOOT_MENU EQU 096 MAIN_FLG_MODULE_BOOT_MENU EQU 0 96 97 %endif 97 98 98 99 %ifdef MODULE_EBIOS 99 MAIN_FLG_MODULE_EBIOS EQU FLG_ROMVARS_MODULE_EBIOS100 MAIN_FLG_MODULE_EBIOS EQU FLG_ROMVARS_MODULE_EBIOS 100 101 %else 101 MAIN_FLG_MODULE_EBIOS EQU 0102 MAIN_FLG_MODULE_EBIOS EQU 0 102 103 %endif 103 104 104 105 %ifdef MODULE_HOTKEYS 105 MAIN_FLG_MODULE_HOTKEYS EQU FLG_ROMVARS_MODULE_HOTKEYS106 MAIN_FLG_MODULE_HOTKEYS EQU FLG_ROMVARS_MODULE_HOTKEYS 106 107 %else 107 MAIN_FLG_MODULE_HOTKEYS EQU 0108 MAIN_FLG_MODULE_HOTKEYS EQU 0 108 109 %endif 109 110 110 111 %ifdef MODULE_IRQ 111 MAIN_FLG_MODULE_IRQ EQU FLG_ROMVARS_MODULE_IRQ112 MAIN_FLG_MODULE_IRQ EQU FLG_ROMVARS_MODULE_IRQ 112 113 %else 113 MAIN_FLG_MODULE_IRQ EQU 0114 MAIN_FLG_MODULE_IRQ EQU 0 114 115 %endif 115 116 116 117 %ifdef MODULE_SERIAL 117 MAIN_FLG_MODULE_SERIAL EQU FLG_ROMVARS_MODULE_SERIAL118 MAIN_FLG_MODULE_SERIAL EQU FLG_ROMVARS_MODULE_SERIAL 118 119 %else 119 MAIN_FLG_MODULE_SERIAL EQU 0120 MAIN_FLG_MODULE_SERIAL EQU 0 120 121 %endif 121 122 122 123 %ifdef MODULE_SERIAL_FLOPPY 123 MAIN_FLG_MODULE_SERIAL_FLOPPY EQU FLG_ROMVARS_MODULE_SERIAL_FLOPPY124 MAIN_FLG_MODULE_SERIAL_FLOPPY EQU FLG_ROMVARS_MODULE_SERIAL_FLOPPY 124 125 %else 125 MAIN_FLG_MODULE_SERIAL_FLOPPY EQU 0126 MAIN_FLG_MODULE_SERIAL_FLOPPY EQU 0 126 127 %endif 127 128 … … 145 146 146 147 MASK_ROMVARS_INCLUDED_MODULES EQU MAIN_FLG_MODULE_8BIT_IDE | MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_IRQ | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED | MAIN_FLG_MODULE_POWER_MANAGEMENT | MAIN_FLG_MODULE_8BIT_IDE_ADVANCED 147 -
trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
r555 r589 132 132 %endif 133 133 134 alignb 2 ; Keep the INTPACK structure and stack pointer WORD aligned 135 134 136 .intpack resb INTPACK_size 135 137 endstruc -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r588 r589 71 71 ; (Conveniently, this is 8, a fact we exploit when testing the bit) 72 72 73 ; Here in case the configuration needs to know functionality is present 73 ; Here in case the configuration needs to know functionality is present. Note! Changing the order/location of these flags 74 ; also requires changes elsewhere as they are usually tested using byte-accesses for efficiency. 74 75 FLG_ROMVARS_MODULE_POWER_MANAGEMENT EQU (1<<5) 75 76 FLG_ROMVARS_MODULE_8BIT_IDE EQU (1<<6) … … 146 147 ; Device types for IDEVARS.bDevice 147 148 ; IDE Devices are grouped so device numbers cannot be changed without modifying code elsewhere! 148 ; (IdeTransfer.asm)149 149 COUNT_OF_STANDARD_IDE_DEVICES EQU 2 ; 16- and 32-bit controllers 150 150 COUNT_OF_8BIT_IDE_DEVICES EQU 9 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r584 r589 33 33 IdeCommand_ResetMasterAndSlaveController: 34 34 ; HSR0: Set_SRST 35 call AccessDPT_GetDeviceControlByteToAL 36 or al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN ; Set Reset bit 35 ; Used to be: 36 ; call AccessDPT_GetDeviceControlByteToAL 37 ; or al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN ; Set Reset bit 38 ; Is now: 39 mov al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN 40 ; --- 37 41 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 38 42 mov ax, HSR0_RESET_WAIT_US … … 40 44 41 45 ; HSR1: Clear_wait 42 call AccessDPT_GetDeviceControlByteToAL 43 or al, FLG_DEVCONTROL_nIEN 44 and al, ~FLG_DEVCONTROL_SRST ; Clear reset bit 46 ; Used to be: 47 ; call AccessDPT_GetDeviceControlByteToAL 48 ; or al, FLG_DEVCONTROL_nIEN 49 ; and al, ~FLG_DEVCONTROL_SRST ; Clear reset bit 50 ; Is now: 51 mov al, FLG_DEVCONTROL_nIEN 52 ; --- 45 53 OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER DEVICE_CONTROL_REGISTER_out 46 54 mov ax, HSR1_RESET_WAIT_US … … 51 59 jmp IdeWait_PollStatusFlagInBLwithTimeoutInBH 52 60 61 ; *FIXME* AccessDPT_GetDeviceControlByteToAL currently always returns with 62 ; AL cleared (0) or with only bit 1 set (FLG_DEVCONTROL_nIEN = 2). 63 ; The commented away instructions above sets FLG_DEVCONTROL_nIEN anyway 64 ; making the call to AccessDPT_GetDeviceControlByteToAL redundant. 65 ; I have left this code as is since I don't know if it's a mistake 66 ; (from all the way back to r150) or if it's coded this way in anticipation 67 ; of some future changes to AccessDPT_GetDeviceControlByteToAL. 53 68 54 69 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm
r567 r589 94 94 ; When DI is zero only one transfer is required since we've limited the 95 95 ; XT-CFv3 block size to 32k 96 jnc SHORT .TransferLastDmaPageWithSizeInCX96 jnc SHORT StartDMAtransferForXTCFwithDmaModeInBL 97 97 98 98 ; CF was set, so DI != 0 and we might need one or two transfers 99 cmp cx, ax ; if we won't cross a physical page boundary...100 jbe SHORT .TransferLastDmaPageWithSizeInCX; ...perform the transfer in one operation99 cmp cx, ax ; if we won't cross a physical page boundary... 100 jbe SHORT StartDMAtransferForXTCFwithDmaModeInBL ; ...perform the transfer in one operation 101 101 102 102 ; Calculate how much we can transfer on first and second rounds … … 108 108 call StartDMAtransferForXTCFwithDmaModeInBL 109 109 pop cx ; Pop size for second DMA page 110 111 .TransferLastDmaPageWithSizeInCX:112 110 ; Fall to StartDMAtransferForXTCFwithDmaModeInBL 113 111 … … 115 113 ;-------------------------------------------------------------------- 116 114 ; StartDMAtransferForXTCFwithDmaModeInBL 117 ; Updated for XT-CFv3, 11-Apr-13118 115 ; Parameters: 119 116 ; BL: Byte for DMA Mode Register -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm
r580 r589 29 29 ; -------------------------------------------------------------------------------------------------- 30 30 31 32 31 %ifdef MODULE_8BIT_IDE 33 34 32 ;-------------------------------------------------------------------- 35 33 ; IdePioBlock_ReadFromXtideRev1 … … 57 55 58 56 ;-------------------------------------------------------------------- 57 ; 8-bit PIO from a single data port. 58 ; 59 59 ; IdePioBlock_ReadFrom8bitDataPort 60 ;61 ; 8-bit PIO from a single data port.62 ;63 60 ; Parameters: 64 61 ; CX: Block size in 512 byte sectors … … 68 65 ; Nothing 69 66 ; Corrupts registers: 70 ; AX, BX,CX67 ; AX, CX 71 68 ;-------------------------------------------------------------------- 72 69 ALIGN JUMP_ALIGN … … 87 84 ret 88 85 %endif 89 90 %endif ; MODULE_8BIT_IDE 91 92 93 ;-------------------------------------------------------------------- 86 %endif ; MODULE_8BIT_IDE 87 88 89 ;-------------------------------------------------------------------- 90 ; 16-bit and 32-bit PIO from a single data port. 91 ; 94 92 ; IdePioBlock_ReadFrom16bitDataPort 95 ; 96 ; 16-bit PIO from a single data port. 97 ; 93 ; IdePioBlock_ReadFrom32bitDataPort 98 94 ; Parameters: 99 95 ; CX: Block size in 512 byte sectors … … 103 99 ; Nothing 104 100 ; Corrupts registers: 105 ; AX, BX,CX101 ; AX, CX 106 102 ;-------------------------------------------------------------------- 107 103 ALIGN JUMP_ALIGN 108 104 IdePioBlock_ReadFrom16bitDataPort: 109 105 %ifdef USE_186 110 xchg cl, ch ; Sectors to WORDs106 xchg cl, ch ; Sectors to WORDs 111 107 rep insw 112 108 ret … … 126 122 127 123 ;-------------------------------------------------------------------- 124 %ifdef MODULE_ADVANCED_ATA 128 125 ALIGN JUMP_ALIGN 129 126 IdePioBlock_ReadFrom32bitDataPort: 130 db 0C1h ; SHL 131 db 0E1h ; CX 132 db 7 ; 7 (Sectors to DWORDs) 133 rep 134 db 66h ; Override operand size to 32-bit 135 db 6Dh ; INSW/INSD 136 ret 137 127 shl cx, 7 ; Sectors to DWORDs 128 rep insd 129 ret 130 %endif ; MODULE_ADVANCED_ATA 138 131 139 132 … … 145 138 146 139 %ifdef MODULE_8BIT_IDE 147 148 140 ;-------------------------------------------------------------------- 149 141 ; IdePioBlock_WriteToXtideRev1 … … 151 143 ; CX: Block size in 512-byte sectors 152 144 ; DX: IDE Data port address 153 ; ES:SI: Normalized ptr to buffer containing data145 ; DS:SI: Normalized ptr to buffer containing data 154 146 ; Returns: 155 147 ; Nothing … … 159 151 ALIGN JUMP_ALIGN 160 152 IdePioBlock_WriteToXtideRev1: 161 push ds162 153 UNROLL_SECTORS_IN_CX_TO_QWORDS 163 154 mov bl, 8 ; Bit mask for toggling data low/high reg 164 push es165 pop ds166 155 ALIGN JUMP_ALIGN 167 156 .OutswLoop: … … 170 159 %endrep 171 160 loop .OutswLoop 172 pop ds173 161 ret 174 162 … … 179 167 ; CX: Block size in 512-byte sectors 180 168 ; DX: IDE Data port address 181 ; ES:SI: Normalized ptr to buffer containing data182 ; Returns: 183 ; Nothing 184 ; Corrupts registers: 185 ; AX, BX,CX169 ; DS:SI: Normalized ptr to buffer containing data 170 ; Returns: 171 ; Nothing 172 ; Corrupts registers: 173 ; AX, CX 186 174 ;-------------------------------------------------------------------- 187 175 ALIGN JUMP_ALIGN 188 176 IdePioBlock_WriteToXtideRev2: 189 177 UNROLL_SECTORS_IN_CX_TO_QWORDS 190 push ds191 push es192 pop ds193 178 ALIGN JUMP_ALIGN 194 179 .WriteNextQword: … … 197 182 %endrep 198 183 loop .WriteNextQword 199 pop ds200 184 ret 201 185 … … 206 190 ; CX: Block size in 512-byte sectors 207 191 ; DX: IDE Data port address 208 ; ES:SI: Normalized ptr to buffer containing data209 ; Returns: 210 ; Nothing 211 ; Corrupts registers: 212 ; AX, BX,CX192 ; DS:SI: Normalized ptr to buffer containing data 193 ; Returns: 194 ; Nothing 195 ; Corrupts registers: 196 ; AX, CX 213 197 ;-------------------------------------------------------------------- 214 198 ALIGN JUMP_ALIGN … … 216 200 %ifdef USE_186 217 201 shl cx, 9 ; Sectors to BYTEs 218 es ; Source is ES segment219 202 rep outsb 220 203 ret … … 222 205 %else ; 808x 223 206 UNROLL_SECTORS_IN_CX_TO_QWORDS 224 push ds225 push es226 pop ds227 207 ALIGN JUMP_ALIGN 228 208 .WriteNextQword: … … 232 212 %endrep 233 213 loop .WriteNextQword 234 pop ds 235 ret 236 %endif 237 214 ret 215 %endif 238 216 %endif ; MODULE_8BIT_IDE 239 217 … … 245 223 ; CX: Block size in 512-byte sectors 246 224 ; DX: IDE Data port address 247 ; ES:SI: Normalized ptr to buffer containing data248 ; Returns: 249 ; Nothing 250 ; Corrupts registers: 251 ; AX, BX,CX225 ; DS:SI: Normalized ptr to buffer containing data 226 ; Returns: 227 ; Nothing 228 ; Corrupts registers: 229 ; AX, CX 252 230 ;-------------------------------------------------------------------- 253 231 ALIGN JUMP_ALIGN … … 255 233 %ifdef USE_186 256 234 xchg cl, ch ; Sectors to WORDs 257 es ; Source is ES segment258 235 rep outsw 259 236 ret … … 261 238 %else ; 808x 262 239 UNROLL_SECTORS_IN_CX_TO_QWORDS 263 push ds264 push es265 pop ds266 240 ALIGN JUMP_ALIGN 267 241 .WriteNextQword: … … 271 245 %endrep 272 246 loop .WriteNextQword 273 pop ds274 ret 275 %endif 276 277 ;-------------------------------------------------------------------- 247 ret 248 %endif 249 250 ;-------------------------------------------------------------------- 251 %ifdef MODULE_ADVANCED_ATA 278 252 ALIGN JUMP_ALIGN 279 253 IdePioBlock_WriteTo32bitDataPort: 280 db 0C1h ; SHL 281 db 0E1h ; CX 282 db 7 ; 7 (Sectors to DWORDs) 283 es ; Source is ES segment 284 rep 285 db 66h ; Override operand size to 32-bit 286 db 6Fh ; OUTSW/OUTSD 287 ret 254 shl cx, 7 ; Sectors to DWORDs 255 rep outsd 256 ret 257 %endif ; MODULE_ADVANCED_ATA -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r584 r589 173 173 cmp [bp+PIOVARS.bSectorsLeft], cl 174 174 jbe SHORT .WriteLastBlockToDrive 175 push ds 176 push es 177 pop ds 175 178 call [bp+PIOVARS.fnXfer] 176 179 pop ds 177 180 ; Wait until ready for next block and check for errors 178 181 call IdeWait_IRQorDRQ ; Wait until ready to transfer … … 189 192 mov cl, [bp+PIOVARS.bSectorsLeft] ; CH is already zero 190 193 push cx 194 push ds 195 push es 196 pop ds 191 197 call [bp+PIOVARS.fnXfer] ; Transfer possibly partial block 198 pop ds 192 199 jmp SHORT CheckErrorsAfterTransferringLastBlock 193 200 … … 237 244 ; Convert ES:SI to physical address 238 245 %ifdef USE_386 239 240 246 mov dx, es 241 247 xor ax, ax … … 247 253 248 254 %elifdef USE_186 249 ; Bytes EU Cycles(286) 250 mov ax, es ; 2 2 251 rol ax, 4 ; 3 9 252 mov dx, ax ; 2 2 253 and ax, BYTE 0Fh; 3 3 254 xor dx, ax ; 2 2 255 add si, dx ; 2 2 256 adc al, ah ; 2 2 257 mov es, ax ; 2 2 258 ;------------------------------------ 259 ; 18 24 255 mov ax, es 256 rol ax, 4 257 mov dx, ax 258 and ax, 0Fh 259 xor dx, ax 260 add si, dx 261 adc al, ah 262 mov es, ax 263 260 264 %else ; 808x 261 ; Bytes EU Cycles(808x) 262 mov al, 4 ; 2 4 263 mov dx, es ; 2 2 264 xchg cx, ax ; 1 3 265 rol dx, cl ; 2 24 266 mov cx, dx ; 2 2 267 xchg cx, ax ; 1 3 268 and ax, BYTE 0Fh; 3 4 269 xor dx, ax ; 2 3 270 add si, dx ; 2 3 271 adc al, ah ; 2 3 272 mov es, ax ; 2 2 273 ;------------------------------------ 274 ; 21 53 275 ; 276 ; Judging by the Execution Unit cycle count the above block of code is 277 ; apparently slower. However, the shifts and rotates in the block below 278 ; execute faster than the Bus Interface Unit on an 8088 can fetch them, 279 ; thus causing the EU to starve. The difference in true execution speed 280 ; (if any) might not be worth the extra 5 bytes. 281 ; In other words, we could use a real world test here. 282 ; 283 %if 0 284 ; Bytes EU Cycles(808x/286) 285 xor dx, dx ; 2 3/2 286 mov ax, es ; 2 2/2 287 %rep 4 288 shl ax, 1 ; 8 8/8 289 rcl dx, 1 ; 8 8/8 290 %endrep 291 add si, ax ; 2 3/2 292 adc dl, dh ; 2 3/2 293 mov es, dx ; 2 2/2 294 ;------------------------------------ 295 ; 26 29/26 296 %endif ; 0 265 mov al, 4 266 mov dx, es 267 xchg cx, ax 268 rol dx, cl 269 mov cx, dx 270 xchg cx, ax 271 and ax, 0Fh 272 xor dx, ax 273 add si, dx 274 adc al, ah 275 mov es, ax 276 297 277 %endif 298 278 … … 334 314 %ifdef USE_AT ; CF is always clear for XT builds 335 315 ; AH = RET_HD_INVALID (01) if CF set, RET_HD_SUCCESS (00) if not. CF unchanged. 316 %ifdef USE_386 317 setc ah 318 %else 336 319 sbb ah, ah 337 320 neg ah 338 321 %endif 322 %endif ; USE_AT 339 323 ret 340 324 … … 345 329 g_rgfnPioRead: 346 330 dw IdePioBlock_ReadFrom16bitDataPort ; 0, DEVICE_16BIT_ATA 331 %ifdef MODULE_ADVANCED_ATA 347 332 dw IdePioBlock_ReadFrom32bitDataPort ; 1, DEVICE_32BIT_ATA 333 %elifdef MODULE_8BIT_IDE 334 dw NULL 335 %endif ; MODULE_ADVANCED_ATA 348 336 %ifdef MODULE_8BIT_IDE 349 337 dw IdePioBlock_ReadFrom8bitDataPort ; 2, DEVICE_8BIT_ATA … … 361 349 g_rgfnPioWrite: 362 350 dw IdePioBlock_WriteTo16bitDataPort ; 0, DEVICE_16BIT_ATA 351 %ifdef MODULE_ADVANCED_ATA 363 352 dw IdePioBlock_WriteTo32bitDataPort ; 1, DEVICE_32BIT_ATA 353 %elifdef MODULE_8BIT_IDE 354 dw NULL 355 %endif ; MODULE_ADVANCED_ATA 364 356 %ifdef MODULE_8BIT_IDE 365 357 dw IdePioBlock_WriteTo8bitDataPort ; 2, DEVICE_8BIT_ATA -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r568 r589 98 98 %endif 99 99 cld ; String instructions to increment pointers 100 CREATE_FRAME_INTPACK_TO_SSBP SIZE_OF_IDEPACK_WITHOUT_INTPACK 100 ePUSHA 101 push ds 102 push es 103 %ifdef USE_386 104 ; push fs 105 ; push gs 106 %endif 107 sub sp, BYTE SIZE_OF_IDEPACK_WITHOUT_INTPACK 108 mov bp, sp 101 109 call RamVars_GetSegmentToDS 102 110 … … 297 305 ; on INT 13h to enable interrupts. 298 306 or BYTE [bp+IDEPACK.intpack+INTPACK.flags+1], (FLG_FLAGS_IF>>8) 299 mov sp, bp ; This makes possible to exit anytime, no matter what is on stack 300 RESTORE_FRAME_INTPACK_FROM_SSBP SIZE_OF_IDEPACK_WITHOUT_INTPACK 307 308 lea sp, [bp+SIZE_OF_IDEPACK_WITHOUT_INTPACK] 309 %ifdef USE_386 310 ; pop gs 311 ; pop fs 312 %endif 313 pop es 314 pop ds 315 ePOPA 316 iret 301 317 302 318 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
r588 r589 152 152 153 153 154 %if 0155 ; We always need to enable 8-bit mode since 16-bit mode is restored156 ; when controller is reset (AH=00h or 0Dh)157 ePUSH_T bx, AH23h_Enable8bitPioMode158 159 ; Convert mode to device type (see XTCF.inc for full details)160 and ax, 3161 jz SHORT .Set8bitPioMode ; XTCF_8BIT_PIO_MODE = 0162 dec ax ; XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD = 1163 jz SHORT .Set8bitPioModeWithBIUOffload164 dec ax ; XTCF_16BIT_PIO_WITH_BIU_OFFLOAD = 2165 jz SHORT .Set16bitPioModeWithBIUOffload166 167 ; XTCF_DMA_MODE = 3168 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA169 170 ; DMA transfers have limited block size171 mov al, [di+DPT_ATA.bBlockSize]172 cmp al, XTCF_DMA_MODE_MAX_BLOCK_SIZE173 jbe SHORT AH24h_SetBlockSize174 mov al, XTCF_DMA_MODE_MAX_BLOCK_SIZE175 jmp SHORT AH24h_SetBlockSize176 177 .Set16bitPioModeWithBIUOffload:178 pop bx ; Do not enable 8-bit PIO...179 ePUSH_T bx, AH23h_Disable8bitPioMode ; ...disable it instead180 mov al, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD181 SKIP2B bx182 183 .Set8bitPioMode:184 mov al, DEVICE_8BIT_XTCF_PIO8185 SKIP2B bx186 187 .Set8bitPioModeWithBIUOffload:188 mov al, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD189 mov [di+DPT_ATA.bDevice], al190 ret191 %endif ; 0192 193 194 154 ;-------------------------------------------------------------------- 195 155 ; AH1Eh_GetCurrentXTCFmodeToAX … … 197 157 ; DS:DI: Ptr to DPT (in RAMVARS segment) 198 158 ; Returns: 199 ; AX: XT-CF mode ( XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD, XTCF_16BIT_PIO_WITH_BIU_OFFLOAD or XTCF_DMA_MODE)159 ; AX: XT-CF mode (see XTCF.inc) 200 160 ; CF: Clear 201 161 ; Corrupts registers: … … 208 168 ret 209 169 210 %if 0211 mov al, [di+DPT_ATA.bDevice]212 shr al, 1213 cbw214 sub al, XTCF_DEVICE_OFFSET >> 1215 ret216 %endif ; 0 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm
r584 r589 92 92 mov si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE 93 93 jmp SHORT AH23h_SetControllerFeatures 94 95 %ifdef MODULE_8BIT_IDE_ADVANCED 94 96 AH23h_Disable8bitPioMode: 95 97 mov si, FEATURE_DISABLE_8BIT_PIO_TRANSFER_MODE … … 97 99 xor ah, ah ; Clear error since modern drives might not understand the command and are 98 100 ret ; always in 16-bit mode anyway 99 %endif 101 %endif ; MODULE_8BIT_IDE_ADVANCED 102 %endif ; MODULE_8BIT_IDE -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
r526 r589 40 40 ; AH: Int 13h/40h floppy return status 41 41 ; AL: Burst error length if AH returns 11h (we never return error code 11h) 42 ; Number of sectors actually read (only valid if CF set for some BIOSes)42 ; Number of sectors actually read (only valid if CF set for some BIOSes) 43 43 ; CF: 0 if successful, 1 if error 44 44 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
r526 r589 39 39 ; Returns with INTPACK: 40 40 ; AH: Int 13h/40h floppy return status 41 ; AL: Number of sectors actually written (only valid if CF set for some BIOSes)41 ; AL: Number of sectors actually written (only valid if CF set for some BIOSes) 42 42 ; CF: 0 if successful, 1 if error 43 43 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r588 r589 184 184 185 185 ; Advanced PIO mode 3 and above 186 mov dl, [di+DPT_ADVANCED_ATA.bPioMode]187 or dl, PIO_FLOW_CONTROL_MODE_xxx186 mov dl, PIO_FLOW_CONTROL_MODE_xxx 187 or dl, [di+DPT_ADVANCED_ATA.bPioMode] 188 188 189 189 .IordyNotSupported: -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r568 r589 174 174 ; +=sectToSeek-1 (24-bit result) 175 175 ; Max = 16,450,497 + 63 - 1 = 16,450,559 = FB03FFh 176 xor bh, bh ; Sector number now in BX176 mov bh, ch ; Sector number now in BX, CH=zero 177 177 dec bx ; sectToSeek-=1 178 add ax, bx ; Add to loword 179 adc dl, bh ; Add possible carry to byte2, BH=zero 180 181 ; Copy DX:AX to proper return registers 182 xchg bx, ax ; BL = Sector Number Register (LBA 7...0) 183 mov cl, bh ; Low Cylinder Register (LBA 15...8) 184 mov ch, dl ; High Cylinder Register (LBA 23...16) 185 mov bh, dh ; Drive and Head Register (LBA 27...24) 178 add bx, ax ; Add loword to BX (BL = Sector Number Register (LBA 7...0)) 179 adc ch, dl ; Add possible carry to byte2 (CH = High Cylinder Register (LBA 23...16)) 180 mov cl, bh ; CL = Low Cylinder Register (LBA 15...8) 181 mov bh, dh ; BH = Drive and Head Register (LBA 27...24) 186 182 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r587 r589 37 37 AdvAtaInit_DetectControllerForIdeBaseInBX: 38 38 call Vision_DetectAndReturnIDinAXandPortInDXifControllerPresent 39 jne SHORT .NoAdvancedControllerForPortBX 39 jnz SHORT .NoVisionControllerFound 40 40 41 call Vision_DoesIdePortInBXbelongToControllerWithIDinAX 41 jne SHORT .NoAdvancedControllerForPortBX 42 jz SHORT .AdvancedControllerFoundForPortBX 43 44 .NoVisionControllerFound: 42 45 call PDC20x30_DetectControllerForIdeBaseInBX 43 46 jnc SHORT .NoAdvancedControllerForPortBX 44 47 45 stc ; Advanced Controller found for port BX 48 .AdvancedControllerFoundForPortBX: 49 stc 46 50 ret 47 51 48 52 .NoAdvancedControllerForPortBX: 49 xor ax, ax 53 xor ax, ax ; Clear ID in AX and CF 50 54 ret 51 55 … … 66 70 AdvAtaInit_GetControllerMaxPioModeToALandMinPioCycleTimeToBX: 67 71 cmp ah, ID_QD6580_ALTERNATE 72 %ifdef USE_386 73 jae Vision_GetMaxPioModeToALandMinCycleTimeToBX 74 jmp PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX 75 %else 68 76 jae SHORT .Vision 69 77 jmp PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX 70 78 .Vision: 71 79 jmp Vision_GetMaxPioModeToALandMinCycleTimeToBX 80 %endif 72 81 73 82 … … 88 97 test ax, ax 89 98 jz SHORT .NoAdvancedController ; Return with CF cleared 90 99 91 100 cmp ah, ID_QD6580_ALTERNATE 92 101 jae SHORT .Vision … … 98 107 99 108 call AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI 100 call Vision_InitializeWithIDinAH andConfigInAL109 call Vision_InitializeWithIDinAH 101 110 xor ax, ax ; Success 102 111 … … 116 125 ; Zero if Slave Drive not present 117 126 ; Corrupts registers: 118 ; A X127 ; AL 119 128 ;-------------------------------------------------------------------- 120 129 AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm
r588 r589 36 36 mov dx, bx 37 37 call EnablePdcProgrammingMode 38 jz .ControllerDetected 39 clc 40 ret 41 .ControllerDetected: 42 call GetPdcIDtoAX 38 jnz SHORT DisablePdcProgrammingMode.Return ; PDC controller not detected 39 ; ePUSH_T ax, DisablePdcProgrammingMode ; Uncomment this if GetPdcIDtoAX needs to be a real function 40 ; Fall to GetPdcIDtoAX 41 42 ;-------------------------------------------------------------------- 43 ; Programming mode must be enabled for this function. 44 ; This function also enables PDC 20630 extra registers. 45 ; 46 ; GetPdcIDtoAX 47 ; Parameters: 48 ; DX: IDE Base port 49 ; Returns: 50 ; AH: PDC ID 51 ; Corrupts registers: 52 ; AL, BX 53 ;-------------------------------------------------------------------- 54 GetPdcIDtoAX: 55 push dx 56 57 ; Try to enable PDC 20630 extra registers 58 add dx, BYTE LOW_CYLINDER_REGISTER 59 in al, dx 60 or al, FLG_PDCLCR_ENABLE_EXTRA_REGISTERS 61 out dx, al 62 63 ; Try to access PDC 20630 registers to see if they are available 64 ; Hopefully this does not cause problems for systems with PDC 20230 65 add dx, BYTE PDC20630_INDEX_REGISTER - LOW_CYLINDER_REGISTER 66 mov al, PDCREG7_STATUS ; Try to access PDC 20630 status register 67 out dx, al 68 xchg bx, ax 69 in al, dx ; Does index register contain status register index? 70 cmp al, bl 71 mov ah, ID_PDC20630 72 eCMOVNE ah, ID_PDC20230 73 74 pop dx 75 ; ret ; Uncomment this to make GetPdcIDtoAX a real function 43 76 ; Fall to DisablePdcProgrammingMode 44 77 … … 49 82 ; DX: Base port 50 83 ; Returns: 51 ; Nothing84 ; CF: Set 52 85 ; Corrupts registers: 53 86 ; AL … … 56 89 add dx, BYTE HIGH_CYLINDER_REGISTER 57 90 in al, dx 58 sub dx, BYTE HIGH_CYLINDER_REGISTER59 stc ; Set for PDC20x30_DetectControllerForIdeBaseInBX 91 add dx, -HIGH_CYLINDER_REGISTER ; Sets CF for PDC20x30_DetectControllerForIdeBaseInBX 92 .Return: 60 93 ret 61 94 … … 66 99 ; DX: Base port 67 100 ; Returns: 101 ; CF: Cleared 68 102 ; ZF: Set if programming mode enabled 69 103 ; Corrupts registers: … … 72 106 EnablePdcProgrammingMode: 73 107 ; Set bit 7 to sector count register 74 add dx, BYTE SECTOR_COUNT_REGISTER 75 in al, dx 108 inc dx 109 inc dx 110 in al, dx ; 1F2h (SECTOR_COUNT_REGISTER) 76 111 or al, 80h 77 112 out dx, al … … 93 128 ; PDC20230C and PDC20630 clears the bit we set at the beginning 94 129 in al, dx 95 sub dx, BYTE SECTOR_COUNT_REGISTER 96 test al, 80h 97 ret 98 99 100 ;-------------------------------------------------------------------- 101 ; Programming mode must be enabled for this function. 102 ; This function also enables PDC 20630 extra registers. 103 ; 104 ; GetPdcIDtoAX 105 ; Parameters: 106 ; DX: IDE Base port 107 ; Returns: 108 ; AX: PDC ID word 109 ; Corrupts registers: 110 ; BX 111 ;-------------------------------------------------------------------- 112 GetPdcIDtoAX: 113 ; Try to enable PDC 20630 extra registers 114 add dx, BYTE LOW_CYLINDER_REGISTER 115 in al, dx 116 or al, FLG_PDCLCR_ENABLE_EXTRA_REGISTERS 117 out dx, al 118 119 ; Try to access PDC 20630 registers to see if they are available 120 ; Hopefully this does not cause problems for systems with PDC 20230 121 add dx, BYTE PDC20630_INDEX_REGISTER - LOW_CYLINDER_REGISTER 122 mov al, PDCREG7_STATUS ; Try to access PDC 20630 status register 123 out dx, al 124 xchg bx, ax 125 in al, dx ; Does index register contain status register index? 126 cmp al, bl 127 mov ah, ID_PDC20630 128 eCMOVNE ah, ID_PDC20230 130 dec dx 131 dec dx ; Base port 132 test al, 80h ; Clears CF 129 133 ret 130 134 … … 145 149 PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX: 146 150 cmp ah, ID_PDC20630 147 je SHORT . return ; No need to limit anything151 je SHORT .Return ; No need to limit anything 148 152 mov ax, 2 ; Limit PIO to 2 for ID_PDC20230 149 153 mov bx, PIO_2_MIN_CYCLE_TIME_NS 150 154 stc 151 . return:155 .Return: 152 156 ret 153 157 … … 165 169 ;-------------------------------------------------------------------- 166 170 PDC20x30_InitializeForDPTinDSDI: 171 %ifdef USE_386 172 xor ch, ch 173 test BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE 174 setnz cl 175 %else 167 176 xor cx, cx 168 177 test BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE 169 eCSETNZ cl 178 jz SHORT .NotSlave 179 inc cx 180 .NotSlave: 181 %endif 170 182 171 183 mov dx, [di+DPT.wBasePort] … … 173 185 call SetSpeedForDriveInCX 174 186 cmp BYTE [di+DPT_ADVANCED_ATA.wControllerID+1], ID_PDC20630 175 jne .initializationCompleted187 jne SHORT .InitializationCompleted 176 188 call SetPdc20630SpeedForDriveInCX 177 . initializationCompleted:189 .InitializationCompleted: 178 190 mov dx, [di+DPT.wBasePort] 179 191 call DisablePdcProgrammingMode … … 201 213 mov bh, ~MASK_PDCSCR_DEV1SPEED ; Assume slave 202 214 inc cx 203 loop . setSpeed215 loop .SetSpeed 204 216 eSHL_IM bl, POS_PDCSCR_DEV0SPEED 205 217 mov bh, ~MASK_PDCSCR_DEV0SPEED 206 . setSpeed:218 .SetSpeed: 207 219 in al, dx 208 220 and al, bh 209 221 or al, bl 210 222 cmp bl, 7 211 jb SHORT OutputNewValue223 jb SHORT .OutputNewValue 212 224 or al, FLG_PDCSCR_UNKNOWN_BIT7 ; Flag for PIO 2 and above? 213 jmp SHORT OutputNewValue 225 .OutputNewValue: 226 out dx, al 227 ret 214 228 215 229 .rgbPioModeToPDCspeedValue: … … 228 242 ; DX: Low Cylinder Register 229 243 ; Corrupts registers: 230 ; AX , CX244 ; AX 231 245 ;-------------------------------------------------------------------- 232 246 SetPdc20630SpeedForDriveInCX: 233 247 inc dx ; LOW_CYLINDER_REGISTER 234 mov ah, FLG_PDCLCR_DEV0SPEED_BIT4 | FLG_PDCLCR_DEV0IORDY 235 shr ah, cl 236 in al, dx 237 not ah 248 mov ah, ~(FLG_PDCLCR_DEV0SPEED_BIT4 | FLG_PDCLCR_DEV0IORDY) 249 ror ah, cl 250 in al, dx 238 251 and al, ah ; Clear drive specific bits 239 252 cmp BYTE [di+DPT_ADVANCED_ATA.bPioMode], 2 240 jbe . clearBitsOnly253 jbe .ClearBitsOnly 241 254 not ah 242 255 or al, ah 243 .clearBitsOnly: 244 OutputNewValue: 245 out dx, al 246 ret 247 256 .ClearBitsOnly: 257 out dx, al 258 ret 259 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm
r582 r589 29 29 ; AX: ID WORD specific for QDI Vision Controllers 30 30 ; (AL = QD65xx Config Register contents) 31 ; (AH = QDI Vision Controller ID (bits 4...7))31 ; (AH = QDI Vision Controller ID) 32 32 ; DX: Controller port (not IDE port) 33 33 ; ZF: Set if controller found … … 46 46 ; from Axh to Bxh. 47 47 call IsConfigRegisterWithIDinAL 48 je SHORT VisionControllerDetected 48 je SHORT VisionControllerDetected.Return 49 49 50 50 ; Check QD65xx alternative base port 51 ordl, QD65XX_ALTERNATIVE_BASE_PORT51 mov dl, QD65XX_ALTERNATIVE_BASE_PORT 52 52 in al, QD65XX_ALTERNATIVE_BASE_PORT + QD65XX_CONFIG_REGISTER_in 53 53 %endif ; DANGEROUS_DETECTION … … 68 68 mov ah, al 69 69 and al, MASK_QDCONFIG_CONTROLLER_ID 70 cmp al, ID_QD6500 << 470 cmp al, ID_QD6500 71 71 je SHORT VisionControllerDetected 72 cmp al, ID_QD6580 << 472 cmp al, ID_QD6580 73 73 je SHORT VisionControllerDetected 74 cmp al, ID_QD6580_ALTERNATE << 474 cmp al, ID_QD6580_ALTERNATE 75 75 VisionControllerDetected: 76 76 xchg ah, al 77 .Return: 77 78 ret 78 79 … … 82 83 ; Parameters: 83 84 ; AL: QD65xx Config Register contents 84 ; AH: QDI Vision Controller ID (bits 4...7)85 ; AH: QDI Vision Controller ID 85 86 ; BX: IDE Base port to check 86 87 ; DX: Vision Controller port … … 92 93 ;-------------------------------------------------------------------- 93 94 Vision_DoesIdePortInBXbelongToControllerWithIDinAX: 94 cmp ah, ID_QD6500 << 495 cmp ah, ID_QD6500 95 96 je SHORT .DoesIdePortInDXbelongToQD6500 96 97 … … 128 129 ; Parameters: 129 130 ; AL: QD65xx Config Register contents 130 ; AH: QDI Vision Controller ID (bits 4...7)131 ; AH: QDI Vision Controller ID 131 132 ; Returns: 132 133 ; AL: Max supported PIO mode … … 139 140 ;-------------------------------------------------------------------- 140 141 Vision_GetMaxPioModeToALandMinCycleTimeToBX: 141 cmp ah, ID_QD6500 << 4142 cmp ah, ID_QD6500 142 143 jne SHORT .NoNeedToLimitForQD6580 143 144 … … 149 150 150 151 ;-------------------------------------------------------------------- 151 ; Vision_InitializeWithIDinAHandConfigInAL 152 ; Parameters: 153 ; AL: QD65xx Config Register contents 154 ; AH: QDI Vision Controller ID (bits 4...7) 152 ; Vision_InitializeWithIDinAH 153 ; Parameters: 154 ; AH: QDI Vision Controller ID 155 155 ; DS:DI: Ptr to DPT for Single or Slave Drive 156 156 ; SI: Offset to Master DPT if Slave Drive present … … 162 162 ; AX, BX, CX, DX, BP 163 163 ;-------------------------------------------------------------------- 164 Vision_InitializeWithIDinAH andConfigInAL:164 Vision_InitializeWithIDinAH: 165 165 ; QD6580 has a Control Register that needs to be programmed 166 cmp ah, ID_QD6500 << 4166 cmp ah, ID_QD6500 167 167 mov dx, [di+DPT_ADVANCED_ATA.wControllerBasePort] 168 168 mov bp, QD6500_MAX_ACTIVE_TIME_CLOCKS | (QD6500_MIN_ACTIVE_TIME_CLOCKS << 8) ; Assume QD6500 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r580 r589 81 81 mov al, [cs:ROMVARS.wFlags] ; Configurator set to always scan? 82 82 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 83 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ ALWAYSDETECT83 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_SCANDETECT 84 84 jnz .DriveDetectLoop 85 85 %endif ; MODULE_SERIAL … … 135 135 136 136 shr ch, 1 ; number of drives, 1 or 2 only, to CF flag (clear=1, set=2) 137 rclal, 1 ; starting drive number in upper 7 bits, number of drives in low bit137 eRCL_IM al, 1 ; starting drive number in upper 7 bits, number of drives in low bit 138 138 .NoFloppies: 139 139 mov [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r568 r589 90 90 %ifdef MODULE_SERIAL 91 91 cmp dh, DEVICE_SERIAL_PORT ; Check if this is a serial device 92 93 jnz .pushAndPrint ; CX = string to print, AX = port address, DX won't be used 92 jne SHORT .pushAndPrint ; CX = string to print, AX = port address, DX won't be used 94 93 95 94 mov cl, (g_szDetectCOM-$$) & 0xff ; Setup print string for COM ports … … 106 105 107 106 test dl, dl ; Check if serial port "Auto" 108 jz .pushAndPrintSerial; CX = string to print, AX and DX won't be used107 jz SHORT .pushAndPrintSerial ; CX = string to print, AX and DX won't be used 109 108 110 109 mov cl, (g_szDetectCOMLarge-$$) & 0xff ; Setup secondary print string for "COMn/xx.yK" 111 110 112 mov al, ah ; baud rate divisor to AL111 mov al, ah ; baud rate divisor to AL 113 112 cbw ; clear AH, AL will always be less than 128 114 xchg si, ax ; move AX to SI for divide115 mov ax, 1152; baud rate to display is 115200/divisor, the "00" is handled113 xchg si, ax ; move AX to SI for divide 114 mov ax, 1152 ; baud rate to display is 115200/divisor, the "00" is handled 116 115 ; in the print strings 117 116 cwd ; clear top 16-bits of dividend 118 117 div si ; and divide... Now AX = baud rate/100, DX = 0 (always a clean divide) 119 118 120 mov si, 10 ; Now separate the whole portion from the fractional for "K" display119 mov si, 10 ; Now separate the whole portion from the fractional for "K" display 121 120 div si ; and divide... Now AX = baud rate/1000, DX = low order digit 122 121 123 cmp ax, si ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc.124 jae .pushAndPrintSerial122 cmp ax, si ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc. 123 jae SHORT .pushAndPrintSerial 125 124 126 125 mov cl, (g_szDetectCOMSmall-$$) & 0xff ; Setup secondary print string for "COMn/XXy00" … … 150 149 DetectPrint_DriveNameFromDrvDetectInfoInESBX: 151 150 push bp 152 mov bp, sp153 lea si, [bx+DRVDETECTINFO.szDrvName]151 mov bp, sp 152 lea si, [bx+DRVDETECTINFO.szDrvName] 154 153 push si 155 mov si, g_szDriveName154 mov si, g_szDriveName 156 155 jmp SHORT DetectPrint_FormatCSSIfromParamsInSSBP 157 156 … … 276 275 ; 277 276 push bp 278 mov bp, sp277 mov bp, sp 279 278 ; Fall to DetectPrint_FormatCSSIfromParamsInSSBP 280 279 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r580 r589 240 240 push cx 241 241 xchg ax, cx ; IRQ index to CL 242 mov ch, 1 ; Load 1 to be shifted 243 shl ch, cl ; Shift bit to correct position 244 not ch ; Invert to create bit mask for clearing 242 mov ch, ~1 ; Load bit mask to be rotated 243 rol ch, cl ; Rotate mask to correct position for clearing 245 244 in al, dx ; Read Interrupt Mask Register 246 245 and al, ch ; Clear wanted bit -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r588 r589 117 117 118 118 %ifdef MODULE_SERIAL 119 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, 119 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT 120 120 %endif 121 121 %else … … 134 134 at ROMVARS.bIdleTimeout, db 0 ; Standby timer disabled by default 135 135 136 %ifdef MODULE_8BIT_IDE_ADVANCED 137 at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port 138 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_8BIT_XTCF_PIO8 136 %ifndef MODULE_8BIT_IDE 137 at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_ATA_PRIMARY_PORT ; Controller Command Block base port 138 at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_ATA_PRIMARY_PORTCTRL ; Controller Control Block base port 139 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA 140 %elifdef MODULE_8BIT_IDE_ADVANCED 141 at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port 142 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_8BIT_XTCF_PIO8 139 143 %else 140 at ROMVARS.ideVars0+IDEVARS.wBasePort, 141 at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, 142 at ROMVARS.ideVars0+IDEVARS.bDevice, 144 at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port 145 at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_XTIDE_DEFAULT_PORTCTRL ; Controller Control Block base port 146 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_8BIT_XTIDE_REV1 143 147 %endif 144 148 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 145 149 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 146 150 151 at ROMVARS.ideVars1+IDEVARS.wBasePort, dw DEVICE_ATA_SECONDARY_PORT 152 at ROMVARS.ideVars1+IDEVARS.wControlBlockPort, dw DEVICE_ATA_SECONDARY_PORTCTRL 153 at ROMVARS.ideVars1+IDEVARS.bDevice, db DEVICE_16BIT_ATA 147 154 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 148 155 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 149 156 157 at ROMVARS.ideVars2+IDEVARS.wBasePort, dw DEVICE_ATA_TERTIARY_PORT 158 at ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw DEVICE_ATA_TERTIARY_PORTCTRL 159 at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_16BIT_ATA 150 160 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 151 161 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 152 162 163 at ROMVARS.ideVars3+IDEVARS.wBasePort, dw DEVICE_ATA_QUATERNARY_PORT 164 at ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw DEVICE_ATA_QUATERNARY_PORTCTRL 165 at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA 153 166 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 154 167 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 155 168 156 169 %ifdef MODULE_SERIAL 157 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, 170 at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT 158 171 %endif 159 172 %endif … … 286 299 %include "AH41h_CheckIfExtensionsPresent.asm" 287 300 %endif 301 302 303 ; Although it's very unlikely to happen, we give warnings for builds that cannot be automatically checksummed due to the size being too large. 304 ; In some cases it's theoretically possible to checksum the build anyway (manually) which is why these are warnings and not errors. 305 %if BIOS_SIZE = 8192 ; A small build, possibly a candidate for the ROM socket on a 3Com 3C503 card. 306 %if ($-$$) <= BIOS_SIZE ; Only give warnings when the problem isn't obvious anyway. 307 %if ($-$$) > BIOS_SIZE - 3 308 %warning "This build is too large to be auto-checksummed!" 309 %endif 310 %endif 311 %elif ($-$$) = BIOS_SIZE ; A large build. 312 %warning "This build is too large to be auto-checksummed!" 313 %endif -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
r583 r589 39 39 mov si, g_szRomBootDash ; Standard "Rom Boot" but with a "-" at the front 40 40 mov al, 20h ; The space between "Rom" and "Boot" 41 jnc .ROMBoot; display "Rom Boot" option for last entry41 jnc SHORT .ROMBoot ; display "Rom Boot" option for last entry 42 42 43 43 call FindDPT_ForDriveNumberInDL 44 jc .notOurs44 jc SHORT .notOurs 45 45 46 46 call DriveDetectInfo_ConvertDPTtoBX 47 47 mov si, g_szDriveNumBOOTNFO ; special g_szDriveNum that prints from BDA 48 jmp .go48 jmp SHORT .go 49 49 50 50 .notOurs: 51 mov si, g_szDriveNum52 mov bx, g_szForeignHD ; assume a hard disk for the moment51 mov si, g_szDriveNum 52 mov bx, g_szForeignHD ; assume a hard disk for the moment 53 53 54 54 test dl, dl 55 js .go56 mov bl, ((g_szFloppyDrv)-$$ & 0xff) ; and revisit the earlier assumption...55 js SHORT .go 56 mov bl, ((g_szFloppyDrv)-$$ & 0xff) ; and revisit the earlier assumption... 57 57 58 58 .go: … … 60 60 call DriveXlate_ToOrBack 61 61 62 test dl, 0f0h ; if there is a character in the upper nibble 63 jnz .noSpace 64 dec si ; backup a character to a leading space 65 .noSpace: 62 cmp dl, 10h ; Check if there is a character in the upper nibble 63 sbb si, 0 ; If not, backup a character to a leading space 66 64 67 65 push dx ; translated drive number … … 86 84 ;-------------------------------------------------------------------- 87 85 BootMenuPrint_TitleStrings: 88 xor di, di ; Null character will be eaten86 xor di, di ; Null character will be eaten 89 87 mov si, g_szBootMenuTitle 90 88 jmp DetectPrint_RomFoundAtSegment.BootMenuEntry … … 105 103 106 104 call BootMenu_GetDriveToDXforMenuitemInCX 107 jnc BootMenuEvent_Completed; nothing to display if "Rom Boot" option105 jnc SHORT BootMenuEvent_Completed ; nothing to display if "Rom Boot" option 108 106 109 107 push bp … … 116 114 inc dl ; are we a hard disk? 117 115 dec dl ; inc/dec will set SF, without modifying CF or DL 118 js .HardDiskRefreshInformation119 120 jnc .ours; Based on CF from FindDPT_ForDriveNumberInDL above116 js SHORT .HardDiskRefreshInformation 117 118 jnc SHORT .ours ; Based on CF from FindDPT_ForDriveNumberInDL above 121 119 call FloppyDrive_GetType ; Get Floppy Drive type to BX 122 jmp .around120 jmp SHORT .around 123 121 .ours: 124 122 call AH8h_GetDriveParameters … … 132 130 cmp bl, FLOPPY_TYPE_35_ED 133 131 ja SHORT .PushAXAndOutput 134 135 132 ; Fall to .PrintKnownFloppyType 136 133 … … 162 159 mov al, (g_szFddThreeHalf - $$) & 0xff 163 160 cmp bl, FLOPPY_TYPE_525_HD 164 ja .ThreeHalf161 ja SHORT .ThreeHalf 165 162 mov al, (g_szFddFiveQuarter - $$) & 0xff 166 163 .ThreeHalf: … … 168 165 169 166 xor bh, bh 170 mov al, FloppyTypes.rgbCapacityMultiplier167 mov al, FloppyTypes.rgbCapacityMultiplier 171 168 mul BYTE [cs:bx+FloppyTypes.rgbCapacity - 1] ; -1 since 0 is handled above and not in the table 172 169 … … 184 181 ; Parameters: 185 182 ; DS: RAMVARS segment 183 ; DI: Zero if foreign drive 184 ; Offset to DPT if our drive 185 ; CF: Set if foreign drive 186 ; Clear if our drive 186 187 ; Returns: 187 188 ; CF: Set since menu event was handled successfully 188 189 ; Corrupts registers: 189 ; BX, CX, DX, SI, DI, ES190 ; AX, BX, CX, DX, SI, DI, ES 190 191 ;-------------------------------------------------------------------- 191 192 .HardDiskRefreshInformation: 192 jc .HardDiskMenuitemInfoForForeignDrive; Based on CF from FindDPT_ForDriveNumberInDL (way) above193 jc SHORT .HardDiskMenuitemInfoForForeignDrive ; Based on CF from FindDPT_ForDriveNumberInDL (way) above 193 194 194 195 .HardDiskMenuitemInfoForOurDrive: 195 196 ePUSH_T ax, g_szInformation ; Add substring for our hard disk information 196 call GetTotalSectorCount 197 jmp .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 197 198 %ifdef MODULE_EBIOS 199 ePUSH_T ax, .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 200 test BYTE [di+DPT.bFlagsLow], FLGL_DPT_LBA 201 %ifdef USE_386 202 jnz AccessDPT_GetLbaSectorCountToBXDXAX 203 jmp AH15h_GetSectorCountToBXDXAX 204 %else ; ~USE_386 205 jz SHORT .NoLBA 206 jmp AccessDPT_GetLbaSectorCountToBXDXAX 207 .NoLBA: 208 jmp AH15h_GetSectorCountToBXDXAX 209 %endif 210 %else ; ~MODULE_EBIOS 211 call AH15h_GetSectorCountToBXDXAX 212 jmp SHORT .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 213 %endif ; MODULE_EBIOS 198 214 199 215 .HardDiskMenuitemInfoForForeignDrive: … … 226 242 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 227 243 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 228 229 230 ;--------------------------------------------------------------------231 ; GetTotalSectorCount232 ; Parameters:233 ; DS:DI: DPT Pointer234 ; Returns:235 ; BX:DX:AX: 48-bit sector count236 ; Corrupts registers:237 ; CX238 ;--------------------------------------------------------------------239 %ifdef MODULE_EBIOS240 GetTotalSectorCount EQU AccessDPT_GetLbaSectorCountToBXDXAX241 %else242 GetTotalSectorCount EQU AH15h_GetSectorCountToBXDXAX243 %endif -
trunk/XTIDE_Universal_BIOS/Src/Strings.asm
r588 r589 136 136 g_szDeviceTypeValues: 137 137 g_szDeviceTypeValues_16bit: db " 16",NULL 138 %ifdef MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 138 139 g_szDeviceTypeValues_32bit: db " 32",NULL 140 %ifdef MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 139 141 g_szDeviceTypeValues_8bit: db " 8",NULL 140 142 g_szDeviceTypeValues_XTIDEr1: db "D8 ",NULL ; Dual 8-bit 141 143 g_szDeviceTypeValues_XTIDEr2: db "X8 ",NULL ; A0<->A3 swapped 8-bit 144 %ifdef MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 142 145 g_szDeviceTypeValues_XTCFpio8: db "T8 ",NULL ; True 8-bit 143 146 g_szDeviceTypeValues_XTCFpio8BIU: db "T8B",NULL … … 146 149 g_szDeviceTypeValues_JrIde: db "M8 ",NULL ; Memory Mapped 8-bit 147 150 g_szDeviceTypeValues_ADP50L: db "M8 ",NULL ; Memory Mapped 8-bit 151 %ifdef MODULE_SERIAL 148 152 g_szDeviceTypeValues_Serial: db "SER",NULL 149 150 g_szDeviceTypeValues_Displacement equ (g_szDeviceTypeValues_32bit - g_szDeviceTypeValues) 153 %endif ; MODULE_SERIAL 154 %endif ; MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 155 %endif ; MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 156 %endif ; MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 157 158 g_szDeviceTypeValues_Displacement equ 3 ; 3 compressed, 4 uncompressed 159 ;g_szDeviceTypeValues_Displacement equ (g_szDeviceTypeValues_32bit - g_szDeviceTypeValues) 151 160 ; 152 161 ; Ensure that device type strings are correctly spaced in memory … … 156 165 %error "g_szDeviceTypeValues Displacement Incorrect 1" 157 166 %endif 167 168 %ifdef MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 169 158 170 %if g_szDeviceTypeValues_32bit <> g_szDeviceTypeValues_16bit + g_szDeviceTypeValues_Displacement 159 171 %error "g_szDeviceTypeValues Displacement Incorrect 2" 160 172 %endif 173 174 %ifdef MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 175 161 176 %if g_szDeviceTypeValues_8bit <> g_szDeviceTypeValues_32bit + g_szDeviceTypeValues_Displacement 162 177 %error "g_szDeviceTypeValues Displacement Incorrect 3" … … 168 183 %error "g_szDeviceTypeValues Displacement Incorrect 5" 169 184 %endif 185 186 %ifdef MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 187 170 188 %if g_szDeviceTypeValues_XTCFpio8 <> g_szDeviceTypeValues_XTIDEr2 + g_szDeviceTypeValues_Displacement 171 189 %error "g_szDeviceTypeValues Displacement Incorrect 6" … … 186 204 %error "g_szDeviceTypeValues Displacement Incorrect 11" 187 205 %endif 206 207 %ifdef MODULE_SERIAL 208 188 209 %if g_szDeviceTypeValues_Serial <> g_szDeviceTypeValues_ADP50L + g_szDeviceTypeValues_Displacement 189 210 %error "g_szDeviceTypeValues Displacement Incorrect 12" 190 211 %endif 212 213 %endif ; MODULE_SERIAL 214 %endif ; MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 215 %endif ; MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 216 %endif ; MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 217 191 218 %endif 192 219 -
trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
r588 r589 257 257 db 20h, 2bh, 0fh ; compressed 258 258 259 %ifdef MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 259 260 g_szDeviceTypeValues_32bit: ; db " 32",NULL 260 261 ; db 20h, 33h, 32h, 00h ; uncompressed 261 262 db 20h, 2dh, 0ch ; compressed 262 263 264 %ifdef MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 263 265 g_szDeviceTypeValues_8bit: ; db " 8",NULL 264 266 ; db 20h, 20h, 38h, 00h ; uncompressed … … 273 275 db 5eh, 30h, 00h ; compressed 274 276 277 %ifdef MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 275 278 g_szDeviceTypeValues_XTCFpio8: ; db "T8 ",NULL ; True 8-bit 276 279 ; db 54h, 38h, 20h, 00h ; uncompressed … … 297 300 db 53h, 30h, 00h ; compressed 298 301 302 %ifdef MODULE_SERIAL 299 303 g_szDeviceTypeValues_Serial: ; db "SER",NULL 300 304 ; db 53h, 45h, 52h, 00h ; uncompressed 301 305 db 59h, 4bh, 98h ; compressed 302 306 303 304 g_szDeviceTypeValues_Displacement equ (g_szDeviceTypeValues_32bit - g_szDeviceTypeValues) 307 %endif ; MODULE_SERIAL 308 %endif ; MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 309 %endif ; MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 310 %endif ; MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 311 312 g_szDeviceTypeValues_Displacement equ 3 ; 3 compressed, 4 uncompressed 313 ;g_szDeviceTypeValues_Displacement equ (g_szDeviceTypeValues_32bit - g_szDeviceTypeValues) 305 314 ; 306 315 ; Ensure that device type strings are correctly spaced in memory … … 310 319 %error "g_szDeviceTypeValues Displacement Incorrect 1" 311 320 %endif 321 322 %ifdef MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 323 312 324 %if g_szDeviceTypeValues_32bit <> g_szDeviceTypeValues_16bit + g_szDeviceTypeValues_Displacement 313 325 %error "g_szDeviceTypeValues Displacement Incorrect 2" 314 326 %endif 327 328 %ifdef MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 329 315 330 %if g_szDeviceTypeValues_8bit <> g_szDeviceTypeValues_32bit + g_szDeviceTypeValues_Displacement 316 331 %error "g_szDeviceTypeValues Displacement Incorrect 3" … … 322 337 %error "g_szDeviceTypeValues Displacement Incorrect 5" 323 338 %endif 339 340 %ifdef MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 341 324 342 %if g_szDeviceTypeValues_XTCFpio8 <> g_szDeviceTypeValues_XTIDEr2 + g_szDeviceTypeValues_Displacement 325 343 %error "g_szDeviceTypeValues Displacement Incorrect 6" … … 340 358 %error "g_szDeviceTypeValues Displacement Incorrect 11" 341 359 %endif 360 361 %ifdef MODULE_SERIAL 362 342 363 %if g_szDeviceTypeValues_Serial <> g_szDeviceTypeValues_ADP50L + g_szDeviceTypeValues_Displacement 343 364 %error "g_szDeviceTypeValues Displacement Incorrect 12" 344 365 %endif 366 367 %endif ; MODULE_SERIAL 368 %endif ; MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 369 %endif ; MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 370 %endif ; MODULE_ADVANCED_ATA OR MODULE_8BIT_IDE OR MODULE_8BIT_IDE_ADVANCED OR MODULE_SERIAL 371 345 372 %endif 346 373 … … 567 594 568 595 ;; translated usage stats 569 ;; 172:2570 ;; 47:2571 ;; 171:2572 ;; 46:3573 ;; 48:2574 ;; 181:1575 ;; 200:1576 ;; 54:2577 ;; 45:2578 ;; 49:2579 596 ;; 34:3 580 597 ;; 179:8 581 ;; 56:8 598 ;; 46:3 599 ;; 44:1 600 ;; 200:1 601 ;; 48:2 602 ;; 175:1 603 ;; 171:2 604 ;; 51:3 605 ;; 50:2 582 606 ;; 33:1 583 607 ;; 53:2 608 ;; 45:2 609 ;; 47:2 610 ;; 172:2 611 ;; 56:8 584 612 ;; 32:34 585 ;; 175:1 586 ;; 44:1 587 ;; 50:2 588 ;; 51:3 613 ;; 181:1 614 ;; 54:2 615 ;; 49:2 589 616 ;; total translated: 20 590 617 591 618 ;; format usage stats 592 ;; z:2 619 ;; 5-x:1 620 ;; 2-u:1 621 ;; s:14 593 622 ;; nl:12 594 ;; u:6595 ;; 5-x:1596 ;; c:13597 623 ;; A:4 598 ;; s:14599 624 ;; 5-u:2 600 625 ;; x:5 601 ;; 2-u:1602 626 ;; 2-I:1 627 ;; z:2 628 ;; u:6 629 ;; c:13 603 630 ;; total format: 11 604 631 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r588 r589 62 62 63 63 jnz SHORT .EnableDeviceIrq 64 oral, FLG_DEVCONTROL_nIEN ; Disable IRQ64 mov al, FLG_DEVCONTROL_nIEN ; Disable IRQ 65 65 .EnableDeviceIrq: 66 66 %else -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm
r568 r589 231 231 232 232 xor dl, dl ; Clear DL for checksum 233 push bp 234 mov bp, StoswThenAddALandAHtoDL 233 235 234 236 ; DPTE.wBasePort 235 237 mov ax, [si+DPT.wBasePort] 236 call StoswThenAddALandAHtoDL; Bytes 0 and 1238 call bp ; Bytes 0 and 1 237 239 238 240 ; DPTE.wControlBlockPort 239 241 eMOVZX bx, [si+DPT.bIdevarsOffset] 240 242 mov ax, [cs:bx+IDEVARS.wControlBlockPort] 241 call StoswThenAddALandAHtoDL; Bytes 2 and 3243 call bp ; Bytes 2 and 3 242 244 243 245 ; DPTE.bDrvnhead and DPTE.bBiosVendor … … 245 247 call AccessDPT_GetDriveSelectByteToAL 246 248 xchg si, di 247 call StoswThenAddALandAHtoDL; Bytes 4 and 5249 call bp ; Bytes 4 and 5 248 250 249 251 ; DPTE.bIRQ and DPTE.bBlockSize 250 252 mov al, [cs:bx+IDEVARS.bIRQ] ; No way to define that we might not use IRQ 251 mov ah, [si+DPT_ATA.bBlockSize] 252 cmp ah, 1253 j beSHORT .DoNotSetBlockModeFlag253 mov ah, [si+DPT_ATA.bBlockSize] ; DPT_ATA.bBlockSize must never be zero! 254 sahf ; Only block size = 1 sets CF 255 jc SHORT .DoNotSetBlockModeFlag 254 256 or cl, FLG_BLOCK_MODE_ENABLED 255 257 .DoNotSetBlockModeFlag: 256 call StoswThenAddALandAHtoDL; Bytes 6 and 7258 call bp ; Bytes 6 and 7 257 259 258 260 ; DPTE.bDmaChannelAndType and DPTE.bPioMode … … 266 268 sbb cl, -1 ; FLG_FAST_PIO_ENABLED (if .wControllerID > 0) 267 269 .DoNotSetFastPioFlag: 268 call StoswThenAddALandAHtoDL; Bytes 8 and 9270 call bp ; Bytes 8 and 9 269 271 %endif 270 272 … … 279 281 .NoChsTranslationOrBitShiftTranslationSet: 280 282 xchg ax, cx 281 call StoswThenAddALandAHtoDL ; Bytes 10 and 11 283 call bp ; Bytes 10 and 11 284 pop bp 282 285 283 286 ; DPTE.wReserved (must be zero) -
trunk/XTIDE_Universal_BIOS/makefile
r580 r589 18 18 # MODULE_8BIT_IDE Support for 8-BIT IDE cards like XTIDE # 19 19 # MODULE_8BIT_IDE_ADVANCED Support for memory mapped and DMA based cards like JRIDE and XTCF # 20 # MODULE_ADVANCED_ATA Native support for some VLB IDE controllers 20 # MODULE_ADVANCED_ATA Native support for some VLB IDE controllers (requires USE_386) # 21 21 # MODULE_COMPATIBLE_TABLES Support for ill behaving software that tries to access DPT directly # 22 22 # MODULE_BOOT_MENU Boot Menu for selection of drive to boot from # … … 108 108 DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED 109 109 DEFINES_XTPLUS = $(DEFINES_XT) USE_186 110 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ ADVANCED_ATA MODULE_COMPATIBLE_TABLES110 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_COMPATIBLE_TABLES 111 111 112 112 DEFINES_XT_LARGE = $(DEFINES_XT) $(DEFINES_COMMON_LARGE) … … 115 115 116 116 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION 117 DEFINES_386_8K = $(DEFINES_AT) USE_386 117 DEFINES_386_8K = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA 118 118 119 119 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_POWER_MANAGEMENT MODULE_COMPATIBLE_TABLES -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
r526 r589 75 75 76 76 cmp dx, MAX_EEPROM_SIZE_IN_BYTES >> 16 77 jb SHORT .FileNotTooBig 77 78 ja SHORT .FileTooBig 78 jb SHORT .FileNotTooBig79 79 cmp ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh 80 80 ja SHORT .FileTooBig -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r567 r589 214 214 call Buffers_GetFileBufferToESDI 215 215 call EEPROM_GetXtideUniversalBiosSizeFromESDItoDXCX 216 dec cx ; Leave space for checksum byte 217 xor ax, ax 218 ALIGN JUMP_ALIGN 216 217 ; Compatibility fix for 3Com 3C503 cards where the ASIC returns 8080h as the last two bytes of the ROM. 218 219 ; Assume the BIOS size is not 8K, ie generate a normal checksum. 220 dec cx 221 mov ax, 100h 222 cmp cx, 8192 - 1 223 jne SHORT .BiosSizeIsNot8K 224 ; The BIOS size is 8K and therefore a potential candidate for a 3Com 3C503 card. 225 dec cx 226 dec cx 227 mov ah, 3 228 ALIGN JUMP_ALIGN 229 .BiosSizeIsNot8K: 219 230 .SumNextByte: 220 231 add al, [es:di] 232 .NextChecksumByte: 221 233 inc di 222 234 loop .SumNextByte 223 235 neg al 224 236 mov [es:di], al 237 inc cx 238 dec ah 239 jnz SHORT .NextChecksumByte 225 240 226 241 pop dx … … 271 286 ; ES:DI: Ptr to file buffer 272 287 ; Corrupts registers: 273 ; AX288 ; Nothing 274 289 ;-------------------------------------------------------------------- 275 290 ALIGN JUMP_ALIGN 276 291 Buffers_GetIdeControllerCountToCX: 277 call Buffers_GetFileBufferToESDI 278 mov al, [es:di+ROMVARS.bIdeCnt] 279 280 ; Limit controller count for lite mode 292 xor cx, cx 293 call Buffers_GetFileBufferToESDI 294 or cl, [es:di+ROMVARS.bIdeCnt] 295 jnz SHORT .LimitControllerCountForLiteMode 296 inc cx ; Make sure there is at least one controller 297 298 .LimitControllerCountForLiteMode: 281 299 test BYTE [es:di+ROMVARS.wFlags], FLG_ROMVARS_FULLMODE 282 300 jnz SHORT .ReturnControllerCountInCX 283 MIN_U al, MAX_LITE_MODE_CONTROLLERS301 MIN_U cl, MAX_LITE_MODE_CONTROLLERS 284 302 285 303 .ReturnControllerCountInCX: 286 cbw ; A maximum of 127 controllers should be sufficient287 xchg cx, ax288 304 ret 289 305 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r568 r589 81 81 mov cl, dl 82 82 eSHL_IM ch, 1 83 eRCL_IM dl, 1 83 84 ret 84 85 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm
r567 r589 56 56 DetectMemoryMappedDeviceFromSegmentDX: 57 57 ; *** Try to detect JR-IDE/ISA and ADP50L (only if MODULE_8BIT_IDE_ADVANCED is present) *** 58 test WORD[di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED58 test BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED 59 59 stc 60 60 jz SHORT .NoIdeDeviceFound -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
r554 r589 76 76 ALIGN JUMP_ALIGN 77 77 Main_Start: 78 mov ah, GET_DOS_VERSION 79 int DOS_INTERRUPT_21h 80 cmp al, 2 81 jae SHORT .DosVersionIsOK 82 mov dx, g_s$NotMinimumDosVersion 83 mov ah, WRITE_STRING_TO_STANDARD_OUTPUT 84 int DOS_INTERRUPT_21h 85 ret 86 .DosVersionIsOK: 87 78 88 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE 79 call InitializeScreenWithBackgrou dCharAndAttrInAX89 call InitializeScreenWithBackgroundCharAndAttrInAX 80 90 81 91 call Main_InitializeCfgVars 82 92 call MenuEvents_DisplayMenu 83 93 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE 84 call InitializeScreenWithBackgrou dCharAndAttrInAX94 call InitializeScreenWithBackgroundCharAndAttrInAX 85 95 86 96 ; Exit to DOS 87 mov ax, 4C00h ; Exit to DOS88 int 97 mov ax, TERMINATE_WITH_RETURN_CODE<<8 ; Errorlevel 0 in AL 98 int DOS_INTERRUPT_21h 89 99 90 100 91 101 ;-------------------------------------------------------------------- 92 ; InitializeScreenWithBackgrou dCharAndAttrInAX102 ; InitializeScreenWithBackgroundCharAndAttrInAX 93 103 ; Parameters: 94 104 ; AL: Background character … … 100 110 ;-------------------------------------------------------------------- 101 111 ALIGN JUMP_ALIGN 102 InitializeScreenWithBackgrou dCharAndAttrInAX:112 InitializeScreenWithBackgroundCharAndAttrInAX: 103 113 xchg dx, ax 104 114 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
r526 r589 156 156 ; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI 157 157 ; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI 158 ; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI 158 159 ; Parameters: 159 160 ; DS:SI: Ptr to MENUITEM … … 177 178 178 179 ;-------------------------------------------------------------------- 179 ; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI180 ; PrintLookupValueFromAXtoBufferInESDI 180 181 ; Parameters: 181 182 ; AX: Value to print … … 190 191 PrintLookupValueFromAXtoBufferInESDI: 191 192 push si 192 test byte[si+MENUITEM.bFlags], FLG_MENUITEM_CHOICESTRINGS193 jnz .lookupChoice193 test BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_CHOICESTRINGS 194 jnz SHORT .LookupChoice 194 195 195 196 add ax, [si+MENUITEM.itemValue+ITEM_VALUE.rgszValueToStringLookup] 196 197 xchg bx, ax 197 . found:198 .Found: 198 199 mov si, [bx] 199 . errorReturn:200 .ErrorReturn: 200 201 call String_CopyDSSItoESDIandGetLengthToCX 201 202 pop si … … 212 213 ; value could be zero, we don't use the .rgwChoiceToValueLookup array to find the end. 213 214 ; 214 . lookupChoice:215 mov bx, [si+MENUITEM.itemValue+ITEM_VALUE.rgszChoiceToStringLookup]216 mov si, [si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup]217 218 . wordLoop:219 cmp ax, [si]220 j z .found215 .LookupChoice: 216 mov bx, [si+MENUITEM.itemValue+ITEM_VALUE.rgszChoiceToStringLookup] 217 mov si, [si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup] 218 219 .WordLoop: 220 cmp ax, [si] 221 je SHORT .Found 221 222 inc bx 222 223 inc bx 223 224 inc si 224 225 inc si 225 cmp word [bx],0226 jn z .wordLoop227 228 mov si, g_szValueUnknownError229 jmp .errorReturn226 cmp WORD [bx], 0 227 jne SHORT .WordLoop 228 229 mov si, g_szValueUnknownError 230 jmp SHORT .ErrorReturn 230 231 231 232 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
r567 r589 177 177 %assign i i+1 178 178 %endrep 179 ; dw NULL ; Is this needed? *FIXME* 179 dw NULL 180 180 181 181 182 ; Section containing code … … 285 286 call Buffers_GetRomvarsFlagsToAX 286 287 mov bx, g_MenuitemConfigurationIdleTimeout 287 test a x, FLG_ROMVARS_MODULE_POWER_MANAGEMENT288 test al, FLG_ROMVARS_MODULE_POWER_MANAGEMENT 288 289 jz SHORT .DisableMenuitemFromCSBX 289 290 ; Fall to .EnableMenuitemFromCSBX … … 393 394 push es 394 395 pop ds 395 xor ch, ch ; clearing high order of CX and notification flag 396 mov dx, cx ; (probably unnecessary, CX should be less than 127, but just to be sure) 397 jcxz .done ; probably unnecessary, but make sure there is at least one controller 396 mov dx, cx ; Controller count to DL (will always be at least 1) while also clearing notification flag in DH 398 397 399 398 lea bx, [di+ROMVARS.ideVars0] ; add in offset of first idevars … … 404 403 xor ax, ax ; first non-serial found 405 404 mov cl, dl ; idevars count 406 xor ch, ch407 405 408 406 .loop: 409 cmp byte[di+IDEVARS.bDevice], DEVICE_SERIAL_PORT410 jn z.notSerial407 cmp BYTE [di+IDEVARS.bDevice], DEVICE_SERIAL_PORT 408 jne SHORT .notSerial 411 409 412 410 test si, si ; record the first serial controller that we find 413 jnz .next411 jnz SHORT .next 414 412 mov si, di 415 413 SKIP2B f … … 423 421 424 422 test si, si ; no serial drives, nothing to do 425 jz .done423 jz SHORT .done 426 424 cmp si, ax ; serial port is already later on the list than any other controllers 427 ja .done; (also takes care of the case where there are no other controllers)425 ja SHORT .done ; (also takes care of the case where there are no other controllers) 428 426 429 427 ; … … 438 436 mov di, sp 439 437 440 mov cx, IDEVARS_size441 438 push ss 442 439 pop es 443 440 441 %if IDEVARS_size & 1 442 mov cl, IDEVARS_size 444 443 rep movsb 444 %else 445 mov cl, IDEVARS_size / 2 446 rep movsw 447 %endif 445 448 446 449 lea di, [si-IDEVARS_size] ; move up all the idevars below the serial, by one slot … … 457 460 push ss 458 461 pop ds 459 mov cx, IDEVARS_size460 462 ; di is already at last IDEVARS position 461 463 464 %if IDEVARS_size & 1 465 mov cl, IDEVARS_size 462 466 rep movsb 467 %else 468 mov cl, IDEVARS_size / 2 469 rep movsw 470 %endif 463 471 464 472 add sp, IDEVARS_size … … 469 477 mov dh, 1 ; set flag that we have done a relocation 470 478 471 jmp .outerLoop479 jmp SHORT .outerLoop 472 480 473 481 .done: … … 478 486 479 487 test dh, dh 480 jz .noWorkDone488 jz SHORT .noWorkDone 481 489 482 490 mov dx, g_szSerialMoved -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r568 r589 328 328 call .GetSelectedEepromSizeInWordsToAX 329 329 xor dx, dx 330 shlax, 1 ; Size in bytes to...331 rcldx, 1 ; ...DX:AX330 eSHL_IM ax, 1 ; Size in bytes to... 331 eRCL_IM dx, 1 ; ...DX:AX 332 332 333 333 cmp WORD [si+FLASHVARS.wEepromPageSize], BYTE 1 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r588 r589 571 571 572 572 573 ;574 ; No change to Device byte, but use this opportunity to change defaults stored in wPort and wPortCtrl if we are575 ; changing in/out of a Serial device (since we use these bytes in radically different ways).576 ;577 573 ALIGN JUMP_ALIGN 578 574 IdeControllerMenu_WriteDevice: … … 581 577 push ax 582 578 579 mov bl, [es:di] ; What is the current Device we are changing from? 580 sub di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort ; Get ready to set the Port addresses 581 583 582 ; Note! AL is the choice index, not device code 584 shl ax, 1 ; Selection to device code 585 mov bl, [es:di] ; what is the current Device we are changing from? 586 sub di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort ; Get ready to set the Port addresses 583 shl al, 1 ; Selection to device code 584 585 ; Restore ports and other stuff to default values 586 jz SHORT .StandardIdeDevice ; DEVICE_16BIT_ATA 587 588 cmp al, DEVICE_8BIT_ATA 589 ja SHORT .NotStandardIdeDevice 590 jb SHORT .AdvancedAtaDevice ; DEVICE_32BIT_ATA 591 test BYTE [es:ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE 592 jmp SHORT .CheckZF 593 594 .AdvancedAtaDevice: 595 test BYTE [es:ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_ADVANCED_ATA >> 8 596 .CheckZF: 597 jz SHORT .SupportForDeviceNotAvailable 598 599 ; Standard ATA controllers, including 8-bit mode 600 .StandardIdeDevice: 601 lea ax, [di-ROMVARS.ideVars0+IDEVARS.wBasePort] 602 mov bl, IDEVARS_size 603 div bl 604 mov bx, .rgbLowByteOfStdIdeInterfacePorts 605 xlat 606 mov ah, 1 ; DEVICE_ATA_*_PORT >> 8 607 mov bh, 3 ; DEVICE_ATA_*_PORTCTRL >> 8 608 mov bl, al 609 jmp SHORT .WriteNonSerial 610 611 .rgbLowByteOfStdIdeInterfacePorts: ; Defaults for 16-bit and better ATA devices 612 db DEVICE_ATA_PRIMARY_PORT & 0FFh 613 db DEVICE_ATA_SECONDARY_PORT & 0FFh 614 db DEVICE_ATA_TERTIARY_PORT & 0FFh 615 db DEVICE_ATA_QUATERNARY_PORT & 0FFh 616 617 .NotStandardIdeDevice: 587 618 cmp al, DEVICE_SERIAL_PORT 588 je SHORT .ChangingToSerial 619 jb SHORT .NotSerialDevice 620 test BYTE [es:ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_SERIAL >> 8 621 jnz SHORT .ChangingToSerial 622 623 .SupportForDeviceNotAvailable: 624 push dx 625 mov dx, g_szUnsupportedDevice 626 call Dialogs_DisplayErrorFromCSDX 627 pop dx 628 629 ; Restore device type to the previous value 630 pop ax ; Get choice index from stack 631 mov al, bl ; Previous device type to AL 632 shr al, 1 ; Device code to choice index 633 jmp SHORT .DoneWithNoChangeOfDevice 634 635 .NotSerialDevice: 636 ; Remaining device types all require MODULE_8BIT_IDE or MODULE_8BIT_IDE_ADVANCED 637 test BYTE [es:ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE | FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED 638 jz SHORT .SupportForDeviceNotAvailable 639 640 ; We know MODULE_8BIT_IDE is included 641 lahf ; Save the PF 642 cmp al, DEVICE_8BIT_XTIDE_REV2 643 jbe SHORT .ChangingToXTIDEorXTCF 644 sahf ; Restore the PF 645 jpo SHORT .SupportForDeviceNotAvailable ; Jump if no MODULE_8BIT_IDE_ADVANCED 589 646 cmp al, DEVICE_8BIT_JRIDE_ISA 590 647 je SHORT .ChangingToJrIdeIsa … … 592 649 je SHORT .ChangingToADP50L 593 650 594 ; Restore ports to default values 595 cmp al, DEVICE_8BIT_ATA ; Standard ATA controllers, including 8-bit mode 596 mov ax, DEVICE_ATA_PRIMARY_PORT ; Defaults for 16-bit and better ATA devices 597 mov bx, DEVICE_ATA_PRIMARY_PORTCTRL 598 jbe SHORT .WriteNonSerial 599 651 .ChangingToXTIDEorXTCF: 600 652 mov ax, DEVICE_XTIDE_DEFAULT_PORT ; Defaults for 8-bit XTIDE and XT-CF devices 601 653 mov bx, DEVICE_XTIDE_DEFAULT_PORTCTRL … … 631 683 .Done: 632 684 pop ax 685 .DoneWithNoChangeOfDevice: 633 686 pop di ; IDEVARS.bDevice 634 687 pop bx -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r588 r589 21 21 SECTION .data 22 22 23 ; DOS version check 24 g_s$NotMinimumDosVersion: db LF,"This program requires DOS version 2 or higher.",LF,"$" 25 23 26 ; Menu title 24 27 g_szProgramTitle: db "Configuration and Flashing program for XTIDE Universal BIOS v2.0.0.",LF,CR,NULL 25 g_szXtideUniversalBiosSignature: db "XTIDE205",NULL28 g_szXtideUniversalBiosSignature: db FLASH_SIGNATURE,NULL 26 29 g_szBiosIsNotLoaded: db "BIOS is not loaded!",NULL 27 30 g_szEEPROM: db "EEPROM",NULL … … 134 137 db " Conventional memory. This makes it possible to use ROM BASIC and other software that requires" 135 138 db " the interrupt vectors where XTIDE Universal BIOS parameters would be stored in Lite mode.",LF,LF 136 db "Lite mode supports only one IDE controller (2drives) and stores parameters to the top of the interrupt vectors"139 db "Lite mode supports only 2 IDE controllers (4 drives) and stores parameters to the top of the interrupt vectors" 137 140 db " (30:0h) so no Conventional memory needs to be reserved. Lite mode cannot be used if some software requires" 138 141 db " the top of interrupt vectors. Usually this is not a problem since only IBM ROM BASIC uses them.",LF,LF … … 221 224 g_szDlgIdeEnIRQ: db "Enable interrupt?",NULL 222 225 g_szDlgIdeIRQ: db "Enter IRQ channel (2...7 for 8-bit controllers, 2...15 for any other controller).",NULL 226 g_szUnsupportedDevice: db "There is no support for this device type in the currently loaded BIOS." 227 db " You must load a BIOS built with the proper module included to be able to use this type of device.",NULL 223 228 224 229 g_szNfoIdeBackToCfgMenu: db "Back to XTIDE Universal BIOS Configuration Menu.",NULL … … 275 280 db "XTIDE rev 1",LF 276 281 db "XTIDE rev 2 or modded rev 1",LF 277 db "XT-CF (PIO8)",LF278 db "XT-CF (PIO8 w/BIU offload)",LF279 db "XT-CF (PIO16 w/BIU offload)",LF282 db "XT-CF PIO8",LF 283 db "XT-CF PIO8 (BIU offload)",LF 284 db "XT-CF PIO16 (BIU offload)",LF 280 285 db "XT-CF DMA (v3 only)",LF 281 286 db "JR-IDE/ISA",LF
Note:
See TracChangeset
for help on using the changeset viewer.