Bringing this thread back...
On Thursday, 30 September 2021 21:52:07 CET David Boddie wrote:
> I'm not sure a Thumb-2 implementation is really needed, at least for what I
> want to use the compiler for. If I get to the point where I think I want to
> run Inferno on this hardware - which would be a stretch - then I think I'd
> start by hacking in additional instructions using macros before seeing which
> instructions I'd really need.
>
> For reference, this is the microcontroller I'm playing with:
>
>
https://www.microchip.com/en-us/product/ATSAMD51J20A
I set that one aside because I found it easier to get started with an
STM32F405 MCU, as I mentioned on the 9fans mailing list:
https://9fans.topicbox.com/groups/9fans/Ta4e584a373b05553-Me02d5cb4e136e32f9d0015d0/building-blocks-speaking-9p
It turned out that I misunderstood how some of the support functions are
supposed to work, so I had working versions of _div, _divu, _mod and _modu
for simple use cases, but I had missed that the linker generates code to
call them in a particular way. Since the MCU provides SDIV and UDIV
instructions, I moved those functions into the linker.
The other issue is to do with the implementation of _mulv which the compiler
relies on to perform multiplication of vlongs. I think I have implemented
something that works for Thumb-2, though I'm not sure how reliable it is.
I'm also concerned that I haven't set up the allocator correctly and given
processes enough stack space. It's possible that processes are overwriting
each other if their stacks overflow.
I think I'll have to dig out the Raspberry Pi Zero to verify some things.
David