Running without sudo

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

Running without sudo

Postby jolting » Tue Jun 10, 2014 5:44 am

Is there any way to run the epiphany processor as a standard user. I noticed that parallella requires access /dev/mem directly.
I want to let my friend run the epiphany, but I don't trust him as root. I read a suggestion that UIO could be used for user access to the epiphany, but I'm not familiar enough with it yet to decide how much effort it will be to get it working. Any suggestions would be helpful.
jolting
 
Posts: 1
Joined: Tue Jun 10, 2014 5:27 am

Re: Running without sudo

Postby AlbertoGP » Thu Jun 19, 2014 9:47 am

I'm interested in this too. I didn't know about UIO but it seems like a good way to do it. For now I'm using a server running as root to access the chip and the user interface connects as client to it.

I've found this article exactly about accessing a memory-mapped FPGA device in the ZYNQ on a ZedBoard:
https://fpgacpu.wordpress.com/2013/05/2 ... -part-two/

There it says that the ADI kernel has the UIO drivers included in the source tree but not in the default configuration.
The Parallella kernel is forked from that one and sure enough, it has the drivers:
https://github.com/parallella/parallell ... rivers/uio

They are not activated in the default configurations, but it seems that you could get them by compiling your own kernel.
The configuration files are parallella_defconfig and parallella_lite_defconfig, and both of them have "# CONFIG_UIO is not set":
https://github.com/parallella/parallell ... nfig#L2584
https://github.com/parallella/parallell ... nfig#L2584

That's all I know so far.
AlbertoGP
 
Posts: 41
Joined: Sat May 10, 2014 10:17 am
Location: Saarbrücken, Germany

Re: Running without sudo

Postby shodruk » Thu Jun 19, 2014 11:02 am

I found a mysterious modification in epiphany-libs. 8-)

https://github.com/adapteva/epiphany-li ... /ChangeLog

Removed test for root privs, use /dev/epiphany for memory mapping,
Shodruky
shodruk
 
Posts: 464
Joined: Mon Apr 08, 2013 7:03 pm

Re: Running without sudo

Postby AlbertoGP » Thu Jun 19, 2014 11:41 am

shodruk wrote:I found a mysterious modification in epiphany-libs. 8-)


:D Yes, that's it! e-hal now opens /dev/epiphany which doesn't require root!
https://github.com/adapteva/epiphany-libs/commit/80364e8ee4e99e450a632885a62e7a501398c200
(see the changes in src/e-hal/src/epiphany-hal.c)

Alright then, I don't need to worry about this any more. I'm still using an old system image but I'll upgrade soon to use this.
AlbertoGP
 
Posts: 41
Joined: Sat May 10, 2014 10:17 am
Location: Saarbrücken, Germany

Re: Running without sudo

Postby greytery » Thu Jun 19, 2014 5:06 pm

Removed test for root privs, use /dev/epiphany for memory mapping,

Looks like some tidying up of the way in which the shared memory is set up.
Wonder if it has anything to do with http://forums.parallella.org/viewtopic.php?f=10&t=1069&start=20#p8438 ???
Hope so.

tery
tery
User avatar
greytery
 
Posts: 205
Joined: Sat Dec 07, 2013 12:19 pm
Location: ^Wycombe, UK


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 10 guests

cron