Changeset 380 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src


Ignore:
Timestamp:
Apr 8, 2012, 6:17:37 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Added code to XTIDECFG for Power Management (standby timer) support in the BIOS.
  • Some minor optimizations.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src
Files:
2 edited

Legend:

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

    r376 r380  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing initialized data
     
    2626    at  MENUPAGE.fnEnter,           dw  ConfigurationMenu_EnterMenuOrModifyItemVisibility
    2727    at  MENUPAGE.fnBack,            dw  MainMenu_EnterMenuOrModifyItemVisibility
    28     at  MENUPAGE.wMenuitems,        dw  9
     28    at  MENUPAGE.wMenuitems,        dw  10
    2929iend
    3030
     
    135135iend
    136136
     137g_MenuitemConfigurationIdleTimeout:
     138istruc MENUITEM
     139    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
     140    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
     141    at  MENUITEM.szName,            dw  g_szItemCfgIdleTimeout
     142    at  MENUITEM.szQuickInfo,       dw  g_szNfoCfgIdleTimeout
     143    at  MENUITEM.szHelp,            dw  g_szHelpCfgIdleTimeout
     144    at  MENUITEM.bFlags,            db  FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
     145    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
     146    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  ROMVARS.bIdleTimeout
     147    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgCfgIdleTimeout
     148    at  MENUITEM.itemValue + ITEM_VALUE.szMultichoice,              dw  g_szMultichoiceIdleTimeout
     149    at  MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,     dw  g_rgwChoiceToValueLookupForIdleTimeout
     150    at  MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,   dw  g_rgszChoiceToStringLookupForIdleTimeout
     151iend
     152
     153g_rgwChoiceToValueLookupForIdleTimeout:
     154    %assign i -12
     155    %rep 21
     156        %assign i i+12
     157        dw  i       ; i / 12 = 0 (disabled) or 1...20 minutes
     158    %endrep
     159    %rep 4
     160        %assign i i+1
     161        dw  i       ; 241...244 = (i - 240) * 30 minutes
     162    %endrep
     163g_rgszChoiceToStringLookupForIdleTimeout:
     164    %assign i 0
     165    %rep 25
     166        dw  g_szIdleTimeoutChoice%[i]
     167        %assign i i+1
     168    %endrep
     169    ;   dw  NULL    ; Is this needed? *FIXME*
    137170
    138171; Section containing code
     
    297330; ConfigurationMenu_CheckAndMoveSerialDrivesToBottom
    298331;
    299 ; Checks to ensure that serial adapters are at the end of the 
    300 ; IDEVARS structures list, as serial floppies (if present) need to be 
     332; Checks to ensure that serial adapters are at the end of the
     333; IDEVARS structures list, as serial floppies (if present) need to be
    301334; the last drives detected by the BIOS.  If there are other controllers
    302335; after a serial controller, the other controllers are moved up on the list
     
    309342;   Corrupts registers:
    310343;       All
    311 ;----------------------------------------------------------------------     
    312 ConfigurationMenu_CheckAndMoveSerialDrivesToBottom:     
     344;----------------------------------------------------------------------
     345ConfigurationMenu_CheckAndMoveSerialDrivesToBottom:
    313346    push    es
    314347    push    ds
     
    319352    push    es
    320353    pop     ds
    321     mov     ch, 0                       ; clearing high order of CX and notification flag
    322     mov     dx, cx                      ; (probably unncessary, CX should be less than 127, but just to be sure)
    323     jcxz    .done                       ; probably unnecessary, but make sure there is at least one controller     
    324 
    325     add     di, ROMVARS.ideVars0        ; add in offset of first idevars
    326     mov     bx, di
     354    xor     ch, ch                      ; clearing high order of CX and notification flag
     355    mov     dx, cx                      ; (probably unnecessary, CX should be less than 127, but just to be sure)
     356    jcxz    .done                       ; probably unnecessary, but make sure there is at least one controller
     357
     358    lea     bx, [di+ROMVARS.ideVars0]   ; add in offset of first idevars
    327359
    328360.outerLoop:
     
    331363    xor     ax, ax                      ; first non-serial found
    332364    mov     cl, dl                      ; idevars count
    333     mov     ch, 0
     365    xor     ch, ch
    334366
    335367.loop:
     
    337369    jnz     .notSerial
    338370
    339     test    si, si                      ; record the first serial controllert that we find
    340     jnz     .next   
     371    test    si, si                      ; record the first serial controller that we find
     372    jnz     .next
    341373    mov     si, di
    342374    jmp     .next
     
    345377    mov     ax, di                      ; record the *last* non-serial controller that we find
    346378
    347 .next: 
     379.next:
    348380    add     di, IDEVARS_size
    349381    loop    .loop
    350382
    351     test    si,si                       ; no serial drives, nothing to do
     383    test    si, si                      ; no serial drives, nothing to do
    352384    jz      .done
    353     cmp     si,ax                       ; serial port is already later on the list than any other controllers
    354     ja      .done                       ; (also takes care of the case where ther are no other controllers)
     385    cmp     si, ax                      ; serial port is already later on the list than any other controllers
     386    ja      .done                       ; (also takes care of the case where there are no other controllers)
    355387
    356388;
     
    371403    rep movsb
    372404
    373     mov     di, si                      ; move up all the idevars below the serial, by one slot
    374     sub     di, IDEVARS_size
     405    lea     di, [si-IDEVARS_size]       ; move up all the idevars below the serial, by one slot
    375406
    376407    mov     cx, ax                      ; restore end pointer of list, subtract off end of serial idevars
     
    387418    mov     cx, IDEVARS_size
    388419    ; di is already at last IDEVARS position
    389    
     420
    390421    rep movsb
    391422
    392     add     sp, IDEVARS_size           
     423    add     sp, IDEVARS_size
    393424
    394425    push    es
     
    396427
    397428    mov     dh, 1                       ; set flag that we have done a relocation
    398    
     429
    399430    jmp     .outerLoop
    400431
     
    407438    test    dh, dh
    408439    jz      .noWorkDone
    409        
     440
    410441    mov     dx, g_szSerialMoved
    411442    call    Dialogs_DisplayNotificationFromCSDX
    412443
    413 .noWorkDone:       
     444.noWorkDone:
    414445    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r376 r380  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing initialized data
     
    7171g_szItemMainConfigure:  db  "Configure XTIDE Universal BIOS",NULL
    7272g_szItemMainFlash:      db  "Flash EEPROM",NULL
    73 g_szItemMainSave:       db  "Save BIOS back to original file",NULL     
     73g_szItemMainSave:       db  "Save BIOS back to original file",NULL
    7474g_szItemMainLicense:    db  "Copyright and License Information",NULL
    7575g_szItemMainHomePage:   db  "Web Links",NULL
     
    9292g_szNfoMainFlash:       db  "Flash loaded BIOS image to EEPROM.",NULL
    9393g_szNfoMainSave:        db  "Save BIOS changes back to original file from which it was loaded.",NULL
    94 g_szNfoMainLicense:     db  "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY. Press ENTER for more details...",NULL
     94g_szNfoMainLicense:     db  "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team."
     95                        db  " Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY. Press ENTER for more details...",NULL
    9596g_szNfoMainHomePage:    db  "Visit http://code.google.com/p/ xtideuniversalbios (home page) and http://vintage-computer.com/ vcforum (support)",NULL
    9697
    97 g_szHelpMainLicense:    incbin  "Main_License.txt" 
    98                         db  NULL       
     98g_szHelpMainLicense:    incbin  "Main_License.txt"
     99                        db  NULL
    99100
    100101; Strings for XTIDE Universal BIOS configuration menu
     
    108109g_szItemCfgStealSize:   db  "kiB to steal from RAM",NULL
    109110g_szItemCfgIdeCnt:      db  "IDE controllers",NULL
     111g_szItemCfgIdleTimeout: db  "Power Management",NULL
    110112
    111113g_szDlgCfgFullMode:     db  "Enable full operating mode?",NULL
    112114g_szDlgCfgStealSize:    db  "How many kiB of base memory to steal for XTIDE Universal BIOS variables (1...255)?",NULL
    113115g_szDlgCfgIdeCnt:       db  "How many IDE controllers to manage (1...4)?",NULL
     116g_szDlgCfgIdleTimeout:  db  "Select the amount of time before idling drives should enter standby mode.",NULL
    114117
    115118g_szNfoCfgIde:          db  "IDE controller and drive configuration.",NULL
     
    118121g_szNfoCfgStealSize:    db  "How many kiB's to steal from Conventional memory for XTIDE Universal BIOS variables.",NULL
    119122g_szNfoCfgIdeCnt:       db  "Number of IDE controllers to manage.",NULL
    120 
    121 g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list. No further action is required. Serial Controllers must be placed at the end of the list.",NULL
     123g_szNfoCfgIdleTimeout:  db  "Enable Power Management to set the harddrive(s) to spin down after idling a certain amount of time.",NULL
     124
     125g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list."
     126                        db  " No further action is required. Serial Controllers must be placed at the end of the list.",NULL
    122127
    123128g_szHelpCfgFullMode:    incbin  "Configuration_FullMode.txt"
     
    125130g_szHelpCfgStealSize:   incbin  "Configuration_StealSize.txt"
    126131                        db  NULL
     132g_szHelpCfgIdleTimeout: db  "This option enables the standby timer for all harddrives handled by XTIDE Universal BIOS,"
     133                        db  " allowing the drives to spin down after idling the selected amount of time."
     134                        db  " Note that this does not work with old drives that lack the Power Management feature set."
     135                        db  " Also note that timeouts less than 5 minutes may cause unnecessary wear on the drives and is not recommended"
     136                        db  " (use for compatibility testing only).",NULL
     137g_szMultichoiceIdleTimeout:
     138                            db  "Disabled",LF
     139                            db  "1 m",LF
     140                            db  "2 m",LF
     141                            db  "3 m",LF
     142                            db  "4 m",LF
     143                            db  "5 m",LF
     144                            db  "6 m",LF
     145                            db  "7 m",LF
     146                            db  "8 m",LF
     147                            db  "9 m",LF
     148                            db  "10 m",LF
     149                            db  "11 m",LF
     150                            db  "12 m",LF
     151                            db  "13 m",LF
     152                            db  "14 m",LF
     153                            db  "15 m",LF
     154                            db  "16 m",LF
     155                            db  "17 m",LF
     156                            db  "18 m",LF
     157                            db  "19 m",LF
     158                            db  "20 m",LF
     159                            db  "30 m",LF
     160                            db  "1 h",LF
     161                            db  "1 h 30 m",LF
     162g_szIdleTimeoutChoice24:    db  "2 h",NULL
     163
     164g_szIdleTimeoutChoice0:     db  "Disabled",NULL
     165g_szIdleTimeoutChoice1:     db  "1 m",NULL
     166g_szIdleTimeoutChoice2:     db  "2 m",NULL
     167g_szIdleTimeoutChoice3:     db  "3 m",NULL
     168g_szIdleTimeoutChoice4:     db  "4 m",NULL
     169g_szIdleTimeoutChoice5:     db  "5 m",NULL
     170g_szIdleTimeoutChoice6:     db  "6 m",NULL
     171g_szIdleTimeoutChoice7:     db  "7 m",NULL
     172g_szIdleTimeoutChoice8:     db  "8 m",NULL
     173g_szIdleTimeoutChoice9:     db  "9 m",NULL
     174g_szIdleTimeoutChoice10:    db  "10 m",NULL
     175g_szIdleTimeoutChoice11:    db  "11 m",NULL
     176g_szIdleTimeoutChoice12:    db  "12 m",NULL
     177g_szIdleTimeoutChoice13:    db  "13 m",NULL
     178g_szIdleTimeoutChoice14:    db  "14 m",NULL
     179g_szIdleTimeoutChoice15:    db  "15 m",NULL
     180g_szIdleTimeoutChoice16:    db  "16 m",NULL
     181g_szIdleTimeoutChoice17:    db  "17 m",NULL
     182g_szIdleTimeoutChoice18:    db  "18 m",NULL
     183g_szIdleTimeoutChoice19:    db  "19 m",NULL
     184g_szIdleTimeoutChoice20:    db  "20 m",NULL
     185g_szIdleTimeoutChoice21:    db  "30 m",NULL
     186g_szIdleTimeoutChoice22:    db  "1 h",NULL
     187g_szIdleTimeoutChoice23:    db  "1 h 30 m",NULL
    127188
    128189; Strings for IDE Controller menu
     
    139200g_szItemSerialPort:     db  "COM Port I/O address",NULL
    140201
    141 g_szItemIdeSerialComPort:       db      "COM port",NULL
    142 g_szItemIdeSerialBaudRate:      db      "Baud rate",NULL
     202g_szItemIdeSerialComPort:   db  "COM port",NULL
     203g_szItemIdeSerialBaudRate:  db  "Baud rate",NULL
    143204
    144205g_szDlgDevice:          db  "Select controller type.",NULL
     
    157218g_szNfoIdeIRQ:          db  "IRQ channel to use.",NULL
    158219g_szNfoIdeSerialCOM:    db  "Select a COM port by number.",NULL
    159 g_szNfoIdeSerialBaud:   db  "Select the COM port's Baud Rate. The server must match this speed. Note that UART clock multipliers may impact the actual speed.",NULL
     220g_szNfoIdeSerialBaud:   db  "Select the COM port's Baud Rate. The server must match this speed."
     221                        db  " Note that UART clock multipliers may impact the actual speed.",NULL
    160222g_szNfoIdeSerialPort:   db  "Select a COM port by custom I/O port address. Any address is valid up to 3f8h, but must be on an 8-byte boundary.",NULL
    161223
     
    279341g_szHelpDrvUserLBA:     incbin  "Drive_UserLBA.txt"
    280342                        db  NULL
    281                        
     343
    282344g_szMultichoiseWrCache: db  "Drive Default",LF
    283345                        db  "Disable Write Cache",LF
     
    311373g_szNfoBootFloppyDrvs:  db  "Number of Floppy Drives to display on boot menu.",NULL
    312374g_szNfoBootSwap:        db  "Drive Number Translation (swap first drive with selected).",NULL
    313 g_szNfoSerialDetect:    db  "Scans all standard COM ports for serial drives. This can also be invoked by holding down ALT at the end of normal drive detection.",NULL
     375g_szNfoSerialDetect:    db  "Scans all standard COM ports for serial drives."
     376                        db  " This can also be invoked by holding down ALT at the end of normal drive detection.",NULL
    314377
    315378g_szHelpBootTimeout:    incbin  "Bootmenu_Timeout.txt"
     
    415478g_szValueFlash32bytes:  db  "32 bytes",NULL
    416479
    417 g_szSelectionTimeout:   db      DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2u s",NULL
    418 
    419 g_szDashForZero:        db      "- ",NULL
     480g_szSelectionTimeout:   db  DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2u s",NULL
     481
     482g_szDashForZero:        db  "- ",NULL
    420483
    421484g_szValueUnknownError:  db  "Error!",NULL
Note: See TracChangeset for help on using the changeset viewer.