[Vm-dev] opening a unix pipe via external FFI call

Douglas McPherson djm1329 at san.rr.com
Fri Sep 12 01:06:43 UTC 2014


Hi,

Short: 
Does anyone know offhand of pitfalls trying to make system calls through pipes via FFI from Squeak on Linux (Ubuntu 14.04 on ARM if it makes a difference)?

Long:
I’ve been having fun playing with the Parallella board [1]. The Parallella board has a Xilinx dual-core ARMv7 with a small FPGA, and an Epiphany coprocessor which has 16 RISC cores.

I managed to get a CogStackVM running on (one of the) ARM cores. Based on Tim’s CogStackVM for the RPi (ARMv6), I made some hacks to get it working on the BeagleBoneBlack (ARMv7). This ARMv7 version was compiled on a Chromebook by Ken Dickey where it magically worked, and now by me on the Parallella where it also “just works”. 

So I wanted to see if I could fire up any of the Epiphany cores. I loaded Squeak OpenCL FFI bindings [2] (very cool) and have been able to do some very simple things such as query the Epiphany capabilities, and create Epiphany buffers and write/read them. So far so good.

If you want to induce any of the Epiphany’s cores to do some actual work, you have to provide some code (kernel in OpenCL-speak). These can be compiled and loaded on the fly by an OpenCL library API. This is where I am stuck.

The OpenCL library for the Parallella is open source so I can see exactly where things go wrong. When the kernel compile API is called, it performs its work by making a bunch of system calls via popen(<cmd>, “r”). None of these works; both Squeak and the command are deadlocked once the first popen() call is made. I rebuilt the OpenCL library from sources with debug enabled, as well as added some additional debug prints. 

In order to communicate with the Epiphany, processes need to be run as root, thus I am running Squeak as root for these tests. And since Squeak is running as root I don’t suspect permission problems getting access to commands and files.

The OpenCL library for Parallella compiles kernels successfully for test programs written in C, so /it/ should be ok. And the Squeak OpenCL bindings seem to work fine (insofar as I have played with them; that alone is a lot of fun :)) on a Mac with GPU.

I know the question is vague, and I’m sure I haven’t provided nearly enough info, but thought I would throw it out there :) 

Thanks!
Doug

[1] http://www.parallella.org
[2] https://sites.google.com/site/schwaj/home/opencl-binding-for-squeak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140911/88a439ed/attachment.htm


More information about the Vm-dev mailing list