RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Code review →

Linux Port

Subscribe to Linux Port 373 posts, 52 voices

Posts per page:

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

 
Oct 30, 2018 10:57am
Avatar David Boddie (1934) 198 posts

Now that RISC OS is Apache licensed, does this mean that it would be possible to produce a precompiled image of this for easy deployment?

I guess it depends on how the image is put together, what license the component parts are under, and how it interacts with the Linux kernel which I’m assuming would be installed separately. Timothy knows what he’s doing with all this, so he can fill us in once he’s updated his repository with the new license. :)

 
Oct 30, 2018 1:03pm
Avatar Rick Murray (539) 10321 posts

I sort of assumed it would be like a pre-built SD image that “would just run”?
If so, that’s not relevant to GPL – files on a filesystem don’t taint by proximity.

A more pertinent question may well be how it interacts with the kernel, but if that’s the case it would apply anyway regardless of how the software is started…

 
Oct 30, 2018 3:20pm
Avatar Steve Pampling (1551) 6358 posts

If so, that’s not relevant to GPL – files on a filesystem don’t taint by proximity.

There’s a chance that R.S might disagree ;)

 
Oct 30, 2018 5:11pm
Avatar Rick Murray (539) 10321 posts
files on a filesystem don’t taint by proximity.

There’s a chance that R.S might disagree ;)

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

[ https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html ]

 
Oct 31, 2018 11:19pm
Avatar Timothy Baldwin (184) 229 posts

Also relevant from Linux:

NOTE! This copyright does not cover user programs that use kernel services by normal system calls – this is merely considered normal use of the kernel, and does not fall under the heading of “derived work”.

 
Nov 12, 2018 10:35am
Avatar Chris Gransden (337) 876 posts

Now that there is a RISC OS git client it’s possible to build the RISC OS Linux rom natively.

The git client is available here.

Clone the repository,

sgit clone https://github.com/TimothyEBaldwin/RISC_OS_Dev.git RISC_OS_Dev

or

sgit clone git://github.com/TimothyEBaldwin/RISC_OS_Dev.git RISC_OS_Dev

sgit makes no attempt to set file types at the moment. The file types can be set using !Rename available here.

Drag the folder RISC_OS_Dev to the ‘Smart Renamer’ window and set it up as below,

There is one file that needs copying manually otherwise the following error occurs building the rom,



LinuxSupport (mixed.Linux.Support)...
amu -E -f RAM::RamDisc0.$.RISC_OS_Dev.Env.CallMF  export PHASE=hdrs COMPONENT=LinuxSupport
do mkdir -p <CExport$dir>.ix.h
copy  SocketKVM_Protocol/h <CExport$dir>.ix.h.SocketKVM_Protocol FR~C~VN
AMU: *** File ':RamDisc0.$.RISC_OS_Dev.mixed.Linux.Support.SocketKVM_Protocol/h' not found ***

AMU: *** 'export' not re-made because of errors ***

Error running make export (hdrs) on module 'LinuxSupport'.

Copy the file RISC_OS_Dev.Linux.Support.h.SocketKVM_Protocol

to

RISC_OS_Dev.Linux.Support.SocketKVM_Protocol/h

Then build the rom using !Builder as normal.

 
Nov 12, 2018 11:03am
Avatar Chris Gransden (337) 876 posts

Ever since switching to the ‘Linux2’ branch, running RISCOSMark5 causes an abort and gives a ZeroPain error in the Basic module.
The ZeroPain log is here.

 
Nov 13, 2018 11:47pm
Avatar Timothy Baldwin (184) 229 posts

Ever since switching to the ‘Linux2’ branch, running RISCOSMark5 causes an abort and gives a ZeroPain error in the Basic module.

I suspect that is because it tries identify the system by reading the name of the first HAL device, but currently the Linux Port has no HAL devices.

 
Nov 22, 2018 1:54am
Avatar DavidS (1854) 1863 posts

Looks interesting. May be a good enough reason to go to using Linux more. Just a little hesitant to try it (oddly enough considering one of my current projects).

Running on top of ARM Linux gets rid of the hardware support issues. I can not form a complete opinion yet, as I skipped a good part of this thread.

 
Nov 23, 2018 4:37pm
Avatar Mike Howard (479) 51 posts

