spth / OpenRabbit

Loader and Debugger for Rabbit Semiconductor µC, such as the Rabbit 2000,Rabbit 3000 and Rabbit 4000.
Other
8 stars 3 forks source link

SDCC-compileable replacements for coldboot.bin and pilot.bin? #2

Open spth opened 4 years ago

spth commented 4 years ago

OpenRabbit currently depends on the coldboot.bin and pilot.bin binary blobs from Dynamic C.

While the source code for both is free (MPLv2), the non-free Dynamic C is required to compile them.

It would be good to have replacements that compile with free SDCC.

spth commented 4 years ago

This would essentially be done by translating the Dynamic C source at https://github.com/digidotcom/DCRabbit_10/tree/master/ColdBoot to sdas syntax (despite being named .C these are actually assembler source files). Then we could compare the resulting binary to the coldboot.bin and pilot.bin that come with Dynamic C.

spth commented 4 years ago

At least the source for pilot.bin from Dynamic C 10 won't work, as it uses Rabbit 4000-specific instructions that won't work on Rabbit 2000 and 3000. Need to check coldboot.bin (and see if pilot.bin source from Dynamic C 9 will be released as free software).

See also: https://github.com/digidotcom/DCRabbit_9/issues/3

spth commented 4 years ago

Source for pilot.bin and coldboot.bin suitable for Rabbit 2000 and 3000 from Dynamic C 9 has just been released under MPL: https://github.com/digidotcom/DCRabbit_9/commit/d939c1440e76c2e505c46679b73bef45be483db2

spth commented 4 years ago

The coldoad branch now has coldboot.bin source that can be compiled with SDCC. Doing the same for pilot.bin would be possible, but more work.

tomlogic commented 4 years ago

It should be safe to remove the nop opcodes and trailing instructions. As mentioned in our other communications, I believe the nops are placeholders for debugging via rst28 opcodes and unnecessary, and the 5 instructions at the end are unused/unnecessary.

spth commented 4 years ago

I intent to remove them later, once I have the RFU-equivalent functionality working with OpenRabbit.

spth commented 4 years ago

In current trunk, the unneeded instruction in coldload.bin are removed. It still works fine.

spth commented 4 years ago

Replacing pilot.bin will be harder. The source is mostly assembler code with C declarations. SDCC is a great C compiler, but it doesn not support as much interaction between C and assembler as Dynamic C does. This will be more of a rewrite than a simple syntax translation.

feilipu commented 11 months ago

Philipp, I've taken on a RCM2024 project to build a cheap (hobby) version of a Rabbit 2000 board, since there's nothing else around, afaik.

As a starting point I've been donated a RCM4300 which I can use to play with, and get the loaders and crt0 working with z88dk and sdcc.

Since Dom and Paulo have added R4000 mnemonics to z88dk, I can rewrite the Dynamic C cold boot and pilot code in native assembly.

So just wondering whether you're still interested in Rabbit stuff to add some advice to my endeavour?

Merry Christmas.

spth commented 11 months ago

Well, I still maintain the Rabbit ports (r2k, r2ka, r3ka) of SDCC. Having a reliable and fully free software way to test on hardware would be good. I do have some RCM, so hardware is less of an issue for now. We do now have a free (with source) coldboot.bin. We currently do not have source for a pilot.bin. However, IMO the current main issue are some sporadic hangs I see when using OpenRabbit: see https://github.com/spth/OpenRabbit/issues/22 for details. I'm not near my Rabbit hardware for the moment, so I can't do any testing this or next week.

feilipu commented 11 months ago

Thanks Philipp. Nothing to rush.