[E3-hacking] E2 hackery & coding

David Given dg at cowlark.com
Thu Nov 13 12:02:33 GMT 2008


Matt Evans wrote:
[...]
> Yeah post it! :)  Prex sounds cool, get anywhere fun with it?  I got  
> about 5 lines into uclinux booting and ... Well, it's covered in dust  
> now. :-/

Here you go.

My UART got fried just as I was about to do the first boot calling into
the kernel, to see if I would get any tracing out. In other words, none
of my kernel changes are at all trustworthy (a lot of the code is just
copied straight from the Game Boy port to make it run). The boot loader
ought to work, though.

The boot loader (built to boot/bootldr) is created with a PBL header and
should be written to the beginning of the flash. When booted it will
look at each 8kB page header in the first 256MB of flash. If it finds
one, it'll get loaded, and then the Prex boot code will continue.
AFAICT, what Prex does is:

- load and relocate the first file in the .ar (the kernel).
- load, relocate and link the second file to the first file (the device
drivers).
- load and relocate any subsequent files (the applications).

Then it'll pass control to the kernel. But I haven't gone into this
stuff in detail because ELF makes me come out in hives. All I know is
that I flash it with prexos.a and it seems to work.

The patch includes my handy scripts for doing the blessing and flashing;
but you'll probably need pblq-0.3 for that, which I haven't uploaded
yet. Hopefully tonight or tomorrow.

This is all against Prex 0.8.0, BTW. It'll probably need work for Prex
0.8.1 (which, incidentally, now supports ARMs with MMUs and so would
probably be suitable for the E3 as well. However, the low-traffic
mailing list does seem to suggest that the MMU support is a bit buggy.)

[...]
> By MMC, I mean an MMC card.  A bit like an SD card.  Or, an SD card in  
> MMC mode.  :-)  (I was just bit-banging it from the smartcard  
> header.)  I got fairly tired of the smartmedia cards & NAND in general  
> & didn't finish convincing PBL to do more than fetch blocks from it  
> (it wanted something else to select it as 'current FS' -- possible it  
> plainly doesn't work, but the code appeared to support selection of  
> either device).  (It may have missed initialisation & required some  
> other tickle early on to look for the SM card.)

I never even knew PBL *did* support the SM card --- it would be awesome
if we could make it work, if my E2 had a SMC socket, if my E2 still
worked... but yes, I quite agree about SMC vs MMC. MMC and SD are so
wonderfully simple to drive that they could almost have been designed
for homebrewers...

-- 
David Given
dg at cowlark.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prex.patch.bz2
Type: application/octet-stream
Size: 12504 bytes
Desc: not available
Url : http://www.earth.li/pipermail/e3-hacking/attachments/20081113/0374c3d7/attachment.obj 


More information about the e3-hacking mailing list