[Development] / fastos / ZeptoOS / BGL / docs / chapters / kernel.html Repository:
ViewVC logotype

Diff of /fastos/ZeptoOS/BGL/docs/chapters/kernel.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Tue Sep 6 19:10:02 2005 UTC revision 1.10, Wed Sep 7 19:05:28 2005 UTC
# Line 1  Line 1 
1  <h1><a name=kernel>Kernel</a></h1>  <h1><a name=kernel>The ZeptoOS Kernel</a></h1>
   
2    
3  The ZeptoOS Linux kernel for BlueGene/L I/O nodes is based on the  The ZeptoOS Linux kernel for BlueGene/L I/O nodes is based on the
4  original 2.4.19 Linux supplied by IBM under the GPL.  The original  original 2.4.19 Linux supplied by IBM under the GPL.  The original
# Line 7  Line 6 
6  some added, and some modified.  To better manage those changes, they  some added, and some modified.  To better manage those changes, they
7  have been separated into three patch sets plus an additional set added  have been separated into three patch sets plus an additional set added
8  by the ZeptoOS Team.  The resulting kernel files are:  by the ZeptoOS Team.  The resulting kernel files are:
9    <p>
10    
11  <ul>  <ul>
12  <li> <b>patch-2.4.19-bgl-addition</b>: Files IBM added to the stock 2.4.19 kernel  <li> <b>patch-2.4.19-bgl-addition</b>: Files IBM added to the stock 2.4.19 kernel
# Line 15  Line 15 
15  <li> <b>patch-2.4.19-bgl-zepto-v1.1</b>: Additional patches the ZeptoOS Team have applied to the 2.4.19 kernel  <li> <b>patch-2.4.19-bgl-zepto-v1.1</b>: Additional patches the ZeptoOS Team have applied to the 2.4.19 kernel
16  <li> <b>linux-2.4.19.tar.bz2</b>: Original stock 2.4.19 kernel  <li> <b>linux-2.4.19.tar.bz2</b>: Original stock 2.4.19 kernel
17  </ul>  </ul>
18    <p>
19    
20    <h2>Features modified or added by IBM to the stock kernel</h2>
21    
22  <h2>The summary of features IBM added or modified in kernel</h2>  The kernel tarball that IBM distributed had 11MB(in diff size) in
23    differences from vanilla linux kernel.  The patches not only contains
24  The kernel tarball that IBM distributed had 11MB(in diff size)  BG/L specific modifications but also it contains other PowerPC
 different from vanilla linux kernel.  Patches not only contains BG/L  
 specific modifications but also it contains other PowerPC  
25  modifications. Some of PowerPC modifications are not used for BG/L  modifications. Some of PowerPC modifications are not used for BG/L
26  IONODE kernel.  Actually, we couldn't distinguish which IBM  IONODE kernel. Actually we couldn't distinguish which modifications
27  modification or non-IBM modification correctly.  were from IBM for BG/L, and where were simply for PPC.  You can
28    however use CONFIG_BGL in the linux kernel config for source code to
29    distinguish BG/L PPC modifications from non-BG/L PPC modifications.
30  <!-- Features: * Summary of features IBM added or modified in kernel *  <p>
31  Summary of features ZeptoOS added to the kernel * How to use the  
32  special Zepto Features: logging, kparams, etc  The ZeptoOS team has made additional modifications.  Those
33    modification are all in patch-2.4.19-bgl-zepto-v1.1.  Here is the
34  Build:  summary of patch-2.4.19-bgl-zepto-v1.1.
35     * How to unpack and rebuild the kernel from scratch  <p>
    * How to build kernel modules for ZeptoOS, where they can be placed for loading  
    * Important kernel build #define parameters  
 -->  
   
 patch-2.4.19-bgl-zepto-v1.1 contains the following updates or fixes.  
