Changeset 483 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2


Ignore:
Timestamp:
Oct 28, 2012, 12:13:47 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to Configurator v2:

  • XT-CF Sector Window address can now be selected.
  • Default port settings will now be restored when selecting device.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt

    r68 r483  
    1 IDE controller command block address is the usual address mentioned for IDE controllers. By default the primary IDE controller uses port 1F0h and secondary controller uses port 170h. XTIDE card uses port 300h by default.
     1IDE controller command block address is the usual address mentioned for IDE controllers. By default the primary IDE controller uses port 1F0h and secondary controller uses port 170h. XTIDE card uses port 300h by default. JR-IDE/ISA do not use ports but you need to set ROM space segment address for JR-IDE/ISA.
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm

    r481 r483  
    2525%include "AssemblyLibrary.inc"  ; Assembly Library. Must be included first!
    2626%include "Romvars.inc"          ; XTIDE Universal BIOS variables
     27%include "JRIDE_ISA.inc"        ; For JR-IDE/ISA default segment
    2728%include "XTCF.inc"             ; For XT-CF modes
    2829
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r481 r483  
    2626    at  MENUPAGE.fnEnter,           dw  IdeControllerMenu_EnterMenuOrModifyItemVisibility
    2727    at  MENUPAGE.fnBack,            dw  ConfigurationMenu_EnterMenuOrModifyItemVisibility
    28     at  MENUPAGE.wMenuitems,        dw  11
     28    at  MENUPAGE.wMenuitems,        dw  12
    2929iend
    3030
     
    8383    at  MENUITEM.szQuickInfo,       dw  g_szNfoIdeCmdPort
    8484    at  MENUITEM.szHelp,            dw  g_szHelpIdeCmdPort
    85     at  MENUITEM.bFlags,            db  FLG_MENUITEM_VISIBLE
     85    at  MENUITEM.bFlags,            db  NULL
    8686    at  MENUITEM.bType,             db  TYPE_MENUITEM_HEX
    8787    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  NULL
     
    9898    at  MENUITEM.szQuickInfo,       dw  g_szNfoIdeCtrlPort
    9999    at  MENUITEM.szHelp,            dw  g_szHelpIdeCtrlPort
    100     at  MENUITEM.bFlags,            db  FLG_MENUITEM_VISIBLE
     100    at  MENUITEM.bFlags,            db  NULL
    101101    at  MENUITEM.bType,             db  TYPE_MENUITEM_HEX
    102102    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  NULL
     
    185185    at  MENUITEM.itemValue + ITEM_VALUE.wMinValue,                  dw  2
    186186    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  15
     187iend
     188
     189g_MenuitemIdeControllerXTCFwindow:
     190istruc MENUITEM
     191    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateHexInputForMenuitemInDSSI
     192    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
     193    at  MENUITEM.szName,            dw  g_szItemIdeXTCFwindow
     194    at  MENUITEM.szQuickInfo,       dw  g_szNfoIdeXTCFwindow
     195    at  MENUITEM.szHelp,            dw  g_szNfoIdeXTCFwindow
     196    at  MENUITEM.bFlags,            db  FLG_MENUITEM_BYTEVALUE
     197    at  MENUITEM.bType,             db  TYPE_MENUITEM_HEX
     198    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  NULL
     199    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgIdeXTCFwindow
     200    at  MENUITEM.itemValue + ITEM_VALUE.wMinValue,                  dw  0A000h
     201    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  0E800h
     202    at  MENUITEM.itemValue + ITEM_VALUE.fnValueReader,              dw  ReaderForXTCFwindow
     203    at  MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,              dw  WriterForXTCFwindow
    187204iend
    188205
     
    209226    dw  g_szValueCfgDeviceJrIdeIsa
    210227    dw  g_szValueCfgDeviceSerial
    211 
    212228
    213229g_rgbChoiceToValueLookupForCOM:
     
    315331    mov     [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    316332
     333    lea     ax, [bx+IDEVARS.bXTCFcontrolRegister]
     334    mov     [cs:g_MenuitemIdeControllerXTCFwindow+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     335
    317336    lea     ax, [bx+IDEVARS.bSerialCOMPortChar]
    318337    mov     [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     
    338357    push    cs
    339358    pop     ds
     359    call    .EnableOrDisableCommandBlockPort
     360    call    .EnableOrDisableControlBlockPort
    340361    call    .DisableIRQchannelSelection
    341362    call    .EnableOrDisableEnableInterrupt
     363    call    .EnableOrDisableXTCFwindow
    342364    call    .EnableOrDisableSerial
    343365    mov     si, g_MenupageForIdeControllerMenu
    344366    jmp     Menupage_ChangeToNewMenupageInDSSI
     367
     368
     369;--------------------------------------------------------------------
     370; .EnableOrDisableCommandBlockPort
     371;   Parameters:
     372;       SS:BP:  Menu handle
     373;   Returns:
     374;       Nothing
     375;   Corrupts registers:
     376;       AX, BX
     377;--------------------------------------------------------------------
     378ALIGN JUMP_ALIGN
     379.EnableOrDisableCommandBlockPort:
     380    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     381    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     382    mov     bx, g_MenuitemIdeControllerCommandBlockAddress
     383    cmp     al, DEVICE_8BIT_XTCF_PIO8
     384    jb      SHORT .EnableMenuitemFromCSBX
     385    cmp     al, DEVICE_SERIAL_PORT
     386    je      SHORT .DisableMenuitemFromCSBX
     387    cmp     al, DEVICE_8BIT_XTCF_MEMMAP
     388    ja      SHORT .EnableMenuitemFromCSBX
     389    jmp     SHORT .DisableMenuitemFromCSBX
     390   
     391
     392;--------------------------------------------------------------------
     393; .EnableOrDisableControlBlockPort
     394;   Parameters:
     395;       SS:BP:  Menu handle
     396;   Returns:
     397;       Nothing
     398;   Corrupts registers:
     399;       AX, BX
     400;--------------------------------------------------------------------
     401ALIGN JUMP_ALIGN
     402.EnableOrDisableControlBlockPort:
     403    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     404    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     405    mov     bx, g_MenuitemIdeControllerControlBlockAddress
     406    cmp     al, DEVICE_8BIT_XTCF_PIO8
     407    jb      SHORT .EnableMenuitemFromCSBX
     408    jmp     SHORT .DisableMenuitemFromCSBX
    345409
    346410
     
    389453    mov     bx, g_MenuitemIdeControllerIdeIRQ
    390454    jz      SHORT .DisableMenuitemFromCSBX
     455    jmp     SHORT .DisableMenuitemFromCSBX
     456
     457
     458;--------------------------------------------------------------------
     459; .EnableOrDisableXTCFwindow
     460;   Parameters:
     461;       SS:BP:  Menu handle
     462;   Returns:
     463;       Nothing
     464;   Corrupts registers:
     465;       AX, BX
     466;--------------------------------------------------------------------
     467ALIGN JUMP_ALIGN
     468.EnableOrDisableXTCFwindow:
     469    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     470    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     471    mov     bx, g_MenuitemIdeControllerXTCFwindow
     472    cmp     al, DEVICE_8BIT_XTCF_MEMMAP
     473    je      SHORT .EnableMenuitemFromCSBX
    391474    ; Fall to .DisableMenuitemFromCSBX
    392475
     
    414497
    415498.EnableOrDisableSerial:
    416     mov     bx, g_MenuitemIdeControllerCommandBlockAddress
    417     call    .DisableMenuitemFromCSBX
    418 
    419     mov     bx, g_MenuitemIdeControllerControlBlockAddress
    420     call    .DisableMenuitemFromCSBX
    421 
    422499    mov     bx, g_MenuitemIdeControllerSerialBaud
    423500    call    .DisableMenuitemFromCSBX
     
    446523    jz      .EnableMenuitemFromCSBX
    447524    jmp     .DisableMenuitemFromCSBX
    448 
    449525.DisableAllSerial:
    450 
    451     mov     bx, g_MenuitemIdeControllerCommandBlockAddress
    452     call    .EnableMenuitemFromCSBX
    453 
    454     mov     bx, g_MenuitemIdeControllerControlBlockAddress
    455     call    .EnableMenuitemFromCSBX
    456 
    457526    ret
    458527
     
    527596;       AX
    528597;
     598ALIGN JUMP_ALIGN
     599WriterForXTCFwindow:
     600    mov     al, ah
     601    xor     ah, ah
     602    ret
     603
     604ALIGN JUMP_ALIGN
     605ReaderForXTCFwindow:
     606    mov     ah, al
     607    xor     al, al
     608    ret
     609
    529610
    530611;
     
    534615ALIGN JUMP_ALIGN
    535616IdeControllerMenu_WriteDevice:
    536         push    ax
    537617        push    bx
    538618        push    di
    539 
    540         mov     bl,[es:di]                          ; what is the current Device?
    541 
    542         add     di,IDEVARS.wBasePort - IDEVARS.bDevice  ; Get ready to set the Port addresses
    543 
    544         cmp     al,DEVICE_SERIAL_PORT
    545         jz      .changingToSerial
    546 
    547         cmp     bl,DEVICE_SERIAL_PORT
    548         jnz     .done                               ; if we weren't Serial before, nothing to do
    549 
    550 .changingFromSerial:
    551         cmp     al,DEVICE_16BIT_ATA
    552 
    553         mov     ax,DEVICE_XTIDE_DEFAULT_PORT        ; Defaults for 8-bit XTIDE devices
    554         mov     bx,DEVICE_XTIDE_DEFAULT_PORTCTRL
    555 
    556         jb      .writeNonSerial
    557 
     619        push    di
     620        push    ax
     621
     622        ; Note! AL is the choice index, not device code
     623        shl     ax, 1                               ; Selection to device code
     624        mov     bl, [es:di]                         ; what is the current Device we are changing from?
     625        sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
     626        cmp     al, DEVICE_SERIAL_PORT
     627        je      SHORT .changingToSerial
     628        cmp     al, DEVICE_8BIT_JRIDE_ISA
     629        je      SHORT .ChangingToJrIdeIsa
     630
     631        ; Restore ports to default values
     632        cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
    558633        mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
    559634        mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
     635        jbe     SHORT .writeNonSerial
     636
     637        mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE devices
     638        mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
    560639
    561640.writeNonSerial:
     
    563642        xchg    bx, ax
    564643        stosw
    565 
    566         jmp     .done
     644        jmp     SHORT .done
     645
     646.ChangingToJrIdeIsa:
     647        mov     ax, JRIDE_DEFAULT_SEGMENT_ADDRESS
     648        xor     bx, bx
     649        jmp     SHORT .writeNonSerial
    567650
    568651.changingToSerial:
    569         cmp     bl,DEVICE_SERIAL_PORT
    570         jz      .done                               ; if we were already serial, nothing to do
    571 
    572         mov     byte [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort],SERIAL_DEFAULT_BAUD
    573 
    574         mov     al,SERIAL_DEFAULT_COM
    575         add     di,IDEVARS.bSerialCOMPortChar-IDEVARS.wBasePort
     652        cmp     bl, DEVICE_SERIAL_PORT
     653        je      SHORT .done                         ; if we were already serial, nothing to do
     654
     655        mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
     656
     657        mov     al, SERIAL_DEFAULT_COM
     658        sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
    576659        call    IdeControllerMenu_SerialWriteCOM
    577660        stosb
    578661
    579662.done:
     663        ; See if we are changing to XT-CF. If we are, store
     664        ; byte for Control Register.
     665        pop     ax
     666        pop     di          ; IDEVARS.bDevice
     667        sub     di, BYTE IDEVARS.bDevice - IDEVARS.bXTCFcontrolRegister ; IDEVARS.bXTCFcontrolRegister
     668        cmp     al, DEVICE_8BIT_XTCF_PIO8 >> 1
     669        je      SHORT .ChangingToPioModeXTCF
     670        cmp     al, DEVICE_8BIT_XTCF_DMA >> 1
     671        je      SHORT .ChangingToDmaModeXTCF
     672        cmp     al, DEVICE_8BIT_XTCF_MEMMAP >> 1
     673        jne     SHORT .NoNeedToChangeXTCFsettings
     674
     675        ; XT-CF Memory Mapped Mode
     676        mov     WORD [es:di], DEFAULT_XTCF_SECTOR_WINDOW_SEGMENT >> 8   ; Store word to clear Control Block Port high byte
     677        jmp     SHORT .NoNeedToChangeXTCFsettings
     678.ChangingToPioModeXTCF:
     679        mov     BYTE [es:di], XTCF_8BIT_PIO_MODE
     680        jmp     SHORT .NoNeedToChangeXTCFsettings
     681.ChangingToDmaModeXTCF:
     682        mov     BYTE [es:di], XTCF_DMA_MODE
     683        ; Fall to .NoNeedToChangeXTCFsettings
     684
     685.NoNeedToChangeXTCFsettings:
    580686        pop     di
    581687        pop     bx
    582         pop     ax
    583 
    584688        ret
    585689
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r481 r483  
    196196g_szItemIdeEnIRQ:       db  "Enable interrupt",NULL
    197197g_szItemIdeIRQ:         db  "IRQ",NULL
     198g_szItemIdeXTCFwindow:  db  "XT-CF Sector Window",NULL
    198199g_szItemSerialCOM:      db  "COM Port",NULL
    199200g_szItemSerialBaud:     db  "Baud Rate",NULL
    200201g_szItemSerialPort:     db  "COM Port I/O address",NULL
    201 
    202202g_szItemIdeSerialComPort:   db  "COM port",NULL
    203203g_szItemIdeSerialBaudRate:  db  "Baud rate",NULL
     
    208208g_szDlgIdeEnIRQ:        db  "Enable interrupt?",NULL
    209209g_szDlgIdeIRQ:          db  "Enter IRQ channel (2...7 for 8-bit controllers, 2...15 for any other controller).",NULL
     210g_szDlgIdeXTCFwindow:   db  "XT-CF Sector Window segment (A000h...E800h).",NULL
    210211
    211212g_szNfoIdeBackToCfgMenu:db  "Back to XTIDE Universal BIOS Configuration Menu.",NULL
     
    213214g_szNfoIdeSlave:        db  "Settings for Slave Drive.",NULL
    214215g_szNfoIdeDevice:       db  "Select controller device type.",NULL
    215 g_szNfoIdeCmdPort:      db  "IDE Controller Command Block (base port) address.",NULL
     216g_szNfoIdeCmdPort:      db  "IDE Controller Command Block (base port) address or segment address for JR-IDE/ISA.",NULL
    216217g_szNfoIdeCtrlPort:     db  "IDE Controller Control Block address. Usually Cmd Block + 8 for XTIDE, and Cmd Block + 200h for ATA.",NULL
    217218g_szNfoIdeEnIRQ:        db  "Interrupt or polling mode.",NULL
    218219g_szNfoIdeIRQ:          db  "IRQ channel to use.",NULL
     220g_szNfoIdeXTCFwindow:   db  "Segment Address for XT-CF 4 kiB Sector Access Window.",NULL
    219221g_szNfoIdeSerialCOM:    db  "Select a COM port by number.",NULL
    220222g_szNfoIdeSerialBaud:   db  "Select the COM port's Baud Rate. The server must match this speed."
Note: See TracChangeset for help on using the changeset viewer.