English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   support.OtherUAE (https://eab.abime.net/forumdisplay.php?f=54)
-   -   Run Linux programs from Amiga (in Amibian) (https://eab.abime.net/showthread.php?t=88701)

lar3ry 21 September 2017 07:24

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?

emufan 21 September 2017 14:22

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.

lar3ry 21 September 2017 16:51

Quote:

Originally Posted by emufan (Post 1186314)
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.

Sinphaltimus 21 September 2017 17:18

Quote:

Originally Posted by lar3ry (Post 1186350)
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. :great

emufan 21 September 2017 17:24

Quote:

Originally Posted by lar3ry (Post 1186350)
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.

ma693541 21 September 2017 19:56

Quote:

Originally Posted by emufan (Post 1186314)
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.

emufan 21 September 2017 21:03

Quote:

Originally Posted by ma693541 (Post 1186389)
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).

lar3ry 22 September 2017 04:35

Quote:

Originally Posted by Sinphaltimus (Post 1186356)
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.

lar3ry 22 September 2017 04:49

Quote:

Originally Posted by Sinphaltimus (Post 1186356)
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.

Sinphaltimus 22 September 2017 13:14

Quote:

Originally Posted by lar3ry (Post 1186474)
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.

emufan 30 September 2017 21:08

Quote:

Originally Posted by emufan (Post 1186314)
#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 :spin

lar3ry 10 October 2017 07:35

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...
https://www.youtube.com/watch?v=7HkrkMe3UTE


All times are GMT +2. The time now is 11:47.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.06078 seconds with 11 queries