💾 Archived View for cugi.ie › aminet › 1698982430.gmi captured on 2024-03-21 at 15:52:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

-=-=-=-=-=-=-

Put system information in env. variables

   Author:       larsonmars at email.de (Lars Stockmann)
   Uploader:     larsonmars email de (Lars Stockmann)
   Type:         util/boot
   Version:      0.10
   Architecture: m68k-amigaos >= 1.3
   Distribution: Aminet
   Kurz:         Legt System infos in Umgebungsvariablen
   Date:         2023-11-02
   Readme:       http://aminet.net/util/boot/sysvars.readme
   Downloads:    239

http://aminet.net/util/boot/sysvars.lha

___ _ __ _ _ ____ ____

/ __| | / _| | | |/\ | _ \/ ___)

| (__| | | (_| | | / \| | \| (__

\__ \ \/\__| | |/ /\ | |_/ \__ \

) )\ / )\ \// ____| _ ( ) )

__/ // / __/ /\ / / | | \ \_/ /

(___//_/ |___/ V_/ |_| (___/

https://github.com/larsonmars/sysvars

sysvars is a small CLI tool for the Amiga that creates several environment

variables holding valuable system information. These variables can be used,

for example, in the startup-sequence to enable/disable certain patches,

assigns, and so on.

Currently, the following variables are set

$CPU: installed CPU, for example 68030 (see NOTES for OS 1.3)

$FPU: installed FPU, one of 68881, 68882, internal (for non-LC/EC

040 and 060 CPUs), or empty if no FPU is available (see NOTES

for OS 1.3)

$Chipset: installed graphics chipset, one of OCS, ECS, AGA

$VFreq: the vertical frequency of the native display, can be either

50 (PAL 50Hz) or 60 (NTSC 60Hz)

$KickVer: Kickstart version

$KickRev: Kickstart revision

$BSDSockLib: The id of bsdsocket.library, empty if unavailable

$BSDSockLibVer: The version of bsdsocket.library, empty if unavailable

$BSDSockLibRev: The revision of bsdsocket.library, empty if unavailable

$UAEMajor: The major version of UAE, empty if it was not detected

$UAEMinor: The minor version of UAE, empty if it was not detected

$UAERev: The revision of UAE, empty if it was not detected

_____________________________________________________________________________

NOTES

- 68080 (Vampire) support for the CPU is untested/experimental

- SAGA (Vampire) support is not yet available. I do not own one, so I do not

know what VPOSR might be on the Vampire.

- UAE is detected via the uae.resource, which is only there if a virtual hard

drive or another UAE expansion to be enabled. Thus, detection will fail on

floppy-only-unexpanded Amiga configurations

- The tool works best with Amiga OS 2.0 or later. Here, it calls SetVar,

which allows for local scope variables. Local scope is no limitiation,

because the workbench is also loaded in the scope of the startup-sequence.

Another advantage is that it does not require ENV:. This means it can run

very early, even before SetPatch.

- For the purists, sysvars runs happily also on OS 1.3 and even down to

OS 1.1. However, there are some limitations to consider

- In OS 1.3 and below, sysvars will currently detect CPUs above 68020 as

68020 and any FPUs as 68881.

- in OS 1.3, environment variables can only have global scope (i.e., they

reside in ENV:). This means you must have ENV: mounted (e.g., to some

folder on RAM:). This is not required for OS 2.0 and above.

- In OS 1.3, environment variables are not useable with every command, but

only with IF. Thus, things like 'ECHO $CPU' do not work. You must use

something like 'IF $CPU GE 68010'.

- Below OS 1.3, UAE detection does not work

- Below OS 1.3, the IF command does not support environment variables.

You must use the IF command from Workbench 1.3. Also, only EQ (equal)

seems to work here.

_____________________________________________________________________________

WHY SUCH A TOOL?

As many Amiga users, I have multiple Amigas, booting from flash memory.

However, I do not want to maintain multiple operating system configurations.

In the past, I have used several tools to branch during startup, which

yielded a complex startup-sequence/user-startup and an extended boot time.

I wanted a small fast utility that gives me neat environment variables, so I

can write something like this in the startup-sequence:

IF $CPU GE 68020

MCP

ENDIF

or

IF $FPU EQ internal

FastIEEE

ENDIF

Also, I always wanted to learn M68k assembler. After 30 years using an Amiga

this was about time!

_____________________________________________________________________________

FUTURE PLANS

The tool is already quite useable, but there are still some things missing,

which I want to fix in future versions (no particular order):

- Currently, sysvars can no longer be compiled using ASM-Pro and ASM-One 1.4.

VASM, ASM-One 1.2 and AsmTwo work fine

- Add memory-related variables, such as $Chipmem, $Fastmem, and $Slowmem

(especially to distinguish Amiga 5000 trapdoor/slow memory from actual

Z2/Z3 Fast memory)

- Add $RTG variable to enable/disable stuff like FBlit or swap screen mode

configurations

- For Os 1.3: add detection for CPUs > 68020 and at least the 68882

- Add full support for Vampire

- Make use of boards.library and identify.library if available for even more

expansions.

- Make a WinUAE/FS-UAE-based test suite for automated tests (CI/CD-like)

_____________________________________________________________________________

LICENSE

The code is licensed under the MIT License

_____________________________________________________________________________

RELEASE HISTORY

Version 0.10

- Added $KickVer and $KickEnv that provide kickstart version and revision

- $UAE is now split in $UAEMajor, $UAEMinor and $UAERev for more convenient

scripting

- Added detection of bsdsocket.library ($BSDSockLib contains the id string,

$BSDSockLibVer the version, and $BSDSockRev the revision)

- Refactoring and code improvements (still learning though)

- Easy way to disable certain variables/features at the beginning of the file using constants (Adapt to your need and make the tool as tin

y as possible)

- Unified SetVar approach using macros

- Easier integration of new features via consistent scheme

- Better comments

- added test script for startup-sequence

Version 0.9:

- Added limited OS 1.3 Support (CPU/FPU detection up to 68020/68881) via a

custom SetVar implementation (setenv-like functionality)

- small code improvements

Version 0.8:

- Initial Release on GitHub and Aminet

Contents of util/boot/sysvars.lha

PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                 7127   27047  26.4% -lh5- b9bd Nov  3 03:22 source/sysvars.S
[unknown]                 1118    1784  62.7% -lh5- d232 Nov  3 03:22 sysvars
[unknown]                 2747    6552  41.9% -lh5- 4fce Nov  3 03:22 sysvars.readme
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         3 files   10992   35383  31.1%            Nov  3 03:33

Aminet © 1992-2023 Urban Müller and the Aminet team. Aminet contact address: <aminet aminet net>