26 August 2022, 12:26 | #1 |
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-sequencescript 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 Unknown command ECHO. I have removed the ECHOcommand 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 ECHOcommand is essential here(!). Whatever I have done without the initial ECHOscript it did not work on WB31. Apparently, I must be doing something really bad! Thanks for any help STeN |
26 August 2022, 12:29 | #2 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,323
|
Could you upload the ADF that doesn't work with 3.1?
|
26 August 2022, 12:40 | #3 |
Registered User
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 :) |
26 August 2022, 12:46 | #4 |
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)? |
28 August 2022, 19:52 | #5 | ||||
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
Quote:
Thanks for the clarification! Quote:
Quote:
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. |
||||
29 August 2022, 03:31 | #6 |
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. |
29 August 2022, 05:05 | #7 | |
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
STeN |
|
29 August 2022, 07:51 | #8 |
son of 68k
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.
|
29 August 2022, 09:13 | #9 |
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? |
29 August 2022, 13:25 | #10 | ||
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
Quote:
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-sequenceis 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 COLOR0changed 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: In a result: I know a workaround, but still, I feel bad about not knowing where the problem is. Warm Regards, STeN |
||
29 August 2022, 13:43 | #11 |
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" |
29 August 2022, 14:50 | #12 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
|
Quote:
>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. |
|
29 August 2022, 15:06 | #13 | |
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
Regards, STeN |
|
29 August 2022, 15:27 | #14 |
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". |
29 August 2022, 15:28 | #15 | ||
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
>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 |
||
29 August 2022, 15:34 | #16 | |
Registered User
Join Date: Apr 2022
Location: Brno
Posts: 30
|
Quote:
|
|
29 August 2022, 15:40 | #17 |
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 |
29 August 2022, 15:48 | #18 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
|
Quote:
And the screen won't open unless the shell window does. And without screen, the UI won't work. |
|
29 August 2022, 16:49 | #19 |
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 |
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 |
|
|