3 Here is a small kernel module for booting new kernels on Kuro Box without
4 flashing. It loads a new kernel into memory and jumps to it directly.
6 You need kernel header files to build the module.
7 I put the kernel source came with my Kuro Box in
9 http://jan.csie.ntu.edu.tw/~jo/kuro/CD2/linux-2.4.17_kuro-box.tar.gz
11 You also need a configuration file to build the kernel,
14 ftp://linkstation.yi.org/pub/linkstation/kernel/config_kurobox.040630
16 * Building the new kernel
19 tar xzvf ~/linux-2.4.17_kuro-box.tar.gz
20 cd linux-2.4.17_kuro-box
21 cp ~/config_kurobox.040630 .config
25 # the loader need the kernel to be in binary format
26 objcopy -O binary vmlinux
28 * Building the loader module
30 tar xzvf loader.tar.gz
32 # change Makefile for your kernel source directory
35 * Loading the new kernel
37 sync;insmod loader.o kernel=/usr/src/linux-2.4.17_kuro-box/vmlinux
39 About one minute later or so, you can again telnet in your kuro box
40 and verify it is running the new kernel by typing "uname -a".
42 There are three parameters for this module:
44 kernel: kernel file name (the kernel must be in binary format)
45 initrd: initrd file name (it can be a gzip'ed file)
46 cmdline: kernel command line
48 For example you can use an ramdisk as your root filesystem:
50 sync;insmod loader.o kernel=/usr/src/linux-2.4.17_kuro-box/vmlinux \
51 initrd=/root/initrd.gz cmdline="root=/dev/ram0"
53 The cmdline parameter doesn't work unless a small patch is applied
56 --- arch/ppc/platforms/sandpoint_setup.c.orig Mon Mar 15 00:15:01 2004
57 +++ arch/ppc/platforms/sandpoint_setup.c Sun Jan 9 20:54:55 2005
64 + *(char *)(r7+KERNELBASE) = 0;
65 + strcpy(cmd_line, (char *)(r6+KERNELBASE));
69 printk("initrd_start: %08X\n",initrd_start);
70 printk("initrd_end: %08X\n",initrd_end);
73 Chih-Chung Chang <jochang@gmail.com>
75 P.S. This module works for me most of the time, but sometimes it
76 just crashes. I'd be glad to hear if you have any idea why :)