@@ -44,7 +44,7 @@ interpreter, the X server, etc. The extra user space services are specified by t
44
44
of the linux kernel.
45
45
46
46
You cannot use user space libs such as libc to program the kernel,
47
- since the kernel itself itself if need to be working for user space to work. TODO confirm
47
+ since the kernel itself itself if need to be working for user space to work.
48
48
49
49
# user programs
50
50
@@ -60,6 +60,15 @@ probably via the `write` system call.
60
60
61
61
Another simple example is file io.
62
62
63
+ ## floating point
64
+
65
+ you cannto use floating point operations on kernel code because that would incur too much overhead
66
+ of saving floating point registers on some architectures, so don't do it.
67
+
68
+ ## memory
69
+
70
+ memory is much more restrictive than in user applictions, so be extra cautious to use little memory
71
+
63
72
# rings
64
73
65
74
x86 implemented concept
@@ -75,11 +84,68 @@ linux uses 2:
75
84
76
85
this is used to separate who can do what
77
86
78
- # install a new kernel
87
+ # test a new kernel
88
+
89
+ ## compile and install
90
+
91
+ this is a very slow test mechanism since you need to reboot everytime.
92
+
93
+ <www.cyberciti.biz/tips/compiling-linux-kernel-26.html>
94
+
95
+ get the source:
96
+
97
+ git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98
+
99
+ clean everything:
100
+
101
+ make mrproper
102
+
103
+ generate the ` .config ` file:
104
+
105
+ make menuconfig
106
+
107
+ this opens up a ncurses interface which allows you to choose amongst tons of options
108
+ which determine which features your kernel will include or not.
109
+
110
+ then go on to ` save ` to save to the ` .config ` file and then exit
111
+
112
+ build:
113
+
114
+ make -j5
115
+
116
+ ` -j ` tells make to spawn several process, which is useful if you have a multicore processor.
117
+ it is recommend to use
118
+
119
+ n = number of processors + 1
120
+
121
+ this may take more than one hour.
122
+
123
+ install:
124
+
125
+ sudo make modules_install -j5
126
+ sudo make install -j5
127
+
128
+ this will place:
129
+
130
+ - the compiled kernel under ` /boot/vmlinuz-<version> `
131
+ - config file ` .config ` as ` /boot/config-<version> `
132
+ - ` System.map ` under ` /boot/System.map-<version> ` .
133
+
134
+ This contains symbolic debug information.
135
+
136
+ - ` /lib/modules/<version>/ ` for the modules
137
+
138
+ configure grub: TODO
139
+
140
+ ## kernel module
141
+
142
+ can be inserted and removed while the kernel runs.
79
143
80
- TODO
144
+ However, if you make an error at startup (dereference null pointer for example),
145
+ the kernel module may become impossible to reinsert without a reboot.
146
+ < http://unix.stackexchange.com/questions/78858/cannot-remove-or-reinsert-kernel-module-after-error-while-inserting-it-without-r/ >
81
147
82
- also considering installing a module instead of hacking the kernel if a module would do
148
+ ## kernel virtual machine
83
149
84
150
# get kernel version
85
151
0 commit comments