English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 26 August 2022, 12:26   #1
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
The floppy "startup-sequence" to launch the app

Hello,

I was recently creating a simple
startup-sequence
script for a floppy so I can boot from it and launch the program. It works really nice on WB31:
Code:
   
   ECHO "AMISNAKE Loading..."

   AMISNAKE:Amisnake.run >NIL:

   ENDCLI
I have decided to try it on WB13, but it ends with the error
Unknown command ECHO
. I have removed the
ECHO
command and it started working nicely. But when I tried it back on WB31 it stops working with the error
AMISNAKE:Amisnake.run: Unknown command AMISNAKE:Amisnake.run failed returncode 10
. I have tried to figure out out the problem and I found that the
ECHO
command is essential here(!). Whatever I have done without the initial
ECHO
script it did not work on WB31. Apparently, I must be doing something really bad!







Thanks for any help
STeN
8bitsten is offline  
Old 26 August 2022, 12:29   #2
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,323
Could you upload the ADF that doesn't work with 3.1?
TCD is offline  
Old 26 August 2022, 12:40   #3
Torti-the-Smurf
Registered User
 
Torti-the-Smurf's Avatar
 
Join Date: Dec 2018
Location: Earth
Posts: 1,101
ECHO is NOT in the 1.3 KickstartRom.
Its on the Workbench 1.3 Disk,
so you would need to copy the ECHO command from the Workbench 1.3 Disk to yours, so it can work in a 1.3 Setting.

Are you sure "AmiSnake.run" is a executable Binary File ?
Seems like a Skript file.

What TCD said. Lets have a look at this disk (AmiSnake.run) thing.

Last edited by Torti-the-Smurf; 26 August 2022 at 13:04. Reason: found a typo, isnt that something :)
Torti-the-Smurf is offline  
Old 26 August 2022, 12:46   #4
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,082
In WB3.1 Echo is a built-in shell command, in WB1.3 it's loaded from disk (e.g. copy it from Workbench disk, it's in C directory). The same for EndCLI.
Are you sure Amisnake is able to run on WB1.3 (or does it require WB2.0+ or similar)?
a/b is offline  
Old 28 August 2022, 19:52   #5
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
In WB3.1 Echo is a built-in shell command, in WB1.3 it's loaded from disk (e.g. copy it from Workbench disk, it's in C directory). The same for EndCLI.
Quote:
ECHO is NOT in the 1.3 KickstartRom.
Its on the Workbench 1.3 Disk,
so you would need to copy the ECHO command from the Workbench 1.3 Disk to yours, so it can work in a 1.3 Setting.
a/b and Torti-the-Smurf
Thanks for the clarification!

Quote:
Are you sure Amisnake is able to run on WB1.3 (or does it require WB2.0+ or similar)?
Quote:
Are you sure "AmiSnake.run" is a executable Binary File ?
Seems like a Skript file.
a/b and Torti-the-Smurf
Yes, it is - it is just a test app (hunk binary) done in C (VBCC). To make absolutely sure I had made no mistake I made a simple "Hello World", but the result is same It must be something really stupid...

Attached is the adf - if you can check it I will really appreciate that.
Attached Files
File Type: zip floppy_issue.zip (51.7 KB, 34 views)
8bitsten is offline  
Old 29 August 2022, 03:31   #6
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
This is weird.
It doesn't want to run when it's the first thing in the startup-sequence. Probably something is not opened yet.

In KS2.0 (a500+) and in KS3.0 (A1200) if you uncomment the echo in startup-sequence it runs.

In KS1.3 (a500) if you copy echo and uncomment the echo then it runs.
alkis is offline  
Old 29 August 2022, 05:05   #7
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
This is weird.
It doesn't want to run when it's the first thing in the startup-sequence. Probably something is not opened yet.

In KS2.0 (a500+) and in KS3.0 (A1200) if you uncomment the echo in startup-sequence it runs.

In KS1.3 (a500) if you copy echo and uncomment the echo then it runs.
@alkis This is exactly my experience. I would love to know what is going wrong there... I spent several hours trying to find out what the issue is but had no success.

