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
|
<?xml version="1.0" encoding="big5"?>
<!--
The FreeBSD Documentation Project
$FreeBSD$
Original revision: 1.180
-->
<chapter id="kernelconfig">
<chapterinfo>
<authorgroup>
<author>
<firstname>Jim</firstname>
<surname>Mock</surname>
<contrib>§ó·s¡B«±Æ¡G</contrib>
<!-- Mar 2000 -->
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Jake</firstname>
<surname>Hamby</surname>
<contrib> ì§@¬°¡G</contrib>
<!-- 6 Oct 1995 -->
</author>
</authorgroup>
</chapterinfo>
<title>³]©w FreeBSD Kernel</title>
<sect1 id="kernelconfig-synopsis">
<title>·§z</title>
<indexterm>
<primary>kernel</primary>
<secondary>building a custom kernel</secondary>
</indexterm>
<para>kernel ¬O¾ãÓ &os; §@·~¨t²Îªº®Ö¤ß¡C
¥¦±±¨î¤F¨t²Îªº¾ãÅé¹B§@¡A¥]§t©M°O¾ÐÅéºÞ²z¡B¦w¥þ±±ºÞ¡Bºô¸ô¡BµwºÐ¦s¨úµ¥µ¥¡C
¾¨ºÞ¥Ø«e &os; ¤j¦h¥i¥H¥Î°ÊºA module ¨Ó¸ü¤J¡B¨ø¸ü©Ò»Ý¥\¯à¡A
¦ý¦³®ÉÔ¤´¦³¥²n¾Ç·|«·s½Õ°t kernel¡C</para>
<para>Ū§¹³o³¹¡A±z±N¤F¸Ñ¡J</para>
<itemizedlist>
<listitem>
<para>¬°¦ó»Ýn«·s½Õ°t¡B½sĶ kernel¡H</para>
</listitem>
<listitem>
<para>n«ç»òקï kernel ³]©wÀÉ¡H</para>
</listitem>
<listitem>
<para>¦p¦ó¥H kernel ³]©wÀɨӫإߡB½sĶ·sªº kernel ©O¡H</para>
</listitem>
<listitem>
<para>¦p¦ó¦w¸Ë·sªº kernel¡C</para>
</listitem>
<listitem>
<para>¦p¦ó³B²z kernel ¿ù»~µLªk¶}¾÷ªº±¡§Î¡C</para>
</listitem>
</itemizedlist>
<para>¥»³¹©ÒÁ|¨Òªº¬ÛÃö«ü¥O³£¬O¥H <username>root</username> Åv¨Ó¶i¦æ¡C</para>
</sect1>
<sect1 id="kernelconfig-custom-kernel">
<title>¬°¦ó»Ýn«·s½Õ°t¡B½sĶ kernel¡H</title>
<para>¦´Áªº &os; ªº kernel ³QÀ¸ºÙ¬° <quote>monolithic</quote> kernel¡C
³o·N«ä¬O»¡·í®Éªº kernel ¬OÓ¤j¶ôÀYµ{¦¡¡A¥B¥u¤ä´©©T©wªºµwÅé¦Ó¤w¡C
¦pªG±z·Q§ïÅÜ kernel ªº³]©w¡A¨º»ò¥²¶·½sĶ¤@Ó·sªº¨Ã«·s¶}¾÷¡A¤~¯à±Ò¥Î¡C</para>
<para>²{¦bªº &os; ¤w§Ö³t¦¨ªø¨ì·s«¬ºAªººÞ²z¼Ò¦¡¡A¨ä«n¯S¦â¬O¡G
kernel ¥\¯à¥i¥HÀH®É¨Ì¾Ú»Ý¨D¡A
¦Ó¥H°ÊºA¸ü¤J©Î¨ø¸ü¬ÛÃöªº kernel module¡C
³o¨Ï±o kernel ¯à°÷§Ö³t¦]À³·sªºÀô¹Ò¦Ó§@½Õ¾ã
(¦³ÂI¹³¬O¡Gµ§°O«¬¹q¸£¤Wªº PCMCIA ¥d¤@¼Ë§Y´¡§Y¥Î)
¡A©Î¬O¼W¥[¨ä¥L쥻ªº¹w³] kernel(<filename>GENERIC</filename>)©Ò¨S¦³ªº¥\¯à¡C
³oºØ¼Ò¦¡¡A´N¥s°µ modular kernel(®Ö¤ß¼Ò²Õ)¡C</para>
<para>¾¨ºÞ¦p¦¹¡AÁÙ¬O¦³¤@¨Ç¥\¯à¤´¶·½sĶ¦b kernel ¤º¤~¦æ¡C¦]¬°¦³®ÉÔ¬O¦]¬°³o¨Ç¥\¯à»P kernel
µ²¦Xªº¬Û·í½ÆÂøºò±K¡A¦ÓµLªk±N¥¦Ì§Ë¦¨¥i°ÊºA¸ü¤Jªº module
¡F¦Ó¦³®ÉÔ¡A«h¬O¦]¬°¨S¦³¤H¦³ªÅ¨Ó§Ë¨º¨Ç kernel module ªº¹ê§@¡C</para>
<para>«·s½Õ°t¡B½sĶ kernel ´X¥G¬O¨C¦ì BSD ¨Ï¥ÎªÌ©Ò¥²¶·¸g¾úªº¹Lµ{¡C
¾¨ºÞ³o¶µ¤u§@¥i¯à¤ñ¸û¯Ó®É¡A¦ý¦b &os; ªº¨Ï¥Î¤W·|¦³³\¦h¦n³B¡C
¸ò¥²¶·¤ä´©¤j¦h¼Æ¦U¦¡µwÅ骺 <filename>GENERIC</filename> kernel ¬Û¤ñªº¸Ü¡A
¦Û¦æ½Õ°t kernel ¤£¦P³B¦b©ó¡G¥i¥H§ó¡yÅé¶K¡z¡A¥u¤ä´©¡y¦Û¤vµwÅé¡zªº³¡¤À´N¦n¡C
¦n³B¦b©ó¡AÄ´¦p¡J</para>
<itemizedlist>
<listitem>
<para>¶}¾÷³t«×§ó§Ö¡G¦]¬°¦Û¦æ½Õ°tªº kernel ¥u»Ýn°»´ú±z¨t²Î¤WªºµwÅé¡A
©Ò¥HÅý±Ò°Ê©Òªáªº¹Lµ{§ó¬yºZ§Ö³t¡C</para>
</listitem>
<listitem>
<para>¦û¥Îªº°O¾ÐÅé§ó¤Ö¡G¦Û¦æ½Õ°tªº kernel ³q±`·|¤ñ
<filename>GENERIC</filename> ®Ö¤ß¨Ï¥Î§ó¤Öªº°O¾ÐÅé¡A¥Ñ©ó kernel
¥²¶·¤@ª½¦s©ñ¦b°O¾ÐÅ餺¡A¦]¦¹³o´NÅã±o§ó¥[«n¡C¦]¦¹¡A
¹ï©ó°O¾ÐÅé¸û¤pªº¨t²Î¨Ó»¡¡A
¦Û¦æ½Õ°tªº kernel ´N¥iµo´§§ó¦hªº§@¥Î¡B´§ÅxªÅ¶¡¡C</para>
</listitem>
<listitem>
<para>¥i¤ä´©§ó¦hµwÅé¡G±z¥i¦b¦Û¦æ½Õ°tªº kernel ¼W¥[¤@¨Ç쥻
<filename>GENERIC</filename> ®Ö¤ß¨S¦³´£¨ÑªºµwÅé¤ä´©¡A¹³¬Oµ®Ä¥d¤§Ãþªº¡C</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="kernelconfig-devices">
<sect1info>
<authorgroup>
<author>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
</sect1info>
<title>±´´ú¨t²ÎµwÅé</title>
<para>¦b¶i¦æ kernel ³]©wªº±´¯Á¤§®È«e¡A
¥ý§â¸Ó¾÷¾¹¦U¶µµwÅé¸ê°T§@ÂI½Õ¬d·|¬O©ú´¼¤§Á|¡C
Y &os; ¨Ã«D¥Dnªº§@·~¨t²Î¡A¨º»ò¤]¥i¥H»´ÃP³z¹L¥Ø«e©Ò¨Ï¥Îªº§@·~¨t²Î¡A
¨Ó¬d¬Ý¬ÛÃöµwÅé¸ê°Tªí¡C Á|¨Ò¨Ó»¡¡Aµsoft; ªº
<application>¸Ë¸mºÞ²zû(Device Manager)</application>
¤º³q±`·|¦³¥Ø«e¦³¸ËªºµwÅé¸ê°T¡C ¦Ó <application>¸Ë¸mºÞ²zû</application>
¬O¦b±±¨î¥x¡C</para>
<note>
<para>µsoft.windows; ¬Y¨Çª©¥»«h¬O¥ý³z¹L
<application>¨t²Î(System)</application> ¦A¶i¤J
<application>¸Ë¸mºÞ²zû</application>¡C</para>
</note>
<para>Y¸Ó¾÷¾¹©|¥¼¦w¸Ë¥ô¦ó§@·~¨t²Î¡A¨º»ò´Nn¿Ë¦Û§ä¥X¬ÛÃöµwÅé¸ê°T¡C
¨ä¤¤¤@ºØ¤è¦¡¬O³z¹L &man.dmesg.8; ¥H¤Î &man.man.1;¡C &os;
¤W¤j¦hµwÅé³£·|¦³¬ÛÃöªº man »¡©ú¦³¤ä´©ªº³W®æ«¬¸¹¡A
¨Ã¥B¶}¾÷ªº°»´ú¹Lµ{¤¤¡A¤]·|¦C¥X¦³§ä¨ìªºµwÅé¡C Á|Ó¨Ò¤l¡A
¤U±³o´X¦æ¬O»¡¦³°»´ú¨ì·Æ¹«¡A¨Ã¥B¬O¥H <devicename>psm</devicename>
ÅX°Êµ{¦¡¡G</para>
<programlisting>psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model Generic PS/2 mouse, device ID 0</programlisting>
<para>ÅX°Êµ{¦¡¥²¶·n¦b¦Ûqªº kernel ³]©wÀɤº¥[¤J¡A©ÎªÌ¬O¥Î
&man.loader.conf.5;¡C</para>
<para><command>dmesg</command> ¦³®É¥uÅã¥Ü¨t²Î°T®§¦Ó¨S¦³¶}¾÷°»´úªº³¡¥÷¡A
¹J¨ì³oºØ±¡ªp½Ð¬d¾\ <filename>/var/run/dmesg.boot</filename> ÀÉ¡C</para>
<para>¥t¥~¤]¥i¥H³z¹L &man.pciconf.8; ¨Ó¦C¥X§ó¸Ô²Óªº¬ÛÃö¸ê°T¡C
Á|¨Ò»¡©ú¡G</para>
<programlisting>ath0@pci0:3:0:0: class=0x020000 card=0x058a1014 chip=0x1014168c rev=0x01 hdr=0x00
vendor = 'Atheros Communications Inc.'
device = 'AR5212 Atheros AR5212 802.11abg wireless'
class = network
subclass = ethernet</programlisting>
<para>¤W±Åã¥Ü¬O³z¹L <command>pciconf <option>-lv</option></command>
©Ò¬Ý¨ìªº <devicename>ath</devicename> µL½uºô¥dÅX°Êµ{¦¡¡C ¥i¥H¥Î
<command>man <replaceable>ath</replaceable></command> ¨Ó¬d¬Ý
&man.ath.4; ªº¬ÛÃö»¡©ú¡C</para>
<para>¦b¨Ï¥Î &man.man.1; ®É¡A¥[¤W <option>-k</option>
°Ñ¼Æ¤]¥i¥H´£¨Ñ¤ñ¸ûºë·Çªº¸ê°T¡C ¥H¤Wz¨Ò¤l¦Ó¨¥¡A¥i¥H§ï¬°¥´¡G</para>
<screen>&prompt.root; man -k <replaceable>Atheros</replaceable></screen>
<para>´N·|¦C¥X¦³§t¤WzÃöÁä¦rªº¬ÛÃö man »¡©ú¡G</para>
<programlisting>ath(4) - Atheros IEEE 802.11 wireless network driver
ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
<para>ª¾¤vª¾©¼¡A¥ýÁA¸Ñ¬ÛÃöµwÅéÀô¹Ò¡A¤~¯àÅý±µ¤U¨Óªº¦Ûq kernel
¥´³y¹Lµ{§ó¬°¶¶§Q¡C</para>
</sect1>
<sect1 id="kernelconfig-building">
<title>«·s½Õ°t¡B½sĶ kernel</title>
<indexterm>
<primary>kernel</primary>
<secondary>building / installing</secondary>
</indexterm>
<para>º¥ý¹ï kernel ¬ÛÃö¥Ø¿ý§@§Ö³t¤¶²Ð¡C
³o¸Ì©Ò´£¨ìªº©Ò¦³¥Ø¿ý³£¦b <filename>/usr/src/sys</filename> ¤º¡A
¤]¥i¥H¥Î <filename>/sys</filename> ³oÓ symbolic link ¨Ó³s¨ì³o¡C
³o¸Ìªº³\¦h¤l¥Ø¿ý¤À§OÂ\©ñ kernel ªº¦U²Õ¦¨³¡¤À¡A¦ý¹ï¥´³y kernel
¼vÅT³Ì«nªº¥Ø¿ý¬O
<filename><replaceable>arch</replaceable>/conf</filename>¡A
³o¸Ì¬O¥i¥H°w¹ï»Ý¨D¨Óקï¦Ûq kernel ¬ÛÃö³]©w¡C
¦¹¥~¡AÁÙ¦³¦b½sĶ kernel ¹Lµ{¤¤·|¼È®ÉÂ\©ñªº <filename>compile</filename>
¥Ø¿ý¡C
èÁ¿¨ìªº <replaceable>arch</replaceable> ¥i¥H¬O¥k¦C¬[ºc¤§¤@¡G
<filename>i386</filename>¡B<filename>alpha</filename>¡B
<filename>amd64</filename>¡B<filename>ia64</filename>¡B
<filename>powerpc</filename>¡B<filename>sparc64</filename>¡B
<filename>pc98</filename>(¦b¤é¥»¸û¬y¦æªº¥t¤@ºØ PC µwÅé¬[ºc)¡C
¦b¦U¯S©wµwÅé¬[ºc¥Ø¿ýªºªF¦è¡A¥u·f°t¬Û¹ïÀ³ªºµwÅé¬[ºc¦Ó¤w¡C
¦Ó¨ä¾lªºì©l½X«h¬O»PµwÅé¬[ºcµLÃö¡A¥i¥H¦b©Ò¦³ &os; ¥i¸Ëªº¥¥x¤W¦@¥Î¡C
¾ãÅé¥Ø¿ý¬[ºc³£¬O¦³ÅÞ¿è¥i´`¡A¹³¬O¦U¶µ¦³¤ä´©ªºµwÅé³]³Æ¡BÀɮרt²Î¡A
¥H¤Î¬ÛÃö¿ï¶µ³q±`³£·|Â\¦b¥¦Ì¦Û¤vªº¤l¥Ø¿ý¤º¡C</para>
<para>¥»³¹©Ò¥Î¨ìªº¨Ò¤l¡A³£¬O§A¨Ï¥Î i386 ¬[ºcªº¾÷¾¹¡C
½Ð¨Ì¹ê»Ú±¡ªp¡A¹ï¬ÛÃö¥Ø¿ý§@½Õ¾ã§Y¥i¡C</para>
<note>
<para>Y±z¨t²Î¤W <emphasis>¨S¸Ë</emphasis>
<filename>/usr/src/sys</filename> ¥Ø¿ý¡A
¤]´N¬O»¡¨S¸Ë kernel source code ªº¸Ü¡A¨º»ò³Ì²³æ¦w¸Ë¤è¦¡´N¬O¥H
<username>root</username> Åv¨Ó°õ¦æ <command>sysinstall</command>¡A
±µµÛ½Ð¿ï <guimenuitem>Configure</guimenuitem>¡AµM«á¿ï
<guimenuitem>Distributions</guimenuitem> ±µµÛ¬°
<guimenuitem>src</guimenuitem> ¦A¿ï
<guimenuitem>base</guimenuitem> ³Ì«á¿ï
<guimenuitem>sys</guimenuitem>¡C Y¤£³ßÅw¥Î
<application>sysinstall</application> ¦Ó¥B¤âÃ䦳
<quote>¥¿¦¡ªº</quote> &os; ¥úºÐ¥i¥H¥Îªº¸Ü¡A
¨º»ò¤]¥i¥H¥Î¥H¤U«ü¥O¨Ó¦w¸Ë¡G</para>
<screen>&prompt.root; <userinput>mount /cdrom</userinput>
&prompt.root; <userinput>mkdir -p /usr/src/sys</userinput>
&prompt.root; <userinput>ln -s /usr/src/sys /sys</userinput>
&prompt.root; <userinput>cat /cdrom/src/ssys.[a-d]* | tar -xzvf -</userinput>
&prompt.root; <userinput>cat /cdrom/src/sbase.[a-d]* | tar -xzvf -</userinput></screen>
</note>
<para>±µ¤U¨Ó¡A¤Á´«¨ì
<filename><replaceable>arch</replaceable>/conf</filename> ¥Ø¿ý¡A
½Æ»s <filename>GENERIC</filename> ³]©wÀɬ°§A·QºÙ©Iªº·s kernel ¦WºÙ¡C
¨Ò¦p¡G</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf</userinput>
&prompt.root; <userinput>cp GENERIC MYKERNEL</userinput></screen>
<para>³q±`¡A©R¦W¤è¦¡³£¬O¤j¼g¡C¦pªG§At³dºûÅ@³\¦h¤£¦PµwÅé¬[ºcªº &os;
¾÷¾¹ªº¸Ü¡A¨º»ò·Ó¸Ó¾÷¾¹¦WºÙ(hostname)¨Ó©R¦W·|¬O¤ñ¸û©ú´¼¡C
¤W±¨Ò¤l¤¤¤§©Ò¥H©R¦W¬° <filename>MYKERNEL</filename>
´N¬O¦]¬°³o½t¬G¡C</para>
<tip>
<para>«Øij¤£n§â§ï¹Lªº kernel ³]©wÀɪ½±µ©ñ¦b
<filename>/usr/src</filename>¡C ¦]¬°Y½sĶ¹J¨ì¨ä¥L°ÝÃD®É¡A
ª½±µ¬å±¼ <filename>/usr/src</filename> ¦A«½m¡A
¥i¯à·|¬O¤ñ¸û°®¯Üªº¿ï¾Ü¤§¤@¡C
¤@¥¹¯uªº¬å¤F¤§«á¡A§A¥i¯à´X¬í¤§«á¤~·|¿ô®©¨ì¡G
§A¦P®É¤]¬å±¼¦Û¤v§ïªº kernel ³]©wÀÉ¡C
¦¹¥~¡A¤]¤£nª½±µ×§ï <filename>GENERIC</filename>¡A¦]¬°¤U¦¸§A
<link linkend="cutting-edge">§ó·s source tree</link>®É¡A
¥¦·|³Q·sª©Âл\¡A¦Ó¬ÛÃöקï¤]±NÀH¤§¦Ó³u¡C</para>
<para>§A¤]¥i¦Ò¼{§â kernel ³]©wÀɧï©ñ¨ì¨ä¥L¦a¤è¡AµM«á¦A¨ì
<filename><replaceable>i386</replaceable></filename>
¥Ø¿ý¤º«ØÓ«ü¦V¥¦ªº symbolic link¡C</para>
<para>Á|¨Ò¡G</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf</userinput>
&prompt.root; <userinput>mkdir /root/kernels</userinput>
&prompt.root; <userinput>cp GENERIC /root/kernels/<replaceable>MYKERNEL</replaceable></userinput>
&prompt.root; <userinput>ln -s /root/kernels/<replaceable>MYKERNEL</replaceable></userinput></screen>
</tip>
<para>²{¦b¡A´N¶}©l¥Î¦Û¤v³ßÅwªº½s¿è¾¹¨Óקï <filename>MYKERNEL</filename>¡C
Y¤~è¸Ë¦n FreeBSD ¦Ó¤w¡A°ß¤@¥i¥Îªº½s¿è¾¹«Ü¥i¯à¬O
<application>vi</application> ¤F¡A¥Ñ©ó¥¦ªº¥Îªk«Ü¦hºØ¡Aê©ó½g´T±N¤£¸Ô²Ó¤¶²Ð¡A
§A¥i¦b <link linkend="bibliography">°Ñ¦Ò®Ñ¥Ø</link> ¤º§ä¨ì¬ÛÃö®ÑÄy¡C
¤£¹L¡A&os; ¤]´£¨Ñ¥t¤@Ó§ó¦n¥Îªº½s¿è¾¹¡A¥¦¥s°µ
<application>ee</application>¡A¹ï·s¤â¦Ó¨¥¡A³o¥i¯à¬OÆZ¦nªº¿ï¾Ü¡C
§A¥i¥H¥ô·NקïÀɮפºªº¬ÛÃöµù¸Ñ¥H»¡©ú¬ÛÃö³]©w¬°¦ó¡A
©ÎªÌ¨ä¥L·Q§ïªº <filename>GENERIC</filename> ³]©w¤º®e¡C</para>
<indexterm><primary>SunOS</primary></indexterm>
<para>Y§A¦³¦b &sunos; ©ÎªÌ¨ä¥LºØ BSD §@·~¨t²Î¤U¶i¦æ½sĶ kernel ªº¸gÅç¡A
¨º»òÀ³¸Ó¤w¸g«Ü¼ô±x¥»½g©Ò¤¶²Ðªº¤j³¡¤À¨BÆJ¡C
´«¥y¸Ü»¡¡AY±z¤§«e¥Îªº¬O DOS ³oÃþ§@·~¨t²Î¡A¨º»ò
<filename>GENERIC</filename> ³]©wÀɪº¤º®e´N¥i¯à¤ñ¸ûÃøÀ´¨Ç¡A¨SÃö«Y¡A
§Ú̱N¦b¤U±ªº <link linkend="kernelconfig-config">kernel ³]©w</link>
·|´`§Çº¥¶i¦a¤¶²Ð¡C</para>
<note>
<para>Y¦³±q &os; p¹º¥h <link
linkend="cutting-edge">§ó·s§Aªº source tree</link> ªº¸Ü¡A
«h¤Á°O¦b¶i¦æ¥ô¦ó¤É¯Å¤§«e¡A°È¥²n¹î¬Ý
<filename>/usr/src/UPDATING</filename>¡C
³oÀÉ·|¤¶²Ð¦b§ó·s¹Lµ{¤¤ªº«¤jijÃD©Înª`·Nªº¨Æ¶µ¡C
¥Ñ©ó <filename>/usr/src/UPDATING</filename> ¬O¹ïÀ³©ó§A¾÷¾¹¤W¥Ø«eªº
&os; source code ª©¥»¡A¦]¦¹·|´£¨Ñ¤ñ¥»¤â¥U§ó·sªº¤º®e¡C</para>
</note>
<para>²{¦b¶}©l¨Ó½sĶ kernel §a¡C</para>
<procedure>
<title>½sĶ Kernel</title>
<step>
<para>½Ð¤Á´«¦Ü <filename
class="directory">/usr/src</filename> ¥Ø¿ý¡G</para>
<screen>&prompt.root; <userinput>cd /usr/src</userinput></screen>
</step>
<step>
<para>½sĶ kernel¡G</para>
<screen>&prompt.root; <userinput>make buildkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
<step>
<para>¦w¸Ë·s kernel¡G</para>
<screen>&prompt.root; <userinput>make installkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen>
</step>
</procedure>
<note>
<para>n¦³§¹¾ãªº &os; source tree ¤~¯à½sĶ kernel¡C</para>
</note>
<tip>
<para>¹w³]±¡ªp¤U¡A¦b½sĶ¦Ûq kernel ®É¡A<emphasis>¥þ³¡ªº</emphasis>
kernel modules ¤]·|¤@°_«½s¡C Yn§Ö³t¤É¯Å kernel¡A
©Î¬O¥u·Q«½s©Ò»Ýªº kernel module¡A¨º»ò¦b½sĶ kernel «en¥ý§ï¤@¤U
<filename>/etc/make.conf</filename>¡A¤ñ¦p¡G</para>
<programlisting>MODULES_OVERRIDE = linux acpi sound/sound sound/driver/ds1 ntfs</programlisting>
<para>¤W±¸Ó³]©wȬ°©Ò§Æ±æ«½sªº kernel module ¦Cªí¡C</para>
<programlisting>WITHOUT_MODULES = linux acpi sound/sound sound/driver/ds1 ntfs</programlisting>
<para>¦Ó¤W±³o³]©wÈ«h¬°¤£n½s¤Jªº kernel module ¦Cªí¡C Y·Q§óÁA¸Ñ¨ä¥L
kernel ½sĶªº¬ÛÃöÅܼơA½Ð°Ñ¾\ &man.make.conf.5; »¡©ú¡C</para>
</tip>
<indexterm>
<primary><filename class="directory">/boot/kernel.old</filename></primary>
</indexterm>
<para>·sªº kernel ·|½Æ»s¨ì <filename
class="directory">/boot/kernel</filename> ¥Ø¿ý¤ºªº
<filename>/boot/kernel/kernel</filename>¡A¦Óªº«h²¾¦Ü
<filename>/boot/kernel.old/kernel</filename>¡C
²{¦b©O¡A¥ýÃö¾÷¡AµM«á´N·|¥H·s kernel «¶}¾÷
Y¦³°ÝÃDªº¸Ü¡A¥»³¹«á±·|¤¶²Ð¤@¨Ç<link
linkend="kernelconfig-trouble">ºÃÃøÂø¯g</link>¨Ó¨ó§U§A¡C
Y·s kernel µLªk¶}¾÷ªº¸Ü¡A½Ð°Ñ¾\ <link
linkend="kernelconfig-noboot">³o¸Ì</link> ¥H«ì´_¨t²Î¹B§@¡C</para>
<note>
<para>¦Ü©ó¶}¾÷¹Lµ{ªº¨ä¥L¬ÛÃöÀɮסB³]©w¡A¤ñ¦p &man.loader.8;
¤Î¨ä³]©w¡A«h©ñ¦b <filename>/boot</filename>¡C
Third party ©Î¦Ûqªº kernel modules «h·|©ñ¦b
<filename class="directory">/boot/kernel</filename>¡A¤£¹L¡A
À³ª`·Nn«O«ù kernel module »P kernel ¬O§_¦³¦P¨B¡A
³oÂI«Ü«n¡A§_«h·|¾ÉP¤£Ã©Î¥X°ÝÃD¡C</para>
</note>
</sect1>
<sect1 id="kernelconfig-config">
<sect1info>
<authorgroup>
<author>
<firstname>Joel</firstname>
<surname>Dahl</surname>
<contrib>Updated for &os; 6.X by </contrib>
</author>
</authorgroup>
</sect1info>
<title>kernel ³]©wÀɸѻ¡</title>
<indexterm>
<primary>kernel</primary>
<secondary>NOTES</secondary>
</indexterm>
<indexterm><primary>NOTES</primary></indexterm>
<indexterm>
<primary>kernel</primary>
<secondary>configuration file</secondary>
</indexterm>
<para>kernel ³]©wÀɪº¤º®e®æ¦¡¬Û·í²³æ¡C
¨C¤@¦æ³£¥]¬A¤@ÓÃöÁä¦r¡A¥H¤Î¤@өΦhӰѼơC¨Æ¹ê¤W¡A
«Ü¦h¦æ¤j¦h¥u¦³¤@ӰѼơC¥ô¦ó¥H <literal>#</literal>
¶}ÀYªº±Ôz³£±N³Qµø¬°µù¸Ñ¦Ó³Q©¿²¤¡C
±µ¤U¨Ó±N¥H¦b <filename>GENERIC</filename> ©Ò¥X²{ªº¶¶§Ç¤@¤@¤¶²Ð¤§¡C
<anchor
id="kernelconfig-options"/>Yn¬Ý»P¸Ó¥¥x¬[ºc¦³Ãöªº¦U¿ï¶µ¡B³]³Æ¦Cªí¡A
½Ð°Ñ¾\»P <filename>GENERIC</filename> ÀɦP¥Ø¿ýªº <filename>NOTES</filename>
ÀÉ¡C ¦Ó»P¥¥x¬[ºc®t²§¸ûµLÃöªº³q¥Î³¡¥÷¡A«h¥i°Ñ¾\
<filename>/usr/src/sys/conf/NOTES</filename>¡C</para>
<note>
<para>Y¬°¤F´ú¸Õ¡A¦Ó»Ýn¤@¥÷§t¦³©Ò¦³¥i¥Î³]©wªº³]©wÀÉ¡A¨º»ò½Ð¥H
<username>root</username> ¨¥÷¤U¡G</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf && make LINT</userinput></screen>
</note>
<indexterm>
<primary>kernel</primary>
<secondary>configuration file</secondary>
</indexterm>
<para>¤U±¬° <filename>GENERIC</filename> ³]©wÀɪº½d¨Ò¡A
¨ä¤¤¥]¬A»¡©ú¥ÎªºµùÄÀ¡C ³o¨Ò¤lÀ³¸Ó»P±z¾÷¾¹¤Wªº
<filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/GENERIC</filename>
¬Û·í±µªñ¡C</para>
<indexterm>
<primary>kernel options</primary>
<secondary>machine</secondary>
</indexterm>
<programlisting>machine i386</programlisting>
<para>¦¹³B¬O«ü¾÷¾¹¬[ºc¡A¥²¶·¬°
<literal>alpha</literal>¡B<literal>amd64</literal>¡B
<literal>i386</literal>¡B<literal>ia64</literal>¡B
<literal>pc98</literal>¡B<literal>powerpc</literal>¡B
<literal>sparc64</literal> ¨ä¤¤¤§¤@¡C</para>
<indexterm>
<primary>kernel options</primary>
<secondary>cpu</secondary>
</indexterm>
<programlisting>cpu I486_CPU
cpu I586_CPU
cpu I686_CPU</programlisting>
<para>¤W±³]©w¬O«ü©wn¥Îþ¤@ºØ CPU «¬¸¹¡C ¤]¥i¥H¦P®É¥[¤W¦h²Õ CPU «¬¸¹
(¤ñ¦p»¡¸U¤@¤£½T©w¬O§_n¥Î <literal>I586_CPU</literal> ©Î
<literal>I686_CPU</literal>)¡C µM¦Ó¦Ûq kernel ªº¸Ü¡A«Øij¥ý½T»{¦Û¤vªº
CPU «¬¸¹¡AµM«á¥u¥Î³Ì¾A¦Xªº¨º²Õ´N¦n¤F¡C Y¤£½T©w CPU ¨ì©³¬O¥Îþ¤@ºØ¡A
¥i¥H¬d¾\ <filename>/var/run/dmesg.boot</filename>
ªº¶}¾÷°T®§¥H½T©w¡C</para>
<indexterm>
<primary>kernel options</primary>
<secondary>ident</secondary>
</indexterm>
<programlisting>ident GENERIC</programlisting>
<para>³o¬O³]©w¸Ó kernel ¦WºÙ¬°¦ó¡A¥i¥HÀH·N©R¦W¤§¡A¹³¬O¨ú¦W¬°
<literal>MYKERNEL</literal>¡AY¬O¦³·Ó¥ý«e»¡©ú¨Ó§@¤j·§·|¨ú³o¼Ë¦W¦r¡C
<literal>ident</literal> «á±ªº¦r¦ê·|¦b¶}¾÷®ÉÅã¥Ü¡A¦]¦¹Yn¿ë»{·s kernel
»P±`¥Î kernel ªº¸Ü¡A´N³]©w¤£¦P²Õ¦WºÙ§Y¥i(¤ñ¦p¦b¦Ûq¹êÅç¥Îªº
kernel)¡C</para>
<programlisting>#To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.</programlisting>
<para>&man.device.hints.5; ¥i¥Î¨Ó³]©w¦U¶µÅX°Êµ{¦¡ªº¿ï¶µ¡C
¶}¾÷®É &man.loader.8; ·|Àˬd¹w³]ªº <filename>/boot/device.hints</filename>
³]©wÀÉ¡C ¨Ï¥Î <literal>hints</literal> ¿ï¶µ¡A´N¥i¥H§â³o¨Ç hints
ÀRºA½s¤J kernel ¤º¡C ¦p¦¹¤@¨Ó´N¤£¥²¦b <filename>/boot</filename>
¤º«Ø¥ß <filename>device.hints</filename> ÀÉ¡C</para>
<!-- XXX: Add a comment here that explains when compiling hints into
the kernel is a good idea and why. -->
<programlisting>makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols</programlisting>
<para>¥[¤W <option>-g</option> ¿ï¶µªº¸Ü¡A&os; ·|¦b½sĶ¹Lµ{¥[¤W debug
¥Îªº¸ê°T¡A³z¹L³o¿ï¶µ·|Åý &man.gcc.1; ±Ò¥Î debug
©Ò·|¥Î¨ìªº¬ÛÃö¸ê°T¡C</para>
<programlisting>options SCHED_4BSD # 4BSD scheduler</programlisting>
<para>&os;. ¶Ç²Î©Ò¥Î(¨Ã¥B¬O¹w³])ªº¨t²Î CPU scheduler¡C Y±z¤£²M·¡n¦p¦ó³]©w
¡A½Ð«O¯d³o³]©w¡C</para>
<programlisting>options PREEMPTION # Enable kernel thread preemption</programlisting>
<para>Allows threads that are in the kernel to be preempted
by higher priority threads. It helps with interactivity and
allows interrupt threads to run sooner rather than waiting.</para>
<programlisting>options INET # InterNETworking</programlisting>
<para>Networking support. Leave this in, even if you do not plan to
be connected to a network. Most programs require at least loopback
networking (i.e., making network connections within your PC), so
this is essentially mandatory.</para>
<programlisting>options INET6 # IPv6 communications protocols</programlisting>
<para>This enables the IPv6 communication protocols.</para>
<programlisting>options FFS # Berkeley Fast Filesystem</programlisting>
<para>This is the basic hard drive file system. Leave it in if you
boot from the hard disk.</para>
<programlisting>options SOFTUPDATES # Enable FFS Soft Updates support</programlisting>
<para>This option enables Soft Updates in the kernel, this will
help speed up write access on the disks. Even when this
functionality is provided by the kernel, it must be turned on
for specific disks. Review the output from &man.mount.8; to see
if Soft Updates is enabled for your system disks. If you do not
see the <literal>soft-updates</literal> option then you will
need to activate it using the &man.tunefs.8; (for existing
file systems) or &man.newfs.8; (for new file systems)
commands.</para>
<programlisting>options UFS_ACL # Support for access control lists</programlisting>
<para>This option enables kernel support
for access control lists. This relies on the use of extended
attributes and <acronym>UFS2</acronym>, and the feature is described
in detail in <xref linkend="fs-acl"/>. <acronym>ACL</acronym>s are
enabled by default and should not be
disabled in the kernel if they have been used previously on a file
system, as this will remove the access control lists, changing the
way files are protected in unpredictable ways.</para>
<programlisting>options UFS_DIRHASH # Improve performance on big directories</programlisting>
<para>This option includes functionality to speed up disk
operations on large directories, at the expense of using
additional memory. You would normally keep this for a large
server, or interactive workstation, and remove it if you are
using &os; on a smaller system where memory is at a premium and
disk access speed is less important, such as a firewall.</para>
<programlisting>options MD_ROOT # MD is a potential root device</programlisting>
<para>This option enables support for a memory backed virtual disk
used as a root device.</para>
<indexterm>
<primary>kernel options</primary>
<secondary>NFS</secondary>
</indexterm>
<indexterm>
<primary>kernel options</primary>
<secondary>NFS_ROOT</secondary>
</indexterm>
<programlisting>options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT</programlisting>
<para>The network file system. Unless you plan to mount partitions
from a &unix; file server over TCP/IP, you can comment these
out.</para>
<indexterm>
<primary>kernel options</primary>
<secondary>MSDOSFS</secondary>
</indexterm>
<programlisting>options MSDOSFS # MSDOS Filesystem</programlisting>
<para>The &ms-dos; file system. Unless you plan to mount a DOS formatted
hard drive partition at boot time, you can safely comment this out.
It will be automatically loaded the first time you mount a DOS
partition, as described above. Also, the excellent
<filename role="package">emulators/mtools</filename> software
allows you to access DOS floppies without having to mount and
unmount them (and does not require <literal>MSDOSFS</literal> at
all).</para>
<programlisting>options CD9660 # ISO 9660 Filesystem</programlisting>
<para>The ISO 9660 file system for CDROMs. Comment it out if you do
not have a CDROM drive or only mount data CDs occasionally (since it
will be dynamically loaded the first time you mount a data CD).
Audio CDs do not need this file system.</para>
<programlisting>options PROCFS # Process filesystem(requires PSEUDOFS)</programlisting>
<para>The process file system. This is a <quote>pretend</quote>
file system mounted on <filename>/proc</filename> which allows
programs like &man.ps.1; to give you more information on what
processes are running. Use of <literal>PROCFS</literal>
is not required under most circumstances, as most
debugging and monitoring tools have been adapted to run without
<literal>PROCFS</literal>: installs will not mount this file
system by default.</para>
<programlisting>options PSEUDOFS # Pseudo-filesystem framework</programlisting>
<para>6.X kernels making use of <literal>PROCFS</literal> must also
include support for <literal>PSEUDOFS</literal>.</para>
<programlisting>options GEOM_GPT # GUID Partition Tables.</programlisting>
<para>This option brings the ability to have a large number of
partitions on a single disk.</para>
<programlisting>options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]</programlisting>
<para>Compatibility with 4.3BSD. Leave this in; some programs will
act strangely if you comment this out.</para>
<programlisting>options COMPAT_FREEBSD4 # Compatible with &os;4</programlisting>
<para>This option is required on &os; 5.X &i386; and Alpha systems
to support applications compiled on older versions of &os;
that use older system call interfaces. It is recommended that
this option be used on all &i386; and Alpha systems that may
run older applications; platforms that gained support only in
5.X, such as ia64 and &sparc64;, do not require this option.</para>
<programlisting>options COMPAT_FREEBSD5 # »P &os;5 ¬Û®e</programlisting>
<para>¦¹¦æ¬O &os; 6.X ¤Î§ó·sªºª©¥»Y»Ý¤ä´© &os; 5.X
¨t²Î©I¥s¤~»Ýn³]©w¡C</para>
<programlisting>options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI</programlisting>
<para>This causes the kernel to pause for 5 seconds before probing
each SCSI device in your system. If you only have IDE hard drives,
you can ignore this, otherwise you can try to lower this
number, to speed up booting. Of course, if
you do this and &os; has trouble recognizing your SCSI devices,
you will have to raise it again.</para>
<programlisting>options KTRACE # ktrace(1) support</programlisting>
<para>This enables kernel process tracing, which is useful in
debugging.</para>
<programlisting>options SYSVSHM # SYSV-style shared memory</programlisting>
<para>This option provides for System V shared memory. The most
common use of this is the XSHM extension in X, which many
graphics-intensive programs will automatically take advantage of for
extra speed. If you use X, you will definitely want to include
this.</para>
<programlisting>options SYSVMSG # SYSV-style message queues</programlisting>
<para>Support for System V messages. This option only adds
a few hundred bytes to the kernel.</para>
<programlisting>options SYSVSEM # SYSV-style semaphores</programlisting>
<para>Support for System V semaphores. Less commonly used but only
adds a few hundred bytes to the kernel.</para>
<note>
<para>The <option>-p</option> option of the &man.ipcs.1; command will
list any processes using each of these System V facilities.</para>
</note>
<programlisting>options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions</programlisting>
<para>Real-time extensions added in the 1993 &posix;. Certain
applications in the Ports Collection use these
(such as <application>&staroffice;</application>).</para>
<programlisting>options KBD_INSTALL_CDEV # install a CDEV entry in /dev</programlisting>
<para>This option is required to allow the creation of keyboard device
nodes in <filename>/dev</filename>.</para>
<programlisting>options ADAPTIVE_GIANT # Giant mutex is adaptive.</programlisting>
<para>Giant is the name of a mutual exclusion mechanism (a sleep mutex)
that protects a large set of kernel resources. Today, this is an
unacceptable performance bottleneck which is actively being replaced
with locks that protect individual resources. The
<literal>ADAPTIVE_GIANT</literal> option causes Giant to be included
in the set of mutexes adaptively spun on. That is, when a thread
wants to lock the Giant mutex, but it is already locked by a thread
on another CPU, the first thread will keep running and wait for the
lock to be released. Normally, the thread would instead go back to
sleep and wait for its next chance to run. If you are not sure,
leave this in.</para>
<note>
<para>Note that on &os; 8.0-CURRENT and later versions, all mutexes are
adaptive by default, unless explicitly set to non-adaptive by
compiling with the <literal>NO_ADAPTIVE_MUTEXES</literal> option. As
a result, Giant is adaptive by default now, and the
<literal>ADAPTIVE_GIANT</literal> option has been removed from the
kernel configuration.</para>
</note>
<indexterm>
<primary>kernel options</primary>
<secondary>SMP</secondary>
</indexterm>
<programlisting>device apic # I/O APIC</programlisting>
<para>The apic device enables the use of the I/O APIC for interrupt
delivery. The apic device can be used in both UP and SMP kernels, but
is required for SMP kernels. Add <literal>options SMP</literal> to
include support for multiple processors.</para>
<note>
<para>apic ¥u i386 ¬[ºc¤~¦³¡A¨ä¥L¬[ºc«h¤£¥²¥[¤W³o¦æ¡C</para>
</note>
<programlisting>device eisa</programlisting>
<para>Include this if you have an EISA motherboard. This enables
auto-detection and configuration support for all devices on the EISA
bus.</para>
<programlisting>device pci</programlisting>
<para>Include this if you have a PCI motherboard. This enables
auto-detection of PCI cards and gatewaying from the PCI to ISA
bus.</para>
<programlisting># Floppy drives
device fdc</programlisting>
<para>This is the floppy drive controller.</para>
<programlisting># ATA and ATAPI devices
device ata</programlisting>
<para>This driver supports all ATA and ATAPI devices. You only need
one <literal>device ata</literal> line for the kernel to detect all
PCI ATA/ATAPI devices on modern machines.</para>
<programlisting>device atadisk # ATA disk drives</programlisting>
<para>This is needed along with <literal>device ata</literal> for
ATA disk drives.</para>
<programlisting>device ataraid # ATA RAID drives</programlisting>
<para>This is needed along with <literal>device ata</literal> for ATA
RAID drives.</para>
<programlisting><anchor id="kernelconfig-atapi"/>
device atapicd # ATAPI CDROM drives</programlisting>
<para>This is needed along with <literal>device ata</literal> for
ATAPI CDROM drives.</para>
<programlisting>device atapifd # ATAPI floppy drives</programlisting>
<para>This is needed along with <literal>device ata</literal> for
ATAPI floppy drives.</para>
<programlisting>device atapist # ATAPI tape drives</programlisting>
<para>This is needed along with <literal>device ata</literal> for
ATAPI tape drives.</para>
<programlisting>options ATA_STATIC_ID # Static device numbering</programlisting>
<para>This makes the controller number static; without this,
the device numbers are dynamically allocated.</para>
<programlisting># SCSI Controllers
device ahb # EISA AHA1742 family
device ahc # AHA2940 and onboard AIC7xxx devices
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
device ahd # AHA39320/29320 and onboard AIC79xx devices
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
device amd # AMD 53C974 (Teckram DC-390(T))
device isp # Qlogic family
device ispfw # Firmware for QLogic HBAs- normally a module
device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
device trm # Tekram DC395U/UW/F DC315U adapters
device adv # Advansys SCSI adapters
device adw # Advansys wide SCSI adapters
device aha # Adaptec 154x SCSI adapters
device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
device bt # Buslogic/Mylex MultiMaster SCSI adapters
device ncv # NCR 53C500
device nsp # Workbit Ninja SCSI-3
device stg # TMC 18C30/18C50</programlisting>
<para>SCSI controllers. Comment out any you do not have in your
system. If you have an IDE only system, you can remove these
altogether. The <literal>*_REG_PRETTY_PRINT</literal> lines are
debugging options for their respective drivers.</para>
<programlisting># SCSI peripherals
device scbus # SCSI bus (required for SCSI)
device ch # SCSI media changers
device da # Direct Access (disks)
device sa # Sequential Access (tape etc)
device cd # CD
device pass # Passthrough device (direct SCSI access)
device ses # SCSI Environmental Services (and SAF-TE)</programlisting>
<para>SCSI peripherals. Again, comment out any you do not have, or if
you have only IDE hardware, you can remove them completely.</para>
<note>
<para>The USB &man.umass.4; driver and a few other drivers use
the SCSI subsystem even though they are not real SCSI devices.
Therefore make sure not to remove SCSI support, if any such
drivers are included in the kernel configuration.</para>
</note>
<programlisting># RAID controllers interfaced to the SCSI subsystem
device amr # AMI MegaRAID
device arcmsr # Areca SATA II RAID
device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
device rr232x # Highpoint RocketRAID 232x
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
# RAID controllers
device aac # Adaptec FSA RAID
device aacp # SCSI passthrough for aac (requires CAM)
device ida # Compaq Smart RAID
device mfi # LSI MegaRAID SAS
device mlx # Mylex DAC960 family
device pst # Promise Supertrak SX6000
device twe # 3ware ATA RAID</programlisting>
<para>Supported RAID controllers. If you do not have any of these,
you can comment them out or remove them.</para>
<programlisting># atkbdc0 controls both the keyboard and the PS/2 mouse
device atkbdc # AT keyboard controller</programlisting>
<para>The keyboard controller (<literal>atkbdc</literal>) provides I/O
services for the AT keyboard and PS/2 style pointing devices. This
controller is required by the keyboard driver
(<literal>atkbd</literal>) and the PS/2 pointing device driver
(<literal>psm</literal>).</para>
<programlisting>device atkbd # AT keyboard</programlisting>
<para>The <literal>atkbd</literal> driver, together with
<literal>atkbdc</literal> controller, provides access to the AT 84
keyboard or the AT enhanced keyboard which is connected to the AT
keyboard controller.</para>
<programlisting>device psm # PS/2 mouse</programlisting>
<para>Use this device if your mouse plugs into the PS/2 mouse
port.</para>
<programlisting>device kbdmux # keyboard multiplexer</programlisting>
<para>¦h«Áä½Lªº¤ä´©¡C Y¤£¥´ºâ¦P®É±µ¦h²ÕÁä½Lªº¸Ü¡A
¨º»òYn²¾°£¸Ó¦æ¤]¨SÃö«Y¡C</para>
<programlisting>device vga # VGA video card driver</programlisting>
<para>The video card driver.</para>
<programlisting>
device splash # Splash screen and screen saver support</programlisting>
<para>Splash screen at start up! Screen savers require this
too.</para>
<programlisting># syscons is the default console driver, resembling an SCO console
device sc</programlisting>
<para><literal>sc</literal> is the default console driver and
resembles a SCO console. Since most full-screen programs access the
console through a terminal database library like
<filename>termcap</filename>, it should not matter whether you use
this or <literal>vt</literal>, the <literal>VT220</literal>
compatible console driver. When you log in, set your
<envar>TERM</envar> variable to <literal>scoansi</literal> if
full-screen programs have trouble running under this console.</para>
<programlisting># Enable this for the pcvt (VT220 compatible) console driver
#device vt
#options XSERVER # support for X server on a vt console
#options FAT_CURSOR # start with block cursor</programlisting>
<para>This is a VT220-compatible console driver, backward compatible to
VT100/102. It works well on some laptops which have hardware
incompatibilities with <literal>sc</literal>. Also set your
<envar>TERM</envar> variable to <literal>vt100</literal> or
<literal>vt220</literal> when you log in. This driver might also
prove useful when connecting to a large number of different machines
over the network, where <filename>termcap</filename> or
<filename>terminfo</filename> entries for the <literal>sc</literal>
device are often not available — <literal>vt100</literal>
should be available on virtually any platform.</para>
<programlisting>device agp</programlisting>
<para>Include this if you have an AGP card in the system. This
will enable support for AGP, and AGP GART for boards which
have these features.</para>
<indexterm>
<primary>APM</primary>
</indexterm>
<programlisting># Power management support (see NOTES for more options)
#device apm</programlisting>
<para>Advanced Power Management support. Useful for laptops,
although in &os; 5.X and above this is disabled in
<filename>GENERIC</filename> by default.</para>
<programlisting># Add suspend/resume support for the i8254.
device pmtimer</programlisting>
<para>Timer device driver for power management events, such as APM and
ACPI.</para>
<programlisting># PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
device cbb # cardbus (yenta) bridge
device pccard # PC Card (16-bit) bus
device cardbus # CardBus (32-bit) bus</programlisting>
<para>PCMCIA support. You want this if you are using a
laptop.</para>
<programlisting># Serial (COM) ports
device sio # 8250, 16[45]50 based serial ports</programlisting>
<para>These are the serial ports referred to as
<devicename>COM</devicename> ports in the &ms-dos;/&windows;
world.</para>
<note>
<para>If you have an internal modem on <devicename>COM4</devicename>
and a serial port at <devicename>COM2</devicename>, you will have
to change the IRQ of the modem to 2 (for obscure technical reasons,
IRQ2 = IRQ 9) in order to access it
from &os;. If you have a multiport serial card, check the
manual page for &man.sio.4; for more information on the proper
values to add to your <filename>/boot/device.hints</filename>.
Some video cards (notably those based on
S3 chips) use IO addresses in the form of
<literal>0x*2e8</literal>, and since many cheap serial cards do
not fully decode the 16-bit IO address space, they clash with
these cards making the <devicename>COM4</devicename> port
practically unavailable.</para>
<para>Each serial port is required to have a unique IRQ (unless you
are using one of the multiport cards where shared interrupts are
supported), so the default IRQs for <devicename>COM3</devicename>
and <devicename>COM4</devicename> cannot be used.</para>
</note>
<programlisting># Parallel port
device ppc</programlisting>
<para>This is the ISA-bus parallel port interface.</para>
<programlisting>device ppbus # Parallel port bus (required)</programlisting>
<para>Provides support for the parallel port bus.</para>
<programlisting>device lpt # Printer</programlisting>
<para>Support for parallel port printers.</para>
<note>
<para>All three of the above are required to enable parallel printer
support.</para>
</note>
<programlisting>device plip # TCP/IP over parallel</programlisting>
<para>This is the driver for the parallel network interface.</para>
<programlisting>device ppi # Parallel port interface device</programlisting>
<para>The general-purpose I/O (<quote>geek port</quote>) + IEEE1284
I/O.</para>
<programlisting>#device vpo # Requires scbus and da</programlisting>
<indexterm><primary>zip drive</primary></indexterm>
<para>This is for an Iomega Zip drive. It requires
<literal>scbus</literal> and <literal>da</literal> support. Best
performance is achieved with ports in EPP 1.9 mode.</para>
<programlisting>#device puc</programlisting>
<para>Uncomment this device if you have a <quote>dumb</quote> serial
or parallel PCI card that is supported by the &man.puc.4; glue
driver.</para>
<programlisting># PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (<quote>Tulip</quote>)
device em # Intel PRO/1000 adapter Gigabit Ethernet Card
device ixgb # Intel PRO/10GbE Ethernet Card
device txp # 3Com 3cR990 (<quote>Typhoon</quote>)
device vx # 3Com 3c590, 3c595 (<quote>Vortex</quote>)</programlisting>
<para>Various PCI network card drivers. Comment out or remove any of
these not present in your system.</para>
<programlisting># PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support</programlisting>
<para>MII bus support is required for some PCI 10/100 Ethernet NICs,
namely those which use MII-compliant transceivers or implement
transceiver control interfaces that operate like an MII. Adding
<literal>device miibus</literal> to the kernel config pulls in
support for the generic miibus API and all of the PHY drivers,
including a generic one for PHYs that are not specifically handled
by an individual driver.</para>
<programlisting>device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
device bfe # Broadcom BCM440x 10/100 Ethernet
device bge # Broadcom BCM570xx Gigabit Ethernet
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
device lge # Level 1 LXT1001 gigabit ethernet
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
device nge # NatSemi DP83820 gigabit ethernet
device nve # nVidia nForce MCP on-board Ethernet Networking
device pcn # AMD Am79C97x PCI 10/100 (precedence over 'lnc')
device re # RealTek 8139C+/8169/8169S/8110S
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (<quote>Starfire</quote>)
device sis # Silicon Integrated Systems SiS 900/SiS 7016
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
device ste # Sundance ST201 (D-Link DFE-550TX)
device stge # Sundance/Tamarack TC9021 gigabit Ethernet
device ti # Alteon Networks Tigon I/II gigabit Ethernet
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c170 <quote>EPIC</quote>)
device vge # VIA VT612x gigabit ethernet
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (<quote>Boomerang</quote>, <quote>Cyclone</quote>)</programlisting>
<para>Drivers that use the MII bus controller code.</para>
<programlisting># ISA Ethernet NICs. pccard NICs included.
device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus'
device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
device ex # Intel EtherExpress Pro/10 and Pro/10+
device ep # Etherlink III based cards
device fe # Fujitsu MB8696x based cards
device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
device lnc # NE2100, NE32-VL Lance Ethernet cards
device sn # SMC's 9000 series of Ethernet chips
device xe # Xircom pccard Ethernet
# ISA devices that use the old ISA shims
#device le</programlisting>
<para>ISA Ethernet drivers. See
<filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/NOTES</filename> for details
of which cards are
supported by which driver.</para>
<programlisting># Wireless NIC cards
device wlan # 802.11 support</programlisting>
<para>¹ï 802.11 ¼Ð·Çªº¤ä´©¡C YnµL½u¤Wºô¡A«h»Ý¥[¤W³o¦æ¡C</para>
<programlisting>device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
device wlan_tkip # 802.11 TKIP support</programlisting>
<para>¹ï 802.11 ¥[±K³]³Æªº¤ä´©¡C Yn¦w¥þ¥[±K¥H¤Î 802.11i ¦w¥þ¨ó©w¡A
«h»Ý¥[¤W³o¦æ¡C</para>
<programlisting>device an # Aironet 4500/4800 802.11 wireless NICs.
device ath # Atheros pci/cardbus NIC's
device ath_hal # Atheros HAL (Hardware Access Layer)
device ath_rate_sample # SampleRate tx rate control for ath
device an # Aironet 4500/4800 802.11 wireless NICs.
device awi # BayStack 660 and others
device ral # Ralink Technology RT2500 wireless NICs.
device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.</programlisting>
<para>Support for various wireless cards.</para>
<programlisting># Pseudo devices
device loop # Network loopback</programlisting>
<para>This is the generic loopback device for TCP/IP. If you telnet
or FTP to <hostid>localhost</hostid> (a.k.a. <hostid
role="ipaddr">127.0.0.1</hostid>) it will come back at you through
this device. This is <emphasis>mandatory</emphasis>.</para>
<programlisting>device random # Entropy device</programlisting>
<para>Cryptographically secure random number generator.</para>
<programlisting>device ether # Ethernet support</programlisting>
<para><literal>ether</literal> is only needed if you have an Ethernet
card. It includes generic Ethernet protocol code.</para>
<programlisting>device sl # Kernel SLIP</programlisting>
<para><literal>sl</literal> is for SLIP support. This has been almost
entirely supplanted by PPP, which is easier to set up, better suited
for modem-to-modem connection, and more powerful.</para>
<programlisting>device ppp # Kernel PPP</programlisting>
<para>This is for kernel PPP support for dial-up connections. There
is also a version of PPP implemented as a userland application that
uses <literal>tun</literal> and offers more flexibility and features
such as demand dialing.</para>
<programlisting>device tun # Packet tunnel.</programlisting>
<para>This is used by the userland PPP software.
See
the <link linkend="userppp">PPP</link> section of this book for more
information.</para>
<programlisting><anchor id="kernelconfig-ptys"/>
device pty # Pseudo-ttys (telnet etc)</programlisting>
<para>This is a <quote>pseudo-terminal</quote> or simulated login port.
It is used by incoming <command>telnet</command> and
<command>rlogin</command> sessions,
<application>xterm</application>, and some other applications such
as <application>Emacs</application>.</para>
<programlisting>device md # Memory <quote>disks</quote></programlisting>
<para>Memory disk pseudo-devices.</para>
<programlisting>device gif # IPv6 and IPv4 tunneling</programlisting>
<para>This implements IPv6 over IPv4 tunneling, IPv4 over IPv6 tunneling,
IPv4 over IPv4 tunneling, and IPv6 over IPv6 tunneling. The
<literal>gif</literal> device is
<quote>auto-cloning</quote>, and will create device nodes as
needed.</para>
<programlisting>device faith # IPv6-to-IPv4 relaying (translation)</programlisting>
<para>This pseudo-device captures packets that are sent to it and
diverts them to the IPv4/IPv6 translation daemon.</para>
<programlisting># The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter</programlisting>
<para>This is the Berkeley Packet Filter. This pseudo-device allows
network interfaces to be placed in promiscuous mode, capturing every
packet on a broadcast network (e.g., an Ethernet). These packets
can be captured to disk and or examined with the &man.tcpdump.1;
program.</para>
<note>
<para>The &man.bpf.4; device is also used by
&man.dhclient.8; to obtain the IP address of the default router
(gateway) and so on. If you use DHCP, leave this
uncommented.</para>
</note>
<programlisting># USB support
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device ugen # Generic
device uhid # <quote>Human Interface Devices</quote>
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
device ural # Ralink Technology RT2500USB wireless NICs
device urio # Diamond Rio 500 MP3 player
device uscanner # Scanners
# USB Ethernet, requires mii
device aue # ADMtek USB Ethernet
device axe # ASIX Electronics USB Ethernet
device cdce # Generic USB over Ethernet
device cue # CATC USB Ethernet
device kue # Kawasaki LSI USB Ethernet
device rue # RealTek RTL8150 USB Ethernet</programlisting>
<para>Support for various USB devices.</para>
<programlisting># FireWire support
device firewire # FireWire bus code
device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)</programlisting>
<para>Support for various Firewire devices.</para>
<para>For more information and additional devices supported by
&os;, see
<filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/NOTES</filename>.</para>
<sect2>
<title>Large Memory Configurations (<acronym>PAE</acronym>)</title>
<indexterm>
<primary>Physical Address Extensions
(<acronym>PAE</acronym>)</primary>
<secondary>large memory</secondary>
</indexterm>
<para>Large memory configuration machines require access to
more than the 4 gigabyte limit on User+Kernel Virtual
Address (<acronym>KVA</acronym>) space. Due to this
limitation, Intel added support for 36-bit physical address
space access in the &pentium; Pro and later line of CPUs.</para>
<para>The Physical Address Extension (<acronym>PAE</acronym>)
capability of the &intel; &pentium; Pro and later CPUs
allows memory configurations of up to 64 gigabytes.
&os; provides support for this capability via the
<option>PAE</option> kernel configuration option, available
in all current release versions of &os;. Due to
the limitations of the Intel memory architecture, no distinction
is made for memory above or below 4 gigabytes. Memory allocated
above 4 gigabytes is simply added to the pool of available
memory.</para>
<para>To enable <acronym>PAE</acronym> support in the kernel,
simply add the following line to your kernel configuration
file:</para>
<programlisting>options PAE</programlisting>
<note>
<para>The <acronym>PAE</acronym> support in &os; is only
available for &intel; IA-32 processors. It should also be
noted, that the <acronym>PAE</acronym> support in &os; has
not received wide testing, and should be considered beta
quality compared to other stable features of &os;.</para>
</note>
<para><acronym>PAE</acronym> support in &os; has a few limitations:</para>
<itemizedlist>
<listitem>
<para>A process is not able to access more than 4
gigabytes of VM space.</para>
</listitem>
<listitem>
<para><acronym>KLD</acronym> modules cannot be loaded into
a <acronym>PAE</acronym> enabled kernel, due to the
differences in the build framework of a module and the
kernel.</para>
</listitem>
<listitem>
<para>Device drivers that do not use the &man.bus.dma.9;
interface will cause data corruption in a
<acronym>PAE</acronym> enabled kernel and are not
recommended for use. For this reason, a
<filename>PAE</filename> kernel
configuration file is provided in &os; which
excludes all drivers not known to work in a <acronym>PAE</acronym> enabled
kernel.</para>
</listitem>
<listitem>
<para>Some system tunables determine memory resource usage
by the amount of available physical memory. Such
tunables can unnecessarily over-allocate due to the
large memory nature of a <acronym>PAE</acronym> system.
One such example is the <option>kern.maxvnodes</option>
sysctl, which controls the maximum number of vnodes allowed
in the kernel. It is advised to adjust this and other
such tunables to a reasonable value.</para>
</listitem>
<listitem>
<para>It might be necessary to increase the kernel virtual
address (<acronym>KVA</acronym>) space or to reduce the
amount of specific kernel resource that is heavily used
(see above) in order to avoid <acronym>KVA</acronym>
exhaustion. The <option>KVA_PAGES</option> kernel option
can be used for increasing the
<acronym>KVA</acronym> space.</para>
</listitem>
</itemizedlist>
<para>For performance and stability concerns, it is advised to
consult the &man.tuning.7; manual page. The &man.pae.4;
manual page contains up-to-date information on &os;'s
<acronym>PAE</acronym> support.</para>
</sect2>
</sect1>
<sect1 id="kernelconfig-trouble">
<title>If Something Goes Wrong</title>
<para>There are five categories of trouble that can occur when
building a custom kernel. They are:</para>
<variablelist>
<varlistentry>
<term><command>config</command> fails:</term>
<listitem>
<para>If the &man.config.8; command fails when you
give it your kernel description, you have probably made a
simple error somewhere. Fortunately,
&man.config.8; will print the line number that it
had trouble with, so that you can quickly locate the line
containing the error. For example, if you see:</para>
<screen>config: line 17: syntax error</screen>
<para>Make sure the
keyword is typed correctly by comparing it to the
<filename>GENERIC</filename> kernel or another
reference.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>make</command> fails:</term>
<listitem>
<para>If the <command>make</command> command fails, it usually
signals an error in your kernel description which is not severe
enough for &man.config.8; to catch. Again, look
over your configuration, and if you still cannot resolve the
problem, send mail to the &a.questions; with your kernel
configuration, and it should be diagnosed quickly.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>The kernel does not boot:<anchor
id="kernelconfig-noboot"/></term>
<listitem>
<para>If your new kernel does not boot, or fails to
recognize your devices, do not panic! Fortunately, &os; has
an excellent mechanism for recovering from incompatible
kernels. Simply choose the kernel you want to boot from at
the &os; boot loader. You can access this when the system
boot menu appears. Select the <quote>Escape to a loader
prompt</quote> option, number six. At the prompt, type
<command>unload kernel</command>
and then type
<command>boot /boot/<replaceable>kernel.old</replaceable>/kernel</command>,
or the filename of any other kernel that will boot properly.
When reconfiguring a kernel, it is always a good idea to keep
a kernel that is known to work on hand.</para>
<para>After booting with a good kernel you can check over your
configuration file and try to build it again. One helpful
resource is the <filename>/var/log/messages</filename> file
which records, among other things, all of the kernel messages
from every successful boot. Also, the &man.dmesg.8; command
will print the kernel messages from the current boot.</para>
<note>
<para>If you are having trouble building a kernel, make sure
to keep a <filename>GENERIC</filename>, or some other kernel
that is known to work on hand as a different name that will
not get erased on the next build. You cannot rely on
<filename>kernel.old</filename> because when installing a
new kernel, <filename>kernel.old</filename> is overwritten
with the last installed kernel which may be non-functional.
Also, as soon as possible, move the working kernel to the
proper <filename class="directory">/boot/kernel</filename>
location or commands such
as &man.ps.1; may not work properly. To do this, simply
rename the directory containing the good kernel:</para>
<screen>&prompt.root; <userinput>mv /boot/kernel /boot/kernel.bad</userinput>
&prompt.root; <userinput>mv /boot/<replaceable>kernel.good</replaceable> /boot/kernel</userinput></screen>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>The kernel works, but &man.ps.1; does not work
any more:</term>
<listitem>
<para>If you have installed a different version of the kernel
from the one that the system utilities have been built with,
for example, a -CURRENT kernel on a -RELEASE, many system-status
commands like &man.ps.1; and &man.vmstat.8; will not work any
more. You should <link linkend="makeworld">recompile and install
a world</link> built with the same version of the source tree as
your kernel. This is one reason it is
not normally a good idea to use a different version of the
kernel from the rest of the operating system.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
</chapter>
|