Changeset 175 in xtideuniversalbios


Ignore:
Timestamp:
Oct 22, 2011, 9:04:01 PM (11 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

ifdef of existing serial code, in preperation for checkin

Location:
trunk/XTIDE_Universal_BIOS
Files:
6 edited

Legend:

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

    r173 r175  
    1212    .bFlagsHigh                 resb    1
    1313    .bIdevarsOffset             resb    1   ; Offset to IDEVARS for this drive
    14                                 resb    1
     14%ifdef MODULE_SERIAL
     15    .bSerialPortAndBaud         resb    1   ; Packed I/O port and baud rate for serial drives
     16%else
     17                                resb    1   ; without serial port support, alignment byte
     18%endif
    1519
    1620    ; IDE Drive related
     
    4448FLGH_DPT_REVERSED_A0_AND_A3     EQU (1<<0)  ; XTIDE mod, Address lines 0 and 3 reversed
    4549FLGH_DPT_BLOCK_MODE_SUPPORTED   EQU (1<<1)  ; Use block transfer commands (must be bit 1!)
     50%ifdef MODULE_SERIAL
    4651FLGH_DPT_SERIAL_DEVICE          EQU (1<<2)  ; Serial Port Device
     52%endif
    4753FLGH_DPT_INTERRUPT_IN_SERVICE   EQU (1<<3)  ; Set when waiting for IRQ
    4854FLGH_DPT_RESET_nDRDY            EQU (1<<4)  ; Drive ready to accept commands
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r150 r175  
    2727    .ideVars2       resb    IDEVARS_size
    2828    .ideVars3       resb    IDEVARS_size
     29
     30    .ideVarsSerialAuto  resb    IDEVARS_size
    2931endstruc
    3032
     
    3234FLG_ROMVARS_FULLMODE    EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
    3335FLG_ROMVARS_DRVXLAT     EQU (1<<2)  ; Enable drive number translation
     36%ifdef MODULE_SERIAL
     37FLG_ROMVARS_MODULE_SERIAL   EQU (1<<3)
     38%else
     39FLG_ROMVARS_MODULE_SERIAL   EQU 0
     40%endif
    3441
    3542; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
     
    4754endstruc
    4855
    49 ; Device types for IDEVARS.bDeviceType
     56; Device types for IDEVARS.bDevice
    5057DEVICE_8BIT_DUAL_PORT_XTIDE             EQU (0<<1)
    5158DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0    EQU (1<<1)
     
    5360DEVICE_16BIT_ATA                        EQU (3<<1)
    5461DEVICE_32BIT_ATA                        EQU (4<<1)
     62%ifdef MODULE_SERIAL
    5563DEVICE_SERIAL_PORT                      EQU (5<<1)
    56 
     64%endif
    5765
    5866; Master/Slave drive specific parameters
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r161 r175  
    1717;--------------------------------------------------------------------
    1818Device_FinalizeDPT:
     19%ifdef MODULE_SERIAL
    1920    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    20     jnz     SHORT ReturnSuccessForSerialPort
     21    jnz     SHORT .FinalizeDptForSerialPortDevice
     22%endif
    2123    jmp     IdeDPT_Finalize
    22 ;.FinalizeDptForSerialPortDevice:   ; Dead label
    23 ;   jmp     SerialDPT_Finalize      ; and code
    24 
     24%ifdef MODULE_SERIAL
     25.FinalizeDptForSerialPortDevice:
     26    jmp     SerialDPT_Finalize     
     27%endif
    2528
    2629;--------------------------------------------------------------------
     
    3538;--------------------------------------------------------------------
    3639Device_ResetMasterAndSlaveController:
     40%ifdef MODULE_SERIAL
    3741    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    3842    jnz     SHORT ReturnSuccessForSerialPort
     43%endif
    3944    jmp     IdeCommand_ResetMasterAndSlaveController
    4045
     
    5459;--------------------------------------------------------------------
    5560Device_IdentifyToBufferInESSIwithDriveSelectByteInBH:
     61%ifdef MODULE_SERIAL
    5662    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    5763    je      SHORT .IdentifyDriveFromSerialPort
     64%endif
    5865    jmp     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     66%ifdef MODULE_SERIAL
    5967.IdentifyDriveFromSerialPort:
    6068    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
    61 
     69%endif
    6270
    6371;--------------------------------------------------------------------
     
    7785ALIGN JUMP_ALIGN
    7886Device_OutputCommandWithParameters:
     87%ifdef MODULE_SERIAL
    7988    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    8089    jnz     SHORT .OutputCommandToSerialPort
     90%endif
    8191    jmp     IdeCommand_OutputWithParameters
     92%ifdef MODULE_SERIAL
    8293ALIGN JUMP_ALIGN
    8394.OutputCommandToSerialPort:
    8495    jmp     SerialCommand_OutputWithParameters
    85 
     96%endif
    8697
    8798;--------------------------------------------------------------------
     
    98109ALIGN JUMP_ALIGN
    99110Device_SelectDrive:
     111%ifdef MODULE_SERIAL
    100112    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    101113    jnz     SHORT ReturnSuccessForSerialPort
     114%endif
    102115    jmp     IdeCommand_SelectDrive
     116%ifdef MODULE_SERIAL
    103117ReturnSuccessForSerialPort:
    104118    xor     ax, ax
    105119    ret
     120%endif
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r150 r175  
    2121    mov     bp, ROMVARS.ideVars0            ; CS:BP now points to first IDEVARS
    2222.DriveDetectLoop:
    23     call    DetectDrives_WithIDEVARS        ; Detect Master and Slave
     23    call    .DetectDrives_WithIDEVARS       ; Detect Master and Slave
    2424    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
    2525    loop    .DriveDetectLoop
     26
     27%ifdef MODULE_SERIAL
     28    test    BYTE [es:BDA.bKBFlgs1], (1<<2)
     29;;  jz      .done
     30    mov     bp, ROMVARS.ideVarsAutoSerial
     31;;; fall-through       
     32%else
    2633    ret
    27 
     34%endif
    2835
    2936;--------------------------------------------------------------------
     
    4047;       AX, BX, DX, SI, DI
    4148;--------------------------------------------------------------------
    42 DetectDrives_WithIDEVARS:
     49.DetectDrives_WithIDEVARS:
    4350    push    cx
    4451    mov     ax, g_szMaster
     
    5057    call    StartDetectionWithDriveSelectByteInBHandStringInAX
    5158    pop     cx
     59.done: 
    5260    ret
    5361
    54 
     62       
    5563;--------------------------------------------------------------------
    5664; StartDetectionWithDriveSelectByteInBHandStringInAX
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r165 r175  
    5454;---------------------------;
    5555%ifdef USE_AT
    56     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT
     56    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MODULE_SERIAL
    5757    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    5858    at  ROMVARS.wBootTimeout,   dw  30 * TICKS_PER_SECOND   ; Boot Menu selection timeout
     
    8989    at  ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  db  FLG_DRVPARAMS_BLOCKMODE
    9090    at  ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   db  FLG_DRVPARAMS_BLOCKMODE
     91
     92%ifdef MODULE_SERIAL
     93    at  ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice,      db  DEVICE_SERIAL_PORT
     94    at  ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db  FLG_DRVPARAMS_BLOCKMODE
     95    at  ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,  db  FLG_DRVPARAMS_BLOCKMODE     
     96%endif         
    9197%else
    9298;-----------------------------------;
    9399; XT and XT+ Build default settings ;
    94100;-----------------------------------;
    95     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT
     101    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MODULE_SERIAL
    96102    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    97103    at  ROMVARS.wBootTimeout,   dw  30 * TICKS_PER_SECOND   ; Boot Menu selection timeout
     
    116122    at  ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  db  FLG_DRVPARAMS_BLOCKMODE
    117123    at  ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   db  FLG_DRVPARAMS_BLOCKMODE
     124
     125%ifdef MODULE_SERIAL
     126    at  ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice,      db  DEVICE_SERIAL_PORT
     127    at  ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db  FLG_DRVPARAMS_BLOCKMODE
     128    at  ROMVARS.ideVarsSerialAuto+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,  db  FLG_DRVPARAMS_BLOCKMODE     
     129%endif 
    118130%endif
    119131iend
     
    165177%include "IdeError.asm"         ; Must be included after IdeWait.asm
    166178
     179%ifdef MODULE_SERIAL       
    167180; Serial Port Device support
    168181%include "SerialCommand.asm"
    169182%include "SerialDPT.asm"
     183%endif
    170184
    171185; INT 13h Hard Disk BIOS functions
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r173 r175  
    6363.StoreFlags:
    6464    mov     [di+DPT.wFlags], ax
     65
     66%ifdef MODULE_SERIAL
     67    cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
     68    jnz     .around
     69    or      byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
     70.around:               
     71%endif     
     72
    6573    ; Fall to .StoreAddressing
    6674
Note: See TracChangeset for help on using the changeset viewer.