/usr/share/doc/HOWTO/ja-html/readkernel.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 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 | <HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-2022-JP">
<TITLE>
$B%3%a%s%H$+$iFI$`(B Linux $B%+!<%M%k(B
</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<A HREF="INDEX-JF.html">JF-INDEX (document list of JF Project)</A>
<HR>
<H1>$B%3%a%s%H$+$iFI$`(B Linux $B%+!<%M%k(B</H1>
<H2>Sano Taketoshi <CODE><kgh12351@nifty.ne.jp></CODE></H2>$Date: 2000/06/27 13:57:52 $
<P><HR>
<EM>NLUG ($BL>8E20(B Linux $B%f!<%6!<%0%k!<%W(B) $BBh(B 3 $B2sJY6/2q$N$?$a$K(B
$B:n@.$7$?;qNA$G$9!#(B $B:#2sFI$`$N$O(B Linux $B%+!<%M%k(B 2.2.5 $B$G$9!#(B
$B<g$K(B PC/AT (i386) $B>e$G!"EE8;(B ON $B$N$"$H!"%+!<%M%k$N%m!<%I!"(B $B%V!<%H%"%C%W$+$i(B /sbin/init $B$,<B9T$5$l$k$^$G$r%=!<%9%3!<%ICf$N(B
$B%3%a%s%H$rMj$j$KDI$$$+$1$F$$$-$^$9!#(B</EM>
<HR>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="#s1">$B$O$8$a$K(B</A></H2>
<UL>
<LI><A HREF="#ss1.1">1.1 $B!V%+!<%M%k!W$H$O(B</A>
<LI><A HREF="#ss1.2">1.2 Linux $B%+!<%M%k(B</A>
<LI><A HREF="#ss1.3">1.3 $B%3!<%I:n@.$K9W8%$7$??M!9(B</A>
<LI><A HREF="#ss1.4">1.4 $BC4Ev<T0lMw(B</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="#s2">$B%7%9%F%`$N5/F0!'35MW(B</A></H2>
<UL>
<LI><A HREF="#ss2.1">2.1 $B%+!<%M%k$N%m!<%I(B</A>
<LI><A HREF="#ss2.2">2.2 BIOS $B>pJs$N<hF@(B</A>
<LI><A HREF="#ss2.3">2.3 $B%+!<%M%kK\BN$NE83+(B</A>
<LI><A HREF="#ss2.4">2.4 $B%G%P%$%9%I%i%$%P!<$N@_Dj(B</A>
<LI><A HREF="#ss2.5">2.5 init $B$N5/F0(B</A>
<LI><A HREF="#ss2.6">2.6 $B%7%9%F%`5/F0(B</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="#s3">$B%+!<%M%k$N%m!<%I(B</A></H2>
<UL>
<LI><A HREF="#ss3.1">3.1 bootsect.S - $BKAF,$N%3%a%s%H(B</A>
<LI><A HREF="#ss3.2">3.2 bootsect.S - $B%Q%i%a!<%?Dj5A(B</A>
<LI><A HREF="#ss3.3">3.3 bootsect.S - $B<B:]$NF0:n(B</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="#s4">BIOS $B>pJs$N<hF@(B</A></H2>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="#s5">$B%+!<%M%kK\BN$NE83+(B</A></H2>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="#s6">$B%G%P%$%9%I%i%$%P!<$N@_Dj(B</A></H2>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="#s7">init $B$N5/F0(B</A></H2>
<P>
<H2><A NAME="toc8">8.</A> <A HREF="#s8">$BHV30(B: Makefile $B$K$D$$$F(B</A></H2>
<P>
<H2><A NAME="toc9">9.</A> <A HREF="#s9">$B=*$o$j$K(B</A></H2>
<UL>
<LI><A HREF="#ss9.1">9.1 $B$*4j$$(B</A>
<LI><A HREF="#ss9.2">9.2 $B<U<-(B</A>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9%H$7$?(B
$B7P83$O$"$j$^$;$s$+(B ?
$B$3$N!V(B /dev/lp0 $B$K=PNO$7$?%G!<%?$O$=$N$^$^%Q%i%l%k%]!<%H$K=PNO$5$l$k!W(B
$B$H$$$&F0:n$O%+!<%M%kFb$N(B lp $B%I%i%$%P$K$h$C$F<B8=$5$l$F$$$^$9!#(B
<P>
<H2><A NAME="ss1.2">1.2 Linux $B%+!<%M%k(B</A>
</H2>
<P>$B0J2<!"$3$NJ8=q$G$O(B Linux $B%+!<%M%k$N%=!<%9%3!<%I%D%j!<$r!"(B
$B%3%a%s%H$r<j$,$+$j$K$7$F$A$g$C$H$@$1C58!$7$F$_$k$3$H$K$7$^$9!#(B
<P>$B$^$:$O!"%P!<%8%g%s(B 2.2.5 $B$N%+!<%M%k$rE83+$7$F!"$=$N%H%C%W%G%#%l%/%H%j(B
$B$K0\F0$7$F$_$^$7$g$&!#$=$&!"DL>o(B /usr/src/linux/ $B$H$7$F8+$k$3$H$,(B
$B$G$-$k>l=j$G$9!#(B
<P>$B$^$:$O$I$s$J%U%!%$%k$,$"$k$+!"(B "ls" $B$GD4$Y$F$_$^$9!#(B
<P>
<PRE>
$ ls -F
COPYING Makefile arch/ init/ mm/
CREDITS README drivers/ ipc/ net/
Documentation/ REPORTING-BUGS fs/ kernel/ scripts/
MAINTAINERS Rules.make include/ lib/
</PRE>
<P>$B:G=i$KFI$s$G$*$/$Y$-%U%!%$%k$O(B "README" $B$G$9$M!#$3$l$O(B
$B%+!<%M%k$G$J$/$F$b!"0lHL$N%"%W%j%1!<%7%g%s$N%=!<%9$G$bF1$8$G$9!#(B
$B$,!"$3$3$G$O$3$N%U%!%$%k$NFbMF$K$D$$$F$O>JN,$7$F!"$=$NBe$o$j$K(B
"CREDITS" $B$H(B "MAINTAINERS" $B$H$$$&(B 2 $B$D$N%U%!%$%k(B
$B$NFbMF$K$D$$$F>R2p$7$?$$$H;W$$$^$9!#(B
<P>
<H2><A NAME="ss1.3">1.3 $B%3!<%I:n@.$K9W8%$7$??M!9(B</A>
</H2>
<P>"CREDITS" $B%U%!%$%k$NKAF,$K$O(B
<P>
<P>
<PRE>
This is at least a partial credits-file of people that have
contributed to the Linux project. It is sorted by name and
formatted to allow easy grepping and beautification by
scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and
snail-mail address (S).
Thanks,
Linus
</PRE>
<P>
<P>$B$H=q$+$l$F$$$^$9!#$3$N%U%!%$%k$K$O(B Linux $B%+!<%M%k$N3+H/$K9W8%$7$?(B
$B?M!9(B ($B$N0lIt(B) $B$NL>A0$,=q$+$l$F$$$k!"$H$$$&$o$1$G$9!#(B
<P>
<P>$BNc$($P!"@hF|(B TV $B$NFC=8$G<h:`$5$l$F$$$?F|K\$N?7It$5$s$NL>A0$b(B
<P>
<P>
<PRE>
N: Niibe Yutaka
D: PLIP driver
D: Asynchronous socket I/O in the NET code
</PRE>
<P>
<P>$B$H5-:\$5$l$F$$$^$9!#$b$A$m$s!"(BLinus $B$5$s$NL>A0$O(B
<P>
<P>
<PRE>
N: Linus Torvalds
D: Original kernel hacker
</PRE>
<P>
<P>$B$H$7$C$+$j:\$C$F$$$^$9$7!"(B ac $B%Q%C%A$GM-L>$J(B Alan Cox $B$d(B
fat32 $BBP1~$r<BAu$7$?(B Gordon Chaffee$B!"$=$l$K0JA0(B Linux Kernel
$B$N(B Sound Driver $B$r=q$$$F$$$?(B OpenSoundSystem $B$N(B Hannu Savolainen $B$N(B
$BL>A0$b$"$j$^$9!#(B
<P>
<P>
<PRE>
N: Alan Cox
D: Linux Networking (0.99.10->2.0.29)
D: Original Appletalk, AX.25, and IPX code
D: Current 3c501 hacker. >>More 3c501 info/tricks wanted<<.
D: Watchdog timer drivers
D: Linux/SMP x86 (up to 2.0 only)
D: Initial Mac68K port
D: Video4Linux design, bw-qcam and PMS driver ports.
D: 2.1.x modular sound
</PRE>
<P>
<P>
<PRE>
N: Gordon Chaffee
D: vfat, fat32, joliet, native language support
</PRE>
<P>
<P>
<PRE>
N: Hannu Savolainen
D: Kernel sound drivers
</PRE>
<P>
<P>$BB>$K$b!"(BSlackware $B$N(B Patrick Volkerding$B!"(B
Debian $B$N(B Ian A. Murdock $B$H(B Ian Jackson $BB>!"$=$l$K(B
$B$$$m$$$m$H3FJ}LL$GM-L>$J(B Eric S. Raymond $B$d(B XFree86 $B$N(B
Dirk Hohndel ($BH`$b(B TV $B$G<h:`$5$l$F$$$^$7$?$M(B) $B$d(B
Harald Koenig $B$NL>A0$b$"$j$^$9$7!"(BLDP $B4X78<T$G$"$k(B
Michael K. Johnson $B$d(B Matt Welsh $B$b:\$C$F$$$^$9!#(B
<P>
<P>
<PRE>
N: Patrick Volkerding
D: Produced the Slackware distribution, updated the SVGAlib
D: patches for ghostscript, worked on color 'ls', etc.
</PRE>
<P>
<P>
<PRE>
N: Ian A. Murdock
D: Creator of Debian distribution
</PRE>
<P>
<P>
<PRE>
N: Ian Jackson
D: FAQ maintainer and poster of the daily postings
D: FSSTND group member
D: Debian core team member and maintainer of several Debian packages
</PRE>
<P>
<P>
<PRE>
N: Eric S. Raymond
D: terminfo master file maintainer
D: Editor: Installation HOWTO, Distributions HOWTO, XFree86 HOWTO
D: Author: fetchmail, Emacs VC mode, Emacs GUD mode
</PRE>
<P>
<P>
<PRE>
N: Dirk Hohndel
D: The XFree86[tm] Project
</PRE>
<P>
<P>
<PRE>
N: Harald Koenig
D: XFree86 (S3), DCF77, some kernel hacks and fixes
</PRE>
<P>
<P>
<PRE>
N: Michael K. Johnson
D: The Linux Documentation Project
D: Kernel Hackers' Guide
D: Procps
D: Proc filesystem
D: Maintain tsx-11.mit.edu
D: LP driver
</PRE>
<P>
<P>
<PRE>
N: Matt Welsh
D: Linux Documentation Project coordinator
D: Author, _Running_Linux_ and I&GS guide
D: Linuxdoc-SGML formatting system
D: Keithley DAS1200 device driver
D: Maintainer of sunsite WWW and FTP, moderator c.o.l.answers
</PRE>
<P>
<P>$B$A$g$C$H(B " egrep '^N:' CREDITS |wc" $B$H$7$F(B
$B?t$($F$_$?$H$3$m!"(B2.2.5 $B%+!<%M%k$N(B CREDITS $B%U%!%$%k$K$O(B
$B$6$C$H(B 273 $B?M$NL>A0$,5s$,$C$F$$$k$h$&$G$9!#(B(2.0.36 $B$GD4$Y$F$_$?$i(B
204 $B?M$G$7$?(B) $B$3$NCf$K=q$+$l$F$$$kL>A0$r2??MCN$C$F$$$k$+!"(B
$B?t$($F$_$k$H(B Linux $B3&$X$N%O%^%jEY$,$o$+$C$F$*$b$7$m$$$+$b$7$l$^$;$s!#(B
<P>$B$=$&$=$&!"!V%3%a%s%H!W$K$3$@$o$j$r;}$D$b$N$H$7$F$O!"(B
$B$3$N%U%!%$%k$N:G8e$b8+F($5$J$$$h$&$K$7$F$*$/$3$H$,I,MW$G$9!#(B
<P>
<P>
<PRE>
# Don't add your name here, unless you really _are_ after Marc
# alphabetically. Leonard used to be very proud of being the
# last entry, and he'll get positively pissed if he can't even
# be second-to-last. (and this file really _is_ supposed to be
# in alphabetic order)
</PRE>
<P>
<P>"pissed off" $B$C$F$$$&$N$O!"!V7c$7$/E\$k!W$H$+(B
$B!VF,$K$/$k!W$H$$$&0UL#$i$7$$$G$9$M!#2?$F$$$&$+!"%+!<%M%k3+H/<T$?$A(B
$B$b?M4V$J$s$@$J!"$H$$$&46$8$,$7$FHy>P$^$7$$5$$,$7$^$9!#(B
<P>
<P>$B$"$H!"$b$&$R$H$DK:$l$F$^$7$?!#$3$l$G$9!#(B
<P>
<PRE>
N: Lars Wirzenius
D: Linux System Administrator's Guide
D: Co-moderator, comp.os.linux.announce
D: Original sprintf in kernel
D: Personal information about Linus
D: Original kernel README
D: Linux News (electronic magazine)
D: Meta-FAQ, originator
D: INFO-SHEET, former maintainer
D: Author of the longest-living linux bug
</PRE>
<P>$B:G8e$N9T$KCmL\$7$F$/$@$5$$!#$J$+$J$+%f!<%b%"$N$"$kJ}$N$h$&$G$9!#(B
<P>$BIaDL!V<+J,$,%P%0$rF~$l$?!W$H$$$&$N$O!"$"$^$j<+K}$G$-$k$3$H$G$O$J$$$N$G!"(B
$B%3!<%I3+H/$X$N9W8%$K<U0U$rI=$9$k$?$a$N!V8%<-!W(B CREDITS $B$K:\$;$k$h$&$J$3$H$O(B
$B$"$^$j$7$J$$$H;W$&$N$G$9$,!">e5-$NJ8$,$o$6$o$6=q$$$F$"$k$H$$$&$N$O!"(B
$B$?$V$s$3$N(B Wirzenius $B$5$s$,<+J,$G!V$3$&=q$$$F$/$l!W$H0MMj$5$l$?$s$8$c$J$$$+$H(B
$BA[A|$7$F$$$^$9!#(B
<P>$B>e5-$N!V:G$bD9$/@8$-$N$S$?%P%0$NCx<T!W$H$$$&J8$+$i$O!"(B
$BDL>o$J$i$"$^$j8xI=$7$?$/$J$$$H;W$&$h$&$J2a5n$N!V%P%0!W$N$3$H$G$5$(!"(B
$B!V>P$$!W$NBP>]$K$7$F$7$^$*$&$H$$$&%P%$%?%j%F%#$H$$$&$+!"(B
$B%f!<%b%"$N%;%s%9$r46$8$^$9!#(B
$B!V$I$&$@$$(B ? $B$3$N26$,$+$NM-L>$J!X:G$bD9$/2r7h(B
$B$5$l$:$K;D$C$?%P%0!Y$NCx<T$J$s$@$<(B ! $B%9%4%$$@$m$&(B !!$B!W(B
$B$_$?$$$J46$8$G$9$M!#(B
<P>
<P>
<H2><A NAME="ss1.4">1.4 $BC4Ev<T0lMw(B</A>
</H2>
<P>$B$5$F!"$=$m$=$m<!$K0\$j$^$7$g$&!#(B
$B:#EY$O(B "MAINTAINERS" $B%U%!%$%k$G$9!#(B
$B$3$N%U%!%$%k$NKAF,$K$O(B
<P>
<P>
<PRE>
List of maintainers and how to submit kernel changes
Please try to follow the guidelines below. This will make things
easier on the maintainers. Not all of these guidelines matter for every
trivial patch so apply some common sense.
</PRE>
<P>
<P>$B$H=q$+$l$F$$$^$9!#$D$^$j4pK\E*$K$O(B Linux $B%+!<%M%k$r<+J,$N<j$GJQ99$7$F(B
$B3Z$7$`?M(B ($B%+!<%M%k%O%C%+!<(B) $B$rBP>]$K!"$=$N%Q%C%A$r$I$3$KAw$l$P(B
$BI8=`$H$7$F:NMQ$5$l$k$N$+!"$H$$$&<j=g$r@bL@$7$?$b$N$G$9!#(B
<P>$B$7$+$7!"$3$N%U%!%$%k$K$b<B$O3Z$7$a$kE@$,$"$k$N$G$9!#(B
$B$=$l$O$3$N%U%!%$%k$N0lHV:G8e!#(B
<P>
<PRE>
THE REST
P: Linus Torvalds
S: Buried alive in reporters
</PRE>
<P>
<P>$B$A$J$_$K!"(B2.0.36 $B$^$G$N(B 2.0.xx $B7O$G$O$3$&$J$C$F$$$^$7$?!#(B
<P>
<PRE>
REST:
P: Linus Torvalds
S: Buried alive in email
</PRE>
<P>$B$3$3?tG/$N(B Linux $B$H(B Linus $B$5$s$r<h$j4,$/>u67$NJQ2=$r(B
$BJ*8l$C$F$$$k$h$&$G$9!#(B
<P>
<P>
<P>
<HR>
<H2><A NAME="s2">2.</A> <A HREF="#toc2">$B%7%9%F%`$N5/F0!'35MW(B</A></H2>
<P>$B$3$3$G$O%7%9%F%`$NEE8;(B ON $B$+$i(B /sbin/init $B$,5/F0$5$l$k$^$G$N(B
$BN.$l$rBg$^$+$K@bL@$7$^$9!#(B
<P>
<H2><A NAME="ss2.1">2.1 $B%+!<%M%k$N%m!<%I(B</A>
</H2>
<P>PC/AT $B8_495!$G$O%^%6!<%\!<%I$N(B BIOS $B$,<B9T$9$k%V!<%H%7!<%1%s%9$K$h$C$F(B
$B5/F0%G%#%9%/$N%V!<%H%;%/%?$K=q$-9~$^$l$F$$$k%3!<%I$rFCDj$N%a%b%j!<0LCV(B
$B$X%m!<%I$7!"$=$N%3!<%I$r<B9T(B ($B%m!<%I$7$?%3!<%I$N3+;O0LCV$X(B jump) $B$7$^$9!#(B
<P>($B!VFCDj$N%a%b%j!<0LCV!W$H$O(B segment 0h / address 7C00h $B$^$?$O(B
[0000:7C00] $B$G$9$,!"(BLinux $B%+!<%M%k$NCf$G$O(B offset $B$,(B 0 $B$+$i(B
$B;O$a$i$l$k$h$&$K(B segment $B$r(B 7C0 $B$K$7$F$$$k$i$7$$$H$$$&>pJs$r(B
$BD:$-$^$7$?!#(B)
<P>PC $B>e$GMxMQ$5$l$k3F(B OS $B$O!"$3$N(B BIOS $B$K$h$k%V!<%H$rA0Ds$H$7$F!"(B
$B:G=i$KFI9~$^$l$k%3!<%I$+$i;O$^$C$F=g$K<+J,$h$jBg$-$$%3!<%I$r(B
$B%m!<%I$7!":G=*E*$KI,MW$J%3!<%I$r$9$Y$F%a%b%j!<$KFI$_9~$s$G(B
$B<B9T$r3+;O$9$k$H$$$&=hM}$r9T$J$C$F$$$^$9!#(B
<P>$B$3$N0lO"$NF0:n$r0lHL$K%V!<%H%9%H%i%C%W!"$H8F$S$^$9!#(B
$B%V!<%H$O(B boot ($BD97$(B)$B!"%9%H%i%C%W$O(B strap ($B3WI3(B) $B$N$3$H$G!"(B
$B<+J,$,Mz$$$F$$$kD97$$NI3$r<+J,$G0z$CD%$C$FBN$r;}$A>e$2$h$&$H$9$k$3$H$K(B
$BNc$($F$$$^$9!#(B
<P>$B$J$*!V(BBootstrap$B!W$K$D$$$F$N2r@b$,(B
<A HREF="http://www.oreilly.com/reference/dictionary/terms/B/Bootstrap.htm">http://www.oreilly.com/reference/dictionary/terms/B/Bootstrap.htm</A><P>$B$K$"$j$^$9$N$G!"6=L#$N$"$kJ}$OD4$Y$F$_$k$3$H$r$*4+$a$7$^$9!#(B
$B$J$*$3$N(B Web $B%Z!<%8$K$O!V(B"Bootstrap" $B$N$3$H$r(B
IBM $BMQ8l$G(B IPL, Initial Program Load $B$H8F$V!W$H=q$+$l$F$$$^$9!#(B
<P>Linux $B%+!<%M%k$NFbIt$K$O!"(B($B$"$i$?$a$FJ9$/$H6C$+$l$k$+$b$7$l$^$;$s$,(B)
$B$9$/$J$/$H$b(B i386 $B7O$G$O%O!<%I%G%#%9%/$+$i<+A0$G%V!<%H$5$;$k$?$a$N(B
$B%3!<%I$OMQ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.S $B$K=hM}$r0\9T$7$^$9!#(B
<P>
<P>
<H2><A NAME="ss2.3">2.3 $B%+!<%M%kK\BN$NE83+(B</A>
</H2>
<P>arch/i386/boot/compressed/head.S $B$O$$$/$D$+$N%A%'%C%/$H(B
SMP $B$N>l9g$KI,MW$J=hM}$r<B9T$7$?8e$G!"F1$8%G%#%l%/%H%j$K(B
$BB8:_$9$k(B arch/i386/boot/compressed/misc.c $B$GDj5A$5$l$?(B
decompress_kernel() $B$H$$$&4X?t$r;H$C$F!"(B
gzip $B05=L$5$l$?>uBV$G%a%b%j!<$K%m!<%I$5$l$F$$$k%+!<%M%kK\BN$r(B
$BE83+$7$^$9!#(B
<P>$B%3%s%=!<%k%b%K%?!<$K(B
<P>
<BLOCKQUOTE><CODE>
Uncompressing Linux...
</CODE></BLOCKQUOTE>
<P>$B$H$$$&I=<($,=PNO$5$l$k$N$O!"$3$N(B decompress_kernel() $B$N<B9TCf$G$9!#(B
<P>$BE83+$,=*N;$9$k$H!"(Barch/i386/boot/compressed/head.S $B$O(B
$B?7$7$/%a%b%j!<>e$K8=$o$l$?K\Mh$N%+!<%M%k%3!<%I$X$H(B
$B=hM}$r0\9T$7$^$9!#(B
<P>
<P>
<H2><A NAME="ss2.4">2.4 $B%G%P%$%9%I%i%$%P!<$N@_Dj(B</A>
</H2>
<P>arch/i386/boot/compressed/head.S $B$K$h$C$FE83+$5$l$?(B
$B!VK\Mh$N%+!<%M%k%3!<%I!W$N@hF,$KB8:_$7$F$$$k$N$O(B
arch/i386/kernel/head.S $B$G$9!#(B
<P>$B$3$N%3!<%I$O<g$K(B CPU $B$K4X$9$k=i4|2=(B ($B%Z!<%8%F!<%V%k$N=`Hw$d(B
$B3d$j9~$_(B ($B%$%s%?%i%W%H(B) $B%F!<%V%k$N=i4|2=$J$I(B) $B$r<B9T$7!"(B
$B:G8e$K(B init/main.c $B$K$"$k(B start_kernel() $B$r<B9T$7$^$9!#(B
<P>$B$3$N(B start_kernel() $B$G$O$3$3$^$G$K%7%9%F%`$+$i=8$a$F$-$F!"(B
$B%a%b%j!<>e$NFCDj0LCV$KJ]B8$5$l$F$$$k$$$m$$$m$J>pJs$r;H$C$F!"(B
$B%a%b%j!<4IM}$d%?%9%/%9%1%8%e!<%k$K4XO"$9$k%+!<%M%kFb$N(B
$B3F%G%P%$%9%I%i%$%P!<$r@_Dj$7$F$$$-$^$9!#(B
$B$^$?%3%s%=!<%k=PNO$N@_Dj$r<B9T$9$k$N$b$3$N(B start_kernel() $B$G$9!#(B
<P>start_kernel() $B$OF1$8(B init/main.c $B$K$"$k(B init() $B$r(B
kernel_thread () $B$r;H$C$F5/F0$7$?8e!"$d$O$jF1$8(B init/main.c $B$K(B
$B$"$k(B cpu_idle() $B$r<B9T$7$^$9!#$3$N(B cpu_idle() $B$O(B
arch/i386/kernel/process.c $B$NCf$GDj5A$5$l$F$$$k(B sys_idle() $B$r(B
$B<B9T$9$kL58B%k!<%W$G$9!#(B
<P>$B$5$F!"(Bstart_kernel() $B$+$i(B kernel_thread() $B$r7PM3$7$F(B
$B5/F0$5$l$?(B init/main.c $B$GDj5A$5$l$F$$$k(B init() $B$G$9$,!"(B
$B:G=i$K(B lock_kernel() ($B$3$l$O(B SMP $B$N>l9g$K$N$_0UL#$,$"$j$^$9(B) $B$r(B
$B<B9T$7$?$"$H!"(Bdo_basic_setup() $B$r<B9T$7$^$9!#(B
<P>$B$3$N(B do_basic_setup() $B$b(B init/main.c $B$NCf$GDj5A$5$l$F$$$^$9$,!"(B
$B%P%9$N=i4|2=$d3F%G%P%$%9%I%i%$%P$N=i4|2=!"%U%!%$%k%7%9%F%`(B
$B4XO"%3!<%I$N=i4|2=!"%k!<%H%U%!%$%k%7%9%F%`$N%^%&%s%H$J$I$r(B
$B$3$3$G<B9T$7$F$$$^$9!#$A$J$_$K!"$3$l$i$N=hM}$O(B 2.0.36 $B$G$O(B
start_kernel() $B$NFbIt$G<B9T$5$l$F$$$^$7$?!#(B2.2.xx $B7O$K$J$C$F(B
$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
$B%+!<%M%kFb$G:G=i$K%m!<%I$5$l$k%3!<%I$O(B arch/i386/boot/bootsect.S $B$G$9!#(B
<P>$B$^$:$O!"$3$N%U%!%$%k$+$iD/$a$F$_$k$3$H$K$7$^$7$g$&!#(B
<P>
<H2><A NAME="ss3.1">3.1 bootsect.S - $BKAF,$N%3%a%s%H(B</A>
</H2>
<P>
<PRE>
!
! bootsect.s Copyright (C) 1991, 1992 Linus Torvalds
! modified by Drew Eckhardt
! modified by Bruce Evans (bde)
!
! bootsect.s is loaded at 0x7c00 by the bios-startup routines, and moves
! itself out of the way to address 0x90000, and jumps there.
!
! bde - should not jump blindly, there may be systems with only 512K low
! memory. Use int 0x12 to get the top of memory, etc.
!
! It then loads 'setup' directly after itself (0x90200), and the system
! at 0x10000, using BIOS interrupts.
!
! NOTE! currently system is at most (8*65536-4096) bytes long. This should
! be no problem, even in the future. I want to keep it simple. This 508 kB
! kernel size should be enough, especially as this doesn't contain the
! buffer cache as in minix (and especially now that the kernel is
! compressed :-)
!
! The loader has been made as simple as possible, and continuous
! read errors will result in a unbreakable loop. Reboot by hand. It
! loads pretty fast by getting whole tracks at a time whenever possible.
</PRE>
<P>$B>e$N!V35MW!W$K=q$$$?$3$H$,!"$7$C$+$jKAF,$K%3%a%s%H$H$7$F(B
$B5-:\$5$l$F$$$^$9$M!#(B
<P>$B!V(Bbootsect.s $B$O(B BIOS $B$N%V!<%H%7!<%1%s%9$K$h$C$F(B
$B%a%b%j!<>e$N%"%I%l%9(B 0x7c00 $B$K%m!<%I$5$l$k!#(B
$B<!$K(B bootsect.s $B$O<+J,<+?H$r%"%I%l%9(B 0x90000 $B$K0\F0$7!"(B
$B$=$7$F$=$3$X%8%c%s%W(B ($B@)8f$r0\9T(B) $B$9$k!#!W(B
<P>$B$R$H$DHt$P$7$F(B
<P>$B!V<!$K<+J,<+?H$ND>8e(B (0x90200) $B$K(B 'setup' $B$r!"$^$?%7%9%F%`$r(B
0x10000 $B$K(B BIOS $B%$%s%?%i%W%H$r;H$C$F%m!<%I$9$k!W(B
<P>$B$=$N<!$,:#$H$J$C$F$O;~Be$r46$8$k%3%a%s%H$G$9$M!#(B
<P>$B!VCm0U(B! $B8=:_!"%7%9%F%`$O:GBg$G$b(B (8*65536-4096) $B%P%$%H$^$G$ND9$5(B
$B$G$"$k!#$3$N@)8B$K$D$$$F$O!"Nc$(>-Mh$K$*$$$F$b!"LdBj$r@8$8$k$3$H$OL5$$!#(B
$BJ*;v$O$J$k$Y$/C1=c$K$7$F$*$-$?$$$b$N$@!#$3$N%+!<%M%k%5%$%:(B 508 kB $B$H(B
$B$$$&@)8B$O!"(Bminix $B$N$h$&$K%P%C%U%!!<%-%c%C%7%e$r4^$s$G$$$k$o$1$G$O(B
$B$J$$$3$H$r9M$($k$H(B ($B$=$7$F$^$?!"8=:_%+!<%M%k$O05=L$5$l$?>uBV$G%m!<%I(B
$B$5$l$F$$$k$3$H$r9M$($k$H(B :) $B$^$C$?$/==J,$JBg$-$5$H8@$($k$O$:$G$"$k!#!W(B
<P>$B<B:]$K$O?tG/A0$+$i4{$K$3$N!V(B508kB $B$NJI!W$O==J,$H$O8@$($J$/$J$C$F(B
$B$7$^$$!"(BbZimage $B$H$$$&H4$1F;$,MQ0U$5$l$F$$$^$9!#$7$+$7!"$3$N$?$a$K(B
$B!VJ*;v$O$J$k$Y$/C1=c$K!W$H$$$&(B Linus $B$N4uK>$+$i<B:]$N%3!<%I$,$d$d(B
$BN%$l$F$7$^$C$?$h$&$K46$8$i$l$^$9!#(B
<P>
<H2><A NAME="ss3.2">3.2 bootsect.S - $B%Q%i%a!<%?Dj5A(B</A>
</H2>
<P>$B$=$m$=$m!"%3!<%I$NCf?H$KF~$C$F$_$^$7$g$&!#(B
<P>
<PRE>
#include <linux/config.h> /* for CONFIG_ROOT_RDONLY */
#include <asm/boot.h>
.text
SETUPSECS = 4 ! default nr of setup-sectors
BOOTSEG = 0x07C0 ! original address of boot-sector
INITSEG = DEF_INITSEG ! we move boot here - out of the way
SETUPSEG = DEF_SETUPSEG ! setup starts here
SYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536).
SYSSIZE = DEF_SYSSIZE ! system size: number of 16-byte clicks
</PRE>
<P>$B:G=i$N9T!"(B<CODE>#include <linux/config.h></CODE> $B$O(B
include/linux/config.h $B$NDj5A$r;H$&!"$H$$$&$3$H$G$9!#(B
$B$G!"$3$N%X%C%@!<%U%!%$%k$NCf?H$O$3$&$J$C$F$^$9!#(B
<P>
<PRE>
#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H
#include <linux/autoconf.h>
#endif
</PRE>
<P>$B$3$l$@$1!#$3$l$O(B include/linux/autoconf.h $B$NDj5A$r;H$$$J$5$$!"$H(B
$B$$$&$3$H$G$9!#$G!"$3$N%U%!%$%k$rC5$7$F$_$k$H!"$"$j$^$;$s!#(B
<P>$B<B$O$3$N(B autoconf.h $B$O(B make config / menuconfig / xconfig $B$J$I$r(B
$B<B9T$7$F;O$a$F:n@.$5$l$k%U%!%$%k$G$"$C$F!"C1$K%"!<%+%$%V$rE83+$7$?(B
$B$@$1$G$OB8:_$7$J$$$b$N$G$9!#(B
<P>$B:#2s$O;~4V$NET9g$G!"$3$N%U%!%$%k$r:n$i$l$k<j=g$rDI$$$+$1$k$N$O(B
$B>JN,$7!"<!$N(B <CODE>#include <asm/boot.h></CODE> $B$rD4$Y$F$_$k(B
$B$3$H$K$7$^$9!#(B
<P>$B$3$A$i$O(B include/asm-i386/boot.h $B$,C5$7$F$$$k%U%!%$%k$G(B
<P>
<PRE>
#ifndef _LINUX_BOOT_H
#define _LINUX_BOOT_H
/* 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
/* Internal svga startup constants */
#define NORMAL_VGA 0xffff /* 80x25 mode */
#define EXTENDED_VGA 0xfffe /* 80x50 mode */
#define ASK_VGA 0xfffd /* ask for it at bootup */
#endif
</PRE>
<P>$B$H=q$+$l$F$$$^$9!#$3$N$"$?$j$b!"(B2.0.36 $B$HHf3S$7$FJQ99$5$l$?ItJ,$G$9$M!#(B
(2.0.36 $B$G$O$3$NDj5A$,(B include/linux/config.h $B$K$"$j$^$7$?(B)
<P>$B$5$F!"OC$r$b$H$N(B bootsect.S $B$KLa$7$^$9!#(B
<P>
<PRE>
.text
SETUPSECS = 4 ! default nr of setup-sectors
BOOTSEG = 0x07C0 ! original address of boot-sector
INITSEG = DEF_INITSEG ! we move boot here - out of the way
SETUPSEG = DEF_SETUPSEG ! setup starts here
SYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536).
SYSSIZE = DEF_SYSSIZE ! system size: number of 16-byte clicks
</PRE>
<P>$B$3$NItJ,$N:G=i$K$"$k(B ".text" $B$O!"%3%s%F%-%9%H$H$$$&0UL#$G(B
$B<B9T%3!<%I$N3+;O0LCV$r<($7$F$$$^$9!#(B
<P>$B:G=i!";d$O$3$3$+$i<!$N(B".globl _main" $B$^$G$O!VJQ?t!W$NDj5A$@$H(B
$B;W$C$F$$$?$N$G$9$,!"$=$&$G$O$J$/$F!"%"%;%s%V%k(B ($B5!3#8l$KK]Lu(B) $B$9$k:]$K?tCM$K(B
$BJQ49$5$l$F%3!<%I$KBeF~$5$l$k!VDj?tDj5A!W(B(C $B$N(B #define $B$GDj5A$5$l$k%^%/%m(B
$B$K;w$?$b$N(B) $B$H9M$($?$[$&$,NI$$$H65$o$j$^$7$?!#(B
<P>$B$3$3$G;2>H$5$l$F$$$k(B
<BLOCKQUOTE><CODE>
DEF_INITSEG, DEF_SETUPSEG, DEF_SYSSEG, DEF_SYSSIZE
</CODE></BLOCKQUOTE>
$B$O4{$K8+$F$-$?$h$&$K!"(Binclude/asm/boot.h $B$GDj5A$5$l$F$$$^$9!#(B
<P>$B$3$NItJ,$N2<$K$b!"$$$/$D$+Dj?t$NDj5A$,B3$$$F$$$^$9$,!">JN,$7$F(B
$B<!$K?J$_$^$9!#(B
<P>
<H2><A NAME="ss3.3">3.3 bootsect.S - $B<B:]$NF0:n(B</A>
</H2>
<P>$B<!$N(B ".globl _main" $B0J9_$+$i<B:]$KF0:n$9$k:]$K(B
$B;H$o$l$k%3!<%I$,;O$^$C$F$$$^$9!#(B
<P>
<PRE>
! ld86 requires an entry symbol. This may as well be the usual one.
.globl _main
_main:
#if 0 /* hook for debugger, harmless unless BIOS is fussy (old HP) */
int 3
#endif
mov ax,#BOOTSEG
mov ds,ax
mov ax,#INITSEG
mov es,ax
mov cx,#256
sub si,si
sub di,di
cld
rep
movsw
jmpi go,INITSEG
! ax and es already contain INITSEG
</PRE>
<P>$B$3$3$G(B "#BOOTSEG" $B$O(B BIOS $B$K$h$C$F(B bootsect.S $B$N(B
$B%3!<%I$,%m!<%I$5$l$?%"%I%l%9!"(B"#INITSEG" $B$O(B
bootsect.S $B$,<+J,<+?H$r%3%T!<$7$F=hM}$r0\$9(B($B%8%c%s%W$9$k(B)
$B%"%I%l%9$G$9!#$3$3$G$O(B "movsw" $B$^$G$N9T$G!V<+J,<+?H$N(B
$B%3%T!<!W$r<B9T$7!"(B"jmpi" $B$G(B "#INITSEG"
$B$K%3%T!<$5$l$?<+J,<+?H$N(B "go" $B%i%Y%k$N0LCV$X%8%c%s%W(B
$B$7$F$$$^$9!#(B
<P>$B$3$N$"$H$7$P$i$/%U%m%C%T!<%I%i%$%V$r$&$^$/F0:n$5$;$k$?$a$N=`Hw$,(B
$B9T$J$o$l$^$9!#$=$7$F<!$N(B "load_setup" $B$+$i(B setup.S $B$N(B
$B%3!<%I$r%m!<%I$7$F$$$-$^$9!#(B
<P>
<PRE>
load_setup:
xor ah,ah ! reset FDC
xor dl,dl
int 0x13
</PRE>
<P>$B:G=i$O%U%m%C%T!<%I%i%$%V%3%s%H%m!<%i$r%j%;%C%H$9$k$H$3$m$+$i;O$^$C$F(B
<P>
<PRE>
xor dx, dx ! drive 0, head 0
mov cl,#0x02 ! sector 2, track 0
mov bx,#0x0200 ! address = 512, in INITSEG
mov ah,#0x02 ! service 2, nr of sectors
mov al,setup_sects ! (assume all on head 0, track 0)
int 0x13 ! read it
jnc ok_load_setup ! ok - continue
</PRE>
<P>$B%I%i%$%V!"%X%C%I!"%;%/%?!<!"%H%i%C%/$J$I$N0LCV$r=i4|2=$7!"(B
$BFI$_=P$7%"%I%l%9$r;XDj$7$F(B "int 0x13" $B$N<B9T$K(B
$B$h$C$F(B BIOS $B$N%;%/%?!<FI$_9~$_5!G=$rMxMQ$7$F(B "setup.S"
$B$N%3!<%I$r%a%b%j!<>e$K%m!<%I$7$F$$$^$9!#%m!<%I@h$N%"%I%l%9$O(B
"INITSEG" $B$N%"%I%l%9(B 0x9000 $B$K(B 0x200 $B$r2C$($?(B
0x9200 $B$H$J$j$^$9!#(B
<P>setup.S $B$N%m!<%I$r40N;$9$k$H(B "Loading" $B$H$$$&(B
$B%a%C%;!<%8$rI=<($7$F!"<!$NCJ3,(B ($B05=L$5$l$?%7%9%F%`K\BN$N%m!<%I(B)
$B$X$H?J$_$^$9!#(B
<P>
<PRE>
got_sectors:
! Restore es
mov ax,#INITSEG
mov es,ax
! Print some inane message
mov ah,#0x03 ! read cursor pos
xor bh,bh
int 0x10
mov cx,#9
mov bx,#0x0007 ! page 0, attribute 7 (normal)
mov bp,#msg1
mov ax,#0x1301 ! write string, move cursor
int 0x10
! ok, we've written the message, now
! we want to load the system (at 0x10000)
mov ax,#SYSSEG
mov es,ax ! segment of 0x010000
call read_it
call kill_motor
call print_nl
</PRE>
<P>$B>e$N(B "int 0x10" $B$O2hLLI=<(@)8f$N(B BIOS $B%$%s%?%i%W%H(B
$B$G$"$j!"(B "#msg1" $B$O(B bootsect.S $B$N=*$j$N$[$&$G(B
<P>
<PRE>
msg1:
.byte 13,10
.ascii "Loading"
</PRE>
<P>$B$H$7$FDj5A$5$l$F$$$^$9!#$3$3$G(B ".byte" $B$N(B
13 $B$O(B <CODE>CR</CODE> ($B%-%c%j%C%8%j%?!<%s(B)$B!"(B
10 $B$O(B<CODE>LF</CODE> ($B%i%$%s%U%#!<%I(B) $B$G$9!#(B
<P>$B$5$F!"%7%9%F%`K\BN$N%m!<%I$G$9$,!"$3$l$O>e$K=q$+$l$?(B
"call read_it"$B$K$h$C$F8F$S=P$5$l$k(B
<P>
<PRE>
! This routine loads the system at address 0x10000, making sure
! no 64kB boundaries are crossed. We try to load it as fast as
! possible, loading whole tracks whenever we can.
!
! in: es - starting address segment (normally 0x1000)
!
sread: .word 0 ! sectors read of current track
head: .word 0 ! current head
track: .word 0 ! current track
read_it:
</PRE>
<P>$B0J9_$NItJ,!"FC$K<!$N(B rp_read: $B$+$i;O$^$kItJ,$K$h$j$^$9!#(B
<P>
<PRE>
rp_read:
#ifdef __BIG_KERNEL__
#define CALL_HIGHLOAD_KLUDGE .word 0x1eff,0x220 ! call far * bootsect_kludge
! NOTE: as86 can't assemble this
CALL_HIGHLOAD_KLUDGE ! this is within setup.S
#else
mov ax,es
sub ax,#SYSSEG
#endif
cmp ax,syssize ! have we loaded all yet?
jbe ok1_read
ret
</PRE>
<P>$B$3$3$G(B "CALL_HIGHLOAD_KLUDGE" $B$O%3%a%s%H$K$"$k$h$&$K(B
$B$A$g$&$I$3$NItJ,$N$9$3$7A0$K%m!<%I$7$?(B setup.S $B$N%3!<%I$K4^$^$l$F(B
$B$$$k(B bootsect_kludge $B$KBP1~$7$?%"%I%l%9$+$i;O$^$k%3!<%I$G$9!#(B
setup.S $B$NCf$G$O(B "bootsect_kludge" $B$O<!$N$h$&$K(B
$BDj5A$5$l$F$$$^$9!#(B
<P>
<PRE>
bootsect_kludge:
.word bootsect_helper,SETUPSEG
</PRE>
<P>$B$^$?$3$N(B bootsect_helper $B$O(B setup.S $B$NCf$G0J2<$N$h$&$K(B
$BDj5A$5$l$F$$$^$9!#(B
<P>
<PRE>
! This routine only gets called, if we get loaded by the simple
! bootsect loader _and_ have a bzImage to load.
! Because there is no place left in the 512 bytes of the boot sector,
! we must emigrate to code space here.
!
bootsect_helper:
</PRE>
<P>$B%3%a%s%H$K$7$C$+$j!V(Bbootsect.S $B$K$h$C$F(B bzImage $B7A<0$N%+!<%M%k$,(B
$B%m!<%I$5$l$?>l9g$K8B$C$F<B9T$5$l$k!"$H=q$$$F$"$j$^$9$M!#(B
<P>$B$5$F!"(Bbootsect.S $B$NCf$G!"<B:]$K%U%m%C%T!<$+$i%7%9%F%`$r(B
$BFI$s$G$$$k$N$O!"0J2<$NItJ,$G$9!#(B
<P>
<PRE>
read_track:
pusha
pusha
mov ax, #0xe2e ! loading... message 2e = .
mov bx, #7
int 0x10
popa
</PRE>
<P>$B$3$3$N(B 0x10 $B$O2hLLI=<($r9T$J$&(B BIOS $B%$%s%?%i%W%H%3!<%k$G$9!#(B
$B4{$K(B setup.S $B$N%3!<%I$r%m!<%I$7$?;~E@$G!"(B "Loading"
$B$H$$$&%a%C%;!<%8$,2hLL$K=PNO$5$l$F$$$k$O$:$J$N$G!"$3$3$G$O(B
"." $B$N=PNO$N$_$r9T$J$C$F$$$^$9!#(B
<P>
<PRE>
mov dx,track
mov cx,sread
inc cx
mov ch,dl
mov dx,head
mov dh,dl
and dx,#0x0100
mov ah,#2
push dx ! save for error dump
push cx
push bx
push ax
int 0x13
jc bad_rt
add sp, #8
popa
ret
</PRE>
<P>BIOS $B%$%s%?%i%W%H(B "Int 0x13" $B$N<B9T$K$h$C$F(B
$B%U%m%C%T!<>e$N%7%9%F%`%U%!%$%k$,%a%b%j!<$K%m!<%I$5$l$F$$$-$^$9!#(B
<P>$B%m!<%I$,40N;$9$k$H!"@h$K0zMQ$7$?(B
<P>
<PRE>
call read_it
call kill_motor
call print_nl
</PRE>
<P>$B$r=g$K<B9T$7$F%U%m%C%T!<%I%i%$%V$N%b!<%?!<$r(B OFF $B$K$7!"(B
$B2hLL$K2~9T%3!<%I(B (NewLine) $B$r=PNO$7$^$9!#(B
<P>$B$=$N8e!"%k!<%H%G%P%$%9$N%A%'%C%/$r7P$F(B
<P>
<PRE>
! after that (everything loaded), we jump to
! the setup-routine loaded directly after
! the bootblock:
jmpi 0,SETUPSEG
</PRE>
<P>"SETUPSEG" $B$KB8:_$9$k(B setup.S $B$N%3!<%I$K(B
$B%8%c%s%W$7$^$9!#(B
<P>
<P>
<HR>
<H2><A NAME="s4">4.</A> <A HREF="#toc4">BIOS $B>pJs$N<hF@(B</A></H2>
<P>$B$5$F!"(Barch/i386/boot/setup.S $B$K?J$_$^$7$g$&!#(B
<P>$B$^$:$O%U%!%$%kKAF,$N%3%a%s%H$+$i!#(B
<P>
<PRE>
!
! setup.S Copyright (C) 1991, 1992 Linus Torvalds
!
! setup.s is responsible for getting the system data from the BIOS,
! and putting them into the appropriate places in system memory.
! both setup.s and system has been loaded by the bootblock.
!
! This code asks the bios for memory/disk/other parameters, and
! puts them in a "safe" place: 0x90000-0x901FF, ie where the
! boot-block used to be. It is then up to the protected mode
! system to read them from there before the area is overwritten
! for buffer-blocks.
!
! Move PS/2 aux init code to psaux.c
! (troyer@saifr00.cfsat.Honeywell.COM) 03Oct92
!
! some changes and additional features by Christoph Niemann,
! March 1993/June 1994 (Christoph.Niemann@linux.org)
!
! add APM BIOS checking by Stephen Rothwell, May 1994
! (Stephen.Rothwell@canb.auug.org.au)
!
! High load stuff, initrd support and position independency
! by Hans Lermen & Werner Almesberger, February 1996
! <lermen@elserv.ffm.fgan.de>, <almesber@lrc.epfl.ch>
!
! Video handling moved to video.S by Martin Mares, March 1996
! <mj@k332.feld.cvut.cz>
!
! Extended memory detection scheme retwiddled by orc@pell.chi.il.us (david
! parsons) to avoid loadlin confusion, July 1997
</PRE>
<P>$B$I$&$G$7$g$&(B ? $B$b$&$3$N%3%a%s%H$@$1FI$a$P!"$3$N%U%!%$%k$K(B
$B=q$+$l$F$$$k%3!<%I$,2?$r$7$F$$$k$N$+!"$@$$$?$$$o$+$C$?$h$&$J(B
$B5$$K$J$j$^$;$s$+(B ?
<P>$BMW$9$k$K!V(Bsetup.S $B$O(B BIOS $B$+$i%7%9%F%`$K4X$9$k%G!<%?$r<hF@$7!"(B
$B%7%9%F%`%a%b%j!<$NE,@Z$J>l=j$KJ]4I$9$k$?$a$N%3!<%I$G$"$k!#!W(B
$B$H$$$&$3$H$G$9!#(B
<P>$B$^$"!"$3$l$@$1$G$O$"$s$^$j$J$N$G!"$A$g$C$HLLGr$=$&$J$H$3$m$r(B
$BH4$-=P$7$F$_$k$H!"(B
<P>
<PRE>
! SETUP-header, must start at CS:2 (old 0x9020:2)
!
.ascii "HdrS" ! Signature for SETUP-header
.word 0x0201 ! Version number of header format
! (must be >= 0x0105
! else old loadlin-1.5 will fail)
realmode_swtch: .word 0,0 ! default_switch,SETUPSEG
start_sys_seg: .word SYSSEG
.word kernel_version ! pointing to kernel version string
! note: above part of header is compatible with loadlin-1.5 (header v1.5),
! must not change it
type_of_loader: .byte 0 ! = 0, old one (LILO, Loadlin,
! Bootlin, SYSLX, bootsect...)
! else it is set by the loader:
! 0xTV: T=0 for LILO
! T=1 for Loadlin
! T=2 for bootsect-loader
! T=3 for SYSLX
! T=4 for ETHERBOOT
! V = version
loadflags: ! flags, unused bits must be zero (RFU)
LOADED_HIGH = 1 ! bit within loadflags,
! if set, then the kernel is loaded high
CAN_USE_HEAP = 0x80 ! if set, the loader also has set heap_end_ptr
! to tell how much space behind setup.S
| can be used for heap purposes.
! Only the loader knows what is free!
#ifndef __BIG_KERNEL__
.byte 0x00
#else
.byte LOADED_HIGH
#endif
</PRE>
<P>"type_of_loader" $B$N$H$3$m$G(B
<CODE> LILO, Loadlin, bootsect-loader, SYSLX, ETHERBOOT</CODE>
$B$,%j%9%H$5$l$F$$$^$9!#(B
Linux $B$N%+!<%M%k%m!<%@!<$b7k9=<oN`$,$"$j$^$9$M!#(B
<P>$B$3$N:G=i$NItJ,$G$O%m!<%@!<$N%A%'%C%/$r$7$F$$$^$9!#8E$$%m!<%@!<$G$O(B
"big kernel" $B$r$&$^$/07$($J$$$?$a!"$=$&$$$&>l9g$K$O(B
$B7Y9p$rH/$7$F;_$k$h$&$K$J$C$F$$$^$9!#(B
<P>$B%m!<%@!<$N%A%'%C%/$,=*$o$k$H!"%a%b%j!<%5%$%:$N%A%'%C%/$,(B
$B;O$^$j$^$9!#(B
<P>
<PRE>
loader_ok:
! Get memory size (extended mem, kB)
#ifndef STANDARD_MEMORY_BIOS_CALL
push ebx
xor ebx,ebx ! preload new memory slot with 0k
mov [0x1e0], ebx
mov ax,#0xe801
int 0x15
jc oldstylemem
</PRE>
<P>"int 0x15" $B$H(B #0xe801 $B$rAH$_9g$o$;$F(B
$B%a%b%j!<%5%$%:$r%A%'%C%/$7$F$$$^$9!#(B
<P>
<PRE>
! Memory size is in 1 k chunksizes, to avoid confusing loadlin.
! We store the 0xe801 memory size in a completely different place,
! because it will most likely be longer than 16 bits.
! (use 1e0 because that's what Larry Augustine uses in his
! alternative new memory detection scheme, and it's sensible
! to write everything into the same place.)
</PRE>
<P>$B<!$O%-!<%\!<%I%j%T!<%H%l!<%H$N@_Dj$G$9!#(B
<P>
<PRE>
! Set the keyboard repeat rate to the max
mov ax,#0x0305
xor bx,bx ! clear bx
int 0x16
</PRE>
<P>$B$=$7$F%3%s%=!<%kMQ%S%G%*%+!<%I$N%A%'%C%/!#(B
<P>
<PRE>
! Check for video adapter and its parameters and allow the
! user to browse video modes.
call video ! NOTE: we need DS pointing to boot sector
</PRE>
<P>$B$3$N(B "call video" $B$G8F$S=P$5$l$F$$$k$N$O(B
$BF1$8%G%#%l%/%H%j$K$"$k(B arch/i386/boot/video.S $B$NCf$G(B
$BDj5A$5$l$F$$$k4X?t$G$9!#(B
<P>$B0J8e!"3F%O!<%I%&%'%"$r%A%'%C%/$7$F$$$kItJ,$G!"%3%a%s%H$@$1(B
$B=&$C$F$$$/$H(B ( [] $BFb$O%3%a%s%H$rOBLu$7$?$b$N$G$9(B)
<P>
<PRE>
! Get hd0 data
[hd0 $B$N%G!<%?$r<hF@(B]
! Get hd1 data
[hd1 $B$N%G!<%?$r<hF@(B]
! Check that there IS a hd1 :-)
[hd1 $B$,@\B3$5$l$F$$$k$+$I$&$+%A%'%C%/(B]
! check for Micro Channel (MCA) bus
[$B%^%$%/%m%A%c%s%M%k(B (MCA) $B%P%9$r%A%'%C%/(B]
! Check for PS/2 pointing device
[PS/2 $B$N%]%$%s%?AuCV(B ($B%^%&%9!"%Q%C%I!"%9%F%#%C%/$J$I(B) $B$r%A%'%C%/(B]
#ifdef CONFIG_APM
! check for APM BIOS
[APM BIOS $B$r%A%'%C%/(B]
!
! Redo the installation check as the 32 bit connect
! modifies the flags returned on some BIOSs
!
[32bit $B$G@\B3$9$k$H%U%i%C%0$NCM$rJQ99$9$k(B BIOS $B$,$"$k$N$G(B
$B%$%s%9%H%l!<%7%g%s%A%'%C%/$r:FEY<B9T(B]
done_apm_bios:
#endif
</PRE>
<P>$B$J$I$N=hM}$,$"$j$^$9!#(B
<P>$B$3$N8e!"(B
<P>
<PRE>
! Now we want to move to protected mode ...
[$B$$$h$$$h%W%m%F%/%H%b!<%I$X0\9T$9$k;~$@!"!"!"(B]
! we get the code32 start address and modify the below 'jmpi'
! (loader may have changed it)
[code32 $B$N3+;O%"%I%l%9$r<hF@$7$F2<$N(B "jmpi" $B$rJQ99$9$k(B
($B%m!<%@!<$K$h$C$FJQ99$5$l$F$$$k$+$b$7$l$J$$$N$G(B)]
! Now we move the system to its rightful place
! ...but we check, if we have a big-kernel.
! in this case we *must* not move it ...
[$B$5$"!"%7%9%F%`$r@55,$N>l=j$X0\F0$7$h$&!"!"!"$7$+$7$=$NA0$K(B
big-kernel $B$r;H$C$F$$$k$+$I$&$+%A%'%C%/$7$J$$$H%@%a$@!#(B
$B$b$7(B big-kernel $B$r;H$C$F$$$k$J$i!">l=j$r0\F0(B *$B$7$F$O$J$i$J$$(B* ]
! then we load the segment descriptors
[$B<!$K%;%0%a%s%H%G%9%/%j%W%?(B ($B%"%I%l%9$r<($9>pJs(B) $B$r%m!<%I$9$k(B]
! If we have our code not at 0x90000, we need to move it there now.
! We also then need to move the parameters behind it (command line)
! Because we would overwrite the code on the current IP, we move
! it in two steps, jumping high after the first one.
[$B$b$7%+!<%M%k%3!<%I$,(B 0x90000 $B$KL5$+$C$?$i!"$3$N;~E@$G$=$3$X0\F0$9$k(B
$BI,MW$,$"$k!#$^$?!"$3$N8e$N%Q%i%a!<%?(B ($B%3%^%s%I%i%$%s%Q%i%a!<%?(B) $B$b(B
$B$"$o$;$F0\F0$7$J$1$l$P$J$i$J$$!#(B
$B$3$NF0:n$O8=:_$N(B IP $B$K$"$k%3!<%I$r>e=q$-$7$F$7$^$&$?$a!"0\F0$O(B
2 $BCJ3,$KJ,$1$F9T$o$l$k!#:G=i$N0\F0$N8e$G(B high $BNN0h$X0\9T$9$k$N$@!#(B]
! that was painless, now we enable A20
[$B$3$l$O$?$$$7$?$3$H$8$c$J$$!#$5$"!"(BA20 $B$rM-8z$K$7$h$&!#(B]
! wait until a20 really *is* enabled; it can take a fair amount of
! time on certain systems; Toshiba Tecras are known to have this
! problem. The memory location used here is the int 0x1f vector,
! which should be safe to use; any *unused* memory location < 0xfff0
! should work here.
[a20 $B$,!VK\Ev$K!WM-8z$K$J$k$^$GBT$H$&!#$"$k<o$N%7%9%F%`$G$O$3$N$?$a$K(B
$B$($i$/D9$$;~4V$,I,MW$J$s$@!#(B Toshiba $B$N(B Tecra $B%7%j!<%:$O$3$NLdBj$r(B
$B;}$C$F$$$k$3$H$GCN$i$l$F$$$k!#$3$3$G;H$o$l$F$$$k%a%b%j!<$N0LCV$O(B
$B%Y%/%?!<(B int 0x1f $B$G!";H$C$F$bBg>fIW$J$O$:!#$3$N;~E@$G$O(B 0xfff0 $B$h$j(B
$B2<$N;H$o$l$F$$$J$$%a%b%j!<0LCV$J$i$I$3$G$bMxMQ$G$-$k$O$:$J$s$@!#(B]
</PRE>
<P>$B$H!"(B32bit protect mode $B$X$N0\9T$N=`Hw$r?J$a$F$$$-$^$9!#(B
<P>$B:G8e$N(B "wait until a20 really ..." $B$O(B 2.0.xx $B7O(B
$B%+!<%M%k$G(B bzImage $B$K$9$k$H5/F0$G$-$J$+$C$?El<G$N(B TECRA $B$d(B
Portege $B$J$I$r;O$a$H$7$?%N!<%H(B PC $B$J$I$X$NBP:v$G$9$M!#(B
2.2 $B7O%+!<%M%k$G$O(B TECRA $B$J$I$N%N!<%H(B PC $B$G$b0B?4$7$F(B bzImage $B$r(B
$BMxMQ$G$-$k$h$&$K$J$C$?$i$7$$$H$$$&OC$rJ9$$$?$3$H$,$"$j$^$9!#(B
<P>$BB3$$$F!"%$%s%?%i%W%H4X78$N=hM}!#(B
<P>
<PRE>
! make sure any possible coprocessor is properly reset..
[$B@\B3$5$l$F$$$k2DG=@-$N$"$k$9$Y$F$N%3%W%m%;%C%5$,$A$c$s$H%j%;%C%H$5$l$F(B
$B$$$k$3$H$r3NG'$7$h$&!"!"!"(B]
! well, that went ok, I hope. Now we have to reprogram the interrupts :-(
! we put them right after the intel-reserved hardware interrupts, at
! int 0x20-0x2F. There they won't mess up anything. Sadly IBM really
! messed this up with the original PC, and they haven't been able to
! rectify it afterwards. Thus the bios puts interrupts at 0x08-0x0f,
! which is used for the internal hardware interrupts as well. We just
! have to reprogram the 8259's, and it isn't fun.
[$B$"$"!"$3$3$^$G$O$?$V$s$&$^$/$$$C$?!#$=$&;W$&$h!#$5$F!"$3$l$+$i(B
$B3d$j9~$_$r:F@_Dj(B (reprogram) $B$7$J$-$c$$$1$J$$!#(B($B%&%s%6%j(B)
Linux $B$G$O3d$j9~$_$r(B Intel $B$,M=Ls$7$?%O!<%I%&%'%"3d$j9~$_$N$9$08e!"(B
int 0x20-0x2F $B$K2!$79~$`$s$@!#$3$3$J$i2?$b<YKb$5$l$J$$$+$i$M!#(B
$BHa$7$$$3$H$K!"(BIBM $B$O:G=i$N(B PC $B$r:n$k:]!"3d$j9~$_$N@_Dj$r%a%A%c%/%A%c$K(B
$B$7$F$7$^$C$?!#$=$7$F!"7k6IH`$i$O$3$l$rD>$9$3$H$,$G$-$J$+$C$?$s$@!#(B
$B$@$+$i!"(BBIOS $B$N3d$j9~$_$O%O!<%I%&%'%"$NFbIt3d$j9~$_$,;H$C$F$$$k$N$H(B
$BF1$8NN0h!"(B0x08-0x0f $B$K$"$k$s$@$h!#$H$$$&$o$1$G!"KM$i$O$3$l$+$i(B 8259 $B$r(B
$B%W%m%0%i%`$7D>$5$J$$$H$$$1$J$$!#$=$7$F$3$$$D$OA4A33Z$7$/$J$$$s$@!#(B]
! Well, that certainly wasn't fun :-(. Hopefully it works, and we don't
! need no steenking BIOS anyway (except for the initial loading :-).
! The BIOS routine wants lots of unnecessary data, and it's less
! "interesting" anyway. This is how REAL programmers do it.
[$B$&!<$s!"$3$$$D$O$?$7$+$K$A$C$H$bLLGr$/$J$$(B ($B$"$"Hh$l$?(B)$B!#(B
$B$H$K$+$/!"$3$l$G$&$^$/F0$$$F$/$l$k$H;W$&!#$=$l$K!"$I$C$A$K$7$F$b(B
$B$b$&(B BIOS $B$r$$$8$/$kI,MW$OL5$$$s$@!#(B($B:G=i$N%m!<%I0J30$O!#$o$+$k$h$M(B)
BIOS $B%k!<%A%s$O$d$?$i$H$?$/$5$s$NITMW$J%G!<%?$rM_$7$,$k$7!"$3$$$D$O(B
$BA4A3(B "$B$*$b$7$m$$(B" $B$3$H$8$c$J$$!#!VK\J*$N!W%W%m%0%i%^$J$i$3$&$9$k$5!#(B]
! Well, now's the time to actually move into protected mode. To make
! things as simple as possible, we do no register set-up or anything,
! we let the GNU-compiled 32-bit programs do that. We just jump to
! absolute address 0x1000 (or the loader supplied one),
! in 32-bit protected mode.
[$B$5$F!":#EY$3$=K\Ev$K%W%m%F%/%H%b!<%I$X0\9T$9$k;~$@!#$G$-$k$@$1J*;v$r(B
$BC1=c$KJ]$D$?$a$K!"%l%8%9%?!<@_Dj$H$+$=$&$$$C$?$b$N$O2?$b$7$J$$!#(B
$B$3$3$G$O(B GNU $B$N%D!<%k$G%3%s%Q%$%k$5$l$?(B 32-bit $B$N%W%m%0%i%`$K$=$l$r(B
$B$d$i$;$k$s$@!#$?$@C1$K(B 32-bit $B$N%W%m%F%/%H%b!<%I$G@dBP%"%I%l%9(B 0x1000
($B%m!<%@!<$,;XDj$7$?>l=j(B) $B$X%8%c%s%W$9$k$@$1$@$h!#(B]
! Note that the short jump isn't strictly needed, although there are
! reasons why it might be a good idea. It won't hurt in any case.
[$B$3$3$G(B short jump $B$,$I$&$7$F$bI,MW$C$F$o$1$8$c$J$$$3$H$KCm0U!#(B
$B$?$@!"$3$&$7$F$*$$$?$[$&$,$$$$M}M3$b$$$/$D$+$"$k$s$@!#$=$l$K(B
$B$3$&$7$?$+$i$C$F2?$+LdBj$,5/$-$k$C$F$3$H$b$J$$$7$M!#(B]
</PRE>
<P>$B$I$&$d$i(B Linus $B$5$s$O:G=i$K3+H/$r;O$a$?:"!"$3$N$"$?$j$N=hM}$K(B
$BAjEv6lO+$7$?$i$7$/!"(B"Sadly IBM messed this up" $B$H$+(B
"and it isn't fun." $B$^$?(B
"Well, that certainly wasn't fan <CODE>:-(</CODE>."
$B$J$s$F$N$b$"$j$^$9!#0lJ}$G!"<+J,$N5s$2$?@.2L$K$O$=$l$J$j$K0&Ce$b(B
$B;}$C$F$$$k$h$&$G!"(B"This is how REAL programmers do it."
$B$J$I$H=q$$$F$"$C$?$j$b$7$^$9!#(B
<P>
<A HREF="http://www.linux.or.jp/JF/">JF</A>
$B$N;qNA$K(B "Linux HISTORY" $B$H$$$&J8=q$,$"$j$^$9$,!"(B
$B$=$NCf$K$3$s$J0l@a$,$"$j$^$9!#(B
<P>
<BLOCKQUOTE>
> 1) $B%+!<%M%k$r:n$C$F$$$k$H$-$K$O!"(B
$B$@$$$?$$$I$&$d$C$F%G%P%C%0$7$^$9$+(B ?
</BLOCKQUOTE>
<P>
<BLOCKQUOTE>
$B;H$C$F$$$k%^%7%s$H!":n6H$N?J$_6q9g$K$h$j$^$9!#(B
$B$b$C$H%7%s%W%k$J%7%9%F%`$J$i$?$$$F$$%;%C%H%"%C%W$O$b$C$H4JC1$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z!<%8%s%0!"%?%$%^3d$j9~$_!"C1=c$J%?%9%/%9%$%C%A%c!"%;%0%a%s%H$N%F%9%H(B)
$B$r:n$k$H$$$&$3$H$r$7$J$$$G:Q$`$h$&$K$J$j$^$7$?!#(B
</BLOCKQUOTE>
<P>$B$3$N$"$?$j$NOC$rFI$`$H!"(Bsetup.S $B$N%$%s%?%i%W%H4X78$N=hM}$d(B
$B%W%m%F%/%H%b!<%I$X$N0\9T$K4X$9$k=hM}$K$"$k%3%a%s%H$NGX7J$,(B
$B2?$H$J$/$o$+$k$h$&$J5$$,$7$F$-$^$;$s$+(B ?
<P>$B$J$*!"(Bsetup.S $B$N=hM}$O:G8e$K%+!<%M%kK\BN$N%"%I%l%9$X(B
$B%8%c%s%W$7$F=*N;$7$^$9!#(B
<P>
<PRE>
! NOTE: For high loaded big kernels we need a
! jmpi 0x100000,__KERNEL_CS
[$BCm0U(B: high $BNN0h$K%m!<%I$5$l$?(B big $B%+!<%M%k$N>l9g!"$3$3$G(B
"jmpi 0x100000,__KERNEL_CS" $B$r<B9T$9$kI,MW$,$"$k!#(B]
! but we yet haven't reloaded the CS register, so the default size
! of the target offset still is 16 bit.
! However, using an operant prefix (0x66), the CPU will properly
! take our 48 bit far pointer. (INTeL 80386 Programmer's Reference
! Manual, Mixing 16-bit and 32-bit code, page 16-6)
[$B$G$b$3$N;~E@$G$O$^$@(B CS $B%l%8%9%?!<$r:F%m!<%I$7$F$$$J$$$+$i!"(B
$B%?!<%2%C%H%*%U%;%C%H$N%G%U%)%k%H%5%$%:$O$^$@(B 16 bit $B$J$s$@!#(B
$B$H$3$m$,!"%*%Z%i%s%H%W%l%U%#%C%/%9(B (0x66) $B$r;H$($P!"(BCPU $B$O(B
$B$&$^$$$3$H(B 48 bit $B$N(B far $B%]%$%s%?$r07$C$F$/$l$k!#(B
(INTeL 80386 $B%W%m%0%i%^!<%:%l%U%!%l%s%9%^%K%e%"%k!"(B
16-bit $B$H(B 32-bit $B$N%3!<%I$N:.MQ!"%Z!<%8(B 16-6)]
db 0x66,0xea ! prefix + jmpi-opcode
code32: dd 0x1000 ! will be set to 0x100000 for big kernels
dw __KERNEL_CS
</PRE>
<P>
<P>
<HR>
<H2><A NAME="s5">5.</A> <A HREF="#toc5">$B%+!<%M%kK\BN$NE83+(B</A></H2>
<P>$B$5$F(B arch/i386/boot/setup.S $B$+$i=hM}$r0z$-7Q$$$@!V%+!<%M%kK\BN!W$G$9$,!"(B
$B<B$O$^$@$=$N<gMWItJ,$O05=L$5$l$?>uBV$G%a%b%j!<Cf$KCV$+$l$F$$$^$9!#(B
<P>$B<B:]$K%+!<%M%k$,F0:n$r;O$a$kA0$K!"$^$:$3$N05=L$5$l$?%+!<%M%k$r(B
$BI|85$7$J$1$l$P$$$1$^$;$s!#(B
<P>$B$3$l$O!"(Barch/i386/boot/compressed/head.S $B$K$"$k(B
<P>
<PRE>
/*
* Do the decompression, and jump to the new kernel..
*/
subl $16,%esp # place for structure on the stack
pushl %esp # address of structure as first arg
call SYMBOL_NAME(decompress_kernel)
orl %eax,%eax
jnz 3f
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
</PRE>
<P>$B$K$h$C$F<B9T$5$l$^$9!#$J$*$3$N(B decompress_kernel $B$OF1$8%G%#%l%/%H%j(B
$B$K$"$k(B arch/i386/boot/compress/misc.c $B$NCf$G(B
<P>
<PRE>
int decompress_kernel(struct moveparams *mv)
{
if (SCREEN_INFO.orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
} else {
vidmem = (char *) 0xb8000;
vidport = 0x3d4;
}
lines = SCREEN_INFO.orig_video_lines;
cols = SCREEN_INFO.orig_video_cols;
if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
else setup_output_buffer_if_we_run_high(mv);
makecrc();
puts("Uncompressing Linux... ");
gunzip();
puts("Ok, booting the kernel.\n");
if (high_loaded) close_output_buffer_if_we_run_high(mv);
return high_loaded;
}
</PRE>
<P>$B$H$7$FDj5A$5$l$F$*$j!"$5$i$K$3$NCf$G;H$o$l$F$$$k(B gunzip() $B$K(B
$B$D$$$F$O(B lib/infalte.c $B$NCf$GDj5A$5$l$F$$$^$9!#(B
<P>($B$3$l$G5/F0;~$K(B "Uncompressing Linux... " $B$H$$$&(B
$B%a%C%;!<%8$r=P$7$F$$$k$N$,2?=h$+!"$o$+$j$^$7$?$M!#(B)
<P>$B$5$F!"(Barch/i386/boot/compressed/head.S $B$NKAF,$K=q$+$l$F$$$k(B
$B%3%a%s%H$r0J2<$K0zMQ$7$F$_$^$7$g$&!#(B
<P>
<PRE>
/*
* linux/boot/head.S
*
* Copyright (C) 1991, 1992, 1993 Linus Torvalds
*/
/*
* head.S contains the 32-bit startup code.
*
</PRE>
<P>$B$*$d(B ? $B%U%!%$%kL>$,0c$$$^$9$M!#$3$l$O(B Linux $B%+!<%M%k$,8=:_$N$h$&$K(B
$BB?$/$N5!<o$K0\?"$5$l$F$$$J$+$C$?(B 1.x $B$N:"0JA0$N%U%!%$%kL>$G$7$g$&!#(B
$BEv;~$O8=:_$N$h$&$K%"!<%-%F%/%A%c$K0MB8$7$?ItJ,$,J,N%$5$l$F$$$^$;$s(B
$B$G$7$?$+$i!#(B
<P>$B$5$F!"05=L$5$l$F$$$?%+!<%M%kK\BN$bE83+$5$l$^$7$?!#<!$O$3$NCf$K(B
$B%8%c%s%W$7$F$$$-$^$9!#(Barch/i386/boot/compressed/head.S $B$N:G8e$O(B
$B<!$N$h$&$K$J$C$F$$$^$9!#(B
<P>
<PRE>
/*
* Do the decompression, and jump to the new kernel..
*/
subl $16,%esp # place for structure on the stack
pushl %esp # address of structure as first arg
call SYMBOL_NAME(decompress_kernel)
orl %eax,%eax
jnz 3f
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
/*
* We come here, if we were loaded high.
* We need to move the move-in-place routine down to 0x1000
* and then start it with the buffer addresses in registers,
* which we got from the stack.
*/
3:
movl $move_routine_start,%esi
movl $0x1000,%edi
movl $move_routine_end,%ecx
subl %esi,%ecx
cld
rep
movsb
popl %esi # discard the address
popl %esi # low_buffer_start
popl %ecx # lcount
popl %edx # high_buffer_start
popl %eax # hcount
movl $0x100000,%edi
cli # make sure we don't get interrupted
ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine
/*
* Routine (template) for moving the decompressed kernel in place,
* if we were high loaded. This _must_ PIC-code !
*/
move_routine_start:
rep
movsb
movl %edx,%esi
movl %eax,%ecx # NOTE: rep movsb won't move if %ecx == 0
rep
movsb
xorl %ebx,%ebx
/*
* Well, the kernel relies on %esp pointing into low mem,
* with the decompressor loaded high this is no longer true,
* so we set esp here.
*/
mov $0x90000,%esp
ljmp $(__KERNEL_CS), $0x100000
move_routine_end:
</PRE>
<P>"decompress_kernel" $B$N$9$08e$N(B "jnz" $B$G(B
"3:"$B$X%8%c%s%W$;$:$K!"(B
$B$=$N$^$^(B"ljmp $(__KERNEL_CS), $0x100000" $B$9$k>l9g(B
(zImage) $B$H!"$$$C$?$s(B "3:" $B$X%8%c%s%W$7$F(B
"move_routine_start:" $B$H(B "move_routine_end:"
$B$N4V$GE83+$7$?%+!<%M%k$N>l=j$N0\F0$r9T$J$C$F$+$i(B
"ljmp $(__KERNEL_CS), $0x100000" $B$9$k>l9g(B (bzImage) $B$,(B
$B$"$j$^$9!#(B
<P>
<P>
<HR>
<H2><A NAME="s6">6.</A> <A HREF="#toc6">$B%G%P%$%9%I%i%$%P!<$N@_Dj(B</A></H2>
<P>$B$5$F!"E83+$5$l$?%+!<%M%kK\BN$G:G=i$K<B9T$5$l$k$N$O!"(B
arch/i386/kernel/head.S $B$G$9!#Nc$K$h$C$FKAF,$N%3%a%s%H!#(B
<P>
<PRE>
/*
* linux/arch/i386/head.S -- the 32-bit startup code.
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Enhanced CPU detection and feature setting code by Mike Jagdis
* and Martin Mares, November 1997.
*/
</PRE>
<P>$B!V(B32bit $B%9%?!<%H%"%C%W!W!V6/2=$5$l$?(B CPU $B8!=P$H5!G=@_Dj!W$H$$$C$?(B
$BJ8$,JB$s$G$$$^$9!#(B
<P>$B$3$l$b%3%a%s%H$rDI$$$+$1$F$_$^$7$g$&!#(B
<P>
<PRE>
* References to members of the boot_cpu_data structure.
* swapper_pg_dir is the main page directory, address 0x00101000
* Set segments to known values
* New page tables may be in 4Mbyte page mode and may
* be using the global pages.
*
* NOTE! We have to correct for the fact that we're
* not yet offset PAGE_OFFSET..
* Setup paging (the tables are already set up, just switch them on)
* Clear BSS first so that there are no surprises...
* start system 32-bit setup. We need to re-do some of the things done
* in 16-bit mode for the "real" operations.
* Initialize eflags. Some BIOS's leave bits like NT set. This would
* confuse the debugger if this code is traced.
* XXX - best to initialize before switching to protected mode.
* Copy bootup parameters out of the way. First 2kB of
* _empty_zero_page is for boot parameters, second 2kB
* is for the command line.
/* check if it is 486 or 386. */
* XXX - this does a lot of unnecessary setup. Alignment checks don't
* apply at our cpl of 0 and the stack ought to be aligned already, and
* we don't need to preserve eflags.
</PRE>
<P>$B$I$&$d$i!"%a%b%j!<4IM}%F!<%V%k$d(B CPU $B$N%U%i%C%0@_Dj$J$I$r(B
$B9T$J$C$F$$$k$h$&$G$9!#(B
<P>$B$3$N(B head.S $B$O:G8e$K(B start_kernel $B$r<B9T$7$^$9!#(B
<P>
<PRE>
xorl %eax,%eax
lldt %ax
cld # gcc2 wants the direction flag cleared at all times
call SYMBOL_NAME(start_kernel)
L6:
jmp L6 # main should never return here, but
# just in case, we know what happens.
</PRE>
<P>head.S $B$+$i8F$S=P$5$l$k(B start_kernel $B$O(B init/main.c $B$K$"$j$^$9!#(B
$B$3$N%U%!%$%k$NKAF,$K$"$k%3%a%s%H$r0zMQ$7$^$9!#(B
<P>
<PRE>
/*
* linux/init/main.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* GK 2/5/95 - Changed to support mounting root fs via NFS
* Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96
* Moan early if gcc is old, avoiding bogus kernels - Paul Gortmaker, May '96
* Simplified starting of init: Michael A. Griffith <grif@acm.org>
*/
</PRE>
<P>$BB3$$$F!"(Bstart_kernel $B$N:G=i$NItJ,$G$9!#(B
<P>
<PRE>
asmlinkage void __init start_kernel(void)
{
char * command_line;
#ifdef __SMP__
static int boot_cpu = 1;
/* "current" has been set up, we need to load it now */
if (!boot_cpu)
initialize_secondary();
boot_cpu = 0;
#endif
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
printk(linux_banner);
setup_arch(&command_line, &memory_start, &memory_end);
memory_start = paging_init(memory_start,memory_end);
trap_init();
init_IRQ();
sched_init();
time_init();
parse_options(command_line);
</PRE>
<P>"linux_banner" $B$H$$$&$N$O(B init/version.c $B$KDj5A$,(B
$B$"$j$^$9!#Nc$($P(B ($B$3$l$O;d$,:#;H$C$F$$$k(B 2.0.36 $B$NNc$G$9$,(B)
<P>
<PRE>
Linux version 2.0.36 (root@pika) (gcc version 2.7.2.3) #1 Wed Feb 10 21:57:36 JST 1999
</PRE>
<P>$B$H$$$C$?46$8$N$b$N$G$9!#5/F0;~$K$3$N!V%P%J!<!W$r=P$7$F$$$k$N$O(B
init/main.c $B$N(B start_kernel $B$@$C$?$o$1$G$9$M!#(B
<P>$B<!$K(B "setup_arch" $B$G$9$,!"$3$l$O(B arch/i386/kernel/setup.c $B$G(B
$BDj5A$5$l$F$$$^$9!#FbMF$O;~4V$NET9g$G>JN,$7$^$9$,!"5/F0;~$K(B BIOS $B$+$i(B
$B<}=8$7$?>pJs$r(B ($BB>$N%G%P%$%9%I%i%$%P!<$+$i%"%/%;%9$G$-$k$h$&(B) $B$"$i$?$a$F(B
$B@0M}$7$F$$$^$9!#(B"paging_init" $B$O(B arch/i386/mm/setup.c $B$K(B
$B$"$j$^$9!#%a%b%j!<%Z!<%8%F!<%V%k$N@_Dj$r9T$J$$$^$9!#(B
"trap_init" $B$O(B arch/i386/kernel/traps.c $B$K$"$C$F(B IDT $B%F!<%V%k(B
$B$N=i4|2=$r<B9T$7$^$9!#(B"init_IRQ" $B$O(B arch/i386/kernel/irq.c
$B$NCf$K$"$j$^$9!#(BIRQ $B4X78$N@_Dj$r9T$J$&$b$N$G$9!#(B"shced_init" $B$O(B
kernel/sched.c $B$NCf$GDj5A$5$l$F$$$^$9!#(B
"time_init" $B$O(B kernel/time.c $B$K!"$=$7$F(B parse_optinos $B$O(B
start_kernel $B$HF1$8$/(B init/main.c $B$NCf$GDj5A$5$l$F$$$^$9!#(B
<P>$B$3$N$"$H!"$$$/$D$b=i4|2=%k!<%A%s$r<B9T$7$?8e(B
<P>
<PRE>
kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
</PRE>
<P>$B$KE~C#$7$^$9!#$3$3$G0z?t$H$7$F;XDj$5$l$F$$$k(B "init" $B$O(B
$BF1$8(B init/main.c $B$NCf$GDj5A$5$l$F$$$k$b$N$G$9!#(B
<P>
<PRE>
static int init(void * unused)
{
lock_kernel();
do_basic_setup();
/*
* Ok, we have completed the initial bootup, and
* we're essentially up and running. Get rid of the
* initmem segments and start the user-mode stuff..
*/
free_initmem();
unlock_kernel();
if (open("/dev/console", O_RDWR, 0) < 0)
printk("Warning: unable to open an initial console.\n");
(void) dup(0);
(void) dup(0);
</PRE>
<P>$B$3$N(B "init" $B$NCf$G8F$S=P$5$l$F$$$k(B lock_kernel $B$O(B
SMP $B$N5!3#$K$N$_4X78$9$k$b$N$G$9!#(B
<P>$B<!$N(B do_basic_setup $B$O(B init/main.c $B$NCf$GDj5A$5$l$F$$$^$9!#(B
$B$3$N4X?t$NCf$K$O%P%9$N@_Dj$d%M%C%H%o!<%/%=%1%C%H$N=i4|2=!"(B
$B%U%!%$%k%7%9%F%`$NG'<1!"%k!<%H%Q!<%F%#%7%g%s$N%^%&%s%H$J$I(B
$B!V%G%P%$%9%I%i%$%P$N=i4|2=!W$H$$$&%?%$%H%k$K$U$5$o$7$$FbMF$,(B
$B4^$^$l$F$$$k$N$G!"K\Mh$J$i$3$NCf?H$r$=$l$>$lD4$Y$F$_$?$$$H$3$m(B
$B$J$N$G$9$,!":#2s$O;~4V$,L5$/$J$C$F$7$^$C$?$N$G>JN,$7$^$9!#(B
<P>$B$b$76=L#$,$"$l$P!"@'Hs<+J,$GD4$Y$F$_$F2<$5$$!#(B
<P>
<P>
<HR>
<H2><A NAME="s7">7.</A> <A HREF="#toc7">init $B$N5/F0(B</A></H2>
<P>$B>e$N9`L\$G0lIt>R2p$7$?(B init/main.c $B$GDj5A$5$l$F$$$k!"%+!<%M%kFb$N(B
"init" $B4X?t$G$9$,!":G8e$O$3$s$JIw$K$J$C$F$$$^$9!#(B
<P>
<PRE>
/*
* We try each of these until one succeeds.
*
* The Bourne shell can be used instead of init if we are
* trying to recover a really broken machine.
*/
if (execute_command)
execve(execute_command,argv_init,envp_init);
execve("/sbin/init",argv_init,envp_init);
execve("/etc/init",argv_init,envp_init);
execve("/bin/init",argv_init,envp_init);
execve("/bin/sh",argv_init,envp_init);
panic("No init found. Try passing init= option to kernel.");
</PRE>
<P>$B$3$3$G(B <CODE>if (execute_command)</CODE> $B$+$i;O$^$k(B 2 $B9T$O!"5/F0;~$N(B
$B%+!<%M%k%*%W%7%g%s(B <CODE>init=</CODE> $B$K$h$C$F:G=i$K5/F0$9$k%W%m%0%i%`$r(B
$B;XDj$7$?>l9g$N$?$a$N$b$N$G$9!#%*%W%7%g%s$r;XDj$7$J$$>l9g$O$=$N$^$^(B
$BDL2a$7$^$9!#(B
<P>$B<!$N(B <CODE>execve("/sbin/init",...)</CODE> $B$O(B <CODE>/sbin/init</CODE>
$B$r<B9T$7$F!"$b$7LdBj$,L5$1$l$P$=$N$^$^La$C$F$3$J$$!"$H$$$&L?Na$G$9!#(B
$BDL>o$N%7%9%F%`5/F0$G$O$3$3$G@)8f$,(B <CODE>/sbin/init</CODE> $B$K0\9T$7$F!"(B
$B$3$l0J8e$N%3!<%I$O;H$o$l$^$;$s!#(B
<P>$B$b$72?$i$+$NM}M3$G(B <CODE>/sbin/init</CODE> $B$r<B9T$G$-$J$$>l9g$O!"(B
$BF1MM$NJ}K!$G(B <CODE>/etc/init</CODE>$B!"(B<CODE>/bin/init</CODE>$B!"$=$7$F(B
<CODE>/bin/sh</CODE> $B$N<B9T$r;n$7$^$9!#$b$7@h$K;n$7$?$b$N$,$&$^$/(B
$B<B9T$G$-$l$P!"$=$N$^$^=hM}$rEO$7$F$7$^$&$N$G$=$l0J9_$N%3!<%I$O(B
$B<B9T$5$l$^$;$s!#(B
<P>$B:G=*E*$K!"(B<CODE>/bin/sh</CODE> $B$b4^$a$F!"$I$&$7$F$b=hM}$rEO$9$3$H$,(B
$B$G$-$J$$>l9g$O!":G8e$N(B <CODE>panic()</CODE> $B$G%(%i!<%a%C%;!<%8$r(B
$BI=<($7$FDd;_$7$^$9!#(B
<P>$B$D$^$j!"$3$3$,(B "man 8 init" $B$K5-:\$5$l$F$$$k(B
$B!V%+!<%M%k%V!<%H$N:G8e$N%9%F%C%W!W$H$$$&$o$1$G$9!#(B
<P>
<P>
<HR>
<H2><A NAME="s8">8.</A> <A HREF="#toc8">$BHV30(B: Makefile $B$K$D$$$F(B</A></H2>
<P>$B%+!<%M%k$,%m!<%I$5$l$?;~$K!"$I$N%U%!%$%k$KF~$C$F$$$k%3!<%I$,(B
$B<B9T$5$l$k$N$+!"$H$$$&E@$O(B Makefile $B$rD4$Y$k$H=q$$$F$"$j$^$9!#(B
<P>$B$^$:%H%C%W%G%#%l%/%H%j$N(B Makefile $B$K$O!"<!$N5-=R$,$"$j$^$9!#(B
<P>
<PRE>
include arch/$(ARCH)/Makefile
vmlinux: $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
$(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o \
--start-group \
$(CORE_FILES) \
$(FILESYSTEMS) \
$(NETWORKS) \
$(DRIVERS) \
$(LIBS) \
--end-group \
-o vmlinux
$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
</PRE>
<P>$B:#2s$NOC$G$O(B i386 $B$rA0Ds$H$7$F$$$k$N$G(B
"arch/i386/Makefile" $B$r(B
$B;2>H$7$F$_$k$H!"(B
<P>
<PRE>
HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
zImage: vmlinux
@$(MAKEBOOT) zImage
</PRE>
<P>$B$H$$$&5-=R$,8+$D$+$j$^$9!#$3$l$H>e5-$N%H%C%W%G%#%l%/%H%j$N(B
Makefile $B$H$+$i!"%H%C%W%G%#%l%/%H%j$N(B vmlinux $B$N@hF,$,(B
"arch/i386/kernel/head.o" $B$G$"$k$3$H$,$o$+$j$^$9!#(B
$B0lJ}!"%H%C%W%G%#%l%/%H%j$N(B Makefile $B$K$O!"<!$N5-=R$b$"$j$^$9!#(B
<P>
<PRE>
boot: vmlinux
@$(MAKE) -C arch/$(ARCH)/boot
</PRE>
<P>$B$3$N5-=R$+$i!"%V!<%H%$%a!<%8$N:n@.$K$D$$$FCN$j$?$1$l$P!"(B
"arch/i386/boot" $B%G%#%l%/%H%j$N(B Makefile $B$r(B
$BD4$Y$F$_$k$HNI$5$=$&$@!"$H$$$&$3$H$,$o$+$j$^$9!#(B
<P>$B$=$3$G(B "arch/i386/boot" $B%G%#%l%/%H%j$N(B Makefile $B$r(B
$B8+$F$_$k$H!"<!$N5-=R$,$"$j$^$9!#(B
<P>
<PRE>
zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
$(OBJCOPY) compressed/vmlinux compressed/vmlinux.out
tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zImage
compressed/vmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinux
setup: setup.o
$(LD86) -s -o $@ $<
setup.o: setup.s
$(AS86) -o $@ $<
setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
bootsect: bootsect.o
$(LD86) -s -o $@ $<
bootsect.o: bootsect.s
$(AS86) -o $@ $<
bootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
</PRE>
<P>$B$3$3$+$i!"(Bbootsect.S $B$+$i(B bootsect.s $B$,:n@.$5$l!"$5$i$K(B bootsect.o $B$r(B
$B7PM3$7$F(B bootsect $B$K$J$k$3$H!"F1$8$/(B setup.S $B$H(B vide.S $B$+$i(B setup.s $B$,(B
$B:n@.$5$l!"$5$i$K(B setup.o $B$r7PM3$7$F(B setup $B$K$J$k$3$H$,$o$+$j$^$9!#(B
$B$^$?$3$&$7$F$G$-$?(B bootsect $B$H(B setup $B$,$=$l$>$l(B zImage $B%U%!%$%k$N(B
$B@hF,$H(B 2 $BHVL\$K3:Ev$9$k$3$H$b$o$+$j$^$9!#(B($B=>$C$F!"%U%m%C%T!<$+$i(B
$B%+!<%M%k$r%V!<%H$9$k$H:G=i$K(B bootsect.S $B$N%3!<%I$,<B9T$5$l$k$o$1$G$9(B)
<P>$B$=$7$F$5$i$K!"(Barch/i386/boot/compressed/Makefile $B$r8+$k$H(B
$B0J2<$N5-=R$,$"$j$^$9!#(B
<P>
<PRE>
HEAD = head.o
SYSTEM = $(TOPDIR)/vmlinux
OBJECTS = $(HEAD) misc.o
vmlinux: piggy.o $(OBJECTS)
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
head.o: head.S $(TOPDIR)/include/linux/tasks.h
$(CC) $(AFLAGS) -traditional -c head.S
piggy.o: $(SYSTEM)
tmppiggy=_tmp_$$$$piggy; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
$(OBJCOPY) $(SYSTEM) $$tmppiggy; \
gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
$(LD) -m elf_i386 -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk
</PRE>
<P>$B$3$l$+$i!"(Bcompressed/vmlinux $B$N@hF,$O(B head.S $B$N%3!<%I$G$"$k$3$H$,(B
$B$o$+$j$^$9!#(B
<P>$B0J>e$N$3$H$r$^$H$a$k$H(B
<P>
<OL>
<LI>arch/i386/boot/bootsect.S ($B%U%m%C%T!<%V!<%H;~!":G=i$K<B9T(B)</LI>
<LI>arch/i386/boot/setup.S (+ video.S) </LI>
<LI>arch/i386/boot/compressed/head.S (+ misc.c)</LI>
<LI>arch/i386/kernel/head.S</LI>
</OL>
<P>$B$H$$$&$3$H$K$J$j$^$9!#(B
<P>
<P>
<HR>
<H2><A NAME="s9">9.</A> <A HREF="#toc9">$B=*$o$j$K(B</A></H2>
<P>
<P>
<H2><A NAME="ss9.1">9.1 $B$*4j$$(B</A>
</H2>
<P>$B$H$j$"$($:$J$s$H$+$^$H$a$F$_$^$7$?$,!"$J$K$V$s!";d$b$^$@$^$@(B
$BCN$i$J$$$3$H$,$?$/$5$s$"$j$^$9!#$3$3$K=q$$$?Cf$K$b4V0c$$$,(B
$B$"$k$+$b$7$l$^$;$s!#(B
$B$b$72~NI$N$?$a$N%"%I%P%$%9$r$*;}$A$G$7$?$i!"@'Hs65$($F$/$@$5$$!#(B
$B$h$m$7$/$*4j$$$7$^$9!#(B
<P>
<P>
<H2><A NAME="ss9.2">9.2 $B<U<-(B</A>
</H2>
<P>$B:G=i$K$3$NJ8=q$r%j%j!<%9$9$k$^$G$K!"(BNLUG $B$d(B JF $B$N%a%s%P!<$NJ}!9$+$i(B
$BB?$/$NM-1W$J0U8+$rD:$-$^$7$?!#$"$j$,$H$&$4$6$$$^$9!#$^$?!"F|:"$*@$OC$K(B
$B$J$C$F$$$k(B fj.os.linux $B$d(B Nifty FUNIX $B$NJ}!9$K$b$3$N>l$r<Z$j$F$*Ni$r(B
$B?=$7>e$2$^$9!#(B
<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