2 ms·
This is cool but at a glance I expected it would boot on "bare metal", however it seems to be running on top of some firmware/bootloader/BIOS to do talk with th
by simias 12y ago
This is cool but at a glance I expected it would boot on "bare metal", however it seems to be running on top of some firmware/bootloader/BIOS to do talk with the hardware:
extern {
fn pspDebugScreenInit();
fn pspDebugScreenPrintf(format: *const u8, ...);
}
So the actual rust code basically does nothing besides calling a bunch of external C functions. The real work was probably in the rustc code itself to add a new target for the PSP.
I've written a bit of low level rust code and it's quite pleasant to work with. For one, it's very easy to crosscompile: all targets are included by default, so if you have a rustc installed you can probably generate code for arm or whatever (although you will have to crosscompile the various libs you need, but in the case of a bare metal application it's probably only libcore).
Then it's pretty much like working with C. I think my main annoyance is that pointer arithmetics is a pity to work with at the moment (you can't even use it in constexpr which is sometimes hard to work around). Oh and you code breaks every other day when you update rustc, but that's life on the edge :)
- bri3d 12y agoAlmost all open-source code available for the PSP relies on the PSPSDK, which in turn relies on the Sony-supplied firmware on the console. I think this is still really cool - it shows how easy it is to interface Rust with C code and how it's possible to configure Rust for new foreign build targets.