Welcome, Guest. Please login or register.

Author Topic: Old school script gurus... where are you??  (Read 1782 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline doctorqTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2003
  • Posts: 2082
    • Show only replies by doctorq
Old school script gurus... where are you??
« on: December 26, 2013, 02:48:54 PM »
Hi,

I would finally like to fix a small issue I can't seem to find a solution to myself.

My Amiga 500 has a Kickstart 1.3 chip and a SCSI harddrive connected through a GVP controller. I want to keep the Kickstart 1.3 chip installed, and if needed I can softkick to Kickstart 2.0.

I need a script that on boot can determine if it is Kickstart 1.3 or Kickstart 2.0 that is available, and depending on which Kickstart, it should load the correct OS. How can I determine which Kickstart is in use?

I can do a C:Version, but this just gives some text output. How can I store this info to be able to use it in my startup-sequence? What is the best and most efficient way to do the check? What should I check for? Kickstart version, exec.library version?

I was thinking something like this, to do the loading after determining which Kickstart is in use.

IF EQ Kickstart1.3

ELSE

ENDIF
 

Offline Thomas

Re: Old school script gurus... where are you??
« Reply #1 on: December 26, 2013, 03:25:04 PM »
version >nil: version 36
if warn

else

endif


Edit: sorry, version version does not work with kick 1.3. Use version exec.library or version dos.library instead. Any library which is located in ROM and not on disk.

Edit2: now I remember the right solution: you just say version 36, but you have to use the 1.3 version of the version command.

So this is correct:

wb13:c/version >nil: 36
if warn

else

endif
« Last Edit: December 26, 2013, 03:57:06 PM by Thomas »
 

Offline doctorqTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2003
  • Posts: 2082
    • Show only replies by doctorq
Re: Old school script gurus... where are you??
« Reply #2 on: December 26, 2013, 08:48:21 PM »
Thanks Thomas, I'll try it out.

A question though, if you can answer it; what does the 36 in the version command do? Why is it there? I assume it is for setting a number to see if the version output is above or below this number?
 

Offline Oldsmobile_Mike

Re: Old school script gurus... where are you??
« Reply #3 on: December 26, 2013, 08:50:47 PM »
Workbench version 36 is 1.3.  37 and above are 2.0 or later.
Amiga 500: 2MB Chip|16MB Fast|30MHz 68030+68882|3.9|Indivision ECS|GVP A500HD+|Mechware card reader + 8GB CF|Cocolino|SCSI DVD-RAM
Amiga 2000: 2MB Chip|136MB Fast|50MHz 68060|3.9|Indivision ECS + GVP Spectrum|Mechware card reader + 8GB CF|AD516|X-Surf 100|RapidRoad|Cocolino|SCSI CD-RW
 Amiga videos and other misc. stuff at https://www.youtube.com/CompTechMike/videos
 

Offline Thomas

Re: Old school script gurus... where are you??
« Reply #4 on: December 26, 2013, 10:43:02 PM »
Version 36 is 2.0.

33 -> 1.2
34 -> 1.3
36 -> 2.0
37 -> 2.1
39 -> 3.0
40 -> 3.1
44 -> 3.5
45 -> 3.9
50 -> 4.0 (or MorphOS)

The command checks for version 36. If the version found is 36 or above, it returns 0 (OK), if the version is below 36, it returns 5 (WARN).

The return code can be checked by the if command:

5 = WARN
10 = ERROR
20 = FAIL
« Last Edit: December 26, 2013, 10:45:32 PM by Thomas »
 

Offline doctorqTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2003
  • Posts: 2082
    • Show only replies by doctorq
Re: Old school script gurus... where are you??
« Reply #5 on: December 27, 2013, 04:00:55 PM »
Thanks for the explanation. You say that I have to use the version command from the WB 1.3 disk to get the desired functionality. How do you get the same result with the newer versions of Workbench, with 2.0 for instance?
 

Offline Thomas

Re: Old school script gurus... where are you??
« Reply #6 on: December 27, 2013, 10:23:39 PM »
The template for the version command is always the same:

VERSION filename version revision

All arguments are optional. If filename is given, the file is loaded and its version is determined. If version is given, the version found is checked against the given one and the return code is set accordingly. Revision likewise if you need more accurate checking than just the version number.

In 2.0 the command line handling has changed. All commands in 2.0 use the same new function of dos.library to handle arguments while in 1.3 each command has its own code to handle command lines.

The 1.3 version of the version command accepts a number as only argument and uses this as version.

The 2.0 version of the version command treats a single argument always as the file name. If you want to omit the file name and only check for a version, then you have to specify keywords. OTOH the 1.3 version does not accept keywords. That's why there is no common solution.

The command line to check the system's version in 2.0 is what I wrote in my first post:

version version 36

This does not check the version of the version command because 'version' in this case is used as a keyword. If you want to check the version of a file called version you have to enclose the file name in quotation marks so that it is not recognised as key word:

version "version" 36

Offline doctorqTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2003
  • Posts: 2082
    • Show only replies by doctorq
Re: Old school script gurus... where are you??
« Reply #7 on: December 28, 2013, 06:22:22 AM »
Thanks again for the thorough explanation. I definately learned something new here. Next step is the fun part; trying it out and get it working :)
 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 672
    • Show only replies by Fats
Re: Old school script gurus... where are you??
« Reply #8 on: December 28, 2013, 01:00:47 PM »
Quote from: Thomas;755571
The template for the version command is always the same:

VERSION filename version revision

All arguments are optional. If filename is given, the file is loaded and its version is determined.


I think one addition is that if filename is a library it will give the version of the library in memory and not the on disk file. To override this one has to add the FILE switch to the command.

greets,
Staf.
Trust me...                                              I know what I\'m doing