Changeset 242 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Feb 10, 2012, 3:12:40 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r233 r242 29 29 30 30 mov cx, g_szDetectSlave 31 mov bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 31 mov bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 32 32 call StartDetectionWithDriveSelectByteInBHandStringInAX 33 33 34 34 pop cx 35 35 36 36 add bp, BYTE IDEVARS_size ; Point to next IDEVARS 37 37 38 %ifdef MODULE_SERIAL 38 %ifdef MODULE_SERIAL 39 39 jcxz .done ; Set to zero on .ideVarsSerialAuto iteration (if any) 40 40 %endif 41 41 42 42 loop .DriveDetectLoop 43 43 44 %ifdef MODULE_SERIAL 44 %ifdef MODULE_SERIAL 45 45 ; 46 46 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection) … … 49 49 jc .done 50 50 51 mov bp, ROMVARS.ideVarsSerialAuto ; Point to our special IDEVARS s ructure, just for serial scans52 51 mov bp, ROMVARS.ideVarsSerialAuto ; Point to our special IDEVARS structure, just for serial scans 52 53 53 mov al,[cs:ROMVARS.wFlags] ; Configurator set to always scan? 54 54 or al,[es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 55 55 and al,8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 56 jnz .DriveDetectLoop 56 jnz .DriveDetectLoop 57 57 %endif 58 58 … … 61 61 62 62 %if FLG_ROMVARS_SERIAL_SCANDETECT != 8 63 %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."63 %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." 64 64 %endif 65 65 66 66 67 67 ;-------------------------------------------------------------------- 68 68 ; StartDetectionWithDriveSelectByteInBHandStringInAX … … 110 110 ;call ReadAtapiInfoFromDrive ; Assume CD-ROM 111 111 ;jnc SHORT _CreateBiosTablesForCDROM 112 112 113 113 ;jmp short DetectDrives_DriveNotFound 114 114 ;;; fall-through instead of previous jmp instruction … … 122 122 ; AX, SI 123 123 ;-------------------------------------------------------------------- 124 DetectDrives_DriveNotFound: 124 DetectDrives_DriveNotFound: 125 125 mov si, g_szNotFound 126 jmp BootMenuPrint_NullTerminatedStringFromCSSIandSetCF 126 jmp BootMenuPrint_NullTerminatedStringFromCSSIandSetCF 127 127 128 128 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r235 r242 22 22 ePUSH_T ax, ROMVARS.szTitle ; Bios title string 23 23 push cs ; BIOS segment 24 25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 24 25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 26 26 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 27 27 … … 32 32 ; CS:CX: Ptr to "Master" or "Slave" string 33 33 ; CS:BP: Ptr to IDEVARS 34 ; SI: Ptr to template string 34 ; SI: Ptr to template string 35 35 ; Returns: 36 36 ; Nothing … … 44 44 ; DL=COM number character, DH=.bDevice 45 45 46 push bp ; setup stack for call to 46 push bp ; setup stack for call to 47 47 mov bp, sp ; BootMenuPrint_FormatCSSIfromParamsInSSBP 48 48 49 49 push cx ; Push "Master" or "Slave" 50 50 51 51 mov cl, (g_szDetectPort-$$) & 0xff ; Setup print string for standard IDE 52 52 ; Note that we modify only the low order bits of CX a lot here, … … 55 55 ; on the same 256 byte page, which is checked in strings.asm. 56 56 57 cmp dx, DEVICE_SERIAL_PORT << 8 ; Check if this is a serial device, 57 cmp dx, DEVICE_SERIAL_PORT << 8 ; Check if this is a serial device, 58 58 ; And also check if DL is zero, check with the jz below 59 ; This optimization requires that DEVICE_SERIAL_PORT be 59 ; This optimization requires that DEVICE_SERIAL_PORT be 60 60 ; the highest value in the DEVICE_* series, ensuring that 61 61 ; anything less in the high order bits is a different device. 62 62 63 j l.pushAndPrint ; CX = string to print, AX = port address, DX won't be used63 jb .pushAndPrint ; CX = string to print, AX = port address, DX won't be used 64 64 65 65 mov cl, (g_szDetectCOM-$$) & 0xff ; Setup print string for COM ports … … 68 68 69 69 push dx ; Push COM number character 70 ; If the str nig is going to be "Auto", we will push a NULL (zero)71 ; here for the COM port number, which will be eaten by the 72 ; print routine (DisplayPrint_CharacterFromAL), resulting in 70 ; If the string is going to be "Auto", we will push a NULL (zero) 71 ; here for the COM port number, which will be eaten by the 72 ; print routine (DisplayPrint_CharacterFromAL), resulting in 73 73 ; just "COM" being printed without a character after it. 74 74 75 75 mov cl, (g_szDetectCOMAuto-$$) & 0xff ; Setup secondary print string for "Auto" 76 76 77 77 jz .pushAndPrint ; CX = string to print, AX and DX won't be used 78 78 79 79 mov cl, (g_szDetectCOMLarge-$$) & 0xff ; Setup secondary print string for "COMn/xx.yK" 80 80 … … 82 82 cbw ; clear AH, AL will always be less than 128 83 83 xchg si,ax ; move AX to SI for divide 84 mov ax,1152 ; baud rate to displa is 115200/divisor, the "00" is handled84 mov ax,1152 ; baud rate to display is 115200/divisor, the "00" is handled 85 85 ; in the print strings 86 xor dx,dx; clear top 16-bits of dividend86 cwd ; clear top 16-bits of dividend 87 87 div si ; and divide... Now AX = baud rate/100, DX = 0 (always a clean divide) 88 88 89 89 mov si,10 ; Now separate the whole portion from the fractional for "K" display 90 90 div si ; and divide... Now AX = baud rate/1000, DX = low order digit 91 92 cmp ax,si ; < = 10: "2400", "9600", etc.; >10: "19.2K", "38.4K", etc.91 92 cmp ax,si ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc. 93 93 jae .pushAndPrint 94 94 95 95 mov cl, (g_szDetectCOMSmall-$$) & 0xff ; Setup secondary print string for "COMn/XXy00" 96 97 .pushAndPrint: 96 97 .pushAndPrint: 98 98 push cx ; Push print string 99 99 push ax ; Push high order digits, or port address, or N/A … … 102 102 mov si, g_szDetectOuter ; Finally load SI with wrapper string "IDE %s at %s: " 103 103 104 jmp short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 104 jmp short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 105 105 106 106 … … 127 127 ret 128 128 129 130 131
Note:
See TracChangeset
for help on using the changeset viewer.