Search This Blog

Sunday 26 October 2008

Kernel booting - continued

The Ubuntu install on the laptop is now complete. No more Windows :) After a quick and painless install via USB flash keyring, I followed the Wiki to setup the laptop for development. A few steps we're missing in the Wiki setup guide (particularly the GDB/Insight install), so that Wiki page has been updated.

I also spent some time looking into Kernel booting. The 2.6.23 kernel decompresses the zImage, it gets to the 'Done' stage, but goes no further than that. I've checked the ldatags side of uMon and compared that to the setup code in the kernel, and they tied together (as they did in 2.6.22). I've also incrementally patched the 2.6.22 kernel up from the sub-version 6 in the VC CVS, all the way up to 2.6.22.19, and it boots fine (except for the usual MTD issues). It's only when I move to 2.6.23 that the boot fails.
So it looks like I need to debug further into the boot sequence. Potentially using the 3 LEDs on the VCMX212 board as a limited binary sequence counter to step through the boot sequence. I need to find some time to see whether I debug the kernel startup/boot via GDB. Just need a way of setting up the ATAG info to pass to the kernel.

So I've got a choice. Continue advancing the kernel versions and sorting out the booting issues, to hopefully get to a point whether the MTD problems sort themselves out. Or, stay with 2.6.22 (with MTD/JFFS2 patches) and work out why it is spewing so many errors out (and once into BusyBox, why it is so unstable).....

Saturday 18 October 2008

Fresh start

So I managed to revert the kernel back to the base version (2.6.22), and had that booting (until it hit the MTD issues, etc.). And it ended up being quite painless to patch to 2.6.23 A relatively small number of files that needed their rej files checking. Most we're VC changes to file header comments. A few we're deleted files.

Unfortunately it fails to get anywhere booting :( The zImage decompresses fine, but halts straight after that. I'll probably take a step back from that, and incrementally apply the 2.6.22 patches first. Narrow down where the boot discrepancy starts. Rather than trying to run straight to 2.6.23

Finally, for today, I've decided to blitz the laptop. The Ubuntu community docs describe a way of installing from a USB stick. I've tried the initial install of this and it works fine (it's a network boot).

As I type the install is setting up the base system. Existing partitions have already been destroyed :O

Tomorrow I should then have a brand new Ubuntu laptop to play with and setup (according to the Wiki) :) Plus 40GB of space to play with, rather than the FAT limited 4GB home space :S

Interesting..

I've reverted the VC CVS coglinux-2.6.22(.6) back to linux-2.6.22 base, and this boots more frequently than the 2.6.22.6 versions!! I'm still getting Magic bitmask issues from JFFS2 and lots of MTD do_erase_oneblock() timeouts :(

I'm going to start applying patches, and see if further kernel versions become more or less stable.

Plus close to deciding whether to blitz WinXP off the laptop and reinstall only Ubuntu on. (As well as testing out all the info on the Wiki to see if all the install and setup steps are correct and nothing is missing)..

Sunday 12 October 2008

Kernel booting: Good News!! (well almost..)

I persevered late into last night with Buildroot. Eventually I was able to get the make to finish. For it to make the toolchain, uClibc, BusyBox, Linux, and the root JFFS2 FS :)

Reflashed the root FS and zImage to the VCMX212 and tried booting. At first I was getting lots of MTD error messages. After a few boots (usual to init the JFFS2 FS) I managed to get to the BusyBox prompt :)

Unfortunately it is very unstable :( Likely to be issues with MTD. A quick google trawl before bed shown lots of MTD issues with various kernels.

Today I'm going to start afresh with Buildroot and fill in any missing gaps in the Wiki page.

Then on to start looking at the MTD problems...

Saturday 11 October 2008

Rebuilding JFFS2 file system

I've spent some time today trying to rebuild the COGlinux JFFS2 file system with a custom built (debug version) of BusyBox.

It ended up being fairly easy to build BusyBox with the Crosstool, and then using the VC shell script and device table to rebuild the coglinux.jffs2 file.

Reflashing this new file on the VCMX212 board, and booting into the 2.6.16 version of the kernel unfortunately produce issues with bad/missing magic numbers :( So VFS couldn't get this new JFFS2 FS mounted and the kernel panics not being able to exec post boot steps.

I tried for a while to diagnose this, including creating what should be an identical coglinux.jffs2 file from the original extracted JFFS2 file from VC, and the VC CVS shell scripts. Annoyingly this still had issues getting mounted with the 2.6.16 kernel :(

I've now fallen back to the original VC JFFS2 file and the 2.6.16 kernel image (both taken from the website). But this has allowed me to "rx" the new custom busybox executable to the FS via Xmodem.

Running this new custom busybox executable produces the dreaded "Permission denied" (?) issues. Which is kind of expected considering that the JFFS2 FS contains cClibc libraries rather than libc ones.

So at the moment I've got myself side tracked looking at sorting out a Buildroot setup. I'll persevere with this for a while. Before dropping back and looking into getting the libc shared libraries across to the VCMX212 FS to sort out running the custom busybox executable.

Friday 10 October 2008

Kernel issues!!! Arghhh!!!

I've only been able to find a few nights to work on this in the last few months :(

Where'd I leave off...

Kernel issues;
Ubuntu setup seems fine. I've tried out different versions/combos with Crosstool compilers. So far, I can get the 2.6.16 kernel rebuilt and working on the VCMX212. But cannot get the 2.6.22 latest CVS snapshot running. It builds fine, but fails to get into BusyBox.

I thought that the issue might have been in the post startup in the kernel. But a rebuilt debug kernel littered with printks shows that is is able to exec post boot commands.

Using the 2.6.16 zImage I can get into Linux and tweak the startup files, inittab etc. Plus I have the coglinux.jffs2 mounted in Ubuntu, so can look at stuff in there (as well as potentionally recreate the file system using BuildRoot or probably MakeRootFS).

So far I've seen it get to the /bin/sh inittab entry. I've tried different Crosstool combos to recompile the kernel, tweaked the 2.6.22 .config to match the 2.6.16 version, reflashed the file system, misc other kernel hacks.. But still no joy to get into BusyBox shell :(

Next step is to start debugging BusyBox startup and ash shell startup..