Changeset 625 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Feb 19, 2023, 9:26:52 PM (22 months ago)
Author:
Krister Nordvall
Message:

Changes:

  • Added a configuration option to let the BIOS store RamVars to an UMB when Full operating mode is enabled. This is primarily for XT class machines with RAM in the UMA (which apparently is a common thing these days).
  • Added two new builds specifically for IBM PS/2 machines. This is for support of the new McIDE adapter from the guys at zzxio.com. Note that the additional hardware specific code (under the USE_PS2 define) is for the PS/2 machines themselves and not for the McIDE adapters, so any controller in an IBM PS/2 machine can be used with the USE_PS2 define.
  • Moved pColorTheme out of the range of ROMVARS being copied over when doing "Load old settings from EEPROM" in XTIDECFG. This fixed a serious bug from r592 where loading a BIOS from file and then loading the old settings from ROM would corrupt 7 bytes of code somewhere in the loaded BIOS.
  • Optimizations (speed and size) to the library. Browsing the menus in XTIDECFG should now feel a little less sluggish.
  • Hopefully fixed a problem with the PostCommitHook script where it sometimes wouldn't find the CommitInProgress file. I say hopefully because testing this is a nightmare.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r617 r625  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    303303;--------------------------------------------------------------------
    304304ALIGN JUMP_ALIGN
    305 IdeCommand_ReadLBAlowRegisterToAL:
     305IdeCommand_ReadLBAlowRegisterToAL:  ; Unused entrypoint OK
    306306    ; HOB bit (defined in 48-bit address feature set) should be zero by default
    307307    ; so we get the correct value for CHS, LBA28 and LBA48 drives and commands
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r602 r625  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    5050ALIGN JUMP_ALIGN
    5151IdeTransfer_StartWithCommandInAL:
     52%ifdef USE_PS2
     53    ; Turn on the software controlled HDD LED on IBM PS/2 machines
     54    xchg    bx, ax  ; Save AX
     55    in      al, 92h ; Read System Control Port A
     56    or      al, 80h ; Set bit 7 to turn on LED (bit 6 would also work)
     57    out     92h, al ; Write it back
     58    xchg    bx, ax  ; Restore AX
     59%endif
    5260    ; Are we reading or writing?
    5361    test    al, 16  ; Bit 4 is cleared on all the read commands but set on 3 of the 4 write commands
     
    124132    ; All sectors successfully transferred
    125133    add     cx, [bp+PIOVARS.bSectorsDone]       ; Never sets CF
     134%ifdef USE_PS2
     135    ; Turn off the software controlled HDD LED on IBM PS/2 machines
     136    in      al, 92h ; Read System Control Port A
     137    and     al, 3Fh ; Clear bits 7 and 6 to turn off LED
     138    out     92h, al ; Write it back
     139%endif
    126140    ret
    127141
     
    133147    mov     cl, [bp+PIOVARS.bSectorsDone]
    134148    mov     ch, 0                               ; Preserve CF
     149%endif
     150%ifdef USE_PS2
     151    ; Turn off the software controlled HDD LED on IBM PS/2 machines
     152    in      al, 92h ; Read System Control Port A
     153    and     al, 3Fh ; Clear bits 7 and 6 to turn off LED (Clears CF)
     154    out     92h, al ; Write it back
     155    stc             ; Restore the CF
    135156%endif
    136157    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r618 r625  
    55;
    66; XTIDE Universal BIOS and Associated Tools
    7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     7; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
    88;
    99; This program is free software; you can redistribute it and/or modify
     
    4545    pop     es
    4646%endif
    47 AtaID_FixIllegalValuesFromESSI:
     47AtaID_FixIllegalValuesFromESSI: ; Unused entrypoint OK
    4848    jc      SHORT .Return   ; Nothing to fix since failed to read ATA Info
    4949
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r624 r625  
    1515;
    1616; XTIDE Universal BIOS and Associated Tools
    17 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     17; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
    1818;
    1919; This program is free software; you can redistribute it and/or modify
     
    6464
    6565; ROM variables (must start at offset 0)
    66 CNT_ROM_BLOCKS      EQU     BIOS_SIZE / 512     ; number of 512B blocks, 16 = 8kB BIOS
     66CNT_ROM_BLOCKS      EQU     BIOS_SIZE / 512                 ; number of 512B blocks, 16 = 8kB BIOS
    6767istruc ROMVARS
    68     at  ROMVARS.wRomSign,   dw  0AA55h          ; PC ROM signature
    69     at  ROMVARS.bRomSize,   db  CNT_ROM_BLOCKS  ; ROM size in 512B blocks
    70     at  ROMVARS.rgbJump,    jmp Initialize_FromMainBiosRomSearch
    71     at  ROMVARS.rgbSign,    db  FLASH_SIGNATURE
    72     at  ROMVARS.szTitle,    db  TITLE_STRING
    73     at  ROMVARS.szVersion,  db  "r"
    74                             db  ROM_VERSION_STRING
    75                             db  BUILD_DATE_STRING,NULL
     68    at  ROMVARS.wRomSign,       dw  0AA55h                  ; PC ROM signature
     69    at  ROMVARS.bRomSize,       db  CNT_ROM_BLOCKS          ; ROM size in 512B blocks
     70    at  ROMVARS.rgbJump,        jmp Initialize_FromMainBiosRomSearch
     71    at  ROMVARS.rgbSign,        db  FLASH_SIGNATURE
     72    at  ROMVARS.szTitle,        db  TITLE_STRING
     73    at  ROMVARS.szVersion,      db  "r"
     74                                db  ROM_VERSION_STRING
     75                                db  BUILD_DATE_STRING,NULL
     76%ifdef MODULE_BOOT_MENU
     77    at  ROMVARS.pColorTheme,    dw  ColorTheme              ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme
     78%endif
    7679
    7780;---------------------------;
     
    8487    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES
    8588%endif
     89    at  ROMVARS.wRamVars,       dw  NULL                    ; Use 'stolen' top of conventional memory by default in Full mode
    8690    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    8791%ifdef MODULE_BOOT_MENU
    8892    at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
    89     at  ROMVARS.pColorTheme,    dw  ColorTheme              ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme
    90 %endif
     93%endif
     94%ifdef USE_PS2
     95    at  ROMVARS.bIdeCnt,        db  4                       ; Number of supported controllers with two McIDE adapters
     96%else
    9197    at  ROMVARS.bIdeCnt,        db  2                       ; Number of supported controllers
     98%endif
    9299    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
    93100    at  ROMVARS.bMinFddCnt,     db  0                       ; Do not force minimum number of floppy drives
     
    99106    at  ROMVARS.ideVars0+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
    100107%ifdef MODULE_IRQ
     108%ifdef USE_PS2
     109    at  ROMVARS.ideVars0+IDEVARS.bIRQ,              db  0
     110%else
    101111    at  ROMVARS.ideVars0+IDEVARS.bIRQ,              db  14
     112%endif
    102113%endif
    103114    at  ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    108119    at  ROMVARS.ideVars1+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
    109120%ifdef MODULE_IRQ
     121%ifdef USE_PS2
     122    at  ROMVARS.ideVars1+IDEVARS.bIRQ,              db  0
     123%else
    110124    at  ROMVARS.ideVars1+IDEVARS.bIRQ,              db  15
     125%endif
    111126%endif
    112127    at  ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    117132    at  ROMVARS.ideVars2+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
    118133%ifdef MODULE_IRQ
     134%ifdef USE_PS2
     135    at  ROMVARS.ideVars2+IDEVARS.bIRQ,              db  0
     136%else
    119137    at  ROMVARS.ideVars2+IDEVARS.bIRQ,              db  0   ; Should be 11 on the GSI Inc. Model 2C
     138%endif
    120139%endif
    121140    at  ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    126145    at  ROMVARS.ideVars3+IDEVARS.bDevice,           db  DEVICE_16BIT_ATA
    127146%ifdef MODULE_IRQ
     147%ifdef USE_PS2
     148    at  ROMVARS.ideVars3+IDEVARS.bIRQ,              db  0
     149%else
    128150    at  ROMVARS.ideVars3+IDEVARS.bIRQ,              db  0   ; Should be 10 on the GSI Inc. Model 2C
     151%endif
    129152%endif
    130153    at  ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  dw  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
     
    139162;-----------------------------------;
    140163    at  ROMVARS.wFlags,         dw  MASK_ROMVARS_INCLUDED_MODULES
     164    at  ROMVARS.wRamVars,       dw  LITE_MODE_RAMVARS_SEGMENT
    141165    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    142166%ifdef MODULE_BOOT_MENU
    143167    at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
    144     at  ROMVARS.pColorTheme,    dw  ColorTheme              ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme
    145168%endif
    146169    at  ROMVARS.bIdeCnt,        db  1
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r623 r625  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    3636    push    es
    3737
    38 %ifndef USE_AT
    39     mov     ax, LITE_MODE_RAMVARS_SEGMENT
    40     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    41     jz      SHORT .InitializeRamvars    ; No need to steal RAM
    42 %endif
     38    mov     ax, [cs:ROMVARS.wRamVars]
     39    test    ax, ax                      ; UMB segment or LITE_MODE_RAMVARS_SEGMENT?
     40    jnz     SHORT .InitializeRamvars    ; No need to steal RAM
    4341
    44     LOAD_BDA_SEGMENT_TO ds, ax, !       ; Zero AX
     42    mov     ds, ax
    4543    mov     al, [cs:ROMVARS.bStealSize]
    4644    sub     [BDA.wBaseMem], ax
     
    6765    ret
    6866
     67
    6968;--------------------------------------------------------------------
    7069; Returns segment to RAMVARS.
    71 ; RAMVARS might be located at the top of interrupt vectors (0030:0000h)
    72 ; or at the top of system base RAM.
     70; RAMVARS might be located at the top of interrupt vectors (0030:0000h),
     71; at the top of system base RAM or in a user configured UMB.
    7372;
    7473; RamVars_GetSegmentToDS
     
    8281ALIGN JUMP_ALIGN
    8382RamVars_GetSegmentToDS:
     83    mov     ds, [cs:ROMVARS.wRamVars]
     84    mov     di, ds
     85    test    di, di                  ; UMB segment or LITE_MODE_RAMVARS_SEGMENT?
     86    jnz     SHORT .Return
    8487
    85 %ifndef USE_AT  ; Always in Full Mode for AT builds
    86     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    87     jnz     SHORT .GetStolenSegmentToDS
    88     %ifndef USE_186
    89         mov     di, LITE_MODE_RAMVARS_SEGMENT
    90         mov     ds, di
    91     %else
    92         push    LITE_MODE_RAMVARS_SEGMENT
    93         pop     ds
    94     %endif
    95     ret
    96 %endif
    97 
    98 ALIGN JUMP_ALIGN
    99 .GetStolenSegmentToDS:
    100     LOAD_BDA_SEGMENT_TO ds, di
    10188;%ifdef USE_186
    10289;   imul    di, [BDA.wBaseMem], 64  ; 2 bytes less but slower, especially on 386/486 processors
     
    11198    cmp     WORD [RAMVARS.wSignature], RAMVARS_RAM_SIGNATURE
    11299    jne     SHORT .LoopStolenKBs    ; Loop until sign found (always found eventually)
     100.Return:
    113101    ret
    114102
Note: See TracChangeset for help on using the changeset viewer.