29 May 2022, 08:36 | #1 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
Emulated Amiga how to detect underlying OS
Good morning,
is there an easy way to detect the underlying OS of an emulated Amiga Workbench setup, e.g. via AmigaDOS? Background: I have a custom AmigaOS 3.2.1 setup I run on Windows via WinUAE and Pi400 via Amiberry. In both setups I want to call some host applications (e.g. Firefox) of the underlying OS. For WinUAE I am using Winlaunch from Aminet, for Amiberry I use host-run. Can anyone point me into the right direction to create a AmigaDOS script, which checks if the host OS is Windows/Linux and the either calls winlaunch Firefox.exe or host-run firefox to start the browser? Any help or hint would be highly appreciated. Cheers zx80 |
29 May 2022, 08:38 | #2 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
Hi,
sorry, should have posted this in the Coders section of this forum. Maybe an admin can move my misplaced post. Sorry for that. |
29 May 2022, 11:05 | #3 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Are WinLaunch and host-run part of the Windows/Linux system or WinUAE and Pi400? If the first case is true (what I think because of http://aminet.net/package/util/misc/winlaunch ) you can just start the commands or use something like "IF EXISTS <command>".
|
29 May 2022, 11:32 | #4 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
Both tools are Amiga programs located in the C: drawer. But good point. I could try to open a tool which should exists e.g. on Windows like C:winlaunch whoami.exe and then check the exit code of the program. If it succeeds, it was Windows, if it fails, try to launch C:host-run linux_tool instead.
Can anyone point me to a quick AmigaDOS reference? My AmigaOS knowledge is a bit rusty. Last real Amiga was a A500 over 30 years back and I just recently started my journey with emulated Amigas using WinUAE and Amiberry. |
29 May 2022, 11:36 | #5 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,529
|
Cheat sheet: https://dfarq.homeip.net/common-amigados-commands/
Full reference: https://wiki.amigaos.net/wiki/AmigaO...mand_Reference |
29 May 2022, 11:42 | #6 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
@TCD: Cool thanks. OMG I have forgotten almost everything after over 30 years of Windows PCs
|
08 July 2022, 18:38 | #7 |
Registered User
Join Date: Dec 2021
Location: Australia
Posts: 186
|
I can't give specifics, but there'd likely be differences in the cpu emulation that can be checked against.
Alternatively you could attempt to mount part of the host file system temporarily (and then unmount after checks are done to keep the Amiga emulation "clean"). If one exists then it's one OS, if it doesnt then its the other OS. Would only need to check one because it if either fails or succeeds then it tells you what the host is. The latter is probably easier as it could be done with a simple script as opposed to needing to code anything. |
08 July 2022, 22:48 | #8 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
Cant rememebr about WinUAE atm, but on FS-UAE when you use the SHOWBOARDS command, a load of hardware shows up containing "UAE Amiga Emulator" or "UAE blah blah"
I tried redirecting that to a file and using the search command to detect the presence of the word "UAE" and output its results to a variable in ENV: so i could use an if statement to check if it was blank or not. This went bonkers/mental with the if command throwing up an error about wrong number of arguments? maybe because its checking against something that is multiline output? Instead i just went a different route after getting stuck that way and just make a quick command that does the same thing, outputs to a file in RAM the contents of SHOWBOARDS then just got the program to read that file, do a much more reliable IF statement to check for the word "UAE", clean up after by deleting the temporary file containing showboards output and set a variable with a clear True/False result. If it finds it, it SETENV's ISUAE = "True" and if it doesnt find "UAE" it sets ISUAE = "False" so now in your startup-sequence you can go somewhere near the top and add Code:
CheckForUAE If $ISUAE eq "True" ; do stuff here else ; do other stuff here endif Wanted something similar myself for my OS32 setup which ive been trying to make into a 1 install to rule them all, regardless if its a real amiga, emulated/etc and this reminder helped a lot. Small program added as an attachment (only tested on my OS32 setup atm), its another 1 of those quick/dirty "Works For Me" type things, kinda hoping theres a older/better method already, lemme know if it doesnt work as it should, you can tell ofc by just typing "ECHO $ISUAE" in a shell window after you have run it manually or when its in your startup-sequence. Previously i tried Code:
Showboards > RAM:TEMPUAE Search >ENV:CHECKUAE From RAM:TEMPUAE "UAE" Delete RAM:TEMPUAE QUIET >NIL: if $CHECKUAE not eq "" SetEnv ISUAE True else SetEnv ISUAE False endif Last edited by DisasterIncarna; 09 July 2022 at 01:03. |
09 July 2022, 10:15 | #9 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
Cool. Will give it a try.
Actually i am using winlaunch to try launching a Windows command available since Windows XP and simply check the return code. If that fails, I assume LinuxOS using hostrun instead. This way I can add an Icon on my Workbench launching either the Windows Firefox browser, or the Linux Chrome one from my Amiga Workbench, as well as some other commands, no matter if the emulation runs on Windows via WinUAE or Amiberry on Linux/Pi. |
09 July 2022, 11:28 | #10 | |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
Quote:
I just have no idea why i'm getting an error message from that IF statement, it's basically copy/paste from an earlier if statement i already use that checks my CPU and FPU types, the only difference being that 1 uses the return value(s) of "Showboards" output which fails with an error and the other uses the return value of "CPU CPUTYPE", which works perfectly, so i'm kinda stumped. |
|
09 July 2022, 20:54 | #11 |
Registered User
Join Date: May 2022
Location: Switzerland
Posts: 107
|
For WinUAE its winlaunch, for Amiberry its hostrun available from https://github.com/BlitterStudio/host-run. Never used FS-UAE yet, so I can‘t comment on that.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Detect Amiga 68k Executable | Steffest | Coders. General | 3 | 02 October 2020 21:59 |
Debugging using 2 emulated Amiga | kamelito | support.WinUAE | 3 | 02 July 2020 22:24 |
Emulated Amiga Systems | fatboy | Retrogaming General Discussion | 5 | 15 November 2013 10:01 |
Is winuae able to detect emulated (Amiga) output resolution? | ceztko | support.WinUAE | 5 | 11 March 2007 23:36 |
What do I need to do to get my emulated Amiga 'online'? | Peanutuk | support.Apps | 2 | 06 July 2004 18:41 |
|
|