Changeset 196 in xtideuniversalbios


Ignore:
Timestamp:
Nov 19, 2011, 11:18:39 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Added printing of COM port and baud rate, when set explicitly by idecfg. Although it eats some bytes, I think it is worth it, since the BIOS will be looking for a server on a particular com port and baud rate, and it could be hard to troubleshoot a mismatch without this information. However, if we become space crunched, this change can be backed out.

Location:
trunk/XTIDE_Universal_BIOS
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r181 r196  
    4545; Controller specific variables
    4646struc IDEVARS
    47     .wPort              resb    2   ; IDE Base Port for Command Block (usual) Registers
    48     .wPortCtrl          resb    2   ; IDE Base Port for Control Block Registers
    49     .bDevice            resb    1   ; Device type
    50     .bIRQ               resb    1   ; Interrupt Request Number
    51     .drvParamsMaster    resb    DRVPARAMS_size
    52     .drvParamsSlave     resb    DRVPARAMS_size
     47    .wPort:                                 ; IDE Base Port for Command Block (usual) Registers
     48    .bSerialCOMDigit            resb    1   ; Serial Device COM Port digit
     49    .bSerialPackedPortAndBaud   resb    1   ; Serial Device packed port and baud
     50
     51    .wPortCtrl:                             ; IDE Base Port for Control Block Registers
     52    .wSerialPackedPrintBaud     resb    2   ; Serial Device packed baud rate for printing
     53
     54    .bDevice                    resb    1   ; Device type
     55    .bIRQ                       resb    1   ; Interrupt Request Number
     56    .drvParamsMaster            resb    DRVPARAMS_size
     57    .drvParamsSlave             resb    DRVPARAMS_size
    5358endstruc
    5459
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r181 r196  
    4040SerialCommand_UART_scratch                      EQU     7
    4141
     42; note that the actual StaringPoint port address is not achievable (results in 0 which triggers auto detect)
    4243SerialCommand_PackedPortAndBaud_StartingPort    EQU     240h
     44       
    4345SerialCommand_PackedPortAndBaud_PortMask        EQU     0fch    ; upper 6 bits - 240h through 438h
    4446SerialCommand_PackedPortAndBaud_BaudMask        EQU     3       ; lower 2 bits - 4 baud rates
     
    125127        and     dl, SerialCommand_PackedPortAndBaud_PortMask
    126128        mov     dh, 0
    127         shl     dx, 1
     129        shl     dx, 1           ; port offset already x4, needs one more shift to be x8
    128130        add     dx, SerialCommand_PackedPortAndBaud_StartingPort
    129131
     
    499501SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
    500502
    501         mov     dx,[cs:bp+IDEVARS.wPortCtrl]
    502         inc     dx
    503         dec     dx
     503        mov     dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]
     504        test    dl,dl
    504505        jz      SerialCommand_AutoSerial
    505506
     
    542543;
    543544
    544 SerialCommand_ScanPortAddresses:  db  0b8h, 0f8h, 0bch, 0bah, 0fah, 0beh, 0feh, 0
    545 ; Corresponds to I/O port:             3f8,  2f8,  3e8,  2e8,  2f0,  3e0,  2e0,  260,  368,  268,  360,  270
    546 ; COM Assignments:                       1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12
     545SerialCommand_ScanPortAddresses:     db  0b8h, 0f8h, 0bch, 0bah, 0fah, 0beh, 0feh, 0
     546; Corresponds to I/O port:                3f8,  2f8,  3e8,  2e8,  2f0,  3e0,  2e0,  260,  368,  268,  360,  270
     547; COM Assignments:                          1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12
     548; Corresponds to Packed I/O port (hex):    37,   17,   35,   15,   16,   34,   14,    4,   25,    5,   24,    6     
    547549
    548550ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r189 r196  
    2121    mov     bp, ROMVARS.ideVars0            ; CS:BP now points to first IDEVARS
    2222.DriveDetectLoop:
    23     mov     si,g_szDetect
     23    mov     si, g_szDetect
     24%ifdef MODULE_SERIAL
     25    cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
     26    jnz     .DriveNotSerial
     27    mov     si, g_szDetectCOM
     28.DriveNotSerial:
     29%endif
    2430    call    .DetectDrives_WithIDEVARS       ; Detect Master and Slave
    2531    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
     
    3036    jz      .done
    3137    mov     bp, ROMVARS.ideVarsSerialAuto
    32     mov     si,g_szSerial
     38    mov     si, g_szDetectCOMAuto
    3339;;; fall-through       
    3440%else
     
    5258.DetectDrives_WithIDEVARS:
    5359    push    cx
    54        
    55     push    si
     60
     61    push    si     
    5662    mov     ax, g_szMaster
    5763    mov     bh, MASK_DRVNHEAD_SET                               ; Select Master drive
    5864    call    StartDetectionWithDriveSelectByteInBHandStringInAX  ; Detect and create DPT + BOOTNFO
    5965    pop     si
    60        
     66
    6167    mov     ax, g_szSlave
    6268    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
     
    112118    ;call   ReadAtapiInfoFromDrive      ; Assume CD-ROM
    113119    ;jnc    SHORT _CreateBiosTablesForCDROM
    114     jmp     DetectPrint_DriveNotFound
     120    jmp     short DetectDrives_DriveNotFound
    115121
    116122
     
    130136CreateBiosTablesForHardDisk:
    131137    call    CreateDPT_FromAtaInformation
    132     jc      SHORT .InvalidAtaInfo
     138    jc      SHORT DetectDrives_DriveNotFound
    133139    call    BootInfo_CreateForHardDisk
    134     jmp     DetectPrint_DriveNameFromBootnfoInESBX
    135 .InvalidAtaInfo:
    136     jmp     DetectPrint_DriveNotFound
     140    jmp     short DetectPrint_DriveNameFromBootnfoInESBX
     141
     142;--------------------------------------------------------------------
     143; DetectDrives_DriveNotFound
     144;   Parameters:
     145;       Nothing
     146;   Returns:
     147;       Nothing
     148;   Corrupts registers:
     149;       AX, SI
     150;--------------------------------------------------------------------
     151DetectDrives_DriveNotFound:     
     152    mov     si, g_szNotFound
     153    jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF     
     154
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r192 r196  
    3636;       Nothing
    3737;   Corrupts registers:
    38 ;       AX, SI, DI
     38;       AX, SI, DI, CX
    3939;--------------------------------------------------------------------
    4040DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
    4141    push    bp
    4242    mov     di, [cs:bp+IDEVARS.wPort]
     43%ifdef MODULE_SERIAL
     44    mov     cx, [cs:bp+IDEVARS.wSerialPackedPrintBaud]
     45%endif
     46       
    4347    mov     bp, sp
    44     push    ax                          ; Push "Master" or "Slave"
    45     push    di                          ; Push port number
    46     jmp     DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
     48
     49    push    ax                          ; Push "Master" or "Slave"
     50       
     51    push    di                          ; Push Port address or COM port number
     52
     53%ifdef MODULE_SERIAL
     54;
     55; Baud rate is packed into one word:
     56;    High order 6 bits: number to add to '0' to get postfix character ('0' or 'K')
     57;    Low order 10 bits: binary number to display (960, 240, 38, or 115)
     58;          To get 9600: '0'<<10 + 960
     59;          To get 2400: '0'<<10 + 240
     60;          To get 38K:  ('K'-'0')<<10 + 38
     61;          To get 115K: ('K'-'0')<<10 + 115
     62;
     63    mov     ax,cx                       ; Unpack baud rate number
     64    and     ax,03ffh
     65    push    ax
     66
     67    mov     al,ch                       ; Unpack baud rate postfix ('0' or 'K')
     68    eSHR_IM al,2
     69    add     al,'0'
     70    push    ax
     71%endif
     72                       
     73    jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay   
    4774
    4875
     
    7097
    7198
    72 ;--------------------------------------------------------------------
    73 ; DetectPrint_DriveNotFound
    74 ;   Parameters:
    75 ;       Nothing
    76 ;   Returns:
    77 ;       Nothing
    78 ;   Corrupts registers:
    79 ;       AX, SI
    80 ;--------------------------------------------------------------------
    81 DetectPrint_DriveNotFound:
    82     mov     si, g_szNotFound
    83     jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     99
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r194 r196  
    1111; POST drive detection strings
    1212g_szRomAt:      db  "%s @ %x",LF,CR,NULL
    13 g_szMaster:     db  "Master",NULL
    14 g_szSlave:      db  "Slave ",NULL
    15 g_szDetect:     db  "IDE %s at %x: ",NULL           ; IDE Master at 1F0h:
    16 g_szSerial:     db  "Serial Port %s: ",NULL
    1713
     14g_szMaster:             db  "IDE Master at ",NULL
     15g_szSlave:              db  "IDE Slave  at ",NULL
     16g_szDetect:             db  "%s%x: ",NULL                      ; IDE Master at 1F0h:
     17g_szDetectCOM:          db  "%sCOM%c/%u%c: ",NULL              ; IDE Master at COM1/115K:       
     18g_szDetectCOMAuto:      db  "%sCOM Detect: ",NULL              ; IDE Master at COM Detect:
     19               
    1820; Boot loader strings
    1921g_szTryToBoot:          db  "Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x",LF,CR,NULL
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompress.pl

    r194 r196  
    175175{
    176176    $translate_index[$translate{$f}] = $f;
    177     $used{$f} || print "translate $f unused\n";
     177    $used{$f} || die "translate $f unused\n";
    178178    $translate{$f} <= 31 || die $translate{$f}.": translate codes must be below 32";
    179179}
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm

    r194 r196  
    2222                  db     34h,  20h, 0c6h,  39h,  1bh                                  ; compressed
    2323
    24 g_szMaster:     ; db    "Master",NULL
    25                 ; db     4dh,  61h,  73h,  74h,  65h,  72h,  00h    ; uncompressed
    26                   db     53h,  67h,  79h,  7ah,  6bh, 0b8h          ; compressed
    27 
    28 g_szSlave:      ; db    "Slave ",NULL
    29                 ; db     53h,  6ch,  61h,  76h,  65h,  20h,  00h    ; uncompressed
    30                   db     59h,  72h,  67h,  7ch,  6bh,  00h          ; compressed
    31 
    32 g_szDetect:     ; db    "IDE %s at %x: ",NULL           ; IDE Master at 1F0h:
    33                 ; db     49h,  44h,  45h,  20h,  25h,  73h,  20h,  61h,  74h,  20h,  25h,  78h,  3ah,  20h,  00h    ; uncompressed
    34                   db     4fh,  4ah, 0cbh,  34h,  20h,  67h, 0fah,  39h,  40h,  00h                                  ; compressed
    35 
    36 g_szSerial:     ; db    "Serial Port %s: ",NULL
    37                 ; db     53h,  65h,  72h,  69h,  61h,  6ch,  20h,  50h,  6fh,  72h,  74h,  20h,  25h,  73h,  3ah,  20h,  00h    ; uncompressed
    38                   db     59h,  6bh,  78h,  6fh,  67h, 0f2h,  56h,  75h,  78h, 0fah,  34h,  40h,  00h                            ; compressed
     24
     25g_szMaster:             ; db    "IDE Master at ",NULL
     26                        ; db     49h,  44h,  45h,  20h,  4dh,  61h,  73h,  74h,  65h,  72h,  20h,  61h,  74h,  20h,  00h    ; uncompressed
     27                          db     4fh,  4ah, 0cbh,  53h,  67h,  79h,  7ah,  6bh, 0f8h,  67h,  7ah,  00h                      ; compressed
     28
     29g_szSlave:              ; db    "IDE Slave  at ",NULL
     30                        ; db     49h,  44h,  45h,  20h,  53h,  6ch,  61h,  76h,  65h,  20h,  20h,  61h,  74h,  20h,  00h    ; uncompressed
     31                          db     4fh,  4ah, 0cbh,  59h,  72h,  67h,  7ch, 0ebh,  20h,  67h,  7ah,  00h                      ; compressed
     32
     33g_szDetect:             ; db    "%s%x: ",NULL                      ; IDE Master at 1F0h:
     34                        ; db     25h,  73h,  25h,  78h,  3ah,  20h,  00h    ; uncompressed
     35                          db     34h,  39h,  40h,  00h                      ; compressed
     36
     37g_szDetectCOM:          ; db  "%sCOM%c/%u%c: ",NULL              ; IDE Master at COM1/115K:     
     38                        ; db   25h,  73h,  43h,  4fh,  4dh,  25h,  63h,  2fh,  25h,  75h,  25h,  63h,  3ah,  20h,  00h    ; uncompressed
     39                          db   34h,  49h,  55h,  53h,  35h,  2ah,  37h,  35h,  40h,  00h                                  ; compressed
     40
     41g_szDetectCOMAuto:      ; db  "%sCOM Detect: ",NULL            ; IDE Master at COM Detect:
     42                        ; db   25h,  73h,  43h,  4fh,  4dh,  20h,  44h,  65h,  74h,  65h,  63h,  74h,  3ah,  20h,  00h    ; uncompressed
     43                          db   34h,  49h,  55h, 0d3h,  4ah,  6bh,  7ah,  6bh,  69h,  7ah,  40h,  00h                      ; compressed
    3944
    4045
     
    310315;; format usage stats
    311316;; A:4
     317;; c:8
     318;; s:15
    312319;; 2-u:1
     320;; u:6
    313321;; 5-u:3
     322;; 2-I:1
    314323;; x:6
    315324;; 5-x:1
    316 ;; s:14
    317325;; nl:6
    318 ;; 2-I:1
    319 ;; c:6
    320 ;; u:5
    321326;; total format: 10
    322327
    323328;; alphabet usage stats
    324 ;; 58,::3
     329;; 58,::4
    325330;; 59,;:
    326331;; 60,<:
     
    331336;; 65,A:3
    332337;; 66,B:11
    333 ;; 67,C:3
    334 ;; 68,D:10
    335 ;; 69,E:3
     338;; 67,C:5
     339;; 68,D:12
     340;; 69,E:4
    336341;; 70,F:3
    337342;; 71,G:
    338343;; 72,H:4
    339 ;; 73,I:2
     344;; 73,I:3
    340345;; 74,J:
    341346;; 75,K:
    342347;; 76,L:3
    343 ;; 77,M:2
     348;; 77,M:4
    344349;; 78,N:
    345 ;; 79,O:1
    346 ;; 80,P:2
     350;; 79,O:3
     351;; 80,P:1
    347352;; 81,Q:1
    348353;; 82,R:4
    349 ;; 83,S:7
     354;; 83,S:6
    350355;; 84,T:
    351356;; 85,U:1
     
    363368;; 97,a:7
    364369;; 98,b:
    365 ;; 99,c:4
     370;; 99,c:5
    366371;; 100,d:4
    367 ;; 101,e:10
     372;; 101,e:11
    368373;; 102,f:2
    369374;; 103,g:2
    370375;; 104,h:
    371 ;; 105,i:12
     376;; 105,i:11
    372377;; 106,j:
    373378;; 107,k:4
    374 ;; 108,l:5
     379;; 108,l:4
    375380;; 109,m:1
    376381;; 110,n:9
    377 ;; 111,o:18
     382;; 111,o:17
    378383;; 112,p:3
    379384;; 113,q:
    380 ;; 114,r:13
     385;; 114,r:11
    381386;; 115,s:6
    382 ;; 116,t:11
     387;; 116,t:13
    383388;; 117,u:2
    384389;; 118,v:2
Note: See TracChangeset for help on using the changeset viewer.