English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 16 November 2020, 23:25   #1
palaste
Registered User
 
Join Date: Oct 2011
Location: Helsinki, Finland
Posts: 65
How to run an Amiga shell from the command line?

I have found that vamos (https://github.com/cnvogelg/amitools/blob/master/docs/vamos.md) allows me to run text-only Amiga programs directly from a Linux terminal, mapping the AmigaOS stdio directly to the Linux stdio. This works great for text-only programs that just run, do their work, and exit. But I'd also like to run an interactive AmigaOS shell on top of the Linux shell. The vamos homepage tells me I need "Shell-Seg" (which I have found in Amiga Forever, and some ADF distributions) and then I should type "vamos -x Shell-Seg". This causes the following error:

23:21:40.776 machine: ERROR: ----- ERROR in CPU Run #1 -----
23:21:40.776 machine: ERROR: Run: 'Shell-Seg': Initial PC=0020c0, SP=005c6c
23:21:40.776 machine: ERROR: PC=ff100003 SR=----- USP=00005c68 ISP=00000700 MSP=00000780
23:21:40.776 machine: ERROR: D0=00000258 D1=00000000 D2=00000800 D3=00000013 D4=0000002e D5=0000003a D6=00000050 D7=00000000
23:21:40.776 machine: ERROR: A0=00000000 A1=00000000 A2=ff01dd05 A3=00000000 A4=00000000 A5=ff01dd05 A6=ff01dd05 A7=00005c68
23:21:40.776 machine: ERROR: SP-32=000000 SP-28=000000 SP-24=000000 SP-20=000000 SP-16=000000 SP-12=000000 SP-08=000000 SP-04=000000
23:21:40.776 machine: ERROR: SP+00=00210a SP+04=000400 SP+08=002000 SP+12=000000 SP+16=001760 SP+20=000000 SP+24=000000 SP+28=00173c
23:21:40.776 machine: ERROR: InvalidMemoryAccessError: Invalid Memory Access R(2): 100001
23:21:40.776 main: ERROR: vamos failed!

I don't understand what is causing this. I don't even know if it's a bug in vamos or a failure in the actual AmigaOS code.

Is there any other way of running a shell in AmigaOS? Keep in mind that it should only run a shell - opening a new CLI window will probably fail as vamos does not support GUIs.

In the end, if all else fails, I could try to resort to writing my own minimal shell which just loops with fgets() from stdin and then calls system() with whatever it gets, until it runs out of input, but that would be a crude hacky solution. I'd prefer a real AmigaOS shell.
palaste is offline  
Old 18 November 2020, 10:22   #2
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,982
You can open a shell from another shell with
newcli
command. It will however open a new window so it won't work unless you can redirect it - for this, try :
newcli window=*

Else, perhaps your best solution is to contact vamos developers.
meynaf is online now  
Old 18 November 2020, 23:28   #3
palaste
Registered User
 
Join Date: Oct 2011
Location: Helsinki, Finland
Posts: 65
newcli window=* works on a real Amiga and on FS-UAE, but not with vamos.


vamos is unable to run OS-internal shell commands, it expects a real AmigaOS binary. Makes sense, as it runs the binaries on their own, without hosting them in a shell.


On my emulated A4000, typing "which newcli" into a shell window reports "INTERNAL newcli". So it's not possible to run that with vamos.


I have newcli binaries from older versions of AmigaOS lying around (which I mostly got from PD disks, applications and ADFs I downloaded straight to emulation) but they are probably from an older version of AmigaOS, before the OS even had OS-internal commands. All of them give the same error when run in vamos.
palaste is offline  
Old 21 November 2020, 12:32   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 684
Quote:
Originally Posted by palaste View Post
I have found that vamos (https://github.com/cnvogelg/amitools.../docs/vamos.md) allows me to run text-only Amiga programs directly from a Linux terminal, mapping the AmigaOS stdio directly to the Linux stdio. This works great for text-only programs that just run, do their work, and exit. But I'd also like to run an interactive AmigaOS shell on top of the Linux shell. The vamos homepage tells me I need "Shell-Seg" (which I have found in Amiga Forever, and some ADF distributions) and then I should type "vamos -x Shell-Seg". This causes the following error:
You need a V45 Shell-Seg, which is rather important. Vamos expects the shell seg in to be prepared in a particular way. The Os 3.9 Shell-Seg with the Shell-Update you find in Aminet will do. Also, I do not know in how far Christian's vamos is well-prepared for that, but mine certainly is:


https://github.com/thorfdbg/amitools


You then run this as follows:


Code:
PATH="$PATH:$HOME/src/amitools/" #or whereever you put amitools 
rm -rf /tmp/amiga
rm -rf /tmp/env
mkdir -p /tmp/amiga/t
mkdir -p /tmp/env
export PYTHONPATH="$HOME/src/amitools/"
python -m amitools.tools.vamos -x L:Shell-Seg -l dos:info,exec:info,file:info,utility:info 2>log #alter log options to your liking

You also need a ".vamosrc" in the directory where you run it, such that L: points to the L directory with the shell-seg in it. Particularly improtant are the library configurations:


Code:
# disable loading library in any case
[68040.library]
mode=off

# "auto" mode: either use amiga library if available and fall back
# to vamos internal lib if not amiga library was found
[icon.library]
mode=vamos

[utility.library]
mode=vamos

[locale.library]
mode=off

[intuition.library]
mode=vamos

[icon.library]
mode=off

[utility.library]
mode=vamos

[graphics.library]
mode=vamos
Thomas Richter is offline  
Old 21 November 2020, 19:17   #5
palaste
Registered User
 
Join Date: Oct 2011
Location: Helsinki, Finland
Posts: 65
Quote:
Originally Posted by Thomas Richter View Post
You need a V45 Shell-Seg, which is rather important. Vamos expects the shell seg in to be prepared in a particular way. The Os 3.9 Shell-Seg with the Shell-Update you find in Aminet will do. Also, I do not know in how far Christian's vamos is well-prepared for that, but mine certainly is:


https://github.com/thorfdbg/amitools


You then run this as follows:


Code:
PATH="$PATH:$HOME/src/amitools/" #or whereever you put amitools 
rm -rf /tmp/amiga
rm -rf /tmp/env
mkdir -p /tmp/amiga/t
mkdir -p /tmp/env
export PYTHONPATH="$HOME/src/amitools/"
python -m amitools.tools.vamos -x L:Shell-Seg -l dos:info,exec:info,file:info,utility:info 2>log #alter log options to your liking
You also need a ".vamosrc" in the directory where you run it, such that L: points to the L directory with the shell-seg in it. Particularly improtant are the library configurations:


Code:
# disable loading library in any case
[68040.library]
mode=off

# "auto" mode: either use amiga library if available and fall back
# to vamos internal lib if not amiga library was found
[icon.library]
mode=vamos

[utility.library]
mode=vamos

[locale.library]
mode=off

[intuition.library]
mode=vamos

[icon.library]
mode=off

[utility.library]
mode=vamos

[graphics.library]
mode=vamos
I tried this, but it seemed to only make matters worse. Perhaps I screwed up something. I tried installing your version of vamos, but trying to run it gave me syntax errors about Python. I don't understand Python, so I went back to Christian's version. I then tried installing ShellUpdate on FS-UAE (as I knew it wouldn't work on vamos), but it gave me this error right from the start:


You MUST have BB2 installed on your system.


I don't know what BB2 is, but apparently my system's version is too old. The last real AmigaOS I installed was AmigaOS 3.1, after that it has been emulation only. I haven't upgraded the emulated Amiga to a new version since that.


What's more, trying to install ShellUpdate somehow caused even FS-UAE and Christian's vamos to fail. I found out what caused FS-UAE to fail, I'll make a separate thread about that on the Support.FS-UAE forum. But even after trying to reinstall amitools I couldn't get vamos to work. In the end, I removed my entire emulated Amiga system and restored it from a backup. Now Christian's vamos works at least.
palaste is offline  
Old 21 November 2020, 19:29   #6
DamienD
disengaged
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 44
Posts: 18,746
Quote:
Originally Posted by palaste View Post
but it gave me this error right from the start:


You MUST have BB2 installed on your system.


I don't know what BB2 is, but apparently my system's version is too old.
It's either "Boing Bag 2" or "Blitz Basic 2"; probably the first though
DamienD is offline  
Old 21 November 2020, 19:36   #7
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 684
Quote:
Originally Posted by palaste View Post
I tried this, but it seemed to only make matters worse. Perhaps I screwed up something. I tried installing your version of vamos, but trying to run it gave me syntax errors about Python.
You need a python 2.7 for that, not a python 3.


Quote:
Originally Posted by palaste View Post
You MUST have BB2 installed on your system.
You can also get the shell-seg from the modules disk of 3.1.4 if that is easier.


Quote:
Originally Posted by palaste View Post
What's more, trying to install ShellUpdate somehow caused even FS-UAE and Christian's vamos to fail.
The shell-update is not an installation. It is a replacement of the shell-seg with a newer version.
Thomas Richter is offline  
Old 21 November 2020, 19:49   #8
palaste
Registered User
 
Join Date: Oct 2011
Location: Helsinki, Finland
Posts: 65
Quote:
Originally Posted by Thomas Richter View Post
You need a python 2.7 for that, not a python 3.
Fedora 32 (the host system) automatically installed python 3 when I installed python.


Quote:
You can also get the shell-seg from the modules disk of 3.1.4 if that is easier.
I don't think I have a modules disk of 3.1.4. It's been more than ten years since I upgraded from 3.0 to 3.1, I haven't upgraded ever since.
I no longer have a working physical A4000, what FS-UAE and vamos are using is a file-for-file dump of my original A4000's hard drive, which was easy to do back in the day as Linux has support of the Amiga's file system just by installing a file system driver.
I found this site: https://www.hyperion-entertainment.c...88-amigaos-314 which apparently offers AmigaOS 3.1.4 for sale for a bit less than $30. This would seem to be what I need, provided that they send me the product in e-mail, either as a direct package or an ADF image. I am unable to install a physical Amiga disk because of what I wrote above.



Quote:
The shell-update is not an installation. It is a replacement of the shell-seg with a newer version.
I just tried to run the "Install" script on FS-UAE by double-clicking on its icon. I didn't find out any other way to do the update.
palaste is offline  
Old 24 November 2020, 02:37   #9
palaste
Registered User
 
Join Date: Oct 2011
Location: Helsinki, Finland
Posts: 65
I just recently bought AmigaOS 3.1.4 from Hyperion Entertainment. I got the product pretty much instantly, because of the wonders of the Internet. It appears to have the Modules disk as an ADF file. I'll probably try it out tomorrow or on the weekend at least, right now it's the middle of the night here in Finland.
palaste 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
Newbie issue: shell command history not working BigTool4U New to Emulation or Amiga scene 17 10 June 2020 23:11
Loading Amiga exe via command line.Help! Mclane support.WinUAE 0 04 November 2018 23:02
Run launcher from command line PDG support.FS-UAE 8 26 February 2016 01:21
Blitz2: Compile & run from command line? attle Coders. Blitz Basic 11 13 June 2015 03:15
command-line to mount and run hdf or zipped folder fil support.WinUAE 1 06 September 2011 00: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 20:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.13398 seconds with 15 queries