Welcome, Guest. Please login or register.

Author Topic: Is this possible? (make a startup sequence skip something)  (Read 1537 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Ral-ClanTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2006
  • Posts: 1979
  • Country: ca
    • Show only replies by Ral-Clan
    • http://www3.sympatico.ca/clarke-santin/
Is this possible? (make a startup sequence skip something)
« on: March 20, 2008, 03:51:10 PM »
Is it possible to write a startup sequence function so, during a warm re-boot, a command is NOT executed if it already has been during a previous boot?

Here is my problem:

1. The first thing my Startup-Sequence executes upon cold booting is ROMTAGMEM to initialise the 32MB of RAM on my 040 accelerator.  This file MUST be the first thing in the startup sequence to function.  Once executed the Amiga carries out a warm reboot.

2. Upon this warm reboot, the startup sequence executes again.  Next SETPATCH is encountered and installs the "AmigaOS ROM UPDATE" file from OS3.9.  This requires a second warm reboot.

3. Now...during THIS warm re-boot , when my Amiga encounters the ROMTAGMEM command at the top of the startup sequence, I get a crash and hanging grey screen.  I highly suspect that this is because the new exec.library from the "AMIGAOS ROM UPDATE" doesn't like ROMTAGMEM if it's executed AFTER SETPATCH.  

So, I need to prevent ROMTAGMEM from even being acknowledged after SETPATCH is executed.  

The only way I can think of doing this is with some sort of "IF...THEN" statement so that if ROMTAGMEM has already been executed, the Amiga will skip it entirely on a subsequent warm reboot.  Is this possible?  I've never done it before.

I'm thinking that a simple way to do it would be to activate a flag of some sort after ROMTAGMEM is executed the first time.  The flag could be something as simple as writing a small text file to the hard drive right after executing ROMTAGMEM for the first time.  Then in subsequent re-boots, {b]IF[/b] the file "xyz.txt" EXISTS, skip the ROMTAGMEM line in the startup-sequence.  At the very end of the startup sequence, after the Amiga has booted sucessfully, this test file "flag" can be deleted.

Something like this (please excuse my syntax, I know not what I am doing and it's just to give the idea):

STARTUP-SEQUENCE

IF FILE SYS:flag.txt exists THEN SKIP
   ROMTAGMEM 5 10 80000 (parameters here)
   PRINT "ROMTAGMEM ON" >SYS:FLAG.txt
END

C: SETPATCH >QUIET


...and so on....


I have never done anything like this before.  Maybe there is a better way.  I don't even know the proper syntax.
Music I've made using Amigas and other retro-instruments: http://theovoids.bandcamp.com
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Is this possible? (make a startup sequence skip something)
« Reply #1 on: March 20, 2008, 03:56:32 PM »
Code: [Select]
version >nil: someromcomponent 45
if warn
  ; component is not present or is older than v45.x
else
  ; that component as v45.x or later is present
endif


You obviously pick some component updated by the "AmigaOS ROM Update", for example scsi.device.
 

Offline tabbybasco

  • Newbie
  • *
  • Join Date: Dec 2007
  • Posts: 21
    • Show only replies by tabbybasco
Re: Is this possible? (make a startup sequence skip something)
« Reply #2 on: March 20, 2008, 04:06:01 PM »
ral-can,

You are on the right track hun. An IF-THEN sequence is the answer. Set up a variable to set it to 0 in the beginning then if ROMTAGMEM is executed by SETPATCH, set it to 1. Then add: IF A=1 SKIP; which will skip to the next line in the Startup-Sequence. You will have to use a variable that isn't used by the Startup-Sequence. Always set a variable to the default condition; 0 usually being FALSE and 1 being TRUE. There are several other ways of doing this. AmigaDOS is very rich.
Tabatha
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Is this possible? (make a startup sequence skip something)
« Reply #3 on: March 20, 2008, 04:18:26 PM »
Quote
tabbybasco wrote:
Set up a variable to set it to 0 in the beginning then if ROMTAGMEM is executed by SETPATCH, set it to 1. Then add: IF A=1 SKIP; which will skip to the next line in the Startup-Sequence.

Not after a warm reboot it won't.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Ilwrath

Re: Is this possible? (make a startup sequence skip something)
« Reply #4 on: March 20, 2008, 04:27:18 PM »
We probably don't need someone who hasn't written a custom startup-sequence in about 10 years to re-enforce that Piru's solution is correct....  But, I'll do it anyhow.  :-P  

In your case, you don't even need the else clause.

Code: [Select]

version >nil: someromcomponent 45
if warn
  ROMTAGMEM
endif
setpatch
[... startup continues ...]

 

Offline Ral-ClanTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2006
  • Posts: 1979
  • Country: ca
    • Show only replies by Ral-Clan
    • http://www3.sympatico.ca/clarke-santin/
Re: Is this possible? (make a startup sequence skip something)
« Reply #5 on: March 20, 2008, 04:33:13 PM »
Thanks!  But what exactly does the "WARN" part of

IF WARN

do?
Music I've made using Amigas and other retro-instruments: http://theovoids.bandcamp.com
 

Offline Ilwrath

Re: Is this possible? (make a startup sequence skip something)
« Reply #6 on: March 20, 2008, 04:37:27 PM »
The c:version command has extra switches besides displaying the version number.  It can also compare a file or library version number to a fixed number to see if it meets minimum requirements.  If it does not, it sets a warn value.  

version >NIL: somelib 45
returns a warn if the version of somelib is below 45, and a succeed if 45 or above.

The IF WARN checks if the previous command set a warn value.  :-)

(EDITED to add clarity)
 

Offline Ral-ClanTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2006
  • Posts: 1979
  • Country: ca
    • Show only replies by Ral-Clan
    • http://www3.sympatico.ca/clarke-santin/
Re: Is this possible? (make a startup sequence skip something)
« Reply #7 on: March 20, 2008, 04:39:54 PM »
Comment removed because I realise you answered it in the previous post.
Music I've made using Amigas and other retro-instruments: http://theovoids.bandcamp.com