Another quick update:
Finished capt_req.c, finnaly everything compiles and boots. Now to finish kbd.c to be able to use it.
Also, does anybody know when CHDK overrides the locked card or where that part of code might reside? It's said that R47 doesn't need extra code to boot from bigger cards, so looking at the reference ports, I left that part out. I'm starting to suspect I might have left out too much.