picocom -b 115200 /dev/ttyS0 #Need to figure out how to do kermit, or whatever #kermit is probably not necessary since I can use tftp instead setenv serverip 10.0.0.7 setenv ipaddr 10.0.0.99 saveenv ; this is not needed after the first time tftp 0x30f00000 zImage tftp 0x30800000 LN2410disk_gz bootm 0x30f00000 0x30800000 go 0x30f00000 ; this does not do the ramdisk thing. reboot will take you back to the uboot prompt, but does not work unless /proc is mounted! make bootpImage INITRD_PHYS=0x30800000 INITRD=/path/to/LN2410disk.gz * Busybox # I had problems because the libraries are # either the wrong EABI or the wrong ARCH (arm5 vs arm4) ## NOW FIXED - see note about "compiling application software" busybox-1.4.1$ make menuconfig busybox-1.4.1$ make CROSS_COMPILE=armv4l-unknown-linux-gnu- ARCH=arm4 *** Hard lessons *** * using an initrd from u-boot If you use the "go" command of u-boot, it just jumps to the start of the kernel decompressor. This means that the initrd will be what was compiled into the kernel, *not* anything that you loaded in with tftp (or kermit) of u-boot. If you want to be able to dynamically load a different ramdisk you need to use the bootm command in u-boot. But to do that, the kernel and initrd images must be in a special format used by u-boot. The tool to make these images is called 'mkimage' and is distributed with u-boot. (But not, apparently, by Littlechips.) If you do use the initrd loaded into the kernel when using INITRD_PHYS= and INITRD=, then be careful! The kernel dependencies do not detect that your initrd has changed, and will not link in the new version since the last kernel compile. To fix this, delete 'arch/arm/boot/bootp/initrd.o'. I avoid these problem by just rebuilding the kernel each time I modify my initrd. It's not very hard once scripted... my script is this: #!/bin/bash cd /usr/local/arm/src/linux/ rm arch/arm/boot/bootp/initrd.o make bootpImage INITRD_PHYS=0x30800000 INITRD=/home/magnus/p/boat/initrd/IMG.gz echo Copy image to tftpboot... sudo cp arch/arm/boot/bootpImage /tftpboot/ cd /home/magnus/p/boat See also ragrot's post to the Littlechips forum which describes how to fix uboot: http://littlechips.com/forums/viewtopic.php?t=204 Considering that I now use this, I can probably use ATAGS to specify the bootpImage. * compiling application software The compilers that come from CodeSourcery build against an included libc and libgcc, etc. which are built for ARMv5, and will not run on the Littlechips board (which is ARMv4). Thus, one can use the CodeSourcery compilers to build the kernel (which does not use any libraries), but not application software. If you try to replace the libraries referenced by the compiler with the ones from the Littlechips disk image it will fail to link because the EABI is different. I fixed my problem by building the toolchain (including glibc) myself, using a modified version of the script provided by Chip Coldwell at http://www.schnozzle.org/~coldwell/toolchain/ I modified Chip's script to use the pre-patched kernel sources from Littlechips, and explicitly set my target to armv4l. This means I am using GCC 3.4.4 and glibc 2.3.5. Which, according the the comment quoted below from CodeSourcery, implies that I can't use this toolchain for newer kernels. I forget why I wanted to move to a newer kernel. Maybe it was just so I could use the new EABI. * mmc device nodes The stock filesystem doesn't have nodes in /dev for the mmc driver. I think the major number for them is 0xFE (254) and minor number starting at 0. Zero is the SD card itself, and the partitions start at minor device 1. to use these do: mknod /dev/mmc b 254 0 mknod /dev/mmc1 b 254 1 mknod /dev/mmc2 b 254 2 mknod /dev/mmc3 b 254 3 mknod /dev/mmc4 b 254 4 mount /dev/mmc1 /mnt * Which kernels are supported by CodeSourcery: The kernel must support the ARM EABI syscall interface and the kernel must be built with CONFIG_EABI enabled. In addition, the kernel must contain \ Native POSIX Thread Library (NPTL) support, even if your application does not use threads. CodeSourcery's GLIBC initialization code requires kernel support for NPTL. Version 2.6.16 of the Linux kernel contains satisfactory implementations of these functions. Some earlier releases contain incomplete support for these features; these earlier releases should not be used. Alas, the kernel version supported by littlechips is 2.6.13.2 * a /linuxrc annecdote: I created a /linuxrc script that looked like this: #!/bin/ash /bin/mount -t proc proc /proc /bin/mount -t sysfs sys /sys exec /bin/busybox linuxrc Which is nice, in that it mounts /proc and /sys, but it didn't work because I hadn't done 'chmod ugo+x linuxrc'. Then when the kernel couldn't execute /linuxrc, it falls back to calling /sbin/init, which worked because I'd built it in to busybox. I was thus confused because it booted, but hadn't run the script that I expected. * job control by default, busybox's init applet starts on /dev/console, but this is not a controlling tty, and thus there is no job control. (i.e. C-c and C-z will not work.) To fix this, apparently you need to run on a real tty, which means that you need an inittab, such as: ::sysinit:/etc/init.d/rcS ttyS0::askfirst:/bin/sh ::ctrlaltdel:/sbin/reboot ::shutdown:/sbin/swapoff -a ::shutdown:/bin/umount -a -r ::restart:/sbin/init Unfortunately, this didn't really work for me. How do I do this? ...time passes... So, eventually I got it. The zeroth serial port on the S3C2410 is called /dev/ttySAC0, which is created as: mknod /dev/ttySAC0 c 204 64 replacing 'console' in /etc/inittab with ttySAC0 means that job control now works on my serial console. * Compact Flash The distrubited kernel source does not have a working CF driver. ragrot announced that he wrote one on the forums, but I don't know how to get the code: http://littlechips.com/forums/viewtopic.php?t=138 Arg. * USB In case I forget again, I researched the USB support. S3C2410 chips do *not* support USB2.0 (aka the 480Mb transfer rate, aka "high speed") (According to the S2C2410 manual published by Samsung). (2440's don't either, but 2443's do.) http://www.littlechips.com/downloads/linux/patch-2.6.13.2-ln2410sbc-0.5.gz http://www.littlechips.com/downloads/customer/CD_Images/LN2410SBC/Linux/Kernel/linux-2.6.13.2-lc6.tar.gz * pppd [m5] ppp-2.4.4$ ./configure --host=armv4l-unknown-linux-gnu --build=i686-pc-linux [m5] ppp-2.4.4$ make CC=/usr/local/bin/armv4l-unknown-linux-gnu-gcc [m5] libusb-0.1.12$ ./configure --host=armv4l-unknown-linux-gnu --build=i686-pc-linux