I called this routine with A=7A (as written in the article) and my calculator crashed. When I called it with A=00 it worked like a charm. Can someone confirm this? --84plusfreak 12:49, 30 June 2006 (PDT)
- This routine, like SetupAppPubKey, starts out by calling FindAppKey. This, in turn, uses FindSubFieldApp to search for the 801 field. If A = 0, FindSubFieldApp will almost immediately fail, because page zero obviously isn't an app or OS header. At this point, SetupOSPubKey will assume (I guess) that the failure is a bad certificate. It will fall back to key 04 if appID = XX X1 04, or key 0A otherwise. Since appID is unlikely to be XX X1 04, you end up with 0A, which was what you really wanted, but has nothing to do with the OS header. (Now, this may be considered a feature, but I'm guessing it's unintentional.)
- As to what could be going on when A = 7A, I have no idea. It appears to work for me. At any rate that's the way the boot code calls this routine.
- Stupid question, perhaps, but are you sure you actually have a valid OS header and haven't done something odd to your certificate? I suppose, too, FindAppKey might not behave as expected if Flash is write-disabled -- does that make any difference? FloppusMaximus 20:45, 8 July 2006 (PDT)