added UART init and progress while booting kernel.
[uloader.git] / README.loader
1 * Introduction
2
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.
5
6 You need kernel header files to build the module.
7 I put the kernel source came with my Kuro Box in
8
9 http://jan.csie.ntu.edu.tw/~jo/kuro/CD2/linux-2.4.17_kuro-box.tar.gz
10
11 You also need a configuration file to build the kernel,
12 I use the one in
13
14 ftp://linkstation.yi.org/pub/linkstation/kernel/config_kurobox.040630
15
16 * Building the new kernel
17
18 cd /usr/src
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
22 make oldconfig
23 make dep
24 make
25 # the loader need the kernel to be in binary format
26 objcopy -O binary vmlinux                    
27
28 * Building the loader module
29
30 tar xzvf loader.tar.gz
31 cd loader
32 # change Makefile for your kernel source directory
33 make
34
35 * Loading the new kernel
36
37 sync;insmod loader.o kernel=/usr/src/linux-2.4.17_kuro-box/vmlinux
38
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".
41
42 There are three parameters for this module:
43
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
47
48 For example you can use an ramdisk as your root filesystem:
49
50 sync;insmod loader.o kernel=/usr/src/linux-2.4.17_kuro-box/vmlinux \
51 initrd=/root/initrd.gz cmdline="root=/dev/ram0"
52
53 The cmdline parameter doesn't work unless a small patch is applied
54 to the kernel:
55
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
58 @@ -666,6 +666,12 @@
59         }
60  #endif
61  
62 +    if ( r6 )
63 +    {
64 +        *(char *)(r7+KERNELBASE) = 0;
65 +        strcpy(cmd_line, (char *)(r6+KERNELBASE));
66 +    }
67 +
68  #ifdef NAS_DEBUG
69         printk("initrd_start: %08X\n",initrd_start);
70         printk("initrd_end: %08X\n",initrd_end);
71
72 --
73 Chih-Chung Chang <jochang@gmail.com>
74
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 :)