36    
37  <ul>  <ul>
38  <li> /proc/zepto/mobx to send msg to the BG/L system using mbox facility  <li> /proc/zepto/mbox to send msgs to the BG/L service node via the mbox facility
39  <li> console log forwarding. zconsole_log=on|off  (off by default)  <li> Console log forwarding. zconsole_log=on|off  (off by default)
40  <li> kernel log forwarding.  zkernel_log=on|off   (off by default)  <li> Kernel log forwarding.  zkernel_log=on|off   (off by default)
41  <li> CONFIG_BGL_FORCE_KERNEL_LOG option to ignore personality log control  <li> CONFIG_BGL_FORCE_KERNEL_LOG option to ignore personality log control
42  <li> kernel parameters handling mechanism. kernel params are passed by ramdisk. zkparam-elfrd is a tool to modify kernel params on ramdisk.  <li> Kernel parameters handling mechanism. kernel params are passed by ramdisk. zkparam-elfrd is a tool to modify kernel params on ramdisk.
43  <li> fixes on gcc-3.3 compilation error  <li> Fixes on gcc-3.3 compilation errors
44  <li> build system fix for cross compilation environment  <li> New build system, including cross compilation support
45  <li> misc fixes such as fix on compilation error on original IBM distribution  <li> Misc fixes such as fix on compilation error on original IBM distribution
46  </ul>  </ul>
47    
48    <p>
49    
50  <h2>How to rebuild the ION linux kernel and modify it</h2>  <h2>Rebuilding the ION kernel from Source</h2>
   
