Who'll do the "da Vinci" workstation, then?
Chris Mahoney (1684) 2165 posts |
Something I’ve given a little thought to – with the assumption that 64-bitting will break compatibility anyway – is the concept of finding an existing Linux distribution that’s similar-ish to RISC OS from a UI perspective, then tweaking that until we have something resembling the current UI. But I haven’t got very far down this track, not least because I’m struggling to find a distro that isn’t riddled with bugs. |
Dave Higton (1515) 3534 posts |
Perhaps you think I mean machine translation? No. If it would be clearer to call it a rewrite rather than a translation, I’m OK with that. But yes, understand what it’s doing and then write that in C. But if we do create RISC OS 64, it has to be compatible with RISC OS 5. Otherwise you’d have to create all the apps from scratch too. I agree that it cannot be the same at register level, but (for example) a call to OS_GBPB must still require the same parameters, in equivalent places, so that BASIC calls to SYS look the same, and C call to _swix (or your preferred equivalent) look the same, etc. If you don’t maintain a very high level of compatibility, you might as well not bother, because you’ll have nothing to run on it. Just run Linux and be done with it. |
David J. Ruck (33) 1636 posts |
That being the entire crux of the matter. |
Simon Willcocks (1499) 519 posts |
I’d really appreciate a re-write of GSTrans/SetVarVal/ReadVarVal written in such a way that it copies the strings (or numbers, or code) into malloc’d blocks of memory. No need for memory management or GSInit/GSRead. I should be able to re-factor that into a multi-processor friendly implementation. This is as far as I got yesterday (just reading the PRMs): Types of variable returned from read: 0 String, 1 Number, 2 Macro Types of variable for setting: 0 String to be GSTrans'd immediately when setting the variable 1 Number (4 bytes, signed) 2 String to be GSTrans'd when the variable is read (Macro) 3 Expression to be evaluated immediately (resulting in number or string) 4 String that will not be GSTrans'd when setting the variable or reading it 16 Code (a code fragment that will be executed to read/write the variable) OMG, you can use wildcards in set operations! Wildcards are a problem, there will have to be a flag indicating that a variable was just found and may be used in another OS_SetVarVal call. Maybe keep a list of current wildcard searches and return a reference to the next matching node in the tree. Something like that. TODO: Set literal string variable Read string variable Set number variable Read number variable Set macro variable GSTrans a string containing no variables GSTrans a string containing variables Read a macro variable |
Rick Murray (539) 13850 posts |
I’m wondering if this wouldn’t be a good time to start a discussion regarding splitting this sort of thing out of the kernel into it’s own resource, so the kernel can be exactly that, rather than an MOS ROM-like pile of “useful routines” all jumbled together (OMG, OS_Byte…). It’s a move the other branch did decades ago. |
Simon Willcocks (1499) 519 posts |
Absolutely. The system variables first, please, (everything uses them) and the whole GSInit/GSRead approach is horribly thread unsafe. |
Alan Adams (2486) 1149 posts |
Nemo joined the discussion last night, taking about his work on Unicode. He mentioned that system variables can already contain unicode, but the variable names cannot. While re-writing GSTrans it would be good to rectify this. |
Paolo Fabio Zaino (28) 1882 posts |
Wouldn’t it be better to create a new thread in WishList for the changes to GSTrans/SetVarVal/ReadVarVal? Just my 0.5c |
Dave Higton (1515) 3534 posts |
Let’s all give credit to Julie for having made a start on rewriting RISC OS in C. |
Simon Willcocks (1499) 519 posts | |
Chris Mahoney (1684) 2165 posts |
I was talking to a friend last night and he asked whether I’d tried out a new “AI” of some description. I scoffed and replied “wake me up when it can convert Arm assembly to C”. At that he copied some random code from GitLab:
He doesn’t understand assembly so he didn’t realise that he didn’t have a full “block”. Despite that, it produced the following C:
Sure, it’s not perfect, but I was surprised by how much it “understood”. I wonder whether this could feasibly be used as a starting point for C-ification. |
Stuart Swales (8827) 1357 posts |
Dangerously bad, isn’t it? |
Chris Mahoney (1684) 2165 posts |
Obviously you’d need to figure out what each bit’s doing and e.g. rename variables (r0, r1, etc. help nobody), but at least it’s in a format that I (and other C users) can understand now. I’ve tried to read bits of assembly and have ended up totally confused, but after that machine translation I have an inkling of what’s going on. I’m certainly not suggesting that the verbatim output is any good as-is :) |
Rick Murray (539) 13850 posts |
I know people say that C is like a high level assembler, but this is just extracting urine… |
Paolo Fabio Zaino (28) 1882 posts |
@ Chris that type of “direct” translation is something that debuggers like IDA do by long time and the IDA decompiler does a better job than that. I have been experimenting extensively with AI models, but it’s a waste of time at the moment. The specific requirements for writing RISC OS Kernel code in C are way to hard to be used to generate an ML Model to train a neuronal network of any form and shape. They can however work well for user-space code and for languages like Python or Lua (I had some success with training an AI to write BBC BASIC code). The other problem is that supervised training is a total pain with kernel code, because (among all the details you need to take care of) you need an environment that can be fully controlled to detect all code mistakes and machine crashes in order for the model to improve. |
Sveinung Wittington Tengelsen (9758) 237 posts |
It would appear that quite a few people, maybe 5-6, are working separately to port RISC OS from assembler to C. Individualism is fine, but in this case – why not cooperate, split the task into parts to ensure that no time is wasted on two or more programmers working on the same code. Maybe Github could host such a project, with the most experienced person as project manager? Just a thought. |
Rick Murray (539) 13850 posts |
Several people are doing work to convert some parts of RISC OS to C. Nobody is doing all of it.
That being said, I’d like to draw attention to this. |
Simon Willcocks (1499) 519 posts |
AFAIK, I’m the only one trying to re-implement the underlying kernel to provide threading and multi-processing. I am not re-writing the OS_Plot code, for example, just using the existing code. I anticipate objections to my approach to implementing a HAL. It’s also still to be seen if the interrupt model works well. It might not be popular, but a lot easier to convince people if it works than if it doesn’t! |
Steve Pampling (1551) 8172 posts |
I always maintain that informed, constructive criticism is fine. |
Rick Murray (539) 13850 posts |
Fixed that for you. Seems far too many people just want to whinge about stuff, all too often in the context of “I’m right and you’ll never be”. 1 Especially when they’re demonstrably not right. As I get older, I’m more and more inclined to want to glue pillows to the wall so I don’t hurt myself smacking my head against a solid object.
The usual best answer to that is “feel free to do better”.
Or it might be a lifeline. Who knows?
Can’t argue that. ;) 1 Recent comment topic on El Reg – vaccinations and mask wearing. Oh my… |
Stuart Swales (8827) 1357 posts |
RISC OS – (arguably) never was right and never will be ;-)
I think I mentioned her RAMFS port to C somewhere recently too. Doesn’t fill anyone with enthusiasm to do similar work, does it?
OK, let’s have a poll. Who is actively writing replacement modules for existing RISC OS assembler components in C? Not me. |
David J. Ruck (33) 1636 posts |
Lets dismiss the idea of directly translating existing assembler to C right now, it is a pointless waste of time to use C as a macro assembler. There are far better automated just or ahead of time translators which can turn 32 bit ARM in to 64 bit ARM or AMD64 or whatever. The point of re-writing in C is to express the idea of what the code is doing in as higher level human readable way as possible, to make it easier to maintain, enhance and debug. It should make things like adding new APIs easier, allowing data types to changed to a larger number of bits, or to ad local storage and locks for multiprocessor support. Translating assembler does none of that, a fresh implementation from a functional specification is the only way to achieve those aims. |
Stuart Swales (8827) 1357 posts |
I agree – but I wonder how hard it would be to get a consensus on such a spec – how much ancient stuff can be junked? And again, it boils down to money. It’s too large a project for a volunteer effort. The future for RISC OS on AArch64 is emulation. I like having a whizzy little Pi etc. but would happily settle for RPCEmu on Linux (and don’t really care what architecture that’s running on) when the native hardware dies. |
Sveinung Wittington Tengelsen (9758) 237 posts |
No, I was not. It doesn’t appear to be very active, however. Last activity from 3 moths back; most between 1-3 years. No indication as to when it’ll be done that I found. Should one be optimistic? |
Stuart Swales (8827) 1357 posts |
Perhaps this https://www.riscosopen.org/viewer/events helps?
A pessimist is rarely disappointed. Don’t get me wrong – I really love RISC OS. I’m very happy that it’s been dragged kicking and screaming into the 21st Century. But we have to realise its serious limitations and that some ‘dreams’ are simply beyond scope. |