English Amiga Board


Go Back   English Amiga Board > Main > Nostalgia & memories

 
 
Thread Tools
Old 29 May 2022, 08:36   #1
zx80
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
zx80 is offline  
Old 29 May 2022, 08:38   #2
zx80
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.
zx80 is offline  
Old 29 May 2022, 11:05   #3
daxb
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>".
daxb is offline  
Old 29 May 2022, 11:32   #4
zx80
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.
zx80 is offline  
Old 29 May 2022, 11:36   #5
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
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
TCD is offline  
Old 29 May 2022, 11:42   #6
zx80
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
zx80 is offline  
Old 08 July 2022, 18:38   #7
Korban
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.
Korban is offline  
Old 08 July 2022, 22:48   #8
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
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
of whatever combos you like with the "True" "False" results stored in $ISUAE

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
^ This code in my head should work but the IF command just says "Wrong Number Of Arguments" and i have several other IF statements that are doing nearly the same thing detecting my CPU and FPU type and various other things, only the contents of the variable they are checking is different, all my others are 1 line affairs whereas this one (technically) has the whole of ShowBoards dumped into it, tho when i echo it only 1 line appears anyways????
Attached Files
File Type: lha CheckForUAE.lha (9.2 KB, 46 views)

Last edited by DisasterIncarna; 09 July 2022 at 01:03.
DisasterIncarna is offline  
Old 09 July 2022, 10:15   #9
zx80
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.
zx80 is offline  
Old 09 July 2022, 11:28   #10
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,172
Quote:
Originally Posted by zx80 View Post
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.
Yeah that is great for WinUAE, I myself however use and prefer FS-UAE and it unfortunately does not yet support winlaunch, not sure about all the other variety's of UAE, i think Amiberry does as thats basically WinUAE, I was kinda just after a catch-all solution and using the output from showboards seemed ideal

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.
DisasterIncarna is offline  
Old 09 July 2022, 20:54   #11
zx80
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.
zx80 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
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

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 00:02.

Top

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