51    
52  Although the ZeptoOS distribution contains the pre-compiled ION linux  Although the ZeptoOS distribution contains the pre-compiled ION linux
53  kernel image, you may need to re-compile the linux kernel for your  kernel image, you may need to re-compile the linux kernel, such as for
54  purpose such as change kernel config or adding some extra codes.  changing a kernel config or adding components.<p>
55    
56  Re-building the ION kernel image is straightforward. Go to the ION  Re-building the ION kernel image is straightforward. Go to the ION
57  kernel directory and type `make all`.  kernel directory and type `make all`.
58    <p>
59    
60    <pre>
61  $ cd ZeptoOS/BGL/ionode-linux-2.4.19  $ cd ZeptoOS/BGL/ionode-linux-2.4.19
62  $ make all  $ make all
63    </pre>
64    
65    <p>
66  You will get zImage.elf which is the ION kernel image in your current  You will get zImage.elf which is the ION kernel image in your current
67  working directory. Re-building process will usually take several  working directory. Re-building process will usually take several
68  minites ( approx. 4 minutes on JS20 BG/L front-end in ANL ).  minutes ( approx. 4 minutes on JS20 BG/L front-end in ANL ).
   
   
69    
70    
71    <p>
72  Re-building is simple enough but there are two things you have to know  Re-building is simple enough but there are two things you have to know
73  a couple of things.  But don't be afraid. it's just Linux kernel,  a couple of things.  But don't be afraid. it's just Linux kernel,
74  which means you can simply apply your knowlegde.  which means you can simply apply your knowledge.
75    <p>
76  First of all, there are two Makefile files we consider here.  To avoid  First of all, there are two Makefile files we consider here.  To avoid
77  confusion, we use the wrapper Makefile and the linux kernel Makefile.  confusion, we use the wrapper Makefile and the linux kernel Makefile.
78    <p>
79    
80  <ul>  <ul>
81  <li>the wrapper Makefile : ZeptoOS/BGL/ionode-linux-2.4.19/Makefile  <li>the wrapper Makefile : ZeptoOS/BGL/ionode-linux-2.4.19/Makefile
82  <li>the linux kernel Makefile : ZeptoOS/BGL/ionode-linux-2.4.19/linux-2.4.19/Makefile (*1)  <li>the linux kernel Makefile : ZeptoOS/BGL/ionode-linux-2.4.19/linux-2.4.19/Makefile (*)
83  </ul>  </ul>
84    
85    <p>
86  Note: The linux kernel Makefile doesn't exist initially. The wrapper  Note: The linux kernel Makefile doesn't exist initially. The wrapper
87  Makefile extracts a linux-2.4.19 tree.  Makefile extracts a linux-2.4.19 tree.
88    <p>
89    
90  The next thing is that the vanilla Linux kernel(PPC) never run on BG/L  The next thing is that the vanilla Linux kernel(PPC) never run on BG/L
91  because bootstrap code is different and BG/L specific capabilities  because bootstrap code is different and BG/L specific capabilities
92  such as RAS are required. Currently we have 4 patches. The wrapper  such as RAS are required. Currently we have 4 patches. The wrapper
93  Makefile applies them after unpacking the vannila Linux kernel. This  Makefile applies them after unpacking the vanilla Linux kernel. This
94  is nothing special. You could apply BG/L patches to the stock 2.4.19  is nothing special. You could apply BG/L patches to the stock 2.4.19
95  linux kernel by hand.  linux kernel by hand.
96    
97    <p>
98    
99  The last thing is that ION kernel compilation uses our compiler tool  The last thing is that ION kernel compilation uses our compiler tool
100  chain by default, which is included in the ZeptoOS distribution. Using  chain by default, which is included in the ZeptoOS distribution. Using
# Line 101  Line 102 
102  difficulties on compilation. Makefile in the ionode-linux directory  difficulties on compilation. Makefile in the ionode-linux directory
103  does the followings about the compiler tool chain.  does the followings about the compiler tool chain.
104    
105    <p>
106    
107  <ol>  <ol>
108  <li>automatically prepare the compiler toolchain if it doesn't exist  <li>automatically prepare the compiler toolchain if it doesn't exist
109  <li>provide the compiler path and the cross compiler prefix.  <li>provide the compiler path and the cross compiler prefix.
110  <li>pass them(path,flags,etc) to the next level Makefile which is a  <li>pass them(path,flags,etc) to the next level Makefile which is a
111  regular Linux kernal makefile  regular Linux kernel makefile
112  </ol>  </ol>
113    <p>
114    
115  If you are familiar with the compiler tool chain, you can directly use  If you are familiar with the compiler tool chain, you can directly use
116  Makefile in the linux kernel.  Here is information about our tool  Makefile in the linux kernel.  Here is information about our tool
117  chain.  chain.
118    <p>
119    
120  <ol>  <ol>
121  <li>PATH : ${IONODE_LINUX_DIR}/../toolchain/powerpc-440-linux-gnu/bin  <li>PATH : ${IONODE_LINUX_DIR}/../toolchain/powerpc-440-linux-gnu/bin
122  <li>CROSS_COMPILE : powerpc-440-linux-gnu-  <li>CROSS_COMPILE : powerpc-440-linux-gnu-
123  </ol>  </ol>
124    <p>
125  Here is an concrete example.  Here is an concrete example.
126    <p>
127  <pre>  <pre>
128  $ pwd  $ pwd
129  /home/joe/ZeptoOS/BGL/ionode-linux-2.4.19  /home/joe/ZeptoOS/BGL/ionode-linux-2.4.19
# Line 126  Line 131 
131  $ PATH=$PATH:../../toolchain/powerpc-440-linux-gnu/bin make CROSS_COMPILE=powerpc-440-linux-gnu-  zImage  $ PATH=$PATH:../../toolchain/powerpc-440-linux-gnu/bin make CROSS_COMPILE=powerpc-440-linux-gnu-  zImage
132  </pre>  </pre>
133    
134    <p>
135  <h3>Add your code to the ION tree</h3>  <h3>Add your code to the ION tree</h3>
136    <p>
137  Before start writing code to the ION tree, you need to prepare the  Before start writing code to the ION tree, you need to prepare the
138  working tree. The ".config" target does prepare the tree.  Now ready  working tree. The ".config" target does prepare the tree.  Now ready
139  to modify files in the Linux kernl dir. The "kernel" target does  to modify files in the Linux kernel dir. The "kernel" target does
140  (re-)compile the kernel image.  (re-)compile the kernel image.
141    
142    <p>
143  <pre>  <pre>
144  $ pwd  $ pwd
145  /home/joe/ZeptoOS/BGL/ionode-linux-2.4.19  /home/joe/ZeptoOS/BGL/ionode-linux-2.4.19
# Line 144  Line 150 
150  $ make kernel  $ make kernel
151  </pre>  </pre>
152    
153    <p>
154  You also need to change the kernel configuration as well as the code  You also need to change the kernel configuration as well as the code
155  modification. It's basically same as regular Linux kernel but  modification. It's basically same as regular Linux kernel but
156  linux-2.4.19/linux.config is default configuration we are using.  The  linux-2.4.19/linux.config is default configuration we are using.  The
157  wrapper Makefile copies linux.config to .config before start  wrapper Makefile copies linux.config to .config before start
158  compilation. So if you edit Linux configuration, please copy .config  compilation. So if you edit Linux configuration, please copy .config
159  back to linux.config for the next build.  back to linux.config for the next build.
160    <p>
161    
162    
163    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

No CVS admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.1