/usr/share/doc/HOWTO/ja-html/Linux-Kernel-Internals-1.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>Linux Kernel 2.4 Internals: $B%V!<%H(B</TITLE>
<LINK HREF="Linux-Kernel-Internals-2.html" REL=next>
<LINK HREF="Linux-Kernel-Internals.html#toc1" REL=contents>
</HEAD>
<BODY>
<A HREF="Linux-Kernel-Internals-2.html">$B<!$N%Z!<%8(B</A>
$BA0$N%Z!<%8(B
<A HREF="Linux-Kernel-Internals.html#toc1">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s1">1.</A> <A HREF="Linux-Kernel-Internals.html#toc1">$B%V!<%H(B</A></H2>
<H2><A NAME="ss1.1">1.1</A> <A HREF="Linux-Kernel-Internals.html#toc1.1">Linux$B%+!<%M%k%$%a!<%8$N:n@.(B</A>
</H2>
<P>$B$3$N>O$G$O!"(BLinux$B%+!<%M%k$r%3%s%Q%$%k$r$9$k;~$K<h$i$l$k%9%F%C%W$H3F%9%F!<%8$N@8@.J*$K$D$$$F2r@b$7$^$9!#(B
$B%S%k%I9)Dx$O%"!<%-%F%/%A%c$K$h$j0[$J$j$^$9$,!"$3$3$G$O(BLinux/x86$B%+!<%M%k$N%S%k%I$K$D$$$F$@$19M$($k$3$H$K$7$^$9!#(B</P>
<P>$B%f!<%6$,!"(B'make zImage'$B$"$k$$$O(B'make bzimage'$B$H%?%$%W$9$k$H!"$=$N7k2L$N5/F0%$%a!<%8$O!"$=$l$>$l(B<CODE>arch/i386/boot/zImage</CODE> $B$H(B <CODE>arch/i386/boot/bzImage</CODE> $B$K$J$j$^$9!#(B
$B$3$3$G$O!"$I$N$h$&$K%$%a!<%8$,:n$i$l$k$+$r8+$F$$$-$^$7$g$&!#(B
<OL>
<LI> C $B$H%"%;%s%V%j$N%=!<%9%U%!%$%k$O!"(BELF $B:FG[CV2DG=%*%V%8%'%/%H7A<0(B (.o) $B$X$H%3%s%Q%$%k$5$l$k!#Cf$K$OO@M}E*$J%0%k!<%W$H$7$F(B <B>ar(1)</B> $B$r;H$C$F%"!<%+%$%V7A<0(B (.a) $B$K$5$l$k$b$N$b$"$k!#(B</LI>
<LI> <B>ld(1)</B> $B$r;H$C$F!">e5-$N(B .o $B$H(B .a $B$O(B 'vmlinux' $B%U%!%$%k$X$H%j%s%/$5$l$k!#(B'vmlinux'$B%U%!%$%k$O!"@EE*$K%j%s%/$5$l$?%9%H%j%C%WA0$N(B ELF 32-bit LSB 80386 $B<B9T7A<0%U%!%$%k$G$"$k!#(B
</LI>
<LI> <CODE>System.map</CODE> $B$O!"(B'nm vmlinux' $B$+$i:n@.$5$l$k!#4XO"$,$J$$%7%s%\%k$d:3:Y$J%7%s%\%k$O!"(Bf$B%^%C%W%U%!%$%k$+$i=|30$5$l$k!#(B
</LI>
<LI> <CODE>arch/i386/boot</CODE> $B%G%#%l%/%H%j$K0\$k!#(B
</LI>
<LI> $B%V!<%H%;%/%?$N%"%;%s%V%i%3!<%I(B <CODE>bootsect.S</CODE> $B$O!"%?!<%2%C%H$,(B bzImage $B$+(B zImage $B$+$K$h$C$F(B <B>-D__BIG_KERNEL__ </B> $B$r$D$1$k$+!"$"$k$$$O$D$1$J$$$+$5$l$F!"%W%j%W%m%;%C%5$,(B
$B=hM}$9$k!#$=$7$F!"3F!9$N>l9g$G(B <CODE>bbootsect.s</CODE> $B$+$"$k$$$O(B <CODE>bootsect.s</CODE> $B$,@8@.$5$l$k!#(B
</LI>
<LI> <CODE>bbootsect.s</CODE> $B$O%"%;%s%V%k$5$l!"$=$N8e!"(B<CODE>bbootsect</CODE> $B$H$$$&L>A0$N(B'raw$B%P%$%J%j(B'$B7A<0$X$HJQ49$5$l$k!#(B($B$"$k$$$O!"(B<CODE>bootsect.s</CODE> $B$,%"%;%s%V%k$5$l(B zImage $B8~$1$N(B <CODE>bootsect</CODE> $B$X(Braw$B%P%$%J%jJQ49$5$l$k(B)
</LI>
<LI> $B%;%C%H%"%C%WMQ$N%3!<%I(B setup.S (setup.S$B$O!"(Bvideo.S$B$r4^$`(B)$B$O!"(B bzImage$B$N$H$-$O(Bbsetup.s$B$X!"(BzImage$B$N;~$O(Bsetup.s$B$X%W%j%W%m%;%C%5$N=hM}7k2L$,=PNO$5$l$k!#%V!<%H%;%/%?$N%3!<%I$HF1$8J}K!$G=hM}$5$l$k$,!"(BbzImage$B$N>l9g$K!"(B-D__BIG_KERNEL__$B%?%0$,IUM?$5$l$k$H$3$m$K0c$$$,$"$k!#@8@.J*$O!"(Bbsetup$B$H$$$&L>A0$N(B'raw$B%P%$%J%j(B'$B7A<0$X$HJQ49$5$l$k!#(B
</LI>
<LI> arch/i386/boot/compressed $B$H$$$&%G%#%l%/%H%j$X$H$&$D$j!"(B /usr/src/linux/vmlinux $B$r(Braw$B%P%$%J%j7A<0$N!"(B$tmppiggy ($B%F%s%]%i%j%U%!%$%kL>(B)$B$X$HJQ49$9$k!#$^$?$3$N:]$K!"(BELF $B%U%)!<%^%C%H$G$N(B .note $B%;%/%7%g%s$H(B .comment $B%;%/%7%g%s$,:o=|$5$l$k!#(B
</LI>
<LI> gzip -9 < $tmppiggy > $tmppiggy.gz</LI>
<LI> $tmppiggy.gz $B$r(B ELF $B:FG[CV2DG=7A<0$N(B (ld -r) piggy.o $B$X%j%s%/$9$k!#(B</LI>
<LI> head.S $B$H(B misc.c $B$+$i$J$k05=L%k!<%A%s$r%3%s%Q%$%k$9$k(B($B$^$@(B arch/i386/boot/compressed $B%G%#%l%/%H%j(B)$B!#$=$7$F(B ELF $B%*%V%8%'%/%H7A<0$N(B head.o $B$H!"(Bmisc.o $B$r@8@.$9$k!#(B
</LI>
<LI> head.o $B$H(B misc.o$B!"$=$7$F(B piggy.o $B$r%j%s%/$7!"(Bbvmlinux$B$H$9$k(B($B$"$k$$$O(B zImage$B$N>l9g$O!"(Bvmlinux $B$K$9$k!#(B /usr/src/linux/vmlinux $B$H4V0c$o$J$$$3$H(B)$B!#$3$3$G!"(Bvmlinux $B$G$O(B-Ttext 0x1000 $B$@$,!"(Bbvmlinux $B$N>l9g(B -Ttext 0x100000 $B$H$$$&$H$3$m$K0c$$$,$"$k!#(BbzImage $B$N05=L%m!<%@$O(B high $B%(%j%"$K%m!<%I$5$l$k!#(B
</LI>
<LI>.note $B$H(B .comment $B$N(B2$B$D$N(B ELF $B%;%/%7%g%s$r:o=|$7$F(B bvmlinux $B$O(B 'raw $B%P%$%J%j(B'$B7A<0$N(B bvmlinux.out$B$X$HJQ49$5$l$k!#(B
</LI>
<LI> $B%G%#%l%/%H%j(B arch/i386/boot $B$XLa$j!"(Btools/build $B$K$"$k%W%m%0%i%`$r;H$C$F!"(B bbootsect + bsetup + $B05=L$5$l$?(B/bvmlinux.out $B$r(B bzImage $B$X$H$D$J$.9g$o$;$k(B(zImage $B$N>l9g$O!"3F!9$N(B b $B$r<h$C$?$b$N$r$D$J$.9g$o$;$k(B)$B!#$3$l$O!"$5$i$K(B setup_sects $B$d!"(Broot_dev $B$N$h$&$J=EMW$JJQ?t$r!"%V!<%H%;%/%?$N:G8e$N$H$3$m$X$H=q$-9~$`!#(B</LI>
</OL>
</P>
<P>$B%V!<%H%;%/%?$NBg$-$5$O!">o$K(B512$B%P%$%H$G$9!#(Bsetup$B$N%5%$%:$O!"(B4$B%;%/%?$h$jBg$-$/$J$1$l$P$J$j$^$;$s$,!":GBg$G$bLs(B12K$B$K@)8B$5$l$F$$$^$9!#$3$l$O<!$N$h$&$J%k!<%k$G7W;;$5$l$^$9!#(B</P>
<P>0x4000 bytes >= 512 + setup $B$N%;%/%??t(B * 512 + $B%V!<%H%;%/%?!?(Bsetup$B$r<B9T$9$k$H$-$N%9%?%C%/$NNN0h(B</P>
<P>$B8e$G!"$3$N@)8B$,$I$3$+$i$-$F$$$k$N$+3X$V$3$H$K$7$^$7$g$&!#(B</P>
<P>bzImage $B$N%5%$%:$N>e8B$O!"8=;~E@$G$O(B LILO $B$+$i$N%V!<%H$GLs(B2.5M $B$H$J$C$F$$$^$9!#$=$7$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LI>
<LI> $B%V!<%H%;%/%?$O!"(Bsetup $B$H2rE`%k!<%A%s$=$7$F!"05=L$5$l$?%+!<%M%k$rFI$_9~$`!#(B</LI>
<LI> $B%+!<%M%k$O!"%W%m%F%/%H%b!<%I$G2rE`$5$l$k!#(B</LI>
<LI> $B%m!<%l%Y%k$N=i4|2=$,(B asm $B%3!<%I$G9T$o$l$k!#(B</LI>
<LI> $B%O%$%l%Y%k$N(B C $B$G$N=i4|2=$,9T$o$l$k!#(B</LI>
</OL>
</P>
<H2><A NAME="ss1.3">1.3</A> <A HREF="Linux-Kernel-Internals.html#toc1.3">$B%V!<%H(B: BIOS POST</A>
</H2>
<P>
<OL>
<LI> $BEE8;$,F~$j!"%/%m%C%/%8%'%M%l!<%?$,3+;O$9$k!#$^$?!"%P%9>e$N(B #POWERGOOD $B?.9f$,%"%5!<%H$5$l$k!#(B</LI>
<LI> CPU #RESET $B?.9f$,%"%5!<%H$5$l$k(B ($B$3$N;~(B CPU $B$O!"(B8086 $B8_49$N%j%"%k%b!<%I$G$"$k(B)$B!#(B</LI>
<LI> %ds=%es=%fs=%gs=%ss=0, %cs=0xFFFF0000, %eip = 0x0000FFF0 (ROM BIOS POST $B%3!<%I(B)$B!#(B</LI>
<LI> $B3d$j9~$_$,6X;_$5$l$?>uBV$G!"$9$Y$F$N(B POST $B%A%'%C%/$,9T$o$l$k!#(B</LI>
<LI> IVT ($B3d$j9~$_%Y%/%H%k%F!<%V%k(B) $B$,%"%I%l%9(B 0 $B$X=i4|2=$5$l$k!#(B </LI>
<LI> BIOS $B$N(B $B%V!<%H%9%H%i%C%W%m!<%@4X?t$,!"(B<B>int 0x19</B> $B$K$h$j8F$S=P$5$l$k!#$3$N$H$-!"(B%dl $B$O!"%V!<%H%G%P%$%9$N!V%I%i%$%VHV9f!W$G$"$k!#$3$N4X?t$O!"(B $B%H%i%C%/(B 0 $B%;%/%?(B 1 $BHV$rJ*M}%"%I%l%9$N(B 0x7C00 (0x07C0:0000) $B$X$HFI$_9~$`!#(B</LI>
</OL>
</P>
<H2><A NAME="ss1.4">1.4</A> <A HREF="Linux-Kernel-Internals.html#toc1.4">$B%V!<%H(B: $B%V!<%H%;%/%?$H(B setup</A>
</H2>
<P>Linux$B%+!<%M%k$r%V!<%H$9$k$?$a$K;H$o$l$k%V!<%H%;%/%?$O!"(B
<UL>
<LI> Linux $B%V!<%H%;%/%?(B (<CODE>arch/i386/boot/bootsect.S</CODE>),</LI>
<LI> LILO ($B$"$k$$$OB>$N%V!<%H%m!<%@(B) $B%V!<%H%;%/%?!"$"$k$$$O(B</LI>
<LI> $B%V!<%H%;%/%?$O$J$$(B(loadlin$B$J$I(B)</LI>
</UL>
$B$N$$$:$l$+$K$J$j$^$9!#(B
$B$3$3$G!"(BLinux$B%V!<%H%;%/%?$N>\:Y$r8+$F$_$^$9!#:G=i$N?t9T$G$O!"%;%0%a%s%HCM$K;H$&JX59>e$N%^%/%m$,=i4|2=$5$l$F$$$^$9!#(B
<BLOCKQUOTE><CODE>
<HR>
<PRE>
29 SETUPSECS = 4 /* default nr of setup-sectors */
30 BOOTSEG = 0x07C0 /* original address of boot-sector */
31 INITSEG = DEF_INITSEG /* we move boot here - out of the way */
32 SETUPSEG = DEF_SETUPSEG /* setup starts here */
33 SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */
34 SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */
</PRE>
<HR>
</CODE></BLOCKQUOTE>
($B:8$N?t;z$O(B bootsect.S $B%U%!%$%k$N9THV9f$G$"$k(B) <CODE>DEF_INITSEG</CODE>, <CODE>DEF_SETUPSEG</CODE>, <CODE>DEF_SYSSEG</CODE> $B$*$h$S(B <CODE>DEF_SYSSIZE</CODE> $B$NCM$O!"(B <CODE>include/asm/boot.h</CODE> $B$GDj5A$5$l$F$*$j!"(B
<BLOCKQUOTE><CODE>
<HR>
<PRE>
/* Don't touch these, unless you really know what you're doing. */
#define DEF_INITSEG 0x9000
#define DEF_SYSSEG 0x1000
#define DEF_SETUPSEG 0x9020
#define DEF_SYSSIZE 0x7F00
</PRE>
<HR>
</CODE></BLOCKQUOTE>
$B$H$J$C$F$$$^$9!#(B
$B$5$F!"<B:]$N(B<CODE>bootsect.S</CODE>$B$N%3!<%I$r8+$F$$$-$^$7$g$&!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
54 movw $BOOTSEG, %ax
55 movw %ax, %ds
56 movw $INITSEG, %ax
57 movw %ax, %es
58 movw $256, %cx
59 subw %si, %si
60 subw %di, %di
61 cld
62 rep
63 movsw
64 ljmp $INITSEG, $go
65 # bde - changed 0xff00 to 0x4000 to use debugger at 0x6400 up (bde). We
66 # wouldn't have to worry about this if we checked the top of memory. Also
67 # my BIOS can be configured to put the wini drive tables in high memory
68 # instead of in the vector table. The old stack might have clobbered the
69 # drive table.
70 go: movw $0x4000-12, %di # 0x4000 is an arbitrary value >=
71 # length of bootsect + length of
72 # setup + room for stack;
73 # 12 is disk parm size.
74 movw %ax, %ds # ax and es already contain INITSEG
75 movw %ax, %ss
76 movw %di, %sp # put stack at INITSEG:0x4000-12.
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</P>
<P>54-63$B9T$O!"%"%I%l%9(B 0x7C00 $B$+$i(B 0x90000 $B$X%V!<%H%;%/%?%3!<%I$r0\F0$7$F$$$^$9!#$3$l$O!"<!$N$h$&$J<j=g$G<B9T$5$l$F$$$^$9!#(B
<OL>
<LI> %ds:%si $B$X(B $BOOTSEG:0 (0x7C0:0 = 0x7C00) $B$r@_Dj$9$k!#(B
</LI>
<LI> %es:%di $B$X(B $INITSEG:0 (0x9000:0 = 0x90000)$B$r@_Dj$9$k!#(B
</LI>
<LI> %cx $B$X(B16$B%S%C%H$N%o!<%ICM$rBeF~$9$k(B (256 $B%o!<%I(B = 512 $B%P%$%H(B = 1 $B%;%/%?(B)$B!#(B
</LI>
<LI> $B<+F0E*$K%"%I%l%9$r2C;;$9$k$h$&(B(cld)$B$K!"(BEFLAGS $B$N(B DF (direction) $B%U%i%0$r%/%j%"$9$k!#(B
</LI>
<LI> $B@h$K?J$_!"(B 512 bytes (rep movsw)$B%3%T!<$9$k!#(B</LI>
</OL>
</P>
<P>$B$3$N%3!<%I$,(B<CODE>rep movsd</CODE>$B$r;H$o$J$$$N$O!"FCJL$JM}M3$,$"$j$^$9!#(B($B%R%s%H(B .code16)
64$B9TL\$G$O!"?7$7$/:n$i$l$?%V!<%H%;%/%?$N%3%T!<$N%i%Y%k(B<CODE>go:</CODE>$B$X%8%c%s%W$9$k!#$D$^$j!"%;%0%a%s%H(B 0x9000$B$G$9!#$3$l$HB3$/(B3$B$D$NL?Na(B(64-76$B9T(B)$B$G$O!"(B$INITSEG:0x4000-0xC$B$X%9%?%C%/$r@_Dj$7$F$$$^$9!#$D$^$j!"(B%ss = $INITSEG (0x9000) $B$H(B %sp = 0x3FF4 (0x4000-0xC) $B$G$9!#$3$3$KA0=P$N(Bsetup$B$N%5%$%:@)8B$,$I$3$+$i$-$F$$$k$+$NM}M3$,$"$j$^$9(B (Linux $B%+!<%M%k%$%a!<%8$N:n@.(B $B;2>H(B)$B!#(B</P>
<P>77-103$B9T$G$O!"0l$D$a$N%G%#%9%/%Q%i%a!<%?%F!<%V%k$r>e=q$-$7$F!"%^%k%A%;%/%?FI$_9~$_$,$G$-$k$h$&$K$7$^$9!#(B
<BLOCKQUOTE><CODE>
<HR>
<PRE>
77 # Many BIOS's default disk parameter tables will not recognise
78 # multi-sector reads beyond the maximum sector number specified
79 # in the default diskette parameter tables - this may mean 7
80 # sectors in some cases.
81 #
82 # Since single sector reads are slow and out of the question,
83 # we must take care of this by creating new parameter tables
84 # (for the first disk) in RAM. We will set the maximum sector
85 # count to 36 - the most we will encounter on an ED 2.88.
86 #
87 # High doesn't hurt. Low does.
88 #
89 # Segments are as follows: ds = es = ss = cs - INITSEG, fs = 0,
90 # and gs is unused.
91 movw %cx, %fs # set fs to 0
92 movw $0x78, %bx # fs:bx is parameter table address
93 pushw %ds
94 ldsw %fs:(%bx), %si # ds:si is source
95 movb $6, %cl # copy 12 bytes
96 pushw %di # di = 0x4000-12.
97 rep # don't need cld -> done on line 66
98 movsw
99 popw %di
100 popw %ds
101 movb $36, 0x4(%di) # patch sector count
102 movw %di, %fs:(%bx)
103 movw %es, %fs:2(%bx)
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</P>
<P>BIOS $B$N%5!<%S%9$N(B int 0x13 $B%U%!%s%/%7%g%s(B0 (reset FDC) $B$r;H$C$F!"%U%m%C%T!<%G%#%9%/%3%s%H%m!<%i$r%j%;%C%H$7$^$9!#$=$7$F!"(Bsetup $B%;%/%?$,(B bootsector $B$N$9$08e$XFI$_9~$^$l$^$9!#$D$^$j(B $BJ*M}%"%I%l%9$N(B0x90200 ($INITSEG:0x200) $B$G$9!#$=$7$F!":FEY(BBIOS$B%5!<%S%9$N(Bint 0x13 $B%U%!%s%/%7%g%s(B 2(read sector(s)) $B$r8F$S=P$7$^$9!#$3$NJU$j$O!"(B107-124$B9T$K5-=R$5$l$F$$$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
107 load_setup:
108 xorb %ah, %ah # reset FDC
109 xorb %dl, %dl
110 int $0x13
111 xorw %dx, %dx # drive 0, head 0
112 movb $0x02, %cl # sector 2, track 0
113 movw $0x0200, %bx # address = 512, in INITSEG
114 movb $0x02, %ah # service 2, "read sector(s)"
115 movb setup_sects, %al # (assume all on head 0, track 0)
116 int $0x13 # read it
117 jnc ok_load_setup # ok - continue
118 pushw %ax # dump error code
119 call print_nl
120 movw %sp, %bp
121 call print_hex
122 popw %ax
123 jmp load_setup
124 ok_load_setup:
</PRE>
<HR>
</CODE></BLOCKQUOTE>
$B$b$7!"$J$K$+$N860x(B($B%U%m%C%T!<$,Nt2=$7$F$$$k$H$+!";HMQCf$K%G%#%9%1%C%H$rH4$-5n$C$?$H$+(B)$B$GFI$_9~$_$,<:GT$7$?$i!"%(%i!<%3!<%I$rI=<($7$J$,$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$H$7$F(B<CODE>setup.S</CODE>$B$GDj5A$5$l$F$$$^$9!#(B
<CODE>setup.S</CODE>$B$N(B<CODE>bootsect_klugh</CODE>$B%i%Y%k$O!"(Bsetup$B%;%0%a%s%HCM$H!"$=$NCf$N(B<CODE>bootsect_helper</CODE>$B%3!<%I$N%*%U%;%C%H$+$i$J$C$F$$$^$9!#$=$N$?$a!"%V!<%H%;%/%?$G$O!"%8%c%s%W$9$k$N$K(B<CODE>lcall</CODE>$BL?Na$r;H$&$3$H$,$G$-$^$9!#(B($B$D$^$j%;%0%a%s%HFb%8%c%s%W$G$9(B)
<CODE>setup.S</CODE>$B$K$3$l$,$"$k$N$O!"C1$K(Bbootsect.S$B$K$O!"$b$&M>J,$J%9%Z!<%9$,L5$$$+$i$J$N$G$9!#!J$3$l$O87L)$K$O@5$7$/$O$"$j$^$;$s(B -- <CODE>bootsect.S</CODE>$B$K$O!"Ls(B4$B%P%$%H$H>/$J$/$H$b(B1$B%P%$%H$NM>M5$,$"$j$^$9!#$7$+$7!"L@$i$+$K==J,$H$O$$$($^$;$s(B)$B!#$3$N%k!<%A%s$O9b0L$N%a%b%j$X0\F0$9$k$N$K!"(Bint 0x15(ax=0x8700)$B$N(BBIOS$B%5!<%S%9$r;H$$!"(B%es$B$r>o$K(B0x10000$B$r<($9$h$&%j%;%C%H$7$^$9!#$3$l$O!"(B<CODE>bootsect.S</CODE>$B$N%3!<%IFb$G!"%G%#%9%/$+$i%G!<%?$r%3%T!<$9$k$H$-$KDc0L%a%b%j$,B-$i$J$/$J$i$J$$$3$H$rJ]>Z$7$^$9!#(B</P>
<H2><A NAME="ss1.5">1.5</A> <A HREF="Linux-Kernel-Internals.html#toc1.5">LILO$B$r%V!<%H%m!<%@$H$7$F;H$&(B </A>
</H2>
<P>Linux$B%V!<%H%;%/%?$rMg$G;H$o$:!"FCJL$J%V!<%H%m!<%@(B(LILO)$B$r;H$&$3$H$G!"MxE@$,@8$^$l$^$9!#(B
<OL>
<LI> $BJ#?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linux-Kernel-Internals.html#toc1.6">$B9b$$%l%Y%k$N=i4|2=(B </A>
</H2>
<P>$B!V9b$$%l%Y%k$N=i4|2=!W$G$O!"%V!<%H$KD>@\4XO"$7$J$$$b$N$K$D$$$F9M$($^$9!#$7$+$7!"$3$l$r9T$&%3!<%I$N0lIt$O!"(B
$BE83+$5$l$?%+!<%M%k$N@hF,$K$"$k(B<CODE>arch/i386/kernel/head.S</CODE>$B$H8F$P$l$k%"%;%s%V%i$G=q$+$l$F$$$^$9!#$=$3$G$O!"0J2<$N$h$&$J=hM}$,9T$o$l$^$9!#(B</P>
<P>
<OL>
<LI> $B%;%0%a%s%HCM$r=i4|2=$9$k(B (%ds = %es = %fs = %gs = __KERNEL_DS = 0x18)$B!#(B</LI>
<LI> $B%Z!<%8%F!<%V%k$r=i4|2=$9$k!#(B</LI>
<LI> %cr0$B$N(BPG$B%S%C%H$r%;%C%H$7!"%Z!<%8%s%0$rM-8z$K$9$k!#(B</LI>
<LI> BSS$B$r%<%m$GKd$a$k(B (SMP$B$G$O!"#1$D$a$N(BCPU$B$@$1$,$3$N=hM}$r9T$&(B)$B!#(B</LI>
<LI> $B%V!<%H%Q%i%a!<%?$N:G=i$N(B2k$B$r%3%T!<$9$k(B ($B%+!<%M%k%3%^%s%I%i%$%s(B)$B!#(B</LI>
<LI> CPU$B%?%$%W$r(BEFLAGS$B$H!"2DG=$G$"$l$P(B386$B0J>e$r3NG'$G$-$k(Bcpuid$B$G%A%'%C%/$9$k!#(B</LI>
<LI> $B#1$D$a$N(BCPU$B$O(B<CODE>start_kernel()</CODE>$B$r8F$S=P$7!"B>$N(BCPU$B$O!"(Bready=1$B$G$"$l$PC1$K(B esp/eip $B$r%j%m!<%I$9$k$N$_$GLa$C$F$3$J$$4X?t$N(B <CODE>arch/i386/kernel/smpboot.c:initialize_secondary()</CODE> $B$r8F$S=P$9!#(B</LI>
</OL>
</P>
<P><CODE>init/main.c:start_kernel()</CODE>$B$O(BC$B$G=q$+$l$F$*$j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%i%$%s$,$"$l$P!"%W%m%U%!%$%k%P%C%U%!$r=i4|2=$9$k!#(B</LI>
<LI> <CODE>kmem_cache_init()</CODE> $B$r<B9T$7!"$[$H$s$I$N%9%i%V%"%m%1!<%?$r=i4|2=$9$k!#(B</LI>
<LI> $B3d$j9~$_$rM-8z$K$9$k!#(B</LI>
<LI> $B;HMQ$7$F$$$k(B CPU $B$N(B BogoMips $B$r7W;;$9$k!#(B</LI>
<LI> <CODE>max_mapnr</CODE>$B!"(B<CODE>totalram_pages</CODE> $B$H(B <CODE>high_memory</CODE>$B$r7W;;$9$k(B<CODE>mem_init()</CODE>$B$r8F$S=P$7!"(B"Memory: ..." $B$N9T$rI=<($9$k!#(B</LI>
<LI> <CODE>kmem_cache_sizes_init()</CODE> $B$r<B9T$7!"%9%i%V%"%m%1!<%?$N=i4|2=$,40N;$9$k!#(B</LI>
<LI> procfs $B$,;H$&%G!<%?9=B$BN$r=i4|2=$9$k!#(B</LI>
<LI> <CODE>fork_init()</CODE>$B$r8F$S=P$7!"(B<CODE>uid_cache</CODE> $B$r:n@.$7$F!"MxMQ2DG=$J%a%b%jNL$K4p$E$-(B<CODE>max_threads</CODE>$B$r=i4|2=$7!"(B <CODE>init_task</CODE> $B$,(B <CODE>max_threads/2</CODE> $B$K$J$k$h$&(B <CODE>RLIMIT_NPROC</CODE> $B$r@_Dj$9$k!#(B</LI>
<LI> VFS$B!"(BVM$B!"%P%C%U%!%-%c%C%7%e$J$I$GI,MW$J<o!9$N%9%i%V%-%c%C%7%e$r:n@.$9$k!#(B</LI>
<LI> System V IPC $B%5%]!<%H$,%+!<%M%k$K4^$^$l$F$$$?$i!"(BIPC $B%5%V%7%9%F%`$r=i4|2=$9$k!#(BSystem V shm $B$N>l9g$O!"(Bshmfs$B%U%!%$%k%7%9%F%`$N(B($B%+!<%M%k$N(B)$BFbIt%$%s%9%?%s%9$r%^%&%s%H$9$k$3$H$KCm0U$9$k$3$H!#(B</LI>
<LI> quota $B%5%]!<%H$,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(BBP $B$O(B <CODE>start_kernel()</CODE>$B$X?J$_!"$=$7$F(B<CODE>smp_init()</CODE>$B$HFC$K(B<CODE>src/i386/kernel/smpboot.c:smp_boot_cpus()</CODE>$B$K?J$`$^$G!"DL>o$N%V!<%H%;%/%?!"(Bsetup$B$J$I$N%V!<%H%7!<%1%s%9$r?J$s$G$$$-$^$9!#(B
<CODE>smp_boot_cpus()</CODE>$B$O!"(B(<CODE>NR_CPUS</CODE>$B$^$G(B)$B%k!<%W$G3F(Bapicid$B$4$H$K<B9T$5$l!"$=$NCf$G(B<CODE>do_boot_cpu()</CODE>$B$,8F$P$l$^$9!#(B
<CODE>do_boot_cpu()</CODE>$B$O%?!<%2%C%H$N(BCPU$BMQ$N%"%$%I%k%?%9%/$r@8@.(B(i.e. <CODE>fork_by_hand</CODE>)$B$7$^$9!#$=$7$F!"(BIntel MP$B;EMM$GDj5A$5$l$F$$$k4{Dj$N0LCV(B (0x467/0x469) $B$X$H!"(B<CODE>trampoline.S</CODE>$B$K$"$k%H%i%s%]%j%s%3!<%I$N(BEIP$B$r=q$-9~$_$^$9!#$=$7$F!"$3$N(BAP$B$,(B <CODE>trampoline.S</CODE>$B$N%3!<%I$r<B9T$9$k$h$&$K!"%?!<%2%C%H(B CPU $B$N(B STARTUP IPI $B$r@8@.$7$^$9!#(B</P>
<P>$B%V!<%H$7$?(B CPU $B$O!"Dc0L%a%b%j$K$"$k3F(B CPU $B$N%H%i%s%]%j%s%3!<%I$N%3%T!<$r:n@.$7$^$9!#(BAP$B%3!<%I$O%^%8%C%/%J%s%P!<$r<+?H$N%3!<%I$KKd$a9~$`$3$H$G!"(BBP$B$K$h$j$=$N(BAP$B$,%H%i%s%]%j%s%3!<%I$r<B9T$7$F$h$$$+$NH=CG$r9T$o$;$^$9!#(BIntel MP$B;EMM$K$h$C$F5,Dj$5$l$F$$$k$?$a!"%H%i%s%]%j%s%3!<%I$ODc0L%a%b%j$KCV$+$l$kI,MW$,$"$j$^$9!#(B</P>
<P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HR>
<PRE>
#ifndef MODULE
#define __init __attribute__ ((__section__ (".text.init")))
#define __initdata __attribute__ ((__section__ (".data.init")))
#else
#define __init
#define __initdata
#endif
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</P>
<P>$B$3$l$,0UL#$9$k$3$H$O!"$b$7%3!<%I$,%+!<%M%k$K@EE*$K%3%s%Q%$%k$5$l$F$$$k$J$i(B($B$D$^$j(B MODULE$B$,Dj5A$5$l$F$$$J$1$l$P!K!"FC<l$J(B ELF $B%;%/%7%g%s$N(B<CODE>text.init</CODE>$B$K$3$l$i$N%3!<%I$,G[CV$5$l$k$H$$$&$3$H$G$9!#$=$7$F$=$NG[CV$O!"(B<CODE>arch/i386/vmlinux.lds</CODE>$B$N%j%s%+%^%C%W$KDj5A$5$l$k$N$G$9!#(B
$B5U$K(B($B$D$^$j%b%8%e!<%k$G$"$l$P(B)$B%^%/%m$O$J$K$b$7$J$$$H$$$&$3$H$G$9!#(B</P>
<P>$B%V!<%H;~$K!"%"%I%l%9(B<CODE>__init_begin</CODE>$B$+$i(B<CODE>__init_end</CODE>$B$N4V$NA4$F$N%Z!<%8$r2rJ|$9$k!"%"!<%-%F%/%A%cFCM-$N4X?t(B<CODE>free_initmem()</CODE>$B$r!"(B"init"$B%+!<%M%k%9%l%C%I(B($B4X?t(B<CODE>init/main.c:init()</CODE>)$B$,8F$S=P$9$N$G$9!#(B</P>
<P>($B;d$N%o!<%/%9%F!<%7%g%s$N$h$&$J(B)$B0lHLE*$J%7%9%F%`$G$O!"$3$N7k2L!"Ls(B260K$B$N%a%b%j$N2rJ|$K$J$j$^$9!#(B</P>
<P><CODE>module_init()</CODE>$B$K$h$C$FEPO?$5$l$?4X?t$O!"(B<CODE>.initcall.init</CODE>$B$KG[CV$5$l!"@EE*$K%j%s%/$5$l$F$$$?$H$-$K$OF1MM$K2rJ|$5$l$^$9!#(BLinux $B3+H/$N8=:_$NJ}8~@-$G$O!">-MhLdBj$N%5%V%7%9%F%`$,I,MW$K1~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"$k$3$H$r<($90u$H$$$C$7$g$K3JG<$9$k!#(B</LI>
<LI> <CODE>arch/i386/kernel/head.S</CODE> $B$O<+?H$N:G=i$N(B 2k $B$r%<%m%Z!<%8$N30$X$H%3%T!<$9$k!#(B
</LI>
<LI> (<CODE>start_kernel()</CODE> $B$+$i8F$P$l$?(B <CODE>setup_arch()</CODE>$B$+$i8F$S=P$5$l$k(B) <CODE>arch/i386/kernel/setup.c:parse_mem_cmdline()</CODE>$B$O!"%<%m%Z!<%8$+$i(B 256 $B%P%$%H$r(B <CODE>/proc/cmdline</CODE> $B$GI=<($5$l$k$N$HF1$8(B <CODE>saved_command_line</CODE> $B$X$H%3%T!<$9$k!#$3$l$HF1$8%k!<%A%s$O!"(B"mem=" $B%*%W%7%g%s$,$b$7$"$l$P=hM}$7!"(BVM $B%Q%i%a!<%?$rE,@Z$KD4@0$9$k!#(B
</LI>
<LI> $BOC$r(B(<CODE>start_kernel()</CODE>$B$+$i8F$P$l$k(B) <CODE>parse_options()</CODE> $B$N%3%^%s%I%i%$%s$KLa$9$H!"$3$N4X?t$O!V%+!<%M%kFbIt!W%Q%i%a!<%?(B($B8=;~E@$G$O!"(B"init="$B$H(B init $B$N4D6-JQ?t!"0z?t(B)$B$b=hM}$7!"3F%o!<%I$r(B<CODE>checksetup()</CODE>$B$X$HEO$9!#(B
</LI>
<LI> <CODE>checksetup()</CODE> $B$O(B ELF $B%;%/%7%g%s(B<CODE>.setup.init</CODE>$B$N%3!<%I$K$D$$$F!"$=$3$N3F4X?t$r5/F0$7!"%3%^%s%I%i%$%s$,%^%C%A$7$F$$$?;~$O!"%3%^%s%I%i%$%s$N%o!<%I$rEO$7$F$$$/!#$3$3$G!"(B<CODE>__setup()</CODE>$B$GEPO?$5$l$?4X?t$+$i$NJV$jCM$,(B 0 $B$N$H$-$O!"F1$8(B"variable=value" $B$r0l$D0J>e$N4X?t$XEO$;!"$=$N(B"value"$B$,0lJ}$N4X?t$G$OL58z$G!"B>J}$G$OM-8z$G$"$k$H$$$&$3$H$rI=$7$F$$$k!#(B
Jeff Garzik$B$O!"!V$3$&$$$&$3$H$r$9$k%O%C%+!<$O$*$7$j%Z%s%Z%s$@(B :) $B!W$H%3%a%s%H$7$F$$$k!#$J$<$+(B?
$B$3$l$OL@$i$+$K(B ID $B$N=g=x$KFCM-$G!"$D$^$j$"$k=g=x$G%j%s%/$5$l$?%+!<%M%k$O4X?t(BA$B$r4X?t(BB$B$NA0$K5/F0$9$k$,!"$=$&$G$J$$>l9g$O!"5U$N=g=x$K$J$j7k2L$,=g=x$K0MB8$7$F$7$^$&$+$i$@!#(B
</LI>
</OL>
</P>
<P>$B$5$F!"%V!<%H%3%^%s%I%i%$%s$r=hM}$9$k%3!<%I$O$I$N$h$&$K$J$C$F$$$k$N$G$7$g$&$+!#(B<CODE>include/linux/init.h</CODE>$B$GDj5A$5$l$k(B <CODE>__setup()</CODE> $B%^%/%m$r;H$$$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
/*
* Used for kernel command line parameter setup
*/
struct kernel_param {
const char *str;
int (*setup_func)(char *);
};
extern struct kernel_param __setup_start, __setup_end;
#ifndef MODULE
#define __setup(str, fn) \
static char __setup_str_##fn[] __initdata = str; \
static struct kernel_param __setup_##fn __initsetup = \
{ __setup_str_##fn, fn }
#else
#define __setup(str,func) /* nothing */
endif
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</P>
<P>$B<!$K!"<B:]$N%3!<%I$G$NE57?E*$J;H$$J}$O0J2<$N$h$&$K$J$j$^$9(B ($B<B:]$N%I%i%$%P$N(B BusLogic HBA <CODE>drivers/scsi/BusLogic.c</CODE>$B$+$i0zMQ(B)$B!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
static int __init
BusLogic_Setup(char *str)
{
int ints[3];
(void)get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] != 0) {
BusLogic_Error("BusLogic: Obsolete Command Line Entry "
"Format Ignored\n", NULL);
return 0;
}
if (str == NULL || *str == '\0')
return 0;
return BusLogic_ParseDriverOptions(str);
}
__setup("BusLogic=", BusLogic_Setup);
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</P>
<P>$B$3$3$G(B <CODE>__setup()</CODE>$B$O%b%8%e!<%k$KBP$7$F$O2?$b$7$^$;$s!#$=$7$F%b%8%e!<%k$G$"$l@EE*$K%j%s%/$5$l$F$$$k$N$G$"$l!"%V!<%H%3%^%s%I%i%$%s$r=hM}$7$?$$%3!<%I$G$O!"%b%8%e!<%k$N=i4|2=%k!<%A%s$K$*$$$F!"<+?H$N2r@O4X?t$r;}$C$F$$$F$=$l$r5/F0$7$J$1$l$P$J$i$J$$$+$i$G$9!#$3$l$O!"@EE*$K%3%s%Q%$%k$5$l$k;~$J$I$@$1$G$J$/!"%b%8%e!<%k$H$7$F%3%s%Q%$%k$5$l$k;~$K$b!"%Q%i%a!<%?$r=hM}$9$k%3!<%I$r=q$/$3$H$,$G$-$k$H$$$&;v$G$b$"$j$^$9!#(B</P>
<HR>
<A HREF="Linux-Kernel-Internals-2.html">$B<!$N%Z!<%8(B</A>
$BA0$N%Z!<%8(B
<A HREF="Linux-Kernel-Internals.html#toc1">$BL\<!$X(B</A>
</BODY>
</HTML>
|