STeN
8bitsten is offline  
Old 29 August 2022, 07:51   #8
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
It is possible the C startup code badly wants the shell window to be opened and doesn't work if it's not. On 1.3 it is always open, but starting with 2.0 it is only opened when actually used.
meynaf is offline  
Old 29 August 2022, 09:13   #9
Exodous
Registered User
 
Join Date: Sep 2019
Location: Leicester / England
Posts: 203
I'm intrigued by this, so have just tried it myself.

If I replace the bootblock with one from 1.3 (boot from a 1.3 disk in DF0: and open a Shell, insert your disk in DF1: and do "install df1:") then it works fine on both a Quickstart 500 and Quickstart 1200 without the echo command enabled.

As far as I recall, the only difference is that KS2.0+ bootblocks load the expansion.library as well as the dos.library, but that shouldn't cause this sort of oddity otherwise a lot of other software would break.

Using the 2.0+ bootblock, I tested with a short assembler program I just knocked up and it works fine, so I guess there is something wrong in the startup code your program is linked with.

What are you using to write/link your program with?
Exodous is offline  
Old 29 August 2022, 13:25   #10
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
I guess there is something wrong in the startup code your program is linked with.
Quote:
It is possible the C startup code badly wants the shell window to be opened and doesn't work if it's not.
@Exodous and @meynaf

First let me thank both of you for your time and help

So the suspect is compilation or linking... I used VBCC and this example code https://github.com/8bitsten/public/t...hellointuition. I cannot find anything wrong there.

But I found that the
>NIL:
in
startup-sequence
is the problem. When I removed it starts working on WB31... No idea why.

What is even worse that I wrote another example (called
rl.exe
) - just simple
printf()
and scanline
COLOR0
changed in asm and it works fine with and without
>NIL:
:

Code:
;This does not work !!
;HelloInt.exe >NIL:

;I have removed ">NIL:" and it  works just fine
;HelloInt.exe

;But this works!! Why?
rl.exe >NIL:
I updated the ADF (floppy_issue2.zip) and put both samples here.

In a result: I know a workaround, but still, I feel bad about not knowing where the problem is.

Warm Regards,
STeN
Attached Files
File Type: zip floppy_issue2.zip (52.4 KB, 43 views)
8bitsten is offline  
Old 29 August 2022, 13:43   #11
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
Ok, I've looked at the source and I think this must be the problem
struct Screen* workBenchScreen = getWorkbenchPubScreen();
https://github.com/8bitsten/public/b...ntuition.c#L62

this must return null (cause there is no workbench screen at the moment) and thus you return -1 which gives "Unknown command"
alkis is offline  
Old 29 August 2022, 14:50   #12
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
Quote:
Originally Posted by 8bitsten View Post
But I found that the
>NIL:
in
startup-sequence
is the problem. When I removed it starts working on WB31... No idea why.
This is normal.
>NIL: suppresses the output and the screen is not opened. Without it, there is some output (pretty much like if the echo command was there) and the screen is opened.
meynaf is offline  
Old 29 August 2022, 15:06   #13
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
Ok, I've looked at the source and I think this must be the problem
struct Screen* workBenchScreen = getWorkbenchPubScreen();
https://github.com/8bitsten/public/b...ntuition.c#L62

this must return null (cause there is no workbench screen at the moment) and thus you return -1 which gives "Unknown command"
@alkis That was my guess as well. I "logically assumed" there is no Workbench screen, but it is. Believe me - I spend ~2 hours commenting our and in line by line trying to figure out where the problem is and the non-existence of Workbench screen was my first tip. But it is here
  • See the screensho
  • Even if it will be not there there are many
    pritntf()
    statements whose output will be printed. But from the CLI output, it seems the program is not even started
  • It will not work on WB13.
But thanks for the tip. I really appreciate that.



Regards,
STeN
8bitsten is offline  
Old 29 August 2022, 15:27   #14
Exodous
Registered User
 
Join Date: Sep 2019
Location: Leicester / England
Posts: 203
As @meynaf says, if you suppress all console output, there is no screen. Having a single printf causes the screen to be opened.

If you add the following just after your "struct Screen* workBenchScreen = getWorkbenchPubScreen();" line:

printf("Workbench Screen: 0x%08lx\n", (long) workBenchScreen);

You will see the value of the screen pointer when you run your program.

From a floppy boot, running this after you've done some screen output prints a valid hex value and the program works.

