Page 1 of 1

an easy way to remotely execute x86 apps as they were local

Posted: Wed Mar 15, 2017 3:35 pm
by Y888099
Image
MachineB, shitty but useful Pentium4 @ 3.4Ghz with 2GB of ram



I happen to have a PA-RISC machine, and gNAT doesn't exist for it.
Therefore I am using the following trick:

  • MachineA: ip 192.168.1.20, linux on PA-RISC workstation, my HPPA C3600
  • MachineB: ip 192.168.1.24, linux on i686 < -- gGNAT exists for i686!

(*) MachineA and MachineB are sharing a NFS link.

Code: Select all

host_remote="192.168.1.24" # MachineB's IP

echo "step1"
ssh-keygen -t rsa

echo "step2"
if [ ! -f ~/.ssh/id_rsa.pub ]
   then
       echo "failure"
       exit
   fi
ssh $host_remote mkdir -p .ssh

echo "step3"
cat ~/.ssh/id_rsa.pub | ssh $host_remote 'cat >> ~/.ssh/authorized_keys'

(to be executed from the MachineA's console)


Code: Select all

host_remote="192.168.1.24"

argc="$#"     # how many arg from bash command line ?
app_args=""   # where to store arguments from bash command line
args=("$@")   # args[]={arg0..argC}

here="`pwd`"

argv="cd $here; source /etc/profile; "
for ((i=0;i< =argc;i+=1))
    do
       argi="$i"
       argv="$argv ${args[$i]} "
    done

ssh $host_remote $argv

ans="$?"
if [ "$ans" == "0" ]
   then
       answ="success"
   else
       answ="failure"
fi

echo "$answ"

on MachineA, /usr/bin/myrexec (bash script)






Results, on MachineA

Code: Select all

remote_ctrl # myrexec gnat -v
v4.3.5

success


Code: Select all

remote_ctrl # myrexec cat /proc/cpuinfo | grep name
model name   : Intel(R) Pentium(R) 4 CPU 3.40GHz

success


Ugly, simple, but it works :D




Note:
this line

Code: Select all

for ((i=0;i< =argc;i+=1))

needs a fix up

I can't write the correct form because it wastes the whole post
it seems a bug in the forum, related to [ code ] "< =" [ /code ]

Re: an easy way to remotely execute x86 apps as they were local

Posted: Wed Mar 15, 2017 11:08 pm
by ClassicHasClass
You could conceivably make it portable, too, with something like a Compute Stick stuck inside the case.

Re: an easy way to remotely execute x86 apps as they were local

Posted: Thu Mar 16, 2017 3:06 am
by Y888099
Yup, the above PeeeCeee costs 70 euro, including
  • GigaBYTE motherboard, 2xpATA, 2xsATA, 3xPCI32, 1xAGP, 2xDDR(max 2GB)
  • CPU P4 intel @ 3.4Ghz
  • 2GB RAM DDR2, 2 sticks, 1GB each @ 500Mhz
  • Matrox G450 2xVGA, AGP
  • pATA hd, 80Gbyte
  • Orange Case, thin sheet metal

ClassicHasClass wrote:Compute Stick stuck inside the case


Tell me more about it. Costs? How fast? Where Can I buy one?




btw, next step (on the software side): I'd like to adapt the trick for Irix, so it can have gNAT!

Re: an easy way to remotely execute x86 apps as they were local

Posted: Thu Mar 16, 2017 8:12 pm
by ClassicHasClass

Re: an easy way to remotely execute x86 apps as they were local

Posted: Fri Mar 17, 2017 1:45 am
by Shiunbird
Y888099 wrote:Tell me more about it. Costs? How fast? Where Can I buy one?


Here in the Czech Republic any respectable computer hardware chain will have them in stock for prompt delivery.
The cheaper ones go for ~115 euro and the most expensive ~350-400. They differ in CPU, RAM and storage.

There are many reviews on the Internet. I'm considering buying one to carry around for a few specific things.

Re: an easy way to remotely execute x86 apps as they were local

Posted: Fri Mar 17, 2017 2:14 am
by Y888099
WUAAA Impressive small device!!! Never heard before.

But it's more expensive than my Orange Box. And I prefer to deal with a motherboard with PCI slots, lan, and pATA/sATA/SCSI hard drives. Also a Pentium4 @ 3.4GHz is much more faster (than Atom x5-Z @ 1.6Ghz) for things like gNAT and ghdl.

Briefly, with one hundred euro of budget, the best I can do is still the Orange Box :D

Re: an easy way to remotely execute x86 apps as they were local

Posted: Fri Mar 17, 2017 10:23 am
by ClassicHasClass
My plan for the G5 is to case-mod it to accommodate one internally (with internal power and self-contained networking), likely connected over VNC or something and using the G5 to proxy its network connections, since the G5 is probably less likely to be attacked ;)

Re: an easy way to remotely execute x86 apps as they were local

Posted: Fri Mar 17, 2017 12:31 pm
by Raion-Fox
That sounds smart Classic. I bet Bruce probably will continue to be relatively viable for daily use into 2020 or later so you are investing relatively smart. I do wish Apple would have kept the G5 up to date at least in Snow Leopard since for me that was the Pinnacle of OS X. If I had to use OS X again that would be the version I would like to use the most.

Re: an easy way to remotely execute x86 apps as they were local

Posted: Sat Mar 18, 2017 1:53 pm
by Shiunbird
ClassicHasClass wrote:My plan for the G5 is to case-mod it to accommodate one internally (with internal power and self-contained networking), likely connected over VNC or something and using the G5 to proxy its network connections, since the G5 is probably less likely to be attacked ;)


Can't you get one of the PCIe USB cards that have one internal USB port?
That would eliminate the need of modding the case. Or, I assume, you have all your slots occupied?

Re: an easy way to remotely execute x86 apps as they were local

Posted: Sat Mar 18, 2017 9:13 pm
by ClassicHasClass
No, that's what I was thinking of, but I'd still need something to handle the networking and accommodate it inside (probably inside the indentation on the air deflector).

Re: an easy way to remotely execute x86 apps as they were local

Posted: Sun Mar 19, 2017 5:57 am
by Y888099
ClassicHasClass wrote:since the G5 is probably less likely to be attacked ;)



I don't get your rationale. Why should be probably less likely to be attacked?

I assume because Power/64bit is less used than x86, therefore less vulnerabilities around.

Well, ok, but for me It doesn't matter the architecture, it matters which profile has been used under the hood! The hardened profile (aka Secure Linux) is safer against maliciously for attacks because it comes with a strong set of patches for the kernel, directives for the C compiler, for libc and glibc, and for the whole userland.