It fails to build using an lxc container (arm on arm) complaining that;

’Can’t mount proc on /newroot/proc: Operation not permitted’

 
Nov 23, 2018 11:27pm
Avatar Timothy Baldwin (184) 229 posts

It fails to build using an lxc container (arm on arm) complaining that;
’Can’t mount proc on /newroot/proc: Operation not permitted’

I read that by default LXC security settings prohibit mounting filesystems and other operations that are required create containers. Disabling these is may be unsafe for privileged containers, that is those that do not use user namespaces.

I suggest you ask on a Linux forum if you need help setting up LXC to support nested containers.

You can disable the sandbox using RISC_OS__INSECURE=YES ./run_RISC_OS when running RISC OS or make INSECURE=YES when compiling. This of exposes your user account to all RISC OS security flaws.

I have added instructions to the README.md file.

 
Nov 24, 2018 12:02am
Avatar Mike Howard (479) 51 posts
I suggest you ask on a Linux forum if you need help setting up LXC to support nested containers.

Thank you but it was just for your information. There was no nesting of containers here though, simply an lxc container running on an arm server, to prevent bloat of the host.

I have added instructions to the README.md file.

Cool.

 
Nov 24, 2018 2:03pm
Avatar Jan Rinze (235) 313 posts

Aemulor on the Linux environment would be nice to have.
Has anyone tried it and had any luck with that?
I am very curious because it would complement it much if we could use 26 bit apps.

 
Dec 8, 2018 10:32am
Avatar Tristan M. (2946) 1046 posts

Not sure if it’s documented. Attempting to change the mouse type from “Unrecognised” via the configuration screen results in some kind of lockup.

 
Dec 20, 2018 1:27pm
Avatar Timothy Baldwin (184) 229 posts

There was no nesting of containers here though,

No, there is, at least by some definition. The run_RISC-OS script does use container techniques to restrict what RISC OS can do, including creating user, PID and mount namespaces bind mount parts of the filesystem that should be accessible, calling pivot_root and mounting a new instance of procfs which is where it fails. It is prohibited to mount procfs unless the caller has procfs already mounted without anything mounted on top, or has CAP_SYS_ADMIN (is root) in the root user namespace.

A solution I have found is to bind mount /proc/self instead of mounting a fresh procfs instance, however this breaks my parallel build modifications to srcbuild. I think that can be fixed by sharing the file descriptor table between processes.

 
Dec 20, 2018 11:34pm
Avatar Timothy Baldwin (184) 229 posts

It works on ARM64 virtual servers running Ubuntu from Amazon Web Services, at last the search for cloud servers that can run RISC OS without CPU emulation is over.

Unlike other cloud providers (eg Packet and Scaleway) who have brought 64-bit only processors they designed their own chips based on ARM’s 32/64-bit design. I haven’t tested the other Linux distributions, please note that it is possible to compile Linux without support for 32-bit programs.

I discovered and fixed a few bugs:

  • ARM64 Linux ptrace behaves differently when an SWI is called with r7 = -1, which was breaking the ptrace SWI interceptor (only used if Linux does not support seccomp mode 2)
  • The QEMU decision script code was inappropriately choosing to use QEMU if RISC OS failed due to the vm.mmap_min_addr setting, it now just uses the HAL —help option as test if 32-bit ARM programs run, and then checks and fails it RISC OS will not work.
  • The checksum for the HardDisc4 zip file was out of date. I changed to using the current self-extracting archive instead.

I decided to make some benchmarks comparing Amazon’s smallest ARM virtual server to my desktop and laptop building RISC OS and running the following BASIC loop:

TIME=0:I=0:REPEAT:I+=1:UNTIL TIME>2000:PRINT I/20; " BASIC loops per second"

Amazon Web Services a1.medium

51904.9 BASIC loops per second

RISC OS build:

real 4m20.498s
user 1m28.691s
sys 2m45.845s

AMD A8-5600K on ASRock FM2A75 Pro4 with 2 × 4GB DDR3 CL9 1333MHz DIMMs

122534.55 BASIC loops per second

RISC OS build:

real 9m15.656s
user 17m46.909s
sys 2m26.064s

ASUS Chromebook C100P

