HelenOS as a foundation for next generation RISC OS
Pages: 1 2
Stuart Swales (1481) 351 posts |
The point is that the current SWI-based API is NOT APCS-32, so changing to that would break everything. |
Stuart Swales (1481) 351 posts |
Don’t delude yourself. Nobody is going to write new assembler modules ever again. I haven’t done a pure assembler module since 1988. |
Charlotte Benton (8631) 168 posts |
No one is going to win this debate, simply because it’s a matter of taste. Some like coffee. Some like tea. And ultimately you can’t tell people what they want. A split could happen, but this doesn’t necessarily have to be a bad thing, and it doesn’t have to be an end to cooperation. |
Steffen Huber (91) 1953 posts |
The last “advanced projects” in pure assembler were probably Artworks and Sibelius. Artworks is now a mixture of Assembler and C, the other is dead on RISC OS and got rewritten in a HLL on Windows. So I am interested which “advanced projects” you are talking about. Maybe it is just our definition of “advanced” that is different. |
David J. Ruck (33) 1636 posts |
No one is using assembler to write OS or application code any more, it is jtust not a sensible use of time to write non portable code. I’m not just talking about portability from 32 to 64 bit, but old 26 bit code, alignment issues and the SWP instruction, all of which break in assembler, but if writen in C can just need to be recompiled with a recent Norcroft/GCC to fix. One of the reasons for using assembler was for optimal performance, but that isn’t a given any more. There are now RISC OS machines using a range of different cores with far larger ISAs, and producing code which is optimal on all of them by hand is impossible. A compiler can produce either a general build which is ok for all, or code optimised for a specific CPU. The only use of assembler now is by people writing the initialization code to bootstrap a chip, and those writing compilers. i.e. its a specialism not a general purpose solution. The last thing we need on RISC OS is more assembler being written to become rapidly obsoleted, and abandoned. |
Charlotte Benton (8631) 168 posts |
Indeed. Those who write compliers typically know a lot more about optimising machine code than those who write applications. And as CPUs become ever more complex (with machine code drifting ever further towards being a high level interface for what is truly going on the core) this will become more and more true. |
Clive Semmens (2335) 3276 posts |
Indeed, in much the same way that 6502 Assembler is pretty much set in stone, or Classical Latin. If RISCOS is tied to AARCH32 ISA, it’s on its last legs. That might be so. It’ll probably last me out – just about. |
Clive Semmens (2335) 3276 posts |
I pretty certainly won’t last fifty more years, anyway. I’d be breaking world records if I did. I didn’t know 68K HW is still being produced; that fact doesn’t mean that every architecture will live that long – most don’t. I’d be very surprised if AARCH32 is still being manufactured ten years hence, never mind fifty. Old stock? Maybe another five after that. My own machine? Rest of my life, even if I live to a good age – if I’m lucky. RISCOS might last longer, running on something else, but I’m not very optimistic about that. |
Andy S (2979) 504 posts |
David Look around. You say “NO ONE” does, then where do these newer written in assembly code come from. So Assembly is no longer something that can be argued against for RISC OS. Some people do enjoy writing in assembler and it’s certainly more fun on the ARM and in RISC OS than, for example, x86. If you want to write new RISC OS modules and programs in assembler, go for it. If you want to change the minds of the regulars here who are choosing C, I’m afraid you’re wasting your time. |
Andy S (2979) 504 posts |
No interest in changing anyones mind. If you like any given language use it. Fair enough. |
Clive Semmens (2335) 3276 posts |
I used to write in Assembler because BASIC wasn’t fast enough for what I wanted to do, and I find assembler (particularly ARM assembler, but I’ve used several others down the years) easy, whereas I’ve never really got my head around C. But BASIC is fast enough for everything I want nowadays, and I’m not writing modules (although there are a couple of existing ones I’d actually like to edit – but probably never will). |
David Feugey (2125) 2709 posts |
And there will probably be no none using it anyway :) |
Paolo Fabio Zaino (28) 1882 posts |
@ DavidS
If you mean the ARM ASM used in the HelenOS kernel then it’s minimal (as it should be to have a portable kernel) and you can find it here: AArch32: https://github.com/HelenOS/helenos/tree/master/kernel/arch/arm32/src AArch64: https://github.com/HelenOS/helenos/tree/master/kernel/arch/arm64/src HelenOS could possibly be used also on older machines:
If you meant the specific bits for the RPi they are here: https://github.com/HelenOS/helenos/tree/master/kernel/arch/arm32/src/mach/raspberrypi If instead you mean to use ASM to create an Application on HelenOS then the ASM syntax is the usual GCC GASM Syntax for ARM (either ARM32 or ARM64). And finally if you meant the API access then HelenOS has a preemptive scheduler which makes application coding easier than on RISC OS: So you probably need less code than in your example above if you code straight for HelenOS. Also HelenOS comes with its own “WIMP” which has (obviously) its own API. To access it from ASM source in user space you can use the standard “low level programming” techniques you would use in regular GCC on Linux for example or BSD and obviously call a different API. So on This HelenOS works as a modern OS (aka SWI/SVC are used only to call the Kernel, not everything). Does this answers your question?1 fn.1 With that said I am not pushing for HelenOS, just answering a question, that’s all. |
Paolo Fabio Zaino (28) 1882 posts |
Here then few examples for you: https://github.com/HelenOS/helenos/blob/master/uspace/app/hello/hello.c https://github.com/HelenOS/helenos/blob/master/uspace/app/calculator/calculator.c More in general UI API here: Full UI implementation here: Also HelenOS already implements a minix and a Posix API, so it’s not much different that coding on BSD for example. |
Paolo Fabio Zaino (28) 1882 posts |
@ DavidS
One day you like Amiga OS / Atari TOS and then another day you say things like above, make up you mind my friend :D The API in HelenOS is the C USUAL API David, so similar to all the UI APIs in the world (where also AmigaOS Intuition and Atari TOS GEM/AES has similarities), aka is not the SWI API that is peculiar to RISC OS only. The difference in HelenOS is that HelenOS is a micro kernel and uses messaging for a lot of things, which IMHO is quite nice actually, however not sure how performant it is compared to more monolithic kernels |
David Boddie (1934) 222 posts |
Paolo wrote:
The answer is in the FAQ. The question is, “Are microkernel-based systems inherently slow?”
|
Paolo Fabio Zaino (28) 1882 posts |
I don’t think anyone is working on this, because to work on this it requires first to “un-spaghetti” RISC OS Kernel (I mentioned this in few topics already, so no need to repeat it again). Otherwise the only other options are:
Charlotte mentioned to use an approach like the Gerph Pyromaniac which makes sense if someone wants to rewrite the entire RISC OS API on top of HelenOS, but let’s not forget that pyromaniac is not yet a full “RISC OS WINE” and even WINE that is pretty much such type of approach (without the emulation of Unicorn of course) and has been in development for many years and has a similar API approach to all modern OS (so nothing as peculiar as RISC OS) still has problems, so no idea when such an effort may be fully working tbh. |
Paolo Fabio Zaino (28) 1882 posts |
What “artificially add complexity” are you talking about? I am not adding anything nor I have any intention to work on this effort. You asked questions on HelenOS clearly because you do not know how it works yet and then you say things like you already know what to do… weird. Anyway remember the Devil is into the details. |
Paolo Fabio Zaino (28) 1882 posts |
Never been against an R&D tbh. As I always state, please feel free to try, R&D is always good and if it brings you nowhere in terms of a “product” it definitely always brings you somewhere in therms of knowledge :) Anyway good luck with your new endeavour! |
Charlotte Benton (8631) 168 posts |
As a relevant aside, how “sensitive” are executables compiled for RISCOS to factors outside the CPU core? Would an ARM 32 emulator with a hypervisor that recognised OS calls, fiddled with the communication registers appropriately and then resumed execution basically do the job, or it a lot more complicated than that? Is memory access just a case of ensuring that pointers returned by the hypervisor to the executable have something meaningful to point to, or do other things need taking into account? |
Paolo Fabio Zaino (28) 1882 posts |
@ Charlotte
You should define what exactly you mean by “executables” AIF? ELF? Modules? Most modules try to run in EL2 (at least they need to enter EL2 via SWI call) and they assume they are linked to SCL for example (if they are written in C). No RISC OS code right now addresses other CPU cores, unless it’s being expressly written for or it’s using something like Jeffrey’s SMP library. So all RISC OS code right now assumes it’s being executed on a single core and single task OS (yes even the WIMP tasks which give back control to the OS/WIMP expressly). If you’re talking about an AIF requirements, the SWIs and the calling conventions are expected to behave in a certain way, they could be replaced under the hood, but you need to identify exactly which one you want to replace: RISC OS native? 3rd parties Modules?
Sure an ARM 32 emulator can be used to run the entire RISC OS on a single core as it happens now and in this case there won’t be any advantage to do all the work and run RISC OS on an emulator with the WIMP still managing the multi-application environment. I think I explained this enough, to make the whole circus work as many seems to expect the first thing to do is to convert RISC OS from Assembly to C, this in order to simplify the required separation between kernel layers1 which right now is a bit of a spaghetti architecture. The conversion to C will also help to remove “tasks management” out of the WIMP which is one of the most limiting factors for RISC OS right now (limiting it way too much). To be close to your question, which exact RISC OS Kernel layer and functions should be affected (and replaced) by the Emulator? None? then you have an RPCEmu kinda situation. Some? which one (with the spaghetti architecture you risk the replacement to be called by something else in an unpredicted manner). When the Kernel architecture is finally separated correctly then (and only then) one can pursue whatever path forward one would like, for example:
OR
Without the conversion to C and restructuring the RISC OS Kernel, every approaches will results to some sort of hacking the existing RISC OS kernel which always assume it’s a single task infrastructure and the WIMP trying to multi-task the applications on top of it which to me personally makes no sense because we already have RPCEmu running on Linux, Windows and macOS, so why even bother? I am not trying to push ROOL’s point of view at all costs, but IMHO what ROOL is doing/asking is already the best path forward for every possible approaches, anyway up to you guys. 1 and a correct definition of interfaces between each layer |
Charlotte Benton (8631) 168 posts |
(To belatedly reply) So the upshot is that a full assembler to C conversion of the kernel is (for all practical purposes) a necessary preliminary to any form of microkernel RISC OS? |
Paolo Fabio Zaino (28) 1882 posts |
IMHO, yes1 it is a must “go through” in order to be able to pursue any other path forward, while, at the same time, maintain some sanity in all the possible divergences that may occur. Obviously this is just my personal opinion. 1 although if not a full ASM to C conversion. I mean in all kernels there is always a minimal ASM component for certain and very specific tasks. |
Pages: 1 2