- Timestamp:
- Nov 22, 2011, 8:38:36 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r193 r200 65 65 ADDRESSING_MODE_LBA48 EQU 3 ; 48-bit LBA Addressing Mode 66 66 67 %macro CustomDPT_GetUnshiftedAddressModeToALZF 068 mov al, [di+DPT.bFlagsLow]69 and al, MASKL_DPT_ADDRESSING_MODE70 %endmacro71 72 67 ; Number of Sectors per Track is fixed to 63 for LBA assist calculation. 73 68 ; 1024 cylinders, 256 heads, 63 sectors = 8.4 GB limit (but DOS does not support more than 255 heads) -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r199 r200 100 100 ; baud rate = b, where 00 = 2400, 01 = 9600, 10 = 38.4K, 11 = 115.2K 101 101 ; 102 DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK EQU 0fch 103 DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTBITS EQU 03fh 104 DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT EQU 240h 105 DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDMASK EQU 3h 106 DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDBITS EQU 3h 102 ; 240h/2400baud corresponds to 0 for a PackedPortAndBaud value, which is reserved (in case we need 103 ; it to know if a value has been set). Which is why ..._MINPORT is 248h. 104 ; 105 DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK EQU 0fch 106 DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTBITS EQU 03fh 107 DEVICE_SERIAL_PACKEDPORTANDBAUD_PORT_FIELD_POSITION EQU 2 108 DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT EQU 240h 109 DEVICE_SERIAL_PACKEDPORTANDBAUD_MINPORT EQU 248h ; minimum port value that the user can set 110 DEVICE_SERIAL_PACKEDPORTANDBAUD_MAXPORT EQU 438h ; or (..._PORTMASK << 1) + ..._STARTINGPORT 111 112 DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDMASK EQU 3h 113 DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDBITS EQU 3h 114 DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUD_FIELD_POSITION EQU 0 107 115 108 116 ; Defines for IDEVARS.wSerialPrintBaud -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r194 r200 254 254 ; Returns: 255 255 ; BP: Popped from stack 256 ; CF: Set since menu event was handled successfully 256 257 ; Corrupts registers: 257 258 ; AX, DI -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r194 r200 54 54 ;-------------------------------------------------------------------- 55 55 .PushAddressingMode: 56 CustomDPT_GetUnshiftedAddressModeToALZF56 AccessDPT_GetUnshiftedAddressModeToALZF 57 57 ;; 58 58 ;; This multiply both shifts the addressing mode bits down to low order bits, and -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r170 r200 79 79 push dx ; Store base port address 80 80 xor cx, cx ; Assume no errors 81 callFindDPT_ToDSDIForIdeMasterAtPortDX81 FindDPT_ToDSDIForIdeMasterAtPortDX 82 82 jnc SHORT .InitializeSlave ; Master drive not present 83 83 call AH9h_InitializeDriveForUse … … 85 85 .InitializeSlave: 86 86 pop dx ; Restore base port address 87 callFindDPT_ToDSDIForIdeSlaveAtPortDX87 FindDPT_ToDSDIForIdeSlaveAtPortDX 88 88 jnc SHORT .CombineErrors ; Slave drive not present 89 89 call AH9h_InitializeDriveForUse -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r194 r200 87 87 call Address_ExtractLCHSparametersFromOldInt13hAddress 88 88 89 CustomDPT_GetUnshiftedAddressModeToALZF89 AccessDPT_GetUnshiftedAddressModeToALZF 90 90 91 91 ;;; 0: ADDR_DPT_LCHS -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r199 r200 20 20 call RamVars_GetIdeControllerCountToCX 21 21 mov bp, ROMVARS.ideVars0 ; CS:BP now points to first IDEVARS 22 .DriveDetectLoop: 23 mov si, g_szDetect 22 23 .DriveDetectLoop: ; Loop through IDEVARS 24 mov si, g_szDetect ; Setup standard print string 24 25 %ifdef MODULE_SERIAL 25 26 cmp byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 26 jnz .DriveNotSerial 27 jnz .DriveNotSerial ; Special print string for serial drives 27 28 mov si, g_szDetectCOM 28 29 .DriveNotSerial: … … 31 32 add bp, BYTE IDEVARS_size ; Point to next IDEVARS 32 33 loop .DriveDetectLoop 34 33 35 %ifdef MODULE_SERIAL 34 mov al,[cs:ROMVARS.wFlags] 35 or al,[es:BDA.bKBFlgs1] 36 and al,8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 37 jz .done 38 mov bp, ROMVARS.ideVarsSerialAuto 39 mov si, g_szDetectCOMAuto 36 call FindDPT_ToDSDIforSerialDevice ; Did we already find any serial drives? 37 jc .done ; Yes, do not scan 38 mov al,[cs:ROMVARS.wFlags] ; Configurator set to always scan? 39 or al,[es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 40 and al,8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 41 jz .done 42 mov bp, ROMVARS.ideVarsSerialAuto ; Point to our special IDEVARS sructure, just for serial scans 43 mov si, g_szDetectCOMAuto ; Special, special print string for serial drives during a scan 40 44 ;;; fall-through 41 45 %else … … 44 48 45 49 %if FLG_ROMVARS_SERIAL_SCANDETECT != 8 46 %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_ ALWAYSDETECT is the same bit as the ALT key code in the BDA. Changes in the code will be needed if these values are no longer the same."50 %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA. Changes in the code will be needed if these values are no longer the same." 47 51 %endif 48 52 … … 70 74 pop si 71 75 76 %ifdef MODULE_SERIAL 77 ; 78 ; This block of code checks to see if we found a master during a serial drives scan. If no master 79 ; was found, there is no point in scanning for a slave as the server will not return a slave without a master, 80 ; as there is very little point given the drives are emulated. Performing the slave scan will take 81 ; time to rescan all the COM port and baud rate combinations. 82 ; 83 jnc .masterFound 84 pop cx 85 jcxz .done ; note that CX will only be zero after the .DriveDetectLoop, indicating a serial scan 86 push cx 87 .masterFound: 88 %endif 89 72 90 mov ax, g_szSlave 73 91 mov bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 74 92 call StartDetectionWithDriveSelectByteInBHandStringInAX 75 93 pop cx 94 76 95 .done: 77 96 ret … … 87 106 ; ES: Zero (BDA segment) 88 107 ; Returns: 89 ; Nothing 108 ; CF: Set on failure, Clear on success 109 ; Note that this is set in the last thing both cases 110 ; do: printing the drive name, or printing "Not Found" 90 111 ; Corrupts registers: 91 112 ; AX, BX, CX, DX, SI, DI … … 150 171 ; Nothing 151 172 ; Returns: 152 ; Nothing173 ; CF: Set (from BootMenuPrint_NullTerminatedStringFromCSSIandSetCF) 153 174 ; Corrupts registers: 154 175 ; AX, SI -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r199 r200 88 88 pop bx 89 89 pop di 90 clc ; return success up through DetectDrives 90 91 ret 91 92 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r193 r200 124 124 .ReturnPointerToDRVPARAMS: 125 125 ret 126 127 ;-------------------------------------------------------------------- 128 ; AccessDPT_GetUnshiftedAddressModeToALZF 129 ; Parameters: 130 ; DS:DI: Ptr to Disk Parameter Table 131 ; Returns: 132 ; AL: Addressing Mode (L-CHS, P-CHS, LBA28, LBA48) 133 ; unshifted (still shifted where it is in bFlagsLow) 134 ; ZF: Set based on value in AL 135 ; Corrupts registers: 136 ; AL 137 ;-------------------------------------------------------------------- 138 ; 139 ; Converted to a macro since only called in two places, and the call/ret overhead 140 ; is not worth it for these two instructions (4 bytes total) 141 ; 142 %macro AccessDPT_GetUnshiftedAddressModeToALZF 0 143 mov al, [di+DPT.bFlagsLow] 144 and al, MASKL_DPT_ADDRESSING_MODE 145 %endmacro 146 147 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r181 r200 50 50 ret 51 51 52 53 52 ;-------------------------------------------------------------------- 54 53 ; Finds Disk Parameter Table for … … 67 66 ; Corrupts registers: 68 67 ; SI 69 ;-------------------------------------------------------------------- 70 ALIGN JUMP_ALIGN 71 FindDPT_ToDSDIForIdeMasterAtPortDX: 68 ; 69 ; Converted to macros since there is only once call site for each of these 70 ; 71 ;-------------------------------------------------------------------- 72 73 %macro FindDPT_ToDSDIForIdeMasterAtPortDX 0 72 74 mov si, IterateToMasterAtPortCallback 73 jmp SHORTIterateAllDPTs74 75 ALIGN JUMP_ALIGN 76 FindDPT_ToDSDIForIdeSlaveAtPortDX: 75 call IterateAllDPTs 76 %endmacro 77 78 %macro FindDPT_ToDSDIForIdeSlaveAtPortDX 0 77 79 mov si, IterateToSlaveAtPortCallback 78 jmp SHORT IterateAllDPTs 79 80 call IterateAllDPTs 81 %endmacro 82 83 80 84 ;-------------------------------------------------------------------- 81 85 ; Iteration callback for finding DPT using … … 113 117 jne SHORT ReturnWrongDPT 114 118 mov dl, ch ; Return drive number in DL 119 120 ReturnRightDPT: 115 121 stc ; Set CF since wanted DPT 116 122 ret … … 118 124 119 125 ;-------------------------------------------------------------------- 120 ; IterateToDptWith InterruptInServiceFlagSet126 ; IterateToDptWithFlagsHighSet: 121 127 ; Parameters: 122 128 ; DS:DI: Ptr to DPT to examine 129 ; AL: Bit in bFlagsHigh to test 123 130 ; Returns: 124 131 ; CF: Set if wanted DPT found … … 128 135 ;-------------------------------------------------------------------- 129 136 ALIGN JUMP_ALIGN 130 IterateToDptWithInterruptInServiceFlagSet: 131 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_INTERRUPT_IN_SERVICE 132 jz SHORT ReturnWrongDPT 133 stc ; Set CF since wanted DPT 134 ret 137 IterateToDptWithFlagsHighSet: 138 test BYTE [di+DPT.bFlagsHigh], al ; Clears CF (but we need the clc below anyway callers above) 139 jnz SHORT ReturnRightDPT 140 135 141 ReturnWrongDPT: 136 142 clc ; Clear CF since wrong DPT 137 143 ret 138 144 139 140 145 ;-------------------------------------------------------------------- 141 146 ; FindDPT_ToDSDIforInterruptInService 147 ; FindDPT_ToDSDIforSerialDevice 142 148 ; Parameters: 143 149 ; DS: RAMVARS segment … … 147 153 ; Cleared if DPT not found 148 154 ; Corrupts registers: 149 ; SI 150 ;-------------------------------------------------------------------- 151 ALIGN JUMP_ALIGN 155 ; SI, AX, BX (for SerialDevice only) 156 ;-------------------------------------------------------------------- 157 ALIGN JUMP_ALIGN 158 159 %ifdef MODULE_SERIAL 160 FindDPT_ToDSDIforSerialDevice: 161 mov al, FLGH_DPT_SERIAL_DEVICE 162 163 SKIP2B bx 164 %endif 165 166 ; do not align due to SKIP2B above 152 167 FindDPT_ToDSDIforInterruptInService: 153 mov si, IterateToDptWithInterruptInServiceFlagSet 168 mov al, FLGH_DPT_INTERRUPT_IN_SERVICE 169 170 mov si, IterateToDptWithFlagsHighSet 154 171 ; Fall to IterateAllDPTs 155 156 172 157 173 ;-------------------------------------------------------------------- … … 166 182 ; DS:DI: Ptr to wanted DPT (if found) 167 183 ; CF: Set if wanted DPT found 168 ; Cleared if DPT not found 169 ; Unchanged if no drives 184 ; Cleared if DPT not found, or no DPTs present 170 185 ; Corrupts registers: 171 186 ; Nothing unless corrupted by callback function … … 175 190 push cx 176 191 mov cx, [RAMVARS.wDrvCntAndFirst] 177 jcxz . AllDptsIterated; Return if no drives192 jcxz .NotFound ; Return if no drives 178 193 mov di, RAMVARS_size ; Point DS:DI to first DPT 179 194 ALIGN JUMP_ALIGN … … 185 200 dec cl ; Decrement drives left 186 201 jnz SHORT .LoopWhileDPTsLeft 202 .NotFound: 187 203 clc ; Clear CF since DPT not found 188 204 ALIGN JUMP_ALIGN -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SerialDetect.txt
r199 r200 1 Set to true, at the end of normal drive detection, COM ports 1-7 (in reverse order) will be scanned for a connection to a serial drive server. This option provides flexibility with the COM port and baud rate to be used, it need not be configured ahead of time, but at the expense of a slower boot process. Even when set to false, this functionality can still be invoked by holding down the ALT key at the end of normal drive detection. 1 Set to Yes, at the end of normal drive detection, COM ports 1-7 (in reverse order) will be scanned for a connection to a serial drive server. This option provides flexibility with the COM port and baud rate to be used, it need not be configured ahead of time, but at the expense of a slower boot process. Even when this option is set to No, this functionality can still be invoked by holding down the ALT key at the end of normal drive detection. Note that if any serial drives are detected during the normal drive detection, no scan will take place (to avoid finding the same drive twice). 2 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r199 r200 119 119 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL 120 120 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort 121 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 240h122 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 438h121 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw DEVICE_SERIAL_PACKEDPORTANDBAUD_MINPORT 122 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw DEVICE_SERIAL_PACKEDPORTANDBAUD_MAXPORT 123 123 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadPort 124 124 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWritePort … … 538 538 .custom: 539 539 mov al,'x' ; ASCII value 'x' for custom 540 mov ah, 0 ; 240h is default custom value540 mov ah,1 << DEVICE_SERIAL_PACKEDPORTANDBAUD_PORT_FIELD_POSITION ; 248h 541 541 jmp IdeControllerMenu_SerialWriteCOM_PackAndRet 542 542 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r199 r200 135 135 g_szNfoIdeSerialCOM: db "Select a COM port by number.",NULL 136 136 g_szNfoIdeSerialBaud: db "Select the COM port's Baud Rate. The server must match this speed. Note UART clock multipliers may impact the actual speed.",NULL 137 g_szNfoIdeSerialPort: db "Select a COM port by custom I/O port address. Address must be in the range 24 0h and438h and be on an 8-byte boundary.", NULL137 g_szNfoIdeSerialPort: db "Select a COM port by custom I/O port address. Address must be in the range 248h to 438h and be on an 8-byte boundary.", NULL 138 138 139 139 g_szHelpIdeCmdPort: incbin "IDE_CommandPort.txt"
Note:
See TracChangeset
for help on using the changeset viewer.