542202.75 BASIC loops per second

RISC OS build:

real 1m24.399s
user 2m3.043s
sys 1m13.273s
 
Dec 21, 2018 10:31pm
Avatar Tristan M. (2946) 1046 posts

Those found and fixed bugs… Those have been plaguing me forever. Thank you so much for fixing them!

I came here today for another reason. Keymapping. I want to map the menu key on the keyboard to the menu mouse button. StrongKey doesn’t work in the Linux port. It thinks Toolbox is missing for some reason. Using StrongKey and Keymapper feels like it wouldn’t work anyway.

What is the right way to do it? I cosidered altering keyboard.h but that may not yield the result I need. The trouble I have is that it’s a notebook keyboard so I can’t plug it into an RO system to work out if the scancode is mapped or as what. I tried trial and error with keymapper last night with no success.

 
Dec 22, 2018 12:45am
Avatar Timothy Baldwin (184) 229 posts

What is the right way to do it? I considered altering keyboard.h but that may not yield the result I need.

Whilst you might be able do it by altering Keyboard.h you shouldn’t as that is the list of RISC OS key numbers.

For the SDL frontend the standard key mapping is specified in sdlkey.c and altered in sdl.cpp if the —chromebook option is given. It’s best add another option to sdl.cpp.

You can find the list of SDL key names in the SDL header file. If you get stuck add "cerr << "Key down: " << e.key.keysym.scancode << endl;" after “case SDL_KEYDOWN:” in sdl.cpp.

 
Dec 22, 2018 8:48am
Avatar Tristan M. (2946) 1046 posts

Thanks. I’ll give that a try later. StrongKey is adamant that Toolbox is missing for some reason so that’s a dead end.

 
Dec 22, 2018 11:26am
Avatar Tristan M. (2946) 1046 posts

I tried adding an option for pinebook. Haven’t got that working yet for some reason. Added “{SDL_SCANCODE_APPLICATION, KeyNo_LeftMouse + 1},” to the scancodes in sdlkey.c and it appears to function. So at least it works the wrong way for now.

 
Dec 22, 2018 3:57pm
Avatar Timothy Baldwin (184) 229 posts

StrongKey is adamant that Toolbox is missing for some reason so that’s a dead end.

It works for me once I load the tabs module, which is not part of the RISC OS distribution.

 
Dec 23, 2018 12:15am
Avatar Tristan M. (2946) 1046 posts

Where are you getting the modules from? The versions I found bundled with something I can’t recall were too old for StrongKey.

What I meant before is that I added an option for Pinebook that should have been selectable. via the commandline args. I didn’ have much time so I didn’get to investigate what I’d done wrong. But adding to sdlkey.c confirmed that there are no actual issues with getting the Pinebook option working besides me.

 
Dec 23, 2018 12:36am
Avatar Timothy Baldwin (184) 229 posts

Where are you getting the modules from? The versions I found bundled with something I can’t recall were too old for StrongKey.

See the announcement thread which states the Tabs module is available via PackMan. It just downloaded the linked zip file.

 
Dec 23, 2018 6:36pm
Avatar Steve Pampling (1551) 6358 posts

See the announcement thread which states the Tabs module is available via PackMan. It just downloaded the linked zip file.

I thought Tabs was an extension Toolbox module for the ROL originated Toolbox. Does it work with the standard release toolbox in RO5?

 
Dec 23, 2018 7:24pm
Avatar Fred Graute (114) 536 posts

I’ve uploaded a new version of StrongKey that includes the Tabs module and RMEnsures it correctly.

I thought Tabs was an extension Toolbox module for the ROL originated Toolbox. Does it work with the standard release toolbox in RO5?

Yes, it works fine on RO5. I use it in several of my applications including one you should be familiar with, Transient (for its choices window). :-)

Next page

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Reply

To post replies, please first log in.

Forums → Code review →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Developer peer review of proposed code alterations.

Voices

  • David Boddie (1934)
  • Rick Murray (539)
  • Steve Pampling (1551)
  • Timothy Baldwin (184)
  • Chris Gransden (337)
  • DavidS (1854)
  • Mike Howard (479)
  • Jan Rinze (235)
  • Tristan M. (2946)
  • Fred Graute (114)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys