Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r546 r567  
    242242    dw  NULL
    243243
    244 SERIAL_DEFAULT_CUSTOM_PORT   EQU        300h           ; can't be any of the pre-defined COM values
    245 
    246 PackedCOMPortAddresses:             ; COM1 - COMC (or COM12)
    247     db      SERIAL_COM1_IOADDRESS >> 2
     244SERIAL_DEFAULT_CUSTOM_PORT      EQU     300h        ; can't be any of the pre-defined COM values
     245SERIAL_DEFAULT_COM              EQU     '1'
     246SERIAL_DEFAULT_BAUD             EQU     ((115200 / 9600)    & 0xff)
     247
     248PackedCOMPortAddresses:                             ; COM1 - COMC (or COM12)
     249    db      SERIAL_COM1_IOADDRESS >> 2
    248250    db      SERIAL_COM2_IOADDRESS >> 2
    249251    db      SERIAL_COM3_IOADDRESS >> 2
     
    258260    db      SERIAL_COMC_IOADDRESS >> 2
    259261    db      SERIAL_DEFAULT_CUSTOM_PORT >> 2         ; must be last entry (see reader/writer routines)
    260 SERIAL_DEFAULT_COM          EQU     '1'
    261262
    262263g_rgbChoiceToValueLookupForBaud:
     
    279280    dw      g_szValueCfgBaud2400
    280281    dw      NULL
    281 SERIAL_DEFAULT_BAUD         EQU     ((115200 / 9600)    & 0xff)
    282282
    283283; Section containing code
     
    339339    push    cs
    340340    pop     ds
     341    call    .EnableOrDisableCommandBlockPort
    341342    call    .EnableOrDisableControlBlockPort
    342343    call    .DisableIRQchannelSelection
     
    345346    mov     si, g_MenupageForIdeControllerMenu
    346347    jmp     Menupage_ChangeToNewMenupageInDSSI
     348
     349
     350;--------------------------------------------------------------------
     351; .EnableOrDisableCommandBlockPort
     352;   Parameters:
     353;       SS:BP:  Menu handle
     354;   Returns:
     355;       Nothing
     356;   Corrupts registers:
     357;       AX, BX
     358;--------------------------------------------------------------------
     359ALIGN JUMP_ALIGN
     360.EnableOrDisableCommandBlockPort:
     361    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     362    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     363    mov     bx, g_MenuitemIdeControllerCommandBlockAddress
     364    cmp     al, DEVICE_SERIAL_PORT
     365    je      SHORT .DisableMenuitemFromCSBX
     366    jmp     SHORT .EnableMenuitemFromCSBX
    347367
    348368
     
    385405    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    386406    mov     bx, g_MenuitemIdeControllerEnableInterrupt
    387     cmp     al, DEVICE_8BIT_XTIDE_REV2
     407    cmp     al, DEVICE_8BIT_XTCF_PIO8
    388408    jae     SHORT .DisableMenuitemFromCSBX
    389409
    390     call    .EnableMenuitemFromCSBX
     410    call    EnableMenuitemFromCSBX
    391411    ; Fall to .EnableOrDisableIRQchannelSelection
    392412
     
    424444ALIGN JUMP_ALIGN
    425445.DisableMenuitemFromCSBX:
    426     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    427     ret
     446    jmp     DisableMenuitemFromCSBX
    428447
    429448ALIGN JUMP_ALIGN
    430449.EnableMenuitemFromCSBX:
    431     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    432     ret
     450    jmp     EnableMenuitemFromCSBX
    433451
    434452
    435453.EnableOrDisableSerial:
    436454    mov     bx, g_MenuitemIdeControllerSerialBaud
    437     call    .DisableMenuitemFromCSBX
     455    call    DisableMenuitemFromCSBX
    438456
    439457    mov     bx, g_MenuitemIdeControllerSerialCOM
    440     call    .DisableMenuitemFromCSBX
     458    call    DisableMenuitemFromCSBX
    441459
    442460    mov     bx, g_MenuitemIdeControllerSerialPort
    443     call    .DisableMenuitemFromCSBX
     461    call    DisableMenuitemFromCSBX
    444462
    445463    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    446464    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    447465    cmp     al, DEVICE_SERIAL_PORT
    448     jnz     .DisableAllSerial
     466    jne     .DisableAllSerial
    449467
    450468    mov     bx, g_MenuitemIdeControllerSerialCOM
    451     call    .EnableMenuitemFromCSBX
     469    call    EnableMenuitemFromCSBX
    452470
    453471    mov     bx, g_MenuitemIdeControllerSerialBaud
    454     call    .EnableMenuitemFromCSBX
     472    call    EnableMenuitemFromCSBX
    455473
    456474    mov     bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    457475    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    458476    mov     bx, g_MenuitemIdeControllerSerialPort
    459     cmp     al,'x'
    460     jz      .EnableMenuitemFromCSBX
    461     jmp     .DisableMenuitemFromCSBX
     477    cmp     al, 'x'
     478    je      SHORT .EnableMenuitemFromCSBX
     479    jmp     SHORT .DisableMenuitemFromCSBX
    462480.DisableAllSerial:
    463481    ret
     
    485503DisplayMasterSlaveMenu:
    486504;
    487 ; block mode is not supported on serial drives, disable/enable the option as appropriate
     505; "Block Mode Transfers" and "Internal Write Cache" are not supported on serial drives, disable/enable the options as appropriate
    488506;
    489507    push    bx
     
    491509    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    492510    mov     bx, g_MenuitemMasterSlaveBlockModeTransfers
    493     cmp     al,DEVICE_SERIAL_PORT
    494     jz      .isSerial
    495     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
     511
     512    cmp     al, DEVICE_SERIAL_PORT
     513    je      .isSerial
     514
     515    call    EnableMenuitemFromCSBX
     516    mov     bx, g_MenuitemMasterSlaveWriteCache
     517    call    EnableMenuitemFromCSBX
    496518    jmp     .isDone
     519
    497520.isSerial:
    498     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
     521    call    DisableMenuitemFromCSBX
     522    mov     bx, g_MenuitemMasterSlaveWriteCache
     523    call    DisableMenuitemFromCSBX
     524
    499525.isDone:
    500526    pop     bx
     
    515541; Writers:
    516542;   Parameters:
    517 ;       AX:     Value that the MENUITEM system was interacting with
    518 ;       ES:DI:  ROMVARS location where the value is to be stored
    519 ;       DS:SI:  MENUITEM pointer
     543;       AX:     Value that the MENUITEM system was interacting with
     544;       ES:DI:  ROMVARS location where the value is to be stored
     545;       DS:SI:  MENUITEM pointer
    520546;   Returns:
    521547;       AX:     Value to actually write to ROMVARS
     
    525551; Readers:
    526552;   Parameters:
    527 ;       AX:     Value read from the ROMVARS location
    528 ;       ES:DI:  ROMVARS location where the value was just read from
    529 ;       DS:SI:  MENUITEM pointer
     553;       AX:     Value read from the ROMVARS location
     554;       ES:DI:  ROMVARS location where the value was just read from
     555;       DS:SI:  MENUITEM pointer
    530556;   Returns:
    531557;       AX:     Value that the MENUITEM system will interact with and display
     
    535561ALIGN JUMP_ALIGN
    536562WriterForXTCFwindow:
    537     mov     al, ah
     563    xor     al, al
     564    SKIP2B  f
     565ReaderForXTCFwindow:
    538566    xor     ah, ah
    539     ret
    540 
    541 ALIGN JUMP_ALIGN
    542 ReaderForXTCFwindow:
    543     mov     ah, al
    544     xor     al, al
     567    xchg    al, ah
    545568    ret
    546569
     
    552575ALIGN JUMP_ALIGN
    553576IdeControllerMenu_WriteDevice:
    554         push    bx
    555         push    di
    556         push    di
    557         push    ax
    558 
    559         ; Note! AL is the choice index, not device code
    560         shl     ax, 1                               ; Selection to device code
    561         mov     bl, [es:di]                         ; what is the current Device we are changing from?
    562         sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
    563         cmp     al, DEVICE_SERIAL_PORT
    564         je      SHORT .changingToSerial
    565         cmp     al, DEVICE_8BIT_JRIDE_ISA
    566         je      SHORT .ChangingToJrIdeIsa
    567         cmp     al, DEVICE_8BIT_ADP50L
    568         je      SHORT .ChangingToADP50L
    569 
    570         ; Restore ports to default values
    571         cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
    572         mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
    573         mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
    574         jbe     SHORT .writeNonSerial
    575 
    576         mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
    577         mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
    578 
    579 .writeNonSerial:
    580         stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
    581         xchg    bx, ax
    582         stosw
    583         jmp     SHORT .done
     577    push    bx
     578    push    di
     579    push    ax
     580
     581    ; Note! AL is the choice index, not device code
     582    shl     ax, 1                               ; Selection to device code
     583    mov     bl, [es:di]                         ; what is the current Device we are changing from?
     584    sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
     585    cmp     al, DEVICE_SERIAL_PORT
     586    je      SHORT .ChangingToSerial
     587    cmp     al, DEVICE_8BIT_JRIDE_ISA
     588    je      SHORT .ChangingToJrIdeIsa
     589    cmp     al, DEVICE_8BIT_ADP50L
     590    je      SHORT .ChangingToADP50L
     591
     592    ; Restore ports to default values
     593    cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
     594    mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
     595    mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
     596    jbe     SHORT .WriteNonSerial
     597
     598    mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
     599    mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
     600
     601.WriteNonSerial:
     602    stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
     603    xchg    bx, ax
     604    stosw
     605    jmp     SHORT .Done
    584606
    585607.ChangingToJrIdeIsa:
    586         mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
    587         SKIP2B  bx
     608    mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
     609    SKIP2B  bx
    588610
    589611.ChangingToADP50L:
    590         mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
    591         xor     al, al
    592         xor     bx, bx
    593         jmp     SHORT .writeNonSerial
    594 
    595 .changingToSerial:
    596         cmp     bl, DEVICE_SERIAL_PORT
    597         je      SHORT .done                         ; if we were already serial, nothing to do
    598 
    599         mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
    600 
    601         mov     al, SERIAL_DEFAULT_COM
    602         sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
    603         call    IdeControllerMenu_SerialWriteCOM
    604         stosb
    605 
    606 .done:
    607         pop     ax
    608         pop     di          ; IDEVARS.bDevice
    609         pop     di
    610         pop     bx
    611         ret
     612    mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
     613    xor     al, al
     614    xor     bx, bx
     615    jmp     SHORT .WriteNonSerial
     616
     617.ChangingToSerial:
     618    cmp     bl, DEVICE_SERIAL_PORT
     619    je      SHORT .Done                         ; if we were already serial, nothing to do
     620
     621    mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
     622
     623    mov     al, SERIAL_DEFAULT_COM
     624    sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
     625    call    IdeControllerMenu_SerialWriteCOM
     626    stosb
     627
     628.Done:
     629    pop     ax
     630    pop     di          ; IDEVARS.bDevice
     631    pop     bx
     632    ret
    612633
    613634;
     
    617638ALIGN JUMP_ALIGN
    618639IdeControllerMenu_SerialWriteCOM:
    619         push    ax
    620         push    bx
    621         push    si
    622 
    623         mov     si,g_rgbChoiceToValueLookupForCOM
    624         mov     bx,PackedCOMPortAddresses
     640    push    ax
     641    push    bx
     642    push    si
     643
     644    mov     si, g_rgbChoiceToValueLookupForCOM
     645    mov     bx, PackedCOMPortAddresses
    625646
    626647.loop:
    627         mov     ah,[bx]
    628 
    629         cmp     ah,(SERIAL_DEFAULT_CUSTOM_PORT >> 2)
    630         jz      .notFound
    631 
    632         cmp     al,[si]
    633         jz      .found
    634 
    635         inc     si
    636         inc     si
    637         inc     bx
    638 
    639         jmp     .loop
     648    mov     ah, [bx]
     649
     650    cmp     ah, (SERIAL_DEFAULT_CUSTOM_PORT >> 2)
     651    je      .notFound
     652
     653    cmp     al, [si]
     654    je      .found
     655
     656    inc     si
     657    inc     si
     658    inc     bx
     659
     660    jmp     .loop
    640661
    641662.notFound:
    642         mov     al, 'x'
     663    mov     al, 'x'
    643664
    644665.found:
    645         mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
    646 
    647         pop     si
    648         pop     bx
    649         pop     ax
    650 
    651         ret
     666    mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
     667
     668    pop     si
     669    pop     bx
     670    pop     ax
     671
     672    ret
    652673
    653674
     
    657678ALIGN JUMP_ALIGN
    658679IdeControllerMenu_SerialReadPort:
    659         xor     ah,ah
    660         eSHL_IM ax, 2
    661         ret
     680    xor     ah, ah
     681    eSHL_IM ax, 2
     682    ret
    662683
    663684;
     
    667688ALIGN JUMP_ALIGN
    668689IdeControllerMenu_SerialWritePort:
    669         push    bx
    670         push    si
    671 
    672         eSHR_IM ax, 2
    673         and     al,0feh         ; force 8-byte boundary
    674 
    675         mov     si,g_rgbChoiceToValueLookupForCOM
    676         mov     bx,PackedCOMPortAddresses           ; loop, looking for port address in known COM address list
     690    push    bx
     691    push    si
     692
     693    eSHR_IM ax, 2
     694    and     al, 0feh            ; force 8-byte boundary
     695
     696    mov     si, g_rgbChoiceToValueLookupForCOM
     697    mov     bx, PackedCOMPortAddresses          ; loop, looking for port address in known COM address list
    677698
    678699.loop:
    679         mov     ah,[si]
    680         cmp     ah,'x'
    681         jz      .found
    682 
    683         cmp     al,[bx]
    684         jz      .found
    685 
    686         inc     si
    687         inc     si
    688         inc     bx
    689 
    690         jmp     .loop
     700    mov     ah, [si]
     701    cmp     ah, 'x'
     702    je      .found
     703
     704    cmp     al, [bx]
     705    je      .found
     706
     707    inc     si
     708    inc     si
     709    inc     bx
     710
     711    jmp     .loop
    691712
    692713.found:
    693         mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
    694 
    695         pop     si
    696         pop     bx
    697 
    698         ret
    699 
     714    mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
     715
     716    pop     si
     717    pop     bx
     718
     719    ret
     720
Note: See TracChangeset for help on using the changeset viewer.