From a floppy boot, if you run it with ">NIL:" you see nothing, but it fails.

However, from a floppy boot, if you run it with ">output.txt" it doesn't open any screen, but puts the content in the file "output.txt" which can then be viewed separately after booting into Workbench and will show "Workbench Screen: 0x00000000".
Exodous is offline  
Old 29 August 2022, 15:28   #15
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
Quote:
Originally Posted by 8bitsten View Post
But I found that the >NIL: in startup-sequence is the problem. When I removed it starts working on WB31... No idea why.
Quote:
This is normal.
>NIL: suppresses the output and the screen is not opened. Without it, there is some output (pretty much like if the echo command was there) and the screen is opened.
@meynaf Hello, what do you mean by that, please? The
>NIL:
discards the text output (diagnostic messages in our
case), but the UI part should work right? Moreover, the
rl.exe
(2nd example) works with
>NIL:
, the only issue is with
HelloInt.exe
(see GitHub).

Obviously, I am doing something wrong... and I hate that.

Thank you for trying to help me.

Kind Regards,
sTeN
8bitsten is offline  
Old 29 August 2022, 15:34   #16
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Quote:
As @meynaf says, if you suppress all console output, there is no screen. Having a single printf causes the screen to be opened.

If you add the following just after your "struct Screen* workBenchScreen = getWorkbenchPubScreen();" line:

printf("Workbench Screen: 0x%08lx\n", (long) workBenchScreen);

You will see the value of the screen pointer when you run your program.

From a floppy boot, running this after you've done some screen output prints a valid hex value and the program works.

From a floppy boot, if you run it with ">NIL:" you see nothing, but it fails.

However, from a floppy boot, if you run it with ">output.txt" it doesn't open any screen, but puts the content in the file "output.txt" which can then be viewed separately after booting into Workbench and will show "Workbench Screen: 0x00000000".
@Exodous AAaaaa. That makes sense. Let me check it.
8bitsten is offline  
Old 29 August 2022, 15:40   #17
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
Well, the thing is....
You redirect to NIL: and thus OS delays the opening of WB.
If you don't redirect to NIL: it works cause it opens the screen.

Here is the run when I replaced all printfs with DBG(), where DBG() is:
void kprintf(const char *fmt, ...);
#define DBG(...) kprintf(__VA_ARGS__)
(Note that this works for gcc, don't know how vbcc would want that. Also note you additionaly have to link with debug '-ldebug')


And here is the output in console log.

FS: mounted virtual unit dh0 (..\shared\Amiga500P)
FS: work (flags=00000002,E=0,ED=1,EF=0,native='..\shared\Amiga500P') starting..
Program started!.
Hello Intuition.
[ERROR] Workbench screen cannot be accessed.
Good Bye!.
WARNING: BPL strobe refresh conflict, hpos 03!
WARNING: BPL refresh conflict, hpos 05!
WARNING: BPL refresh conflict, hpos 07!
ShowCursor 0
alkis is offline  
Old 29 August 2022, 15:48   #18
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
Quote:
Originally Posted by 8bitsten View Post
@meynaf Hello, what do you mean by that, please? The
>NIL:
discards the text output (diagnostic messages in our case), but the UI part should work right?
The shell window does open only when there is actual text output to show. Which isn't the case when using >NIL:.
And the screen won't open unless the shell window does.
And without screen, the UI won't work.
meynaf is offline  
Old 29 August 2022, 16:49   #19
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
@meynaf @alkis @Exodous Fantastic!

Now I'll find some peace... before the next problem comes along.

Thanks for the help!

Regards,
Petr
8bitsten is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ClassicWB: How can I launch "GamesMenu" from Shell? Foebane support.Apps 21 26 October 2018 19:33
"Software Failure" on bootup sequence Thomas Korte support.WinUAE 2 16 March 2015 18:40
OSX Yosemite 10.10: The application" FS-UAE Laucher.app"can't be opened. cartler support.FS-UAE 6 02 December 2014 00:13
Tutorial: using "showboards" in startup-sequence / batch scripts bubbob42 support.Apps 3 17 April 2013 09:45
The 13 best "launch titles" ever (Gamespot this time) killergorilla Retrogaming General Discussion 5 05 October 2005 13:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:28.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11782 seconds with 16 queries