English Amiga Board


Go Back   English Amiga Board > Support > support.OtherUAE

 
 
Thread Tools
Old 21 September 2017, 07:24   #1
lar3ry
 
Posts: n/a
Run Linux programs from Amiga (in Amibian)

I don't know how strange this will sound, but here's what I am doing, and where I want to get to.

Running Amibian V1.4
From boot, I want to go as directly as possible to the Amiga. I have set that up fairly well.

I have written a few small programs that are called in the /usr/local/bin/amiga script. They play a (fairly long) sound, flash an LED, and turn on another LED. They are run in background, and keep running while the Amiga is loading.

I can run a similar set of program after coming back from Amiga mode, but it sorta loses something when I have to start the sound and light stuff AFTER I exit the Amiga and AFTER I hit the QUIT button and AFTER I see the Linux screen.

So, I am wondering if I can run a Linux program from the Amiga mode. I would like to tell the Amiga I want to exit, and have it exit all the way to the Linux prompt without me having to click on the 'quit' button, and have it also start a sound and light sequence that will execute before I see the Linux prompt, and finish just after.

So.. any way I can call a Linux proram from Amiga mode?

Edit: On a related note, what gets called when I hit an F12 to exit Amiga mode?

Last edited by lar3ry; 21 September 2017 at 07:27. Reason: Additional related question
 
Old 21 September 2017, 14:22   #2
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
there are some support tools for the uae emulators, for example: uaectrl, uae-control, uae_rcli.
source files and exectuables you can find for example in p-uae-src.tar.gz
( /PUAE/amiga/programs and /PUAE/amiga/source/ ).

here is someone talking about the possibility to launch a windows app from within amiga.
but I cannot find the tool in question.

#1) i guess it is winlaunch.

does not work anymore, using winuae 3.6.0 beta, I allways get "failed to open dll"
no matter where i put the winlaunch.alib. winuae_dll folder or elsewhere.

Last edited by emufan; 21 September 2017 at 15:45.
emufan is offline  
Old 21 September 2017, 16:51   #3
lar3ry
 
Posts: n/a
Quote:
Originally Posted by emufan View Post
here is someone talking about the possibility to launch a windows app from within amiga.
but I cannot find the tool in question.

#1) i guess it is winlaunch.
Thanks for the pointers. I think I might be able to trigger something by creating a file on the Amiga, and have Linux detect it to trigger the programs. Never thought of that until I looked at some of your links.

Now all I need to do is to find the code that runs when F12 is hit, and modify that.
 
Old 21 September 2017, 17:18   #4
Sinphaltimus
Registered User
 
Sinphaltimus's Avatar
 
Join Date: Aug 2016
Location: Cresco, PA, USA
Age: 53
Posts: 1,126
Quote:
Originally Posted by lar3ry View Post
Thanks for the pointers. I think I might be able to trigger something by creating a file on the Amiga, and have Linux detect it to trigger the programs. Never thought of that until I looked at some of your links.

Now all I need to do is to find the code that runs when F12 is hit, and modify that.
This is very interesting, I also run Amibian but on a Pi3. Would you be interested in sharing everything you do to get this going both ways? (Startup and shutdown). Because I'm fairly certain you will figure it out and it will be interesting.

for instance, with Pi3 and Amibian, My needs would be:
Just like yours on startup - go straight in to Amiga without seeing Linux.
Two options for exiting Amiga. One to exit Amibian and automatically shutdown the pi.
Or
Shutdown Amiga (Amibian) and automatically launch Sox. I use Sox to sample for OctaMed that I have installed in Amibian so it would be nice to close out of Amibian for the sake of sampling then going back in when done.

I'm not too linux/Pi savvy but I'm learning and am grateful for folks like you experimenting in these things.

Would love to see how it works out for a and what you did.
Sinphaltimus is offline  
Old 21 September 2017, 17:24   #5
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by lar3ry View Post
Thanks for the pointers. I think I might be able to trigger something by creating a file on the Amiga, and have Linux detect it to trigger the programs. Never thought of that until I looked at some of your links.
that is a good idea.
Quote:
Now all I need to do is to find the code that runs when F12 is hit, and modify that.
for a start, you may take a look at the winuae source: od-win32/dinput.cpp
has some code dealing with F12 and AKS_ENTERGUI.
emufan is offline  
Old 21 September 2017, 19:56   #6
ma693541
Computer Wizard
 
ma693541's Avatar
 
Join Date: Aug 2007
Location: Ramberg/Norway
Posts: 928
Quote:
Originally Posted by emufan View Post
there are some support tools for the uae emulators, for example: uaectrl, uae-control, uae_rcli.
source files and exectuables you can find for example in p-uae-src.tar.gz
( /PUAE/amiga/programs and /PUAE/amiga/source/ ).

here is someone talking about the possibility to launch a windows app from within amiga.
but I cannot find the tool in question.

#1) i guess it is winlaunch.

