Any plans to have an open source toolchain to build RISC OS?
Pete Moore (2829) 7 posts |
I was interested in seeing how the integration with the VideoCore IV GPU is implemented on the Raspberry Pi, and decided to take a stab at building RISC OS from source. The first hurdle I encountered was that it appeared I needed to pay £50 for a closed source toolchain in order to build RISC OS. Is that correct, or is there an open toolchain I can use? |
Steve Fryatt (216) 2107 posts |
Mostly correct. See this thread and the DDE FAQ for details. There are some free copies available for developers who qualify, though. Building RISC OS with other toolchains is hampered by the fact that Acorn never saw the need, and so there’s lots of dependence on being built using the DDE running on RISC OS within the sources. |
Mike Carter (36) 51 posts |
Yes/Maybe, see the bottom section of the post here https://www.riscosopen.org/news/articles/2020/02/21/new-desktop-development-environment-reaches-out |
Pete Moore (2829) 7 posts |
Many thanks Steve and Mike! I’ve sent an email to ctools@roo – let’s see what they say. Fingers crossed! :-) |
Rick Murray (539) 13861 posts |
Had a brief look at the FAQ (https://www.riscosopen.org/content/documents/dde-faq) and I think something missing from the description of how Acorn ANSI C and Desktop C differ from the DDE is that in those days the assembler was not supplied as standard. As you can see from the 1989 price list (http://heyrick.eu/random/acorn_september1989_retail_price_list.pdf) the compiler was about £170 while the assembler was £228! Maybe twice that, I have no idea what the software developer’s toolbox consisted of. There’s a reason why all my early code that linked to assembler uses Nick Roberts’ ASM! ;-) |
Pete Moore (2829) 7 posts |
Ah thanks for the context – that is interesting indeed. Especially to see the 1989 price list! While I’m here, can anyone point me to the code that makes the mailbox requests to the RPi GPU firmware? Am I right in thinking RISC OS runs with the standard Broadcom GPU firmware, or can it also run with e.g. https://github.com/christinaa/rpi-open-firmware? I also saw (new) open source GPU firmware mentioned here (MESA): https://www.raspberrypi.org/blog/vc4-and-v3d-opengl-drivers-for-raspberry-pi-an-update/ I’m curious how the ARM/VC4 interface works – whether the interface is comprised of firmware mailbox calls (https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface), whether RISC OS contains code that is compiled directly for VC4 target and then remotely executed, or if there is a higher level OpenGL ES / other graphics API interface somehow that bypasses the mailbox interface entirely. I’m relatively new to this area, and thought looking at a real world implementation (in this case for RISC OS) would be a good way to build an understanding. Until now, the bare metal experimentation I’ve done has simply allocated a frame buffer, and written to it directly via the ARM. Many thanks! |
Alan Adams (2486) 1150 posts |
Which is why all my coding is done using BBC BASIC. Getting it to run fast enough used to be a problem, but not so much now with fast computers. I managed to get a 250KHz square wave from a GPIO pin by bit-banging from BASIC, which I was rather surprised to see. I’m not about to try learning C and derivatives now. |
Clive Semmens (2335) 3276 posts |
I’m not about to try brushing up my C either, but I regret the resulting inability to write modules 8~( |
Martin Avison (27) 1497 posts |
You do not need C to write modules – I and many others do it with BASIC (and some assembler). Do you know of any good assembler documentation?! |
Steffen Huber (91) 1958 posts |
So many people seem to moan about the cost of the DDE, yet nobody seems to want to invest some time to at least look into the finer details of making RISC OS buildable with GCC. |
Rick Murray (539) 13861 posts |
Writing modules in C isn’t that difficult… https://heyrick.eu/blog/index.php?diary=20150323 (jeez, a half decade old already, where does time go?) The main things to remember about C are:
Hmm, kind of went off on a tangent, I think…! |
Rick Murray (539) 13861 posts |
Did you use assembler or calls to the GPIO module? If you need stable square waves, I’ve seen some nifty tricks along the way. With the BBC User Port, pushing values into the shift register was able to clock out pulses (and rudimentary PCM) faster than the machine would have been capable by bit banging alone. I’ve also seen similar done with serial ports, setting up the word format and transmitted data to give a square wave, that could then be speed adjusted using a mixture of how many bits on and off and the speed the port is running at. As you’re basically writing bytes to a serial buffer, it can run pretty fast with minimal overhead. [obviously I’m thinking 3.3V serial, you’d need some level shifting if dealing with RS232] |
Rick Murray (539) 13861 posts |
Of course, where there’s an output port, there’s a nerd with way too much spare time. ;-) |
Alan Adams (2486) 1150 posts |
BASIC, calling the GPIO module. The only speed-up was to use the SWI number instead of name. It wasn’t multi-tasking though. |
Richard Walker (2090) 432 posts |
I don’t really get it. OK, so it is fifty quid, but how much have you spent on all the hardware to run it? And how much is your broadband? Or mobile? Or a tank of fuel?! |
Steve Fryatt (216) 2107 posts |
Not sure if that was aimed at me, given the quote? It’s not something that’s ever bothered me enough to want to look at it. A few years back, a few people pointed out that Tokenize might be useful in helping build RISC OS away from RISC OS (ie. on a conventional Linux-based CI system). I don’t think it ever got mentioned again.
On a Pi? Possibly around as much as the dev tools cost.
All largely irrelevant, since most of those would trump buying a set of development tools to investigate an obscure Open Source OS that you’ve just stumbled across on the internet. But then, that’s the problem that ROOL’s current offer addresses. |
Andrew Rawnsley (492) 1445 posts |
A different viewpoint (well, in line with Richard Walker) was made to me last week by a fairly smart guy. In the IoT world (which a version of RISC OS could be vaguely useful in), the only sensible choice for coding is the ARM toolchain which costs thousands per year. GCC isn’t really an option for that audience (I forget quite why – he explained it). By comparison, the 50ukp DDE generating ARM code is a veritable bargain, esp if you multiply that up by number of devs and devices and… It is also worth remembering that the DDE is included in NutPi too. (The background to this was a suggestion that if the kernel implemented a bit more in the way of idling so that power management could be controlled outside of the desktop, an IoT build of Pico could attract more kernel devs). |
Jon Abbott (1421) 2652 posts |
RISCOS mostly uses firmware mailbox calls, with a few direct register writes such as setting the gamma. The VC4 hasn’t been properly documented at register level as far as I know. |
Peter Howkins (211) 236 posts |
An alternative viewpoint. If you employed someone to work on your project, you wouldn’t make them pay for the dev tools. If you want people to write valuable code for you for free, you want to charge them? I realise RISC OS is a spectacular ivory tower backwater. At least put some effort in to attracting developers from elsewhere, because there’s about 4 people left here. |
Clive Semmens (2335) 3276 posts |
ROFL – you did know I wrote ARM’s own Assembler Guide, and the Instruction Set pages in the ARM Architecture Reference Manual up until 2007? I hope that’s good enough – as long as we’re not talking v8, any changes since then are surely minor? I presume RISCOS is still all v7? v8 is essentially a completely different beast that I don’t know at all. It’s not assembler language that’s the problem for me, it’s how modules work, which I’ve never got to grips with. But actually I don’t think I’d have a problem writing a module – it’s more doing anything with existing modules when I think about it. Even so, a pointer to some information about writing modules (in BASIC and assembler) would possibly be useful – don’t worry about needing assembly language, I’ll have no problem getting back up to speed with that. |
Martin Avison (27) 1497 posts |
Of course! :-)) Somewhere I have a skeleton module in BASIC/Asm, if you are interested. |
Clive Semmens (2335) 3276 posts |
Definitely! Sadly I suspect though that until I bite the C bullet, I won’t be able to give Draw or Paint the kind of palette controls that I’d like, but such is life. There are lots of things that are more important to me than that…and I’ve not even been following what others have been doing on that front, possibly even meeting my desiderata anyway! |
Alan Adams (2486) 1150 posts |
The point, for me at least, is that at the time when I might have started to use it, the cost was closer to 400 pounds. The computer cost about the same. Now I have a very large investment in experience and code in BASIC that I’m not going to translate into C. |
Richard Walker (2090) 432 posts |
I agree than a Pi is very cheap, but less so once you consider the ancillaries (OK, so not everyone needs to buy everything from scratch). Professionally, I would agree with Peter H. I would equip a developer with the tools they need, no expense spared, because the cost is dwarfed by their salary. But in RISC OS land, we are talking about volunteers, so there is nothing to compare the cost to. I think it is a touch unfair to try. I think other household bills, particularly those which are non essential, are a fair comparison. It’s about choices. A year of cable TV would be more than the DDE. One final thought, and maybe this only applies to me, but I have found that there are many more factors which stop me working on USBJoystick or contributing to RISC OS. The cost of the DDE didn’t come into it. Back when I started USBJoystick, I just bought it, feeling that it was cheap enough to do so on a whim – certainly compared to its previous pricing! |
Theo Markettos (89) 919 posts |
Developing things for RISC OS is like working on a building site with no electricity or running water, having arrived on a bicycle. Meanwhile other platforms are like having a warm, well-equipped workshop with all the tools you need to hand. Sure, some people like making log cabins in the woods with their bare hands, crafting tools from whatever junk they find lying around – and don’t let me dissuade them from doing so. But sometimes you can be a lot more productive with an electric pillar drill than a hand drill. Having a productive environment gets more things done more quickly. And if the competition is offering better tools, the temptation is to go over there where you can get more done with less hassle. You’re more likely to entice people to work for free if you offer them a nice environment than if they have to suffer much pain on the way (a monetary cost being only one kind of pain). |