Linux Port
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 ... 20
Timothy Baldwin (184) 242 posts |
No, make/AMU checks if the timestamp is newer, not the contents. Which would cause more rebuilding, I copied the method the SharedCLibrary makefile.
“git checkout” tries to preserve local changes and will not make a checkout pristine. I would not expect it create the directory in question unless you were switching from the first commit. To make it pristine use “git clean -fxd; git reset —hard”.
I used an historic value for the ELF flags field which claimed it was using APCS and SWI numbers for system calls. Modern Linux uses R7 to indicate the system call number. That should be fixed in the source code, and I have uploaded a separate binary . |
Timothy Baldwin (184) 242 posts |
Which should be due to the change in it’s source code.
It was. So you can.
The problem solved by including RISC_OS.xz is that you can’t build RISC OS without an already built RISC OS. The alternative is to use RPCEmu and IOMD RISC OS.
I used:
The “METHOD=rpcemu” setting causes the makefile to use IOMD RISC OS 5.22 in RPCEmu instead of mixed/Linux/Support/RISC_OS.xz but should not effect the result. |
Chris Gransden (337) 1207 posts |
The new RISC_OS.xz still hangs. I managed to build the latest source with the old one on a Titanium. Then copied everything across to the Chromebook (Cortex-a72 @2.2GHz). Here’s the results from RISCOSMark5 using a ram disc. :-O RISCOSmark 2.04 (30-Dec-2015) by Richard Spencer 2003 Comparison with RiscPC SA 202MHz running RISC OS 4.02 800x600,256 (HD benchmarks are in kilobytes/sec) MOS Utilities 5.23 (09 Feb 2017) FileSwitch 2.84 (08 May 2016) C Library 5.92 (28 May 2016) FileCore 3.71 (16 Dec 2016) HAL-based system (Linux CLOCK_REALTIME) tested at Mon,01 Jan 1900.00:00:36 Filing system: RAM:RamDisc0.$ Graphics Resoloution: 1440x900, 16M colours Test Benchmark Processor - Looped instructions (cache) 5158932 2900% Memory - Multiple register transfer 79224 48903% Rectangle Copy - Graphics acceleration test 5334 2204% Icon Plotting - 16 colour sprite with mask 44839 2241% Draw Path - Stroke narrow line 20367 1305% Draw Fill - Plot filled shape 21183 1451% Draw Render - Render draw file 11876 1310% HD Read - Block load 8MB file 5442407 182508% HD Write - Block save 8MB file 2749592 90417% FS Read - Byte stream file in 402 194% FS Write - Byte stream file out 405 210% |
Jan Rinze (235) 368 posts |
Okay, I found the cause. Nice results with the Cortex-A72. P.S. My laptop runs kernel 3.10.18 and that might be the cause of the incompatibility. |
Jan Rinze (235) 368 posts |
It shows that the Cortex A72 really shines at memory access compared to the Cortex A15 results shown above. Although the sdl isn’t smooth with updates my small VFP demo !Teapot does neat. |
Timothy Baldwin (184) 242 posts |
Jan Rinze wrote:
That was a fix for a different bug.
Interesting program, where can I get it?
Thanks. Somehow on your system writing to STDOUT causes SIGIO which raises a erroneously enabled interrupt. The HAL should enter the RISC OS kernel with virtual interrupts disabled. Fixed source uploaded. I will upload a binary later. I suspect the desktop was working because STDOUT is redirected to /dev/null by ./Test_Boot. Redirecting STDIN to /dev/null should also workaround the problem. |
Jan Rinze (235) 368 posts |
@Timothy: Your latest patch has fixed it for me. Thanks for the swift actions! benchmark tools RISCOSMARK Now trying to find out why gcc complains in a taskwindow.
|
Timothy Baldwin (184) 242 posts |
That’s because Unixlib contains a OS_EnterOS/MSR pair. If it was statically linked it would be patched by IXSupport. |
Jan Rinze (235) 368 posts |
@Timothy From the description of SharedUnixLibrary: Intercepting OS_EnterOS and doing run time patching could be a solution. Most of the calls after OS_EnterOS are used to fiddle with CPSR and an appropriate work-around could help out. In the past I have written some stuff to switch to emulation (like RPCemu) for the parts that would interfere with the Linux layer. It wasn’t fast not beautiful but it worked somewhat. That was years ago in ‘rose’ or RISC OS emulation for Linux. We didn’t get far then since my knowledge of how Shared Clib etc. worked was far too little to get things going. Digging deeper into that never happened. So even today I still have very little knowledge of how RISC OS starts up code. Some other people did more and that ended up in ‘riscose’ but was abandoned too. In all you can imagine my enthusiasm seeing the results of your work. An adapted version of SharedULib should be possible too but (of course) I have no idea where to start. |
Timothy Baldwin (184) 242 posts |
Think it would be in an ELF shared library, not the SharedULib module which is still used by statically linked UnixLib. |
Timothy Baldwin (184) 242 posts |
I did so on Tuesday. The reported bugs that cause it to fail should be fixed, and it should work out of the box given ROOL DDE. It now support parallel builds, to use N cores add “JOBS=N” to make command line. “JOBS=1” activates parallel build support but is sequential. “JOBS=0” or leaving it unset results in an traditional single process build. I find using 4 cores builds RISC OS in half the time. Wimp slots are however even more broken, “*WimpSlot 2G 2G” causes RISC OS to slowly crash. It appear OS_AMBControl should return an error. Why does the RTC device in the HAL not work? Here it is so far:
Note that “RTC added” and “RTC read” are printed during boot, and RISCOS5Mark reads “Linux CLOCK_REALTIME”. |
Chris Gransden (337) 1207 posts |
A fresh rom build now completes successfully taking 1min 40s. I had to change one thing in the Makefile. The uname -m command returns aarch64 so it tries to use qemu instead. Changing it to uname -m | grep -q -E ‘arm|aarch64’ fixes it. |
Jan Rinze (235) 368 posts |
Quick builds, that’s great! I’m trying to find out if I can persuade GCCSDK builder to build gcc with -mlibscl so that it runs without needing the shared unix lib. |
Chris Gransden (337) 1207 posts |
You can get the GGCSDK builder to complete successfully by changing line 2229 in srcdir.orig/gcc-trunk/gcc/config/arm/arm.h. Change it to ‘if !defined(arm)’. |
Jan Rinze (235) 368 posts |
I’m trying to find out if I can persuade GCCSDK builder to build gcc with -mlibscl so that it runs without needing the shared unix lib. will that build me a gcc executable that is linked with -mlibscl ? I use an ARM platform to build GCCSDK. |
Tristan M. (2946) 1039 posts |
I just want to say this is an amazing project. I look forward to trying it. …that is to say, I have been trying to but I can’t get it to build. Trying to build it on Armbian legacy on an Orange Pi PC. Something breaks after a page or so of stuff. Still trying to pinpoint what. The bootstrap userland RISC OS is working. It finds DDE. There’s not much error-y happening.
Is this an error or just a hack for platform detection? … It just seems to work until it doesn’t. These last few posts are of special interest to me because I haven’t been able to get GCCSDK to build on an ARM platfor because of the SUBTARGET_EXTRA_SPEC_FUNCTIONS problem. Does this Linux port run properly on aarch64 linux as a native app? My Orange Pi PC2 arrived (H5 SoC). I was just curious because I don’t know how aarch64 handles switching between 32 and 64 bit modes. |
Timothy Baldwin (184) 242 posts |
Tristian M. wrote:
The rest of your post seems to contradict that.
It’s a error. The output of “strace mixed/Linux/Support/RISC_OS” might be helpful. However I read that Armbian legacy uses Linux 3.4.113, and this port uses SECCOMP-BPF which was introduced in Linux 3.5, which if OABI support (which causes Linux to pay attention to the SWI number) is also enabled explains the crash. I have rescued the ptrace SWI intercept code, which allow RISC OS to runs slowly, however there is bug that causes a crash when building RISC OS. Source is on github, and binary is here.
It should provided that 32-bit user code and SECCOMP filter/bpf mode are enabled in the Linux kernel configuration, and according to Chris Gransden it does. It appears from the Linux git commit messages that Linux 3.19 is required. |
Chris Gransden (337) 1207 posts |
I’m using ChromeOS which has a 3.18.0 aarch64 kernel. |
Chris Gransden (337) 1207 posts |
I don’t think it’s possible to do this. Once you have the GCCSDK autobuilder working on ARM linux it will be easier and much faster to use this instead of running gcc natively. |
Tristan M. (2946) 1039 posts |
I’m just going to come to the conclusion that it doesn’t like me.
Whitespace lines removed so bq sort of works. |
Timothy Baldwin (184) 242 posts |
I changed the message to “Seccomp-bpf and ptrace not available so trying QEMU SWI hack…” so if you get the same message as before you are running the wrong binary.
Please clarify “well as RISC OS Pico”. So RISC OS works outside the makefile but crashes with an illegal instruction signal without printing “Hello World” in the makefile? Can you find the relevant difference? I have put Export/APCS-32/C/Global/h/Keyboard in a zip file which should allow you run “make sdl” to build the sdl frontend. Then Test_Wimp and Test_Boot should work.
This is different bug. Is it using ptrace, RISC OS will mention it with “Seccomp-bpf not available so using ptrace – This is slow.”. |
Tristan M. (2946) 1039 posts |
I still had the terminal open from before with the RPi3 attempt. I put it on pastebin. This is with the tweaked binary. This is without. It fails before it loads. Oh wow. I just tried the unpatched RISC_OS on Pi3. That’s it. That’s all it outputs. I can’t do the results of the different versions of RISC_OS in aarch64 mainline kernel on the H5 right now sorry. It’s doing the longest GCCSDK build in history right now. Pretty sure it really is building the world. |
Timothy Baldwin (184) 242 posts |
Whilst investigating why strace misbehaves I find that old Linux versions setting the system call number to -1 using ptrace raises SIGILL instead of just skipping the system call. However RISC OS could change the system into something else and arrange for r0 to be restored from the stack. |
Timothy Baldwin (184) 242 posts |
That is a helpful error message. To make it more verbose:
(Someone ought to fix Obey to support multiple arguments) And to see the memory map:
I suspect Linux might be accounting reserved address space as memory. |
Tristan M. (2946) 1039 posts |
e: aarch64 Verbose http://pastebin.com/89QAHMnx page with bash highlighting With memory map One thing that stands oyut to me straight away is:
RPi3 Armbian with patched RISC_OS Verbose Memory map |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 ... 20