does not work anymore, using winuae 3.6.0 beta, I allways get "failed to open dll"
no matter where i put the winlaunch.alib. winuae_dll folder or elsewhere.
Take a look at AmiKit X, from the emulated Amiga there you can run some Windows applications.
ma693541 is offline  
Old 21 September 2017, 21:03   #7
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by ma693541 View Post
Take a look at AmiKit X, from the emulated Amiga there you can run some Windows applications.
thanks, watched some videos over there. nice package.
but while looking at the winuae src, i found some "fake winlaunch" entries
and finaly a hint:
- winlaunch.lib is now built-in feature and is also 64-bit compatible (winuae 3.5.0).
i think there is some incompatibility between the old and new approach.
have to find the new tool(s).
emufan is offline  
Old 22 September 2017, 04:35   #8
lar3ry
 
Posts: n/a
Quote:
Originally Posted by Sinphaltimus View Post
This is very interesting, I also run Amibian but on a Pi3. Would you be interested in sharing everything you do to get this going both ways? (Startup and shutdown). Because I'm fairly certain you will figure it out and it will be interesting.
Well, startup is pretty straightforward...

In /root/amiga

To go straight into Amiga mode, use autostart. I just copied my preferred uae file to autostart.uae, though I can't rememmber if I then set use_gui=no or if it was already set. At any rate, if it is set to use_gui=no, it will boot straight to Amiga.

In /usr/local/bin
There are a load of executable scripts.
menu - prints the instuctions you usually see on boot.
when you type 3 and Enter, you execute 3, which calls amiga.

The script amiga cd's to /root/amiga and runs the following executable binary
./6 -f autostart.uae
At this point, you will end up in the GUI or in the Amiga based on the use_gui setting in the autostart file.

If you write any code you want to execute before or during the loading of your preferred Amiga, place it before the ./6 line.

If you want to run any code as you exit back to Linux, place it after the ./6 call.

Here's my ./6 file...

Code:
cd /root/amiga
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
./6 -f conf/autostart.uae
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
cd ~
clear
cat /etc/issue.net
cat /etc/motd
Since I pretty much consider my Amiga emulator a time machine, I will be putting the Pi into a Tardis case (I'll be 3D printing the case), complete with LEDs, and any time I launch the Amiga or return, the Tardis sound will play, the interior LEDs will come on, and the beacon will flash.. Currently, it is flawless, in that it plays the sound of the Tardis until just after my Amiga screen appears. The pulsing LED, which will be on the top, pulses a few more times, then stops. I have yet to add the interior LEDs to illuminate the windows.

aplay is a Linux program, but pulse.py is a python program I found on the net, and modified for the purpose of putting the beacon on the Tardis.
Note that both of these are run in background, so they continue to run while the Amia is loading.

Exit from Amiga mode is the tricky part.

I don't think winlaunch will be a lot of help, being specifically for Windows.

I did have look at some of the source that emufan pointed me to, and that looks more promising, though I don't know if I have the skills to modify it to do what I want.

I'll keep you posted about any progress I make.

Last edited by lar3ry; 22 September 2017 at 04:48. Reason: Fogot to pint to the uae files.
 
Old 22 September 2017, 04:49   #9
lar3ry
 
Posts: n/a
Quote:
Originally Posted by Sinphaltimus View Post
This is very interesting, I also run Amibian but on a Pi3. Would you be interested in sharing everything you do to get this going both ways? (Startup and shutdown). Because I'm fairly certain you will figure it out and it will be interesting.
Well, startup is pretty straightforward...

In /root/amiga/conf

To go straight into Amiga mode, use autostart. I just copied my preferred uae file to autostart.uae, though I can't rememmber if I then set use_gui=no or if it was already set. At any rate, if it is set to use_gui=no, it will boot straight to Amiga.

In /usr/local/bin
There are a load of executable scripts.
menu - prints the instuctions you usually see on boot.
when you type 3 and Enter, you execute 3, which calls amiga.

The script amiga cd's to /root/amiga and runs the following executable binary
./6 -f autostart.uae
At this point, you will end up in the GUI or in the Amiga based on the use_gui setting in the autostart file.

If you write any code you want to execute before or during the loading of your preferred Amiga, place it before the ./6 line.

If you want to run any code as you exit back to Linux, place it after the ./6 call.

Here's my ./6 file...

Code:
cd /root/amiga
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
./6 -f conf/autostart.uae
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
cd ~
clear
cat /etc/issue.net
cat /etc/motd
Since I pretty much consider my Amiga emulator a time machine, I will be putting the Pi into a Tardis case (I'll be 3D printing the case), complete with LEDs, and any time I launch the Amiga or return, the Tardis sound will play, the interior LEDs will come on, and the beacon will flash.. Currently, it is flawless, in that it plays the sound of the Tardis until just after my Amiga screen appears. The pulsing LED, which will be on the top, pulses a few more times, then stops. I have yet to add the interior LEDs to illuminate the windows.

aplay is a Linux program, but pulse.py is a python program I found on the net, and modified for the purpose of putting the beacon on the Tardis.
Note that both of these are run in background, so they continue to run while the Amia is loading.

Exit from Amiga mode is the tricky part.

I don't think winlaunch will be a lot of help, being specifically for Windows.

I did have look at some of the source that emufan pointed me to, and that looks more promising, though I don't know if I have the skills to modify it to do what I want.

I'll keep you posted about any progress I make.
 
Old 22 September 2017, 13:14   #10
Sinphaltimus
Registered User
 
Sinphaltimus's Avatar
 
Join Date: Aug 2016
Location: Cresco, PA, USA
Age: 53
Posts: 1,126
Quote:
Originally Posted by lar3ry View Post
Well, startup is pretty straightforward...

In /root/amiga/conf

To go straight into Amiga mode, use autostart. I just copied my preferred uae file to autostart.uae, though I can't rememmber if I then set use_gui=no or if it was already set. At any rate, if it is set to use_gui=no, it will boot straight to Amiga.

In /usr/local/bin
There are a load of executable scripts.
menu - prints the instuctions you usually see on boot.
when you type 3 and Enter, you execute 3, which calls amiga.

The script amiga cd's to /root/amiga and runs the following executable binary
./6 -f autostart.uae
At this point, you will end up in the GUI or in the Amiga based on the use_gui setting in the autostart file.

If you write any code you want to execute before or during the loading of your preferred Amiga, place it before the ./6 line.

If you want to run any code as you exit back to Linux, place it after the ./6 call.

Here's my ./6 file...

Code:
cd /root/amiga
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
./6 -f conf/autostart.uae
aplay -t wav -r 48000 -f S16_LE /root/amiga/Tardis.wav &
python pulse.py &
cd ~
clear
cat /etc/issue.net
cat /etc/motd
Since I pretty much consider my Amiga emulator a time machine, I will be putting the Pi into a Tardis case (I'll be 3D printing the case), complete with LEDs, and any time I launch the Amiga or return, the Tardis sound will play, the interior LEDs will come on, and the beacon will flash.. Currently, it is flawless, in that it plays the sound of the Tardis until just after my Amiga screen appears. The pulsing LED, which will be on the top, pulses a few more times, then stops. I have yet to add the interior LEDs to illuminate the windows.

aplay is a Linux program, but pulse.py is a python program I found on the net, and modified for the purpose of putting the beacon on the Tardis.
Note that both of these are run in background, so they continue to run while the Amia is loading.

Exit from Amiga mode is the tricky part.

I don't think winlaunch will be a lot of help, being specifically for Windows.

I did have look at some of the source that emufan pointed me to, and that looks more promising, though I don't know if I have the skills to modify it to do what I want.

I'll keep you posted about any progress I make.
Awesome. Thank you! I'll play around myself this weekend - I do like the idea of maybe an Amiga drive being a linux folder that is monitored from outside of the emulation where a file gets created when you want to quit the emulator, even if you have to run a script on the Amiga side just prior to pressing F12. I'll do some digging myself as well and let you know if I come up with anything interesting.
Sinphaltimus is offline  
Old 30 September 2017, 21:08   #11
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by emufan View Post
#1) i guess it is winlaunch.

does not work anymore, using winuae 3.6.0 beta, I allways get "failed to open dll"
no matter where i put the winlaunch.alib. winuae_dll folder or elsewhere.
you need to enable: Winuae option: Settings WinUAE -> Miscellaneus -> Allow Native Code

thanks to AmigaSystem for that info
emufan is offline  
Old 10 October 2017, 07:35   #12
lar3ry
 
Posts: n/a
Got it going...

While I still haven't figured out how to intercept the exit of Amibian before it actually drops back to Linux, I do have it working very well.

I have 3D printed a case for the Pi 3. It is based on the TARDIS Deluxe Kit by countspatula, https://www.thingiverse.com/thing:124033. It is a VERY well designed print. The whole thing just snaps together.

I modified it by first editing out three "sections" on the back panel to give myself plenty or room for the cabling. I then printed it at 140% and drilled mounting holes for the Pi 3.

I added two LEDs, a white one for the beacon, and an amber one for the interior light.

I added code to flash the beacon, turn on the interior light, and play the sound. I then adjusted everything to end just after the Amiga screen appears.

Very pleased with the result.

Video available on YouTube...
[ Show youtube player ]
 
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amibian.js Sinphaltimus Amiga scene 5 26 January 2018 12:20
Amibian with Vga Signman support.OtherUAE 2 29 August 2017 01:39
Amibian.js Sinphaltimus Amiga scene 1 11 August 2017 13:17
Programs created by vasm don't run on vanilla A500 Knocker Coders. Asm / Hardware 12 30 July 2016 12:00
How do I know which WinUAE config I need to run diffrernt programs? JumpingJackson New to Emulation or Amiga scene 7 02 March 2008 12:36

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 03:20.

Top

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