aboutsummaryrefslogtreecommitdiff
path: root/en/handbook/handbook.sgml
blob: 0d3790a6a440cb93ceae0970d11006133c16c3b2 (plain) (blame)
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
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
34822
34823
34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
34837
34838
34839
34840
34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
34886
34887
34888
34889
34890
34891
34892
34893
34894
34895
34896
34897
34898
34899
34900
34901
34902
34903
34904
34905
34906
34907
34908
34909
34910
34911
34912
34913
34914
34915
34916
34917
34918
34919
34920
34921
34922
34923
34924
34925
34926
34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
34944
34945
34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
34968
34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
34986
34987
34988
34989
34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
35124
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
35151
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
35299
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
35362
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
35380
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
35475
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
35504
35505
35506
35507
35508
35509
35510
35511
35512
35513
35514
35515
35516
35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
35528
35529
35530
35531
35532
35533
35534
35535
35536
35537
35538
35539
35540
35541
35542
35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
35554
35555
35556
35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
35596
35597
35598
35599
35600
35601
35602
35603
35604
35605
35606
35607
35608
35609
35610
35611
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
35627
35628
35629
35630
35631
35632
35633
35634
35635
35636
35637
35638
35639
35640
35641
35642
35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
35668
35669
35670
35671
35672
35673
35674
35675
35676
35677
35678
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
35750
35751
35752
35753
35754
35755
35756
35757
35758
35759
35760
35761
35762
35763
35764
35765
35766
35767
35768
35769
35770
35771
35772
35773
35774
35775
35776
35777
35778
35779
35780
35781
35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
35799
35800
35801
35802
35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
35897
35898
35899
35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
35917
35918
35919
35920
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
35993
35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
36005
36006
36007
36008
36009
36010
36011
36012
36013
36014
36015
36016
36017
36018
36019
36020
36021
36022
36023
36024
36025
36026
36027
36028
36029
36030
36031
36032
36033
36034
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
36056
36057
36058
36059
36060
36061
36062
36063
36064
36065
36066
36067
36068
36069
36070
36071
36072
36073
36074
36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
36113
36114
36115
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
36143
36144
36145
36146
36147
36148
36149
36150
36151
36152
36153
36154
36155
36156
36157
36158
36159
36160
36161
36162
36163
36164
36165
36166
36167
36168
36169
36170
36171
36172
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182
36183
36184
36185
36186
36187
36188
36189
36190
36191
36192
36193
36194
36195
36196
36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
36209
36210
36211
36212
36213
36214
36215
36216
36217
36218
36219
36220
36221
36222
36223
36224
36225
36226
36227
36228
36229
36230
36231
36232
36233
36234
36235
36236
36237
36238
36239
36240
36241
36242
36243
36244
36245
36246
36247
36248
36249
36250
36251
36252
36253
36254
36255
36256
36257
36258
36259
36260
36261
36262
36263
36264
36265
36266
36267
36268
36269
36270
36271
36272
36273
36274
36275
36276
36277
36278
36279
36280
36281
36282
36283
36284
36285
36286
36287
36288
36289
36290
36291
36292
36293
36294
36295
36296
36297
36298
36299
36300
36301
36302
36303
36304
36305
36306
36307
36308
36309
36310
36311
36312
36313
36314
36315
36316
36317
36318
36319
36320
36321
36322
36323
36324
36325
36326
36327
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
36351
36352
36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
36388
36389
36390
36391
36392
36393
36394
36395
36396
36397
36398
36399
36400
36401
36402
36403
36404
36405
36406
36407
36408
36409
36410
36411
36412
36413
36414
36415
36416
36417
36418
36419
36420
36421
36422
36423
36424
36425
36426
36427
36428
36429
36430
36431
36432
36433
36434
36435
36436
36437
36438
36439
36440
36441
36442
36443
36444
36445
36446
36447
36448
36449
36450
36451
36452
36453
36454
36455
36456
36457
36458
36459
36460
36461
36462
36463
36464
36465
36466
36467
36468
36469
36470
36471
36472
36473
36474
36475
36476
36477
36478
36479
36480
36481
36482
36483
36484
36485
36486
36487
36488
36489
36490
36491
36492
36493
36494
36495
36496
36497
36498
36499
36500
36501
36502
36503
36504
36505
36506
36507
36508
36509
36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
36523
36524
36525
36526
36527
36528
36529
36530
36531
36532
36533
36534
36535
36536
36537
36538
36539
36540
36541
36542
36543
36544
36545
36546
36547
36548
36549
36550
36551
36552
36553
36554
36555
36556
36557
36558
36559
36560
36561
36562
36563
36564
36565
36566
36567
36568
36569
36570
36571
36572
36573
36574
36575
36576
36577
36578
36579
36580
36581
36582
36583
36584
36585
36586
36587
36588
36589
36590
36591
36592
36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
36603
36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
36614
36615
36616
36617
36618
36619
36620
36621
36622
36623
36624
36625
36626
36627
36628
36629
36630
36631
36632
36633
36634
36635
36636
36637
36638
36639
36640
36641
36642
36643
36644
36645
36646
36647
36648
36649
36650
36651
36652
36653
36654
36655
36656
36657
36658
36659
36660
36661
36662
36663
36664
36665
36666
36667
36668
36669
36670
36671
36672
36673
36674
36675
36676
36677
36678
36679
36680
36681
36682
36683
36684
36685
36686
36687
36688
36689
36690
36691
36692
36693
36694
36695
36696
36697
36698
36699
36700
36701
36702
36703
36704
36705
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716
36717
36718
36719
36720
36721
36722
36723
36724
36725
36726
36727
36728
36729
36730
36731
36732
36733
36734
36735
36736
36737
36738
36739
36740
36741
36742
36743
36744
36745
36746
36747
36748
36749
36750
36751
36752
36753
36754
36755
36756
36757
36758
36759
36760
36761
36762
36763
36764
36765
36766
36767
36768
36769
36770
36771
36772
36773
36774
36775
36776
36777
36778
36779
36780
36781
36782
36783
36784
36785
36786
36787
36788
36789
36790
36791
36792
36793
36794
36795
36796
36797
36798
36799
36800
36801
36802
36803
36804
36805
36806
36807
36808
36809
36810
36811
36812
36813
36814
36815
36816
36817
36818
36819
36820
36821
36822
36823
36824
36825
36826
36827
36828
36829
36830
36831
36832
36833
36834
36835
36836
36837
36838
36839
36840
36841
36842
36843
36844
36845
36846
36847
36848
36849
36850
36851
36852
36853
36854
36855
36856
36857
36858
36859
36860
36861
36862
36863
36864
36865
36866
36867
36868
36869
36870
36871
36872
36873
36874
36875
36876
36877
36878
36879
36880
36881
36882
36883
36884
36885
36886
36887
36888
36889
36890
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
36905
36906
36907
36908
36909
36910
36911
36912
36913
36914
36915
36916
36917
36918
36919
36920
36921
36922
36923
36924
36925
36926
36927
36928
36929
36930
36931
36932
36933
36934
36935
36936
36937
36938
36939
36940
36941
36942
36943
36944
36945
36946
36947
36948
36949
36950
36951
36952
36953
36954
36955
36956
36957
36958
36959
36960
36961
36962
36963
36964
36965
36966
36967
36968
36969
36970
36971
36972
36973
36974
36975
36976
36977
36978
36979
36980
36981
36982
36983
36984
36985
36986
36987
36988
36989
36990
36991
36992
36993
36994
36995
36996
36997
36998
36999
37000
37001
37002
37003
37004
37005
37006
37007
37008
37009
37010
37011
37012
37013
37014
37015
37016
37017
37018
37019
37020
37021
37022
37023
37024
37025
37026
37027
37028
37029
37030
37031
37032
37033
37034
37035
37036
37037
37038
37039
37040
37041
37042
37043
37044
37045
37046
37047
37048
37049
37050
37051
37052
37053
37054
37055
37056
37057
37058
37059
37060
37061
37062
37063
37064
37065
37066
37067
37068
37069
37070
37071
37072
37073
37074
37075
37076
37077
37078
37079
37080
37081
37082
37083
37084
37085
37086
37087
37088
37089
37090
37091
37092
37093
37094
37095
37096
37097
37098
37099
37100
37101
37102
37103
37104
37105
37106
37107
37108
37109
37110
37111
37112
37113
37114
37115
37116
37117
37118
37119
37120
37121
37122
37123
37124
37125
37126
37127
37128
37129
37130
37131
37132
37133
37134
37135
37136
37137
37138
37139
37140
37141
37142
37143
37144
37145
37146
37147
37148
37149
37150
37151
37152
37153
37154
37155
37156
37157
37158
37159
37160
37161
37162
37163
37164
37165
37166
37167
37168
37169
37170
37171
37172
37173
37174
37175
37176
37177
37178
37179
37180
37181
37182
37183
37184
37185
37186
37187
37188
37189
37190
37191
37192
37193
37194
37195
37196
37197
37198
37199
37200
37201
37202
37203
37204
37205
37206
37207
37208
37209
37210
37211
37212
37213
37214
37215
37216
37217
37218
37219
37220
37221
37222
37223
37224
37225
37226
37227
37228
37229
37230
37231
37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247
37248
37249
37250
37251
37252
37253
37254
37255
37256
37257
37258
37259
37260
37261
37262
37263
37264
37265
37266
37267
37268
37269
37270
37271
37272
37273
37274
37275
37276
37277
37278
37279
37280
37281
37282
37283
37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
37303
37304
37305
37306
37307
37308
37309
37310
37311
37312
37313
37314
37315
37316
37317
37318
37319
37320
37321
37322
37323
37324
37325
37326
37327
37328
37329
37330
37331
37332
37333
37334
37335
37336
37337
37338
37339
37340
37341
37342
37343
37344
37345
37346
37347
37348
37349
37350
37351
37352
37353
37354
37355
37356
37357
37358
37359
37360
37361
37362
37363
37364
37365
37366
37367
37368
37369
37370
37371
37372
37373
37374
37375
37376
37377
37378
37379
37380
37381
37382
37383
37384
37385
37386
37387
37388
37389
37390
37391
37392
37393
37394
37395
37396
37397
37398
37399
37400
37401
37402
37403
37404
37405
37406
37407
37408
37409
37410
37411
37412
37413
37414
37415
37416
37417
37418
37419
37420
37421
37422
37423
37424
37425
37426
37427
37428
37429
37430
37431
37432
37433
37434
37435
37436
37437
37438
37439
37440
37441
37442
37443
37444
37445
37446
37447
37448
37449
37450
37451
37452
37453
37454
37455
37456
37457
37458
37459
37460
37461
37462
37463
37464
37465
37466
37467
37468
37469
37470
37471
37472
37473
37474
37475
37476
37477
37478
37479
37480
37481
37482
37483
37484
37485
37486
37487
37488
37489
37490
37491
37492
37493
37494
37495
37496
37497
37498
37499
37500
37501
37502
37503
37504
37505
37506
37507
37508
37509
37510
37511
37512
37513
37514
37515
37516
37517
37518
37519
37520
37521
37522
37523
37524
37525
37526
37527
37528
37529
37530
37531
37532
37533
37534
37535
37536
37537
37538
37539
37540
37541
37542
37543
37544
37545
37546
37547
37548
37549
37550
37551
37552
37553
37554
37555
37556
37557
37558
37559
37560
37561
37562
37563
37564
37565
37566
37567
37568
37569
37570
37571
37572
37573
37574
37575
37576
37577
37578
37579
37580
37581
37582
37583
37584
37585
37586
37587
37588
37589
37590
37591
37592
37593
37594
37595
37596
37597
37598
37599
37600
37601
37602
37603
37604
37605
37606
37607
37608
37609
37610
37611
37612
37613
37614
37615
37616
37617
37618
37619
37620
37621
37622
37623
37624
37625
37626
37627
37628
37629
37630
37631
37632
37633
37634
37635
37636
37637
37638
37639
37640
37641
37642
37643
37644
37645
37646
37647
37648
37649
37650
37651
37652
37653
37654
37655
37656
37657
37658
37659
37660
37661
37662
37663
37664
37665
37666
37667
37668
37669
37670
37671
37672
37673
37674
37675
37676
37677
37678
37679
37680
37681
37682
37683
37684
37685
37686
37687
37688
37689
37690
37691
37692
37693
37694
37695
37696
37697
37698
37699
37700
37701
37702
37703
37704
37705
37706
37707
37708
37709
37710
37711
37712
37713
37714
37715
37716
37717
37718
37719
37720
37721
37722
37723
37724
37725
37726
37727
37728
37729
37730
37731
37732
37733
37734
37735
37736
37737
37738
37739
37740
37741
37742
37743
37744
37745
37746
37747
37748
37749
37750
37751
37752
37753
37754
37755
37756
37757
37758
37759
37760
37761
37762
37763
37764
37765
37766
37767
37768
37769
37770
37771
37772
37773
37774
37775
37776
37777
37778
37779
37780
37781
37782
37783
37784
37785
37786
37787
37788
37789
37790
37791
37792
37793
37794
37795
37796
37797
37798
37799
37800
37801
37802
37803
37804
37805
37806
37807
37808
37809
37810
37811
37812
37813
37814
37815
37816
37817
37818
37819
37820
37821
37822
37823
37824
37825
37826
37827
37828
37829
37830
37831
37832
37833
37834
37835
37836
37837
37838
37839
37840
37841
37842
37843
37844
37845
37846
37847
37848
37849
37850
37851
37852
37853
37854
37855
37856
37857
37858
37859
37860
37861
37862
37863
37864
37865
37866
37867
37868
37869
37870
37871
37872
37873
37874
37875
37876
37877
37878
37879
37880
37881
37882
37883
37884
37885
37886
37887
37888
37889
37890
37891
37892
37893
37894
37895
37896
37897
37898
37899
37900
37901
37902
37903
37904
37905
37906
37907
37908
37909
37910
37911
37912
37913
37914
37915
37916
37917
37918
37919
37920
37921
37922
37923
37924
37925
37926
37927
37928
37929
37930
37931
37932
37933
37934
37935
37936
37937
37938
37939
37940
37941
37942
37943
37944
37945
37946
37947
37948
37949
37950
37951
37952
37953
37954
37955
37956
37957
37958
37959
37960
37961
37962
37963
37964
37965
37966
37967
37968
37969
37970
37971
37972
37973
37974
37975
37976
37977
37978
37979
37980
37981
37982
37983
37984
37985
37986
37987
37988
37989
37990
37991
37992
37993
37994
37995
37996
37997
37998
37999
38000
38001
38002
38003
38004
38005
38006
38007
38008
38009
38010
38011
38012
38013
38014
38015
38016
38017
38018
38019
38020
38021
38022
38023
38024
38025
38026
38027
38028
38029
38030
38031
38032
38033
38034
38035
38036
38037
38038
38039
38040
38041
38042
38043
38044
38045
38046
38047
38048
38049
38050
38051
38052
38053
38054
38055
38056
38057
38058
38059
38060
38061
38062
38063
38064
38065
38066
38067
38068
38069
38070
38071
38072
38073
38074
38075
38076
38077
38078
38079
38080
38081
38082
38083
38084
38085
38086
38087
38088
38089
38090
38091
38092
38093
38094
38095
38096
38097
38098
38099
38100
38101
38102
38103
38104
38105
38106
38107
38108
38109
38110
38111
38112
38113
38114
38115
38116
38117
38118
38119
38120
38121
38122
38123
38124
38125
38126
38127
38128
38129
38130
38131
38132
38133
38134
38135
38136
38137
38138
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
38154
38155
38156
38157
38158
38159
38160
38161
38162
38163
38164
38165
38166
38167
38168
38169
38170
38171
38172
38173
38174
38175
38176
38177
38178
38179
38180
38181
38182
38183
38184
38185
38186
38187
38188
38189
38190
38191
38192
38193
38194
38195
38196
38197
38198
38199
38200
38201
38202
38203
38204
38205
38206
38207
38208
38209
38210
38211
38212
38213
38214
38215
38216
38217
38218
38219
38220
38221
38222
38223
38224
38225
38226
38227
38228
38229
38230
38231
38232
38233
38234
38235
38236
38237
38238
38239
38240
38241
38242
38243
38244
38245
38246
38247
38248
38249
38250
38251
38252
38253
38254
38255
38256
38257
38258
38259
38260
38261
38262
38263
38264
38265
38266
38267
38268
38269
38270
38271
38272
38273
38274
38275
38276
38277
38278
38279
38280
38281
38282
38283
38284
38285
38286
38287
38288
38289
38290
38291
38292
38293
38294
38295
38296
38297
38298
38299
38300
38301
38302
38303
38304
38305
38306
38307
38308
38309
38310
38311
38312
38313
38314
38315
38316
38317
38318
38319
38320
38321
38322
38323
38324
38325
38326
38327
38328
38329
38330
38331
38332
38333
38334
38335
38336
38337
38338
38339
38340
38341
38342
38343
38344
38345
38346
38347
38348
38349
38350
38351
38352
38353
38354
38355
38356
38357
38358
38359
38360
38361
38362
38363
38364
38365
38366
38367
38368
38369
38370
38371
38372
38373
38374
38375
38376
38377
38378
38379
38380
38381
38382
38383
38384
38385
38386
38387
38388
38389
38390
38391
38392
38393
38394
38395
38396
38397
38398
38399
38400
38401
38402
38403
38404
38405
38406
38407
38408
38409
38410
38411
38412
38413
38414
38415
38416
38417
38418
38419
38420
38421
38422
38423
38424
38425
38426
38427
38428
38429
38430
38431
38432
38433
38434
38435
38436
38437
38438
38439
38440
38441
38442
38443
38444
38445
38446
38447
38448
38449
38450
38451
38452
38453
38454
38455
38456
38457
38458
38459
38460
38461
38462
38463
38464
38465
38466
38467
38468
38469
38470
38471
38472
38473
38474
38475
38476
38477
38478
38479
38480
38481
38482
38483
38484
38485
38486
38487
38488
38489
38490
38491
38492
38493
38494
38495
38496
38497
38498
38499
38500
38501
38502
38503
38504
38505
38506
38507
38508
38509
38510
38511
38512
38513
38514
38515
38516
38517
38518
38519
38520
38521
38522
38523
38524
38525
38526
38527
38528
38529
38530
38531
38532
38533
38534
38535
38536
38537
38538
38539
38540
38541
38542
38543
38544
38545
38546
38547
38548
38549
38550
38551
38552
38553
38554
38555
38556
38557
38558
38559
38560
38561
38562
38563
38564
38565
38566
38567
38568
38569
38570
38571
38572
38573
38574
38575
38576
38577
38578
38579
38580
38581
38582
38583
38584
38585
38586
38587
38588
38589
38590
38591
38592
38593
38594
38595
38596
38597
38598
38599
38600
38601
38602
38603
38604
38605
38606
38607
38608
38609
38610
38611
38612
38613
38614
38615
38616
38617
38618
38619
38620
38621
38622
38623
38624
38625
38626
38627
38628
38629
38630
38631
38632
38633
38634
38635
38636
38637
38638
38639
38640
38641
38642
38643
38644
38645
38646
38647
38648
38649
38650
38651
38652
38653
38654
38655
38656
38657
38658
38659
38660
38661
38662
38663
38664
38665
38666
38667
38668
38669
38670
38671
38672
38673
38674
38675
38676
38677
38678
38679
38680
38681
38682
38683
38684
38685
38686
38687
38688
38689
38690
38691
38692
38693
38694
38695
38696
38697
38698
38699
38700
38701
38702
38703
38704
38705
38706
38707
38708
38709
38710
38711
38712
38713
38714
38715
38716
38717
38718
38719
38720
38721
38722
38723
38724
38725
38726
38727
38728
38729
38730
38731
38732
38733
38734
38735
38736
38737
38738
38739
38740
38741
38742
38743
38744
38745
38746
38747
38748
38749
38750
38751
38752
38753
38754
38755
38756
38757
38758
38759
38760
38761
38762
38763
38764
38765
38766
38767
38768
38769
38770
38771
38772
38773
38774
38775
38776
38777
38778
38779
38780
38781
38782
38783
38784
38785
38786
38787
38788
38789
38790
38791
38792
38793
38794
38795
38796
38797
38798
38799
38800
38801
38802
38803
38804
38805
38806
38807
38808
38809
38810
38811
38812
38813
38814
38815
38816
38817
38818
38819
38820
38821
38822
38823
38824
38825
38826
38827
38828
38829
38830
38831
38832
38833
38834
38835
38836
38837
38838
38839
38840
38841
38842
38843
38844
38845
38846
38847
38848
38849
38850
38851
38852
38853
38854
38855
38856
38857
38858
38859
38860
38861
38862
38863
38864
38865
38866
38867
38868
38869
38870
38871
38872
38873
38874
38875
38876
38877
38878
38879
38880
38881
38882
38883
38884
38885
38886
38887
38888
38889
38890
38891
38892
38893
38894
38895
38896
38897
38898
38899
38900
38901
38902
38903
38904
38905
38906
38907
38908
38909
38910
38911
38912
38913
38914
38915
38916
38917
38918
38919
38920
38921
38922
38923
38924
38925
38926
38927
38928
38929
38930
38931
38932
38933
38934
38935
38936
38937
38938
38939
38940
38941
38942
38943
38944
38945
38946
38947
38948
38949
38950
38951
38952
38953
38954
38955
38956
38957
38958
38959
38960
38961
38962
38963
38964
38965
38966
38967
38968
38969
38970
38971
38972
38973
38974
38975
38976
38977
38978
38979
38980
38981
38982
38983
38984
38985
38986
38987
38988
38989
38990
38991
38992
38993
38994
38995
38996
38997
38998
38999
39000
39001
39002
39003
39004
39005
39006
39007
39008
39009
39010
39011
39012
39013
39014
39015
39016
39017
39018
39019
39020
39021
39022
39023
39024
39025
39026
39027
39028
39029
39030
39031
39032
39033
39034
39035
39036
39037
39038
39039
39040
39041
39042
39043
39044
39045
39046
39047
39048
39049
39050
39051
39052
39053
39054
39055
39056
39057
39058
39059
39060
39061
39062
39063
39064
39065
39066
39067
39068
39069
39070
39071
39072
39073
39074
39075
39076
39077
39078
39079
39080
39081
39082
39083
39084
39085
39086
39087
39088
39089
39090
39091
39092
39093
39094
39095
39096
39097
39098
39099
39100
39101
39102
39103
39104
39105
39106
39107
39108
39109
39110
39111
39112
39113
39114
39115
39116
39117
39118
39119
39120
39121
39122
39123
39124
39125
39126
39127
39128
39129
39130
39131
39132
39133
39134
39135
39136
39137
39138
39139
39140
39141
39142
39143
39144
39145
39146
39147
39148
39149
39150
39151
39152
39153
39154
39155
39156
39157
39158
39159
39160
39161
39162
39163
39164
39165
39166
39167
39168
39169
39170
39171
39172
39173
39174
39175
39176
39177
39178
39179
39180
39181
39182
39183
39184
39185
39186
39187
39188
39189
39190
39191
39192
39193
39194
39195
39196
39197
39198
39199
39200
39201
39202
39203
39204
39205
39206
39207
39208
39209
39210
39211
39212
39213
39214
39215
39216
39217
39218
39219
39220
39221
39222
39223
39224
39225
39226
39227
39228
39229
39230
39231
39232
39233
39234
39235
39236
39237
39238
39239
39240
39241
39242
39243
39244
39245
39246
39247
39248
39249
39250
39251
39252
39253
39254
39255
39256
39257
39258
39259
39260
39261
39262
39263
39264
39265
39266
39267
39268
39269
39270
39271
39272
39273
39274
39275
39276
39277
39278
39279
39280
39281
39282
39283
39284
39285
39286
39287
39288
39289
39290
39291
39292
39293
39294
39295
39296
39297
39298
39299
39300
39301
39302
39303
39304
39305
39306
39307
39308
39309
39310
39311
39312
39313
39314
39315
39316
39317
39318
39319
39320
39321
39322
39323
39324
39325
39326
39327
39328
39329
39330
39331
39332
39333
39334
39335
39336
39337
39338
39339
39340
39341
39342
39343
39344
39345
39346
39347
39348
39349
39350
39351
39352
39353
39354
39355
39356
39357
39358
39359
39360
39361
39362
39363
39364
39365
39366
39367
39368
39369
39370
39371
39372
39373
39374
39375
39376
39377
39378
39379
39380
39381
39382
39383
39384
39385
39386
39387
39388
39389
39390
39391
39392
39393
39394
39395
39396
39397
39398
39399
39400
39401
39402
39403
39404
39405
39406
39407
39408
39409
39410
39411
39412
39413
39414
39415
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V3.0-Based Extension//EN" [
<!ENTITY prompt.root "<prompt>#</prompt>">
<!ENTITY prompt.user "<prompt>%</prompt>">
]>

<book>
  <bookinfo>
    <bookbiblio>
      <title>FreeBSD Handbook</title>
      
      <authorgroup>
	<author>
	  <surname>The FreeBSD Documentation Project</surname>
	</author>
      </authorgroup>
      
      <pubdate>March 1998</pubdate>
      
      <abstract><para>Welcome to FreeBSD! This handbook covers the
	  installation and day to day use of <emphasis>FreeBSD
	    Release &rel.current;</emphasis>. This manual is a <emphasis>work in progress</emphasis> and is the work of many
	  individuals. Many sections do not yet exist and some of those that
	  do exist need to be updated. If you are interested in helping with
	  this project, send email to the &a.doc; The latest version of this
	  document is always available from the <ulink
	    URL="http://www.FreeBSD.ORG/">FreeBSD World Wide Web
	    server</ulink>. It may also be downloaded in plain text,
	  postscript or HTML from the <ulink
	    URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/docs">FreeBSD FTP
	    server</ulink> or one of the numerous
	  <xref linkend="mirrors-ftp" remap="mirror sites">. You may also
	  want to <ulink URL="/search.html">Search the Handbook</ulink>.</para></abstract>
      
    </bookbiblio>
  </bookinfo>
  
  <part>
    <title>Getting Started</title>
    
    
    <chapter>
      <title>Introduction</title>
      
      <para>FreeBSD is a 4.4BSD-Lite based operating system for Intel
	architecture (x86) based PCs. For an overview of FreeBSD, see
	<xref linkend="nutshell" remap="FreeBSD in a nutshell">. For a
	history of the project, read <xref linkend="history" remap="a brief
	  history of FreeBSD">. To see a description of the latest release,
	read <xref linkend="relnotes" remap="about the current
	  release">. If you're interested in contributing something to the
	FreeBSD project (code, equipment, sacks of unmarked bills), please see
	about <xref linkend="contrib"
	  remap="contributing to FreeBSD">.</para>
      
      
      <sect1 id="nutshell">
	<title>FreeBSD in a Nutshell</title>
	
	<para>FreeBSD is a state of the art operating system for personal
	  computers based on the Intel CPU architecture, which includes the
	  386, 486 and Pentium processors (both SX and DX versions). Intel
	  compatible CPUs from AMD and Cyrix are supported as well. FreeBSD
	  provides you with many advanced features previously available only
	  on much more expensive computers. These features include:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><emphasis>Preemptive multitasking</emphasis> with
		dynamic priority adjustment to ensure smooth and fair sharing
		of the computer between applications and users.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Multiuser</emphasis> access means that
		many people can use a FreeBSD system simultaneously for a
		variety of things. System peripherals such as printers and
		tape drives are also properly SHARED BETWEEN ALL users on the
		system.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Complete <emphasis>TCP/IP networking</emphasis>
		including SLIP, PPP, NFS and NIS support. This means that
		your FreeBSD machine can inter-operate easily with other
		systems as well act as an enterprise server, providing vital
		functions such as NFS (remote file access) and e-mail services
		or putting your organization on the Internet with WWW, ftp,
		routing and firewall (security) services.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Memory protection</emphasis> ensures
		that applications (or users) cannot interfere with each other.
		One application crashing will not affect others in any
		way.</para>
	    </listitem>
	    
	    <listitem>
	      <para>FreeBSD is a <emphasis>32-bit</emphasis>
		operating system and was designed as such from the ground
		up.</para>
	    </listitem>
	    
	    <listitem>
	      <para>The industry standard <emphasis>X Window
		  System</emphasis> (X11R6) provides a graphical user
		interface (GUI) for the cost of a common VGA card and monitor
		and comes with full sources.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Binary compatibility</emphasis> with
		many programs built for SCO, BSDI, NetBSD, Linux and
		386BSD.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Hundreds of <emphasis>ready-to-run</emphasis>
		applications are available from the FreeBSD <emphasis>ports</emphasis> and <emphasis>packages</emphasis> collection. Why search the net
		when you can find it all right here?</para>
	    </listitem>
	    
	    <listitem>
	      <para>Thousands of additional and <emphasis>easy-to-port</emphasis> applications available on
		the Internet. FreeBSD is source code compatible with most
		popular commercial Unix systems and thus most applications
		require few, if any, changes to compile.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Demand paged <emphasis>virtual memory</emphasis>
		and <quote>merged VM/buffer cache</quote> design efficiently satisfies
		applications with large appetites for memory while still
		maintaining interactive response to other users.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Shared libraries</emphasis> (the Unix
		equivalent of MS-Windows DLLs) provide for efficient use of
		disk space and memory.</para>
	    </listitem>
	    
	    <listitem>
	      <para>A full compliment of <emphasis>C</emphasis>,
		<emphasis>C++</emphasis> and <emphasis>Fortran</emphasis> development tools. Many
		additional languages for advanced research and development are
		also available in the ports and packages collection.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Source code</emphasis> for the entire
		system means you have the greatest degree of control over your
		environment. Why be locked into a proprietary solution and at
		the mercy of your vendor when you can have a truly Open
		System?</para>
	    </listitem>
	    
	    <listitem>
	      <para>Extensive <emphasis>on-line
		  documentation</emphasis>.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>And many more!</emphasis></para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>FreeBSD is based on the 4.4BSD-Lite release from Computer
	  Systems Research Group (CSRG) at the University of California at
	  Berkeley, and carries on the distinguished tradition of BSD systems
	  development. In addition to the fine work provided by CSRG, the
	  FreeBSD Project has put in many thousands of hours in fine tuning
	  the system for maximum performance and reliability in real-life load
	  situations. As many of the commercial giants struggle to field PC
	  operating systems with such features, performance and reliability,
	  FreeBSD can offer them <emphasis>now</emphasis>!</para>
	
	<para>The applications to which FreeBSD can be put are truly limited
	  only by your own imagination. From software development to factory
	  automation, inventory control to azimuth correction of remote
	  satellite antennae; if it can be done with a commercial UNIX product
	  then it is more than likely that you can do it with FreeBSD, too!
	  FreeBSD also benefits significantly from the literally thousands of
	  high quality applications developed by research centers and
	  universities around the world, often available at little to no cost.
	  Commercial applications are also available and appearing in greater
	  numbers every day.</para>
	
	<para>Because the source code for FreeBSD itself is generally
	  available, the system can also be customized to an almost unheard of
	  degree for special applications or projects, and in ways not
	  generally possible with operating systems from most major commercial
	  vendors. Here is just a sampling of some of the applications in
	  which people are currently using FreeBSD:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><emphasis>Internet Services:</emphasis> The
		robust TCP/IP networking built into FreeBSD makes it an ideal
		platform for a variety of Internet services such as:
		<itemizedlist>
		  
		  <listitem>
		    <para>FTP servers</para>
		  </listitem>
		  
		  <listitem>
		    <para>World Wide Web servers</para>
		  </listitem>
		  
		  <listitem>
		    <para>Gopher servers</para>
		  </listitem>
		  
		  <listitem>
		    <para>Electronic Mail servers</para>
		  </listitem>
		  
		  <listitem>
		    <para>USENET News</para>
		  </listitem>
		  
		  <listitem>
		    <para>Bulletin Board Systems</para>
		  </listitem>
		  
		  <listitem>
		    <para>And more...</para>
		  </listitem>
		  
		</itemizedlist> You can easily start out small with an
		inexpensive 386 class PC and upgrade as your enterprise
		grows.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Education:</emphasis> Are you a student
		of computer science or a related engineering field? There is
		no better way of learning about operating systems, computer
		architecture and networking than the hands on, under the hood
		experience that FreeBSD can provide. A number of freely
		available CAD, mathematical and graphic design packages also
		make it highly useful to those whose primary interest in a
		computer is to get <emphasis>other</emphasis> work
		done!</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Research:</emphasis> With source code
		for the entire system available, FreeBSD is an excellent
		platform for research in operating systems as well as other
		branches of computer science. FreeBSD's freely available
		nature also makes it possible for remote groups to collaborate
		on ideas or shared development without having to worry about
		special licensing agreements or limitations on what may be
		discussed in open forums.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Networking:</emphasis> Need a new
		router? A name server (DNS)? A firewall to keep people out
		of your internal network? FreeBSD can easily turn that unused
		386 or 486 PC sitting in the corner into an advanced router
		with sophisticated packet filtering capabilities.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>X Window workstation:</emphasis>
		FreeBSD is a fine choice for an inexpensive X terminal
		solution, either using the freely available XFree86 server or
		one of the excellent commercial servers provided by X Inside.
		Unlike an X terminal, FreeBSD allows many applications to be
		run locally, if desired, thus relieving the burden on a
		central server. FreeBSD can even boot <quote>diskless</quote>, making
		individual workstations even cheaper and easier to
		administer.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Software Development:</emphasis> The
		basic FreeBSD system comes with a full compliment of
		development tools including  the renowned GNU C/C++ compiler
		and debugger.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>FreeBSD is available in both source and binary form on CDROM and
	  via anonymous ftp. See <xref linkend="mirrors" remap="Obtaining
	    FreeBSD">  for more details.</para>
	
      </sect1>
      
      <sect1 id="history">
	<title>A Brief History of FreeBSD</title>
	
	<para><emphasis>Contributed by &a.jkh;</emphasis>.</para>
	
	<para>The FreeBSD project had its genesis in the early part of 1993,
	  partially as an outgrowth of the <quote>Unofficial 386BSD Patchkit</quote> by the
	  patchkit's last 3 coordinators: Nate Williams, Rod Grimes and
	  myself.</para>
	
	<para>Our original goal was to produce an intermediate snapshot of
	  386BSD in order to fix a number of problems with it that the
	  patchkit mechanism just was not capable of solving. Some of you may
	  remember the early working title for the project being <QUOTE>386BSD 0.5</QUOTE>
	  or <quote>386BSD Interim</quote> in reference to that fact.</para>
	
	<para>386BSD was Bill Jolitz's operating system, which had been up to
	  that point suffering rather severely from almost a year's worth of
	  neglect. As the patchkit swelled ever more uncomfortably with each
	  passing day, we were in unanimous agreement that something had to be
	  done and decided to try and assist Bill by providing this interim
	  <quote>cleanup</quote> snapshot. Those plans came to a rude halt when Bill
	  Jolitz suddenly decided to withdraw his sanction from the project
	  and without any clear indication of what would be done
	  instead.</para>
	
	<para>It did not take us long to decide that the goal remained
	  worthwhile, even without Bill's support, and so we adopted the name
	  <quote>FreeBSD</quote>, coined by David Greenman. Our initial objectives were
	  set after consulting with the system's current users and, once it
	  became clear that the project was on the road to perhaps even
	  becoming a reality, I contacted Walnut Creek CDROM with an eye
	  towards improving FreeBSD's distribution channels for those many
	  unfortunates without easy access to the Internet. Walnut Creek
	  CDROM not only supported the idea of distributing FreeBSD on CD but
	  went so far as to provide the project with a machine to work on and
	  a fast Internet connection. Without Walnut Creek CDROM's almost
	  unprecedented degree of faith in what was, at the time, a completely
	  unknown project, it is quite unlikely that FreeBSD would have gotten
	  as far, as fast, as it has today.</para>
	
	<para>The first CDROM (and general net-wide) distribution was FreeBSD
	  1.0, released in December of 1993. This was based on the
	  4.3BSD-Lite (<quote>Net/2</quote>) tape from U.C. Berkeley, with many components
	  also provided by 386BSD and the Free Software Foundation. It was a
	  fairly reasonable success for a first offering, and we followed it
	  with the highly successful FreeBSD 1.1 release in May of
	  1994.</para>
	
	<para>Around this time, some rather unexpected storm clouds formed on
	  the horizon as Novell and U.C. Berkeley settled their long-running
	  lawsuit over the legal status of the Berkeley Net/2 tape. A
	  condition of that settlement was U.C. Berkeley's concession that
	  large parts of Net/2 were <quote>encumbered</quote> code and the property of
	  Novell, who had in turn acquired it from AT&amp;T some time
	  previously. What Berkeley got in return was Novell's <quote>blessing</quote>
	  that the 4.4BSD-Lite release, when it was finally released, would be
	  declared unencumbered and all existing Net/2 users would be strongly
	  encouraged to switch. This included FreeBSD, and the project was
	  given until the end of July 1994 to stop shipping its own Net/2
	  based product. Under the terms of that agreement, the project was
	  allowed one last release before the deadline, that release being
	  FreeBSD 1.1.5.1.</para>
	
	<para>FreeBSD then set about the arduous task of literally
	  re-inventing itself from a completely new and rather incomplete set
	  of 4.4BSD-Lite bits. The <quote>Lite</quote> releases were light in part because
	  Berkeley's CSRG had removed large chunks of code required for
	  actually constructing a bootable running system (due to various
	  legal requirements) and the fact that the Intel port of 4.4 was
	  highly incomplete. It took the project until December of 1994 to
	  make this transition, and in January of 1995 it released FreeBSD 2.0
	  to the net and on CDROM. Despite being still more than a little
	  rough around the edges, the release was a significant success and
	  was followed by the more robust and easier to install FreeBSD 2.0.5
	  release in June of 1995.</para>
	
	<para>We released FreeBSD 2.1.5 in August of 1996, and it appeared to
	  be popular enough among the ISP and commercial communities that
	  another release along the 2.1-stable branch was merited. This was
	  FreeBSD 2.1.7.1, released in February 1997 and capping the end of
	  mainstream development on 2.1-stable. Now in maintenance mode, only
	  security enhancements and other critical bug fixes will be done on
	  this branch (RELENG_2_1_0).</para>
	
	<para>FreeBSD 2.2 was branched from the development mainline
	  (<quote>-current</quote>) in November 1996 as the RELENG_2_2 branch, and the
	  first full release (2.2.1) was released in April, 1997. Further
	  releases along the 2.2 branch were done in the Summer and Fall of
	  '97, the latest being 2.2.6 which appeared in late March of '98.
	  The first official 3.0 release will appear later in 1998.</para>
	
	<para>Long term development projects for everything from SMP to DEC
	  ALPHA support will continue to take place in the 3.0-current branch
	  and SNAPshot releases of 3.0 on CDROM (and, of course, on the net).</para>
	
      </sect1>
      
      <sect1 id="goals">
	<title>FreeBSD Project Goals</title>
	
	<para><emphasis>Contributed by &a.jkh;</emphasis>.</para>
	
	<para>The goals of the FreeBSD Project are to provide software that
	  may be used for any purpose and without strings attached. Many of
	  us have a significant investment in the code (and project) and would
	  certainly not mind a little financial compensation now and then, but
	  we're definitely not prepared to insist on it. We believe that our
	  first and foremost <quote>mission</quote> is to provide code to any and all
	  comers, and for whatever purpose, so that the code gets the widest
	  possible use and provides the widest possible benefit. This is, I
	  believe, one of the most fundamental goals of Free Software and one
	  that we enthusiastically support.</para>
	
	<para>That code in our source tree which falls under the GNU Public
	  License (GPL) or GNU Library Public License (GLPL) comes with
	  slightly more strings attached, though at least on the side of
	  enforced access rather than the usual opposite. Due to the
	  additional complexities that can evolve in the commercial use of GPL
	  software, we do, however, endeavor to replace such software with
	  submissions under the more relaxed BSD copyright whenever possible.</para>
	
      </sect1>
      
      <sect1 id="development">
	<title>The FreeBSD Development Model</title>
	
	<para><emphasis>Contributed by &a.asami;</emphasis>.</para>
	
	<para>The development of FreeBSD is a very open and flexible process,
	  FreeBSD being literally built from the contributions of hundreds of
	  people around the world, as can be seen from our <xref
	    linkend="staff" remap="list of contributors">. We are constantly
	  on the lookout for new developers and ideas, and those interested in
	  becoming more closely involved with the project need simply contact
	  us at the &a.hackers;. Those who prefer to work more independently
	  are also accommodated, and they are free to use our FTP facilities
	  at <ulink
	    URL="ftp://ftp.freebsd.org/pub/FreeBSD/incoming">ftp.freebsd.org</ulink> to distribute their own patches or work-in-progress sources. The &a.announce; is also available to those wishing to make other FreeBSD users aware of major areas of work.</para>
	
	<para>Useful things to know about the FreeBSD project and its
	  development process, whether working independently or in close
	  cooperation:</para>
	
	
	  <variablelist>
	    <varlistentry><term>The CVS
		  repository<anchor id="development-cvs-repository"></term>
	      <listitem>
		<para>The central source tree for FreeBSD is maintained by
		  <ulink
		    URL="http://www.cyclic.com/cyclic-pages/CVS-sheet.html">CVS</ulink> (Concurrent Version System), a freely available source code control tool which comes bundled with FreeBSD. The primary <ulink URL="http://www.freebsd.org/cgi/cvsweb.cgi">CVS repository</ulink> resides on a machine in Concord CA, USA from where it is replicated to numerous mirror machines throughout the world. The CVS tree, as well as the <xref linkend="current" remap="-current"> and <xref
		    linkend="stable" remap="-stable"> trees which are checked
		  out of it, can be easily replicated to your own machine as
		  well. Please refer to the
		  <xref linkend="synching" remap="Synchronizing your source
		    tree"> section for more information on doing this.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>The committers
		  list<anchor id="development-committers"></term>
	      
	      <listitem>
		<para>The <xref linkend="staff-committers" remap="committers">
		  are the people who have <emphasis>write</emphasis> access to
		  the CVS tree, and are thus authorized to make modifications
		  to the FreeBSD source (the term <quote>committer</quote> comes from the
		  <citerefentry><refentrytitle>cvs</refentrytitle><manvolnum>1</manvolnum></citerefentry> <command>commit</command> command, which is used to
		  bring new changes into the CVS repository). The best way of
		  making submissions for review by the committers list is to
		  use the <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> command, though if something appears to be jammed in the system then you may also reach them by sending mail to <email>committers@freebsd.org</email>.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>The FreeBSD core
		  team<anchor id="development-core"></term>
	      
	      <listitem>
		<para>The <xref linkend="staff-core" remap="FreeBSD core
		    team"> would be equivalent to the board of directors if
		  the FreeBSD Project were a company. The primary task of the
		  core team is to make sure the project, as a whole, is in
		  good shape and is heading in the right directions. Inviting
		  dedicated and responsible developers to join our group of
		  committers is one of the functions of the core team, as is
		  the recruitment of new core team members as others move on.
		  Most current members of the core team started as committers
		  who's addiction to the project got the better of
		  them.</para>

		<para>Some core team members also have specific <xref
		    linkend="staff-who" remap="areas of responsibility">,
		  meaning that they are committed to ensuring that some large
		  portion of the system works as advertised.</para>

		<note>
		  <para>Most members of the core team are volunteers when it
		    comes to FreeBSD development and do not benefit from the
		    project financially, so <quote>commitment</quote> should also not be
		    misconstrued as meaning <quote>guaranteed support.</quote>  The
		    <quote>board of directors</quote> analogy above is not
		    actually very accurate, and it may be more suitable to say
		    that these are the people who gave up their lives in favor
		    of FreeBSD against their better judgement! <!-- smiley --><emphasis>;)</emphasis></para>
		</note>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Outside
		  contributors</term>
	      
	      <listitem>
		<para>Last, but definitely not least, the largest group of
		  developers are the users themselves who provide feedback and
		  bug-fixes to us on an almost constant basis. The primary
		  way of keeping in touch with FreeBSD's more non-centralized
		  development is to subscribe to the &a.hackers; (see <xref
		    linkend="eresources-mail" remap="mailing list
		    info">) where such things are discussed.</para>

		<para><xref linkend="contrib-additional" remap="The list"> of
		  those who have contributed something which made its way into
		  our source tree is a long and growing one, so why not join
		  it by contributing something back to FreeBSD today?
		  <!-- smiley --><emphasis>:-)</emphasis></para>

		<para>Providing code is not the only way of contributing to
		  the project; for a more complete list of things that need
		  doing, please refer to the <xref linkend="contrib"
		    remap="how to
		    contribute"> section in this handbook.</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>In summary, our development model is organized as a loose set of
	  concentric circles. The centralized model is designed for the
	  convenience of the <emphasis>users</emphasis> of FreeBSD, who are
	  thereby provided with an easy way of tracking one central code base,
	  not to keep potential contributors out! Our desire is to present a
	  stable operating system with a large set of coherent <xref
	    linkend="ports"
	    remap="application programs"> that the users can easily install
	  and use, and this model works very well in accomplishing
	  that.</para>
	
	<para>All we ask of those who would join us as FreeBSD developers is
	  some of the same dedication its current people have to its continued
	  success!</para>
	
      </sect1>
      
      <sect1 id="relnotes">
	<title>About the Current Release</title>
	
	<para>FreeBSD is a freely available, full source 4.4BSD-Lite based
	  release for Intel i386/i486/Pentium/PentiumPro/Pentium II (or
	  compatible) based PC's. It is based primarily on software from U.C.
	  Berkeley's CSRG group, with some enhancements from NetBSD, OpenBSD,
	  386BSD, and the Free  Software Foundation.</para>
	
	<para>Since our release of FreeBSD 2.0 in January of 95, the
	  performance, feature set, and stability of FreeBSD has improved
	  dramatically. The largest change is a revamped virtual memory
	  system with a merged VM/file buffer  cache that not only increases
	  performance, but reduces FreeBSD's memory footprint, making a 5MB
	  configuration a more acceptable minimum. Other enhancements include
	  full NIS client and server support, transaction TCP support,
	  dial-on-demand PPP, an improved SCSI subsystem, early ISDN support,
	  support for FDDI and Fast Ethernet (100Mbit) adapters, improved
	  support for the Adaptec 2940 (WIDE and narrow) and many hundreds of
	  bug fixes.</para>
	
	<para>We have also taken the comments and suggestions of many of our
	  users to heart and have attempted to provide what we hope is a more
	  sane and easily understood installation process. Your feedback on
	  this (constantly evolving) process is especially welcome!</para>
	
	<para>In addition to the base distributions, FreeBSD offers a new
	  ported software collection with hundreds of commonly sought-after
	  programs. At the end of March 1998 there were more than 1300 ports!
	  The list of ports ranges from http (WWW) servers, to games,
	  languages, editors and almost everything in between. The entire
	  ports collection requires approximately 26MB of storage, all ports
	  being  expressed as <quote>deltas</quote> to their original sources. This
	  makes  it much easier for us to update ports, and greatly reduces
	  the disk space demands made by the older 1.0 ports collection. To
	  compile a port, you simply change to the directory of the program
	  you wish to install, type <command>make all</command> followed by <command>make install</command>
	  after successful compilation and let the system do the rest. The
	  full original distribution for each port you build is retrieved
	  dynamically off the CDROM or a local ftp site, so you need only
	  enough disk space to build the ports you want. (Almost) every port
	  is also provided as a pre-compiled <quote>package</quote> which can be installed
	  with a simple command (pkg_add) by those who do not wish to compile
	  their own ports from source.</para>
	
	<para>A number of additional documents which you may find very helpful
	  in the process of installing and using FreeBSD may now also be found
	  in the <filename>/usr/share/doc</filename> directory on any machine
	  running FreeBSD 2.1 or later. You may view the locally installed
	  manuals with any HTML capable browser using the following
	  URLs:</para>
	
	
	  <variablelist>
	    <varlistentry><term>The FreeBSD handbook</term>
	      <listitem>
		<para><ulink
		    URL="file:/usr/share/doc/handbook/handbook.html">file:/usr/share/doc/handbook/handbook.html</ulink></para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>The FreeBSD FAQ</term>
	      
	      <listitem>
		<para><ulink
		    URL="file:/usr/share/doc/FAQ/FAQ.html">file:/usr/share/doc/FAQ/FAQ.html</ulink></para>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>You can also visit the master (and most frequently updated)
	  copies at <ulink
	    URL="http://www.freebsd.org">http://www.freebsd.org</ulink>.</para>
	
	<para>The core of FreeBSD does not contain DES code which would
	  inhibit its being exported outside the United States. There is an
	  add-on package to the core distribution, for use only in the United
	  States, that contains the programs that normally use DES. The
	  auxiliary packages provided separately can be used by anyone. A
	  freely (from outside the U.S.) exportable European distribution of
	  DES for our non-U.S. users also exists and is described in the
	  <ulink URL="../FAQ/FAQ.html">FreeBSD FAQ</ulink>.</para>
	
	<para>If password security for FreeBSD is all you need, and you have
	  no requirement for copying encrypted passwords from different hosts
	  (Suns, DEC machines, etc) into FreeBSD password entries, then
	  FreeBSD's MD5 based security may be all you require! We feel that
	  our default security model is more than a match for DES, and without
	  any messy export issues to deal with. If you are outside (or even
	  inside) the U.S., give it a try!</para>
	
      </sect1>
    </chapter>
    
    <chapter id="install">
      <title>Installing FreeBSD</title>
      
      <para>So, you would like to try out FreeBSD on your system? This section
	is a quick-start guide for what you need to do. FreeBSD can be
	installed from a variety of media including CD-ROM, floppy disk,
	magnetic tape, an MS-DOS partition and, if you have a network
	connection, via anonymous ftp or NFS.</para>
      
      <para>Regardless of the installation media you choose, you can get
	started by creating the <emphasis>installation
	  disk</emphasis> as described below. Booting your computer into the
	FreeBSD installer, even if you aren't planning on installing FreeBSD
	right away, will provide important information about compatibility
	between FreeBSD and your hardware which may, in turn, dictate which
	installation options are even possible. It can also provide early
	clues to any compatibility problems which could prevent FreeBSD
	running on your system at all. If you plan on installing via
	anonymous FTP then this installation disk is all you need to download
	(the installation will handle any further required downloading
	itself).</para>
      
      <para>For more information on obtaining the latest FreeBSD
	distributions, please see <xref linkend="mirrors" remap="Obtaining
	  FreeBSD"> in the
	Appendix.</para>
      
      <para>So, to get the show on the road, follow these steps:</para>
      
	<procedure>
	  
	  <step>
	    <para>Review the <xref linkend="install-hw" remap="supported
		configurations"> section of this installation guide to be sure
	      that your hardware is supported by FreeBSD. It may be helpful
	      to make a list of any special cards you have installed, such as
	      SCSI controllers, Ethernet adapters or sound cards. This list
	      should include relevant configuration parameters such as
	      interrupts (IRQ) and IO port addresses.</para>
	  </step>
	  
	  <step>
	    <para>If you're installing FreeBSD from CDROM media then you have
	      several different installation options:
	      <itemizedlist>
		
		<listitem>
		  <para>If the CD has been mastered with El Torrito boot
		    support and your system supports direct booting from CDROM
		    (and many older systems do <emphasis>not</emphasis>),
		    simply insert the CD into the drive and boot directly from
		    it.</para>
		</listitem>
		
		<listitem>
		  <para>If you're running DOS and have the proper drivers to
		    access your CD, run the install.bat script provided on the
		    CD. This will attempt to boot into the FreeBSD
		    installation straight from DOS.</para>

		  <note>
		    <para>You must do this from actual DOS and not a Windows
		      DOS box.</para>
		  </note>

		  <para>If you also want to install FreeBSD
		    from your DOS partition (perhaps because your CDROM drive
		    is completely unsupported by FreeBSD) then run the setup
		    program first to copy the appropriate files from the CD to
		    your DOS partition, afterwards running install.</para>
		</listitem>
		
		<listitem>
		  <para>If either of the two proceeding methods work then you
		    can simply skip the rest of this section, otherwise your
		    final option is to create a boot floppy from the
		    <filename>floppies\boot.flp</filename> image&mdash;proceed to
		    step 4 for instructions on how to do this.</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	  </step>
	  
	  <step>
	    <para>If you don't have a CDROM distribution then simply download
	      the <ulink
		URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/&rel.current;-RELEASE/floppies/boot.flp">installation boot disk image</ulink> file to your hard drive, being sure to tell your browser to <emphasis>save</emphasis> rather than <emphasis>display</emphasis> the file.</para>

	    <note>
	      <para>This disk image can only be used with 1.44 megabyte 3.5
		inch floppy disks.</para>
	    </note>
	  </step>
	  
	  <step>
	    <para>Make the installation boot disk from the image file:
	      <itemizedlist>
		
		<listitem>
		  <para>If you are using MS-DOS then download  <ulink
		      URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/tools/fdimage.exe">fdimage.exe</ulink> or get it from <filename>tools\fdimage.exe</filename> on the CDROM and then run it like so:

		    <informalexample>
		      <screen><prompt>E:\&gt;</prompt> <userinput>tools\fdimage floppies\boot.flp a:</userinput></screen>
		    </informalexample> The <emphasis>fdimage</emphasis>
		    program will format the <devicename>A:</devicename> drive and then copy the
		    <filename>boot.flp</filename> image onto it (assuming that you're at the top
		    level of a FreeBSD distribution and the floppy images live
		    in the floppies subdirectory, as is typically the
		    case).</para>
		</listitem>
		
		<listitem>
		  <para>If you are using a UNIX system to create the floppy
		    image:

		    <informalexample>
		      <screen>&prompt.root; <userinput>dd if=boot.flp of=<replaceable>disk_device</replaceable></userinput></screen>
		    </informalexample> where <replaceable>disk_device</replaceable> is
		    the <filename>/dev</filename> entry for the floppy drive.
		    On FreeBSD systems, this is <filename>/dev/rfd0</filename>
		    for the <devicename>A:</devicename> drive and <filename>/dev/rfd1</filename> for
		    the <devicename>B:</devicename> drive.</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	  </step>
	  
	  <step>
	    <para>With the installation disk in the A: drive, reboot your
	      computer. You should get a boot prompt something like this:
	      <informalexample>
		<screen>
&gt;&gt; FreeBSD BOOT ...
Usage: [[[0:][wd](0,a)]/kernel][-abcCdhrsv]
Use 1:sd(0,a)kernel to boot sd0 if it is BIOS drive 1
Use ? for file list or press Enter for defaults
Boot:
		</screen>
	      </informalexample> If you do <emphasis>not</emphasis> type
	      anything, FreeBSD will automatically boot with its default
	      configuration after a delay of about five seconds. As FreeBSD
	      boots, it probes your computer to determine what hardware is
	      installed. The results of this probing is displayed on the
	      screen.</para>
	  </step>
	  
	  <step>
	    <para>When the booting process is finished, The main FreeBSD
	      installation menu will be displayed.</para>
	  </step>
	  
	</procedure>
      
      <para><emphasis>If something goes wrong...</emphasis></para>
      
      <para>Due to limitations of the PC architecture, it is impossible for
	probing to be 100 percent reliable. In the event that your hardware
	is incorrectly identified, or that the probing causes your computer to
	lock up, first check the
	<xref linkend="install-hw" remap="supported       configurations">
	section of this installation guide to be sure that your hardware is
	indeed supported by FreeBSD.</para>
      
      <para>If your hardware is supported, reset the computer and when the
	<prompt>Boot:</prompt> prompt comes up, type
	<literal>-c</literal>. This puts FreeBSD into a configuration mode
	where you can supply hints about your hardware. The FreeBSD kernel on
	the installation disk is configured assuming that most hardware
	devices are in their factory default configuration in terms of IRQs,
	IO addresses and DMA channels. If your hardware has been
	reconfigured, you will most likely need to use the <option>-c</option>
	option at boot to tell FreeBSD where things are.</para>
      
      <para>It is also possible that a probe for a device not present will
	cause a later probe for another device that is present to fail. In
	that case, the probes for the conflicting driver(s) should be
	disabled.</para>
      
      <para>In the configuration mode, you can:</para>
      
      
	<itemizedlist>
	  
	  <listitem>
	    <para>List the device drivers installed in the kernel.</para>
	  </listitem>
	  
	  <listitem>
	    <para>Disable device drivers for hardware not present in your
	      system.</para>
	  </listitem>
	  
	  <listitem>
	    <para>Change the IRQ, DRQ, and IO port addresses used by a device
	      driver.</para>
	  </listitem>
	  
	</itemizedlist>
      
      
      <para>While at the <prompt>config&gt;</prompt> prompt, type
	<command>help</command> for more information on the
	available commands. After adjusting the kernel to match how you have
	your hardware configured, type <command>quit</command> at
	the <prompt>config&gt;</prompt> prompt to continue
	booting with the new settings.</para>
      
      <para>After FreeBSD has been installed, changes made in the
	configuration mode will be permanent so you do not have to reconfigure
	every time you boot. Even so, it is likely that you will want to
	build a custom kernel to optimize the performance of your system. See
	<xref linkend="kernelconfig"
	  remap="Kernel configuration"> for more information on creating
	custom kernels.</para>
      
      
      <sect1 id="install-hw">
	<title>Supported Configurations</title>
	
	<para>FreeBSD currently runs on a wide variety of ISA, VLB, EISA and
	  PCI bus based PC's, ranging from 386sx to Pentium class machines
	  (though the 386sx is not recommended). Support for generic IDE or
	  ESDI drive configurations, various SCSI controller, network and
	  serial cards is also provided.</para>
	
	<para>A minimum of four megabytes of RAM is required to run FreeBSD.
	  To run the X Window System, eight megabytes of RAM is the
	  recommended minimum.</para>
	
	<para>Following is a list of all disk controllers and Ethernet cards
	  currently known to work with FreeBSD. Other configurations may very
	  well work, and we have simply not received any indication of
	  this.</para>
	
	
	<sect2>
	  <title>Disk Controllers</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>WD1003 (any generic MFM/RLL)</para>
	      </listitem>
	      
	      <listitem>
		<para>WD1007 (any generic IDE/ESDI)</para>
	      </listitem>
	      
	      <listitem>
		<para>IDE</para>
	      </listitem>
	      
	      <listitem>
		<para>ATA</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 1505 ISA SCSI controller</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 152x series ISA SCSI controllers</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 1535 ISA SCSI controllers</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 154x series ISA SCSI controllers</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 174x series EISA SCSI controller in standard and
		  enhanced mode.</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec 274x/284x/2940/2940U/3940 (Narrow/Wide/Twin)
		  series EISA/VLB/PCI SCSI controllers</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec AIC7850 on-board SCSI controllers</para>
	      </listitem>
	      
	      <listitem>
		<para>Adaptec AIC-6360 based boards, which includes the
		  AHA-152x and SoundBlaster SCSI cards.</para>

		<note>
		  <para>You cannot boot from the
		    SoundBlaster cards as they have no on-board BIOS, which is
		    necessary for mapping the boot device into the system BIOS
		    I/O vectors. They are perfectly usable for external tapes,
		    CDROMs, etc, however. The same goes for any other AIC-6x60
		    based card without a boot ROM. Some systems DO have a boot
		    ROM, which is generally indicated by some sort of message
		    when the system is first powered up or reset. Check your
		    system/board documentation for more details.</para>
		</note>
	      </listitem>
	      
	      <listitem>
		<para>Buslogic 545S &amp; 545c</para>

		<note>
		  <para>Buslogic was formerly known as <quote>Bustek</quote>.</para>
		</note>
	      </listitem>
	      
	      <listitem>
		<para>Buslogic 445S/445c VLB SCSI controller</para>
	      </listitem>
	      
	      <listitem>
		<para>Buslogic 742A/747S/747c EISA SCSI controller.</para>
	      </listitem>
	      
	      <listitem>
		<para>Buslogic 946c PCI SCSI controller</para>
	      </listitem>
	      
	      <listitem>
		<para>Buslogic 956c PCI SCSI controller</para>
	      </listitem>
	      
	      <listitem>
		<para>NCR 53C810/53C815/53C825/53C860/53C875 PCI SCSI
		  controller.</para>
	      </listitem>
	      
	      <listitem>
		<para>NCR5380/NCR53400 (<quote>ProAudio Spectrum</quote>) SCSI
		  controller.</para>
	      </listitem>
	      
	      <listitem>
		<para>DTC 3290 EISA SCSI controller in 1542 emulation mode.</para>
	      </listitem>
	      
	      <listitem>
		<para>UltraStor 14F/24F/34F SCSI controllers.</para>
	      </listitem>
	      
	      <listitem>
		<para>Seagate ST01/02 SCSI controllers.</para>
	      </listitem>
	      
	      <listitem>
		<para>Future Domain 8xx/950 series SCSI controllers.</para>
	      </listitem>
	      
	      <listitem>
		<para>WD7000 SCSI controllers.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>With all supported SCSI controllers, full support is provided
	    for SCSI-I &amp; SCSI-II peripherals, including Disks, tape drives
	    (including DAT) and CD ROM drives.</para>
	  
	  <para>The following CD-ROM type systems are supported at this
	    time:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>SoundBlaster SCSI and ProAudio Spectrum SCSI (<literal>cd</literal>)</para>
	      </listitem>
	      
	      <listitem>
		<para>Mitsumi (all models) proprietary interface (<literal>mcd</literal>)</para>
	      </listitem>
	      
	      <listitem>
		<para>Matsushita/Panasonic (Creative) CR-562/CR-563
		  proprietary interface (<literal>matcd</literal>)</para>
	      </listitem>
	      
	      <listitem>
		<para>Sony proprietary interface (<literal>scd</literal>)</para>
	      </listitem>
	      
	      <listitem>
		<para>ATAPI IDE interface  (experimental and should be
		  considered ALPHA quality!)  (<literal>wcd</literal>)</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	</sect2>
	
	<sect2 id="install-nics">
	  <title>Ethernet cards</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Allied-Telesis AT1700 and RE2000 cards</para>
	      </listitem>
	      
	      <listitem>
		<para>SMC Elite 16 WD8013 Ethernet interface, and most other
		  WD8003E, WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and
		  WD8013EBT based clones. SMC Elite Ultra and 9432TX based
		  cards are also supported.</para>
	      </listitem>
	      
	      <listitem>
		<para>DEC EtherWORKS III NICs (DE203, DE204, and DE205)</para>
	      </listitem>
	      
	      <listitem>
		<para>DEC EtherWORKS II NICs (DE200, DE201, DE202, and
		  DE422)</para>
	      </listitem>
	      
	      <listitem>
		<para>DEC DC21040/DC21041/DC21140 based NICs:
		  <itemizedlist>
		    
		    <listitem>
		      <para>ASUS		PCI-L101-TB</para>
		    </listitem>
		    
		    <listitem>
		      <para>Accton		ENI1203</para>
		    </listitem>
		    
		    <listitem>
		      <para>Cogent		EM960PCI</para>
		    </listitem>
		    
		    <listitem>
		      <para>Compex 		CPXPCI/32C</para>
		    </listitem>
		    
		    <listitem>
		      <para>D-Link		DE-530</para>
		    </listitem>
		    
		    <listitem>
		      <para>DEC		DE435</para>
		    </listitem>
		    
		    <listitem>
		      <para>Danpex		EN-9400P3</para>
		    </listitem>
		    
		    <listitem>
		      <para>JCIS		Condor JC1260</para>
		    </listitem>
		    
		    <listitem>
		      <para>Kingston		KNE100TX</para>
		    </listitem>
		    
		    <listitem>
		      <para>Linksys		EtherPCI</para>
		    </listitem>
		    
		    <listitem>
		      <para>Mylex		LNP101</para>
		    </listitem>
		    
		    <listitem>
		      <para>SMC		EtherPower 10/100 (Model 9332)</para>
		    </listitem>
		    
		    <listitem>
		      <para>SMC		EtherPower (Model 8432)</para>
		    </listitem>
		    
		    <listitem>
		      <para>SMC		EtherPower (2)</para>
		    </listitem>
		    
		    <listitem>
		      <para>Zynx		ZX314</para>
		    </listitem>
		    
		    <listitem>
		      <para>Zynx		ZX342</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	      
	      <listitem>
		<para>DEC FDDI (DEFPA/DEFEA) NICs</para>
	      </listitem>
	      
	      <listitem>
		<para>Fujitsu FMV-181 and FMV-182</para>
	      </listitem>
	      
	      <listitem>
		<para>Fujitsu MB86960A/MB86965A</para>
	      </listitem>
	      
	      <listitem>
		<para>Intel EtherExpress</para>
	      </listitem>
	      
	      <listitem>
		<para>Intel EtherExpress Pro/100B 100Mbit.</para>
	      </listitem>
	      
	      <listitem>
		<para>Isolan AT 4141-0 (16 bit)</para>
	      </listitem>
	      
	      <listitem>
		<para>Isolink 4110     (8 bit)</para>
	      </listitem>
	      
	      <listitem>
		<para>Lucent WaveLAN wireless networking interface.</para>
	      </listitem>
	      
	      <listitem>
		<para>Novell NE1000, NE2000, and NE2100 ethernet interface.</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C501 cards</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C503 Etherlink II</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3c505 Etherlink/+</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C507 Etherlink 16/TP</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C509, 3C579, 3C589 (PCMCIA) Etherlink III</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C590, 3C595 Etherlink III</para>
	      </listitem>
	      
	      <listitem>
		<para>3Com 3C90x cards.</para>
	      </listitem>
	      
	      <listitem>
		<para>HP PC Lan Plus (27247B and 27252A)</para>
	      </listitem>
	      
	      <listitem>
		<para>Toshiba ethernet cards</para>
	      </listitem>
	      
	      <listitem>
		<para>PCMCIA ethernet cards from IBM and National
		  Semiconductor are also supported.</para>
	      </listitem>
	      
	    </itemizedlist>
	  

	  <note>
	    <para>FreeBSD does not currently support
	      PnP (plug-n-play) features present on some ethernet cards. If
	      your card has PnP and is giving you problems, try disabling its
	      PnP features.</para>
	  </note>
	</sect2>
	
	<sect2 id="install-misc">
	  <title>Miscellaneous devices</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>AST 4 port serial card using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>ARNET 8 port serial card using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>BOCA IOAT66 6 port serial card using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>BOCA 2016 16 port serial card using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>Cyclades Cyclom-y Serial Board.</para>
	      </listitem>
	      
	      <listitem>
		<para>STB 4 port card using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>SDL Communications Riscom/8 Serial Board.</para>
	      </listitem>
	      
	      <listitem>
		<para>SDL Communications RISCom/N2 and N2pci sync serial
		  cards.</para>
	      </listitem>
	      
	      <listitem>
		<para>Digiboard Sync/570i high-speed sync serial card.</para>
	      </listitem>
	      
	      <listitem>
		<para>Decision-Computer Intl. <quote>Eight-Serial</quote> 8 port serial
		  cards  using shared IRQ.</para>
	      </listitem>
	      
	      <listitem>
		<para>Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum,
		  Gravis UltraSound, Gravis UltraSound MAX and Roland MPU-401
		  sound cards.</para>
	      </listitem>
	      
	      <listitem>
		<para>Matrox Meteor video frame grabber.</para>
	      </listitem>
	      
	      <listitem>
		<para>Creative Labs Video spigot frame grabber.</para>
	      </listitem>
	      
	      <listitem>
		<para>Omnimedia Talisman frame grabber.</para>
	      </listitem>
	      
	      <listitem>
		<para>Brooktree BT848 chip based frame grabbers.</para>
	      </listitem>
	      
	      <listitem>
		<para>X-10 power controllers.</para>
	      </listitem>
	      
	      <listitem>
		<para>PC joystick and speaker.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>FreeBSD does not currently support IBM's microchannel (MCA)
	    bus.</para>
	  
	</sect2>
      </sect1>
      
      <sect1>
	<title>Preparing for the Installation</title>
	
	<para>There are a number of different methods by which FreeBSD can be
	  installed. The following describes what preparation needs to be
	  done for each type.</para>
	
	
	<sect2>
	  <title>Before installing from CDROM</title>
	  
	  <para>If your CDROM is of an unsupported type, then please skip to
	    <xref linkend="install-msdos" remap="MS-DOS
	      Preparation">.</para>
	  
	  <para>There is not a lot of preparatory work that needs to be done
	    to successfully install from one of Walnut Creek's FreeBSD CDROMs
	    (other CDROM distributions may work as well, though we cannot say
	    for certain as we have no hand or say in how they are created).
	    You can either boot into the CD installation directly from DOS
	    using Walnut Creek's supplied <filename>install.bat</filename> batch file or you
	    can make a boot floppy with the <filename>makeflp.bat</filename> command.</para>

	  <note>
	    <para>If you are running FreeBSD 2.1-RELEASE and have an IDE
	      CDROM, use the <filename>inst_ide.bat</filename> or <filename>atapiflp.bat</filename> batch files
	      instead.</para>
	  </note>
	  
	  <para>For the easiest interface of all (from DOS), type <command>view</command>.
	    This will bring up a DOS menu utility that leads you through all
	    the available options.</para>
	  
	  <para>If you are creating the boot floppy from a UNIX machine, see
	    <xref linkend="install" remap="the beginning of this
	      guide"> for examples. of how to create the boot floppy.</para>
	  
	  <para>Once you have booted from DOS or floppy, you should then be
	    able to select CDROM as the media type in the Media menu and load
	    the entire distribution from CDROM. No other types of
	    installation media should be required.</para>
	  
	  <para>After your system is fully installed and you have rebooted
	    from the hard disk, you can mount the CDROM at any time by typing:
	    <command>mount /cdrom</command></para>
	  
	  <para>Before removing the CD again, also note that it is necessary
	    to first type: <command>umount /cdrom</command>. Do not just
	    remove it from the drive!</para>
	  
	  <note>
	    <para>Before invoking the installation, be sure that the CDROM is
	      in the drive so that the install probe can find it. This is
	      also true if you wish the CDROM to be added to the default
	      system configuration automatically during the install (whether
	      or not you actually use it as the installation media).</para>
	  </note>
	  
	  <para>Finally, if you would like people to be able to FTP install
	    FreeBSD directly from the CDROM in your machine, you will find it
	    quite easy. After the machine is fully installed, you simply need
	    to add the following line to the password file (using the vipw
	    command):</para>
	  
	  <programlisting>
ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent
	  </programlisting>
	  
	  <para>Anyone with network connectivity to your machine (and
	    permission to log into it) can now chose a Media type of FTP and
	    type in: <userinput>ftp://<replaceable>your
		machine</replaceable></userinput> after picking <quote>Other</quote> in
	    the ftp sites menu.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Before installing from Floppy</title>
	  
	  <para>If you must install from floppy disks, either due to
	    unsupported hardware or simply because you enjoy doing things the
	    hard way, you must first prepare some floppies for the
	    install.</para>
	  
	  <para>You will need, at minimum, as many 1.44MB or 1.2MB floppies as
	    it takes to hold all files in the bin (binary distribution)
	    directory. If you are preparing these floppies under DOS, then
	    THESE floppies <emphasis>must</emphasis> be formatted using the MS-DOS FORMAT
	    command. If you are using Windows, use the Windows File Manager
	    format command.</para>
	  
	  <para>Do <emphasis>not</emphasis> trust Factory Preformatted
	    floppies! Format them again yourself, just to make sure. Many
	    problems reported by our users in the past have resulted from the
	    use of improperly formatted media, which is why I am taking such
	    special care to mention it here!</para>
	  
	  <para>If you are creating the floppies from another FreeBSD machine,
	    a format is still not a bad idea though you do not need to put a
	    DOS filesystem on each floppy. You can use the <command>disklabel</command> and
	    <command>newfs</command> commands to put a UFS filesystem on them instead, as the
	    following sequence of commands (for a 3.5" 1.44MB floppy disk)
	    illustrates:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>fdformat -f 1440 fd0.1440</userinput>
&prompt.root; <userinput>disklabel -w -r fd0.1440 floppy3</userinput>
&prompt.root; <userinput>newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0</userinput>
	      </screen>
	    </informalexample>
	  

	  <note>
	    <para>Use <literal>fd0.1200</literal> and
	      <literal>floppy5</literal> for 5.25" 1.2MB disks.</para>
	  </note>
		  
	  <para>Then you can mount and write to them like any other file
	    system.</para>
	  
	  <para>After you have formatted the floppies, you will need to copy
	    the files onto them. The distribution files are split into chunks
	    conveniently sized so that 5 of them will fit on a conventional
	    1.44MB floppy. Go through all your floppies, packing as many
	    files as will fit on each one, until you have got all the
	    distributions you want packed up in this fashion. Each
	    distribution should go into a subdirectory on the floppy, e.g.:
	    <filename>a:\bin\bin.aa</filename>,
	    <filename>a:\bin\bin.ab</filename>, and so on.</para>
	  
	  <para>Once you come to the Media screen of the install, select
	    <quote>Floppy</quote> and you will be prompted for the rest.</para>
	  
	</sect2>
	
	<sect2 id="install-msdos">
	  <title>Before installing from a MS-DOS partition</title>
	  
	  <para>To prepare for installation from an MS-DOS partition, copy the
	    files from the distribution into a directory called
	    <filename>C:\FREEBSD</filename>. The directory tree structure of
	    the CDROM must be partially reproduced within this directory so we
	    suggest using the DOS <command>xcopy</command> command.
	    For example, to prepare for a minimal installation of FreeBSD:

	    <informalexample>
	      <screen><prompt>C:\&gt;</prompt> <userinput>MD C:\FREEBSD</userinput>
<prompt>C:\&gt;</prompt> <userinput>XCOPY /S E:\BIN C:\FREEBSD\BIN\</userinput>
<prompt>C:\&gt;</prompt> <userinput>XCOPY /S E:\MANPAGES C:\FREEBSD\MANPAGES\</userinput></screen>
	    </informalexample> assuming that <devicename>C:</devicename>
	    is where you have free space and <devicename>E:</devicename>
	    is where your CDROM is mounted.</para>
	  
	  <para>For as many <abbrev>DISTS</abbrev> you wish to install from MS-DOS (and you
	    have free space for), install each one under
	    <filename>C:\FREEBSD</filename> &mdash; the <abbrev>BIN</abbrev> dist
	    is only the minimal requirement.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Before installing from QIC/SCSI Tape</title>
	  
	  <para>Installing from tape is probably the easiest method, short of
	    an on-line install using FTP or a CDROM install. The installation
	    program expects the files to be simply tar'ed onto the tape, so
	    after getting all of the files for distribution you are interested
	    in, simply tar them onto the tape with a command like:

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /freebsd/distdir</userinput>
&prompt.root; <userinput>tar cvf /dev/rwt0 dist1 ... dist2</userinput></screen>
	    </informalexample>
	  </para>
	  
	  <para>When you go to do the installation, you should also make sure
	    that you leave enough room in some temporary directory (which you
	    will be allowed to choose) to accommodate the <emphasis>full</emphasis> contents of the tape you have created.
	    Due to the non-random access nature of tapes, this method of
	    installation requires quite a bit of temporary storage. You
	    should expect to require as much temporary storage as you have
	    stuff written on tape.</para>
	  
	  <note>
	      <para>When going to do the installation, the tape must be in the
	      drive <emphasis>before</emphasis> booting from the boot floppy.
	      The installation probe may otherwise fail to find it.</para>
	  </note>
	  
	</sect2>
	
	<sect2>
	  <title>Before installing over a network</title>
	  
	  <para>You can do network installations over 3 types of
	    communications links:</para>
	  
	    <variablelist>
	      <varlistentry><term>Serial port</term>
		<listitem>
		  <para>SLIP or PPP</para>
		  
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Parallel port</term>
		
		<listitem>
		  <para>PLIP (laplink cable)</para>
		  
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Ethernet</term>
		
		<listitem>
		  <para>A standard ethernet controller (includes some
		    PCMCIA).</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  <para>SLIP support is rather primitive, and limited primarily to
	    hard-wired links, such as a serial cable running between a laptop
	    computer and another computer. The link should be hard-wired as
	    the SLIP installation does not currently offer a dialing
	    capability; that facility is provided with the PPP utility, which
	    should be used in preference to SLIP whenever possible.</para>
	  
	  <para>If you are using a modem, then PPP is almost certainly your
	    only choice. Make sure that you have your service provider's
	    information handy as you will need to know it fairly soon in the
	    installation process. You will need to know how to dial your ISP
	    using the <quote>AT commands</quote> specific to your modem, as the PPP
	    dialer provides only a very simple terminal emulator. If you're
	    using PAP or CHAP, you'll need to type the necessary <command>set
	    authname</command> and <command>set authkey</command> commands before typing <command>term</command>.
	    Refer to the user-ppp <xref linkend="userppp" remap="handbook">
	    and <ulink URL="../FAQ/userppp.html">FAQ</ulink> entries for
	    further information. If you have problems, logging can be
	    directed to the screen using the command <command>set
	      log local ...</command>.</para>
	  
	  <para>If a hard-wired connection to another FreeBSD (2.0R or later)
	    machine is available, you might also consider installing over a
	    <quote>laplink</quote> parallel port cable. The data rate over the parallel
	    port is much higher than what is typically possible over a serial
	    line (up to 50k/sec), thus resulting in a quicker
	    installation.</para>
	  
	  <para>Finally, for the fastest possible network installation, an
	    ethernet adaptor is always a good choice! FreeBSD supports most
	    common PC ethernet cards, a table of supported cards (and their
	    required settings) is provided in <xref linkend="install-hw"
	      remap="Supported
	      Hardware">. If you are using one of the supported PCMCIA
	    ethernet cards, also be sure that it is plugged in
	    <emphasis>before</emphasis> the laptop is powered on! FreeBSD
	    does not, unfortunately, currently support hot insertion of PCMCIA
	    cards during installation.</para>
	  
	  <para>You will also need to know your IP address on the network, the
	    netmask value for your address class, and the name of your
	    machine. Your system administrator can tell you which values to
	    use for your particular network setup. If you will be referring
	    to other hosts by name rather than IP address, you will also need
	    a name server and possibly the address of a gateway (if you are
	    using PPP, it is your provider's IP address) to use in talking to
	    it. If you do not know the answers to all or most of these
	    questions, then you should really probably talk to your system
	    administrator <emphasis>first</emphasis> before trying this type
	    of installation.</para>
	  
	  <para>Once you have a network link of some sort working, the
	    installation can continue over NFS or FTP.</para>
	  
	  
	  <sect3>
	    <title>Preparing for NFS installation</title>
	    
	    <para>NFS installation is fairly straight-forward: Simply copy the
	      FreeBSD distribution files you want onto a server somewhere and
	      then point the NFS media selection at it.</para>
	    
	    <para>If this server supports only <quote>privileged port</quote> access (as
	      is generally the default for Sun workstations), you will need to
	      set this option in the Options menu before installation can
	      proceed.</para>
	    
	    <para>If you have a poor quality ethernet card which suffers from
	      very slow transfer rates, you may also wish to toggle the
	      appropriate Options flag.</para>
	    
	    <para>In order for NFS installation to work, the server must
	      support subdir mounts, e.g., if your FreeBSD &rel.current;
	      distribution directory lives on:
	      <filename>ziggy:/usr/archive/stuff/FreeBSD</filename> Then <hostid>ziggy</hostid>
	      will have to allow the direct mounting of
	      <filename>/usr/archive/stuff/FreeBSD</filename>, not just
	      <filename>/usr</filename> or
	      <filename>/usr/archive/stuff</filename>.</para>
	    
	    <para>In FreeBSD's <filename>/etc/exports</filename> file, this is
	      controlled by the <option>-alldirs</option> option. Other
	      NFS servers may have different conventions. If you are getting
	      <errortype>Permission Denied</errortype> messages from the server then it is likely
	      that you do not have this enabled properly.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Preparing for FTP Installation</title>
	    
	    <para>FTP installation may be done from any mirror site containing
	      a reasonably up-to-date version of FreeBSD &rel.current;. A
	      full menu of reasonable choices from almost anywhere in the
	      world is provided by the FTP site menu.</para>
	    
	    <para>If you are installing from some other FTP site not listed in
	      this menu, or you are having troubles getting your name server
	      configured properly, you can also specify your own URL by
	      selecting the <quote>Other</quote> choice in that menu. A URL can also be
	      a direct IP address, so the following would work in the absence
	      of a name server:</para>
	    
	    
	      <informalexample>
		<screen><userinput>ftp://165.113.121.81/pub/FreeBSD/&rel.current;-RELEASE</userinput></screen>
	      </informalexample>
	    
	    
	    <para>There are two FTP installation modes you can use:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>FTP Active</term>
		  <listitem>
		    <para>For all FTP transfers, use <quote>Active</quote> mode. This
		      will not work through firewalls, but will often work
		      with older ftp servers that do not support passive mode.
		      If your connection hangs with passive mode (the
		      default), try active!</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>FTP Passive</term>
		  
		  <listitem>
		    <para>For all FTP transfers, use <quote>Passive</quote> mode. This
		      allows the user to pass through firewalls that do not
		      allow incoming connections on random port
		      addresses.</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <note>
	      <para>Active and passive modes are not the same as a <quote>proxy</quote>
		connection, where a proxy FTP server is listening and
		forwarding FTP requests!</para>
	    </note>
	    
	    <para>For a proxy FTP server, you should usually give name of the
	      server you really want as a part of the username, after an
	      @-sign. The proxy server then 'fakes' the real server. An
	      example: Say you want to install from <hostid role="fqdn">ftp.freebsd.org</hostid>, using the
	      proxy FTP server <hostid role="fqdn">foo.bar.com</hostid>, listening on port 1234.</para>
	    
	    <para>In this case, you go to the options menu, set the FTP
	      username to ftp@ftp.freebsd.org, and the password to your e-mail
	      address. As your installation media, you specify FTP (or
	      passive FTP, if the proxy support it), and the URL

	      <informalexample>
		<screen><userinput>ftp://foo.bar.com:1234/pub/FreeBSD</userinput></screen>
	      </informalexample> <filename>/pub/FreeBSD</filename> from
	      <hostid role="fqdn">ftp.freebsd.org</hostid> is proxied
	      under <hostid role="fqdn">foo.bar.com</hostid>, allowing you to install from _that_ machine
	      (which fetch the files from <hostid role="fqdn">ftp.freebsd.org</hostid> as your installation
	      requests them).</para>
	    
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1>
	<title>Installing FreeBSD</title>
	
	<para>Once you have taken note of the appropriate preinstallation
	  steps, you should be able to install FreeBSD without any further
	  trouble.</para>
	
	<para>Should this not be true, then you may wish to go back and
	  re-read the relevant preparation section above for the installation
	  media type you are trying to use, perhaps there is a helpful hint
	  there that you missed the first time? If you are having hardware
	  trouble, or FreeBSD refuses to boot at all, read the Hardware Guide
	  provided on the boot floppy for a list of possible solutions.</para>
	
	<para>The FreeBSD boot floppy contains all the on-line documentation
	  you should need to be able to navigate through an installation and
	  if it does not then we would like to know what you found most
	  confusing. Send your comments to the &a.doc;. It is the objective
	  of the FreeBSD installation program (sysinstall) to be
	  self-documenting enough that painful <quote>step-by-step</quote> guides are no
	  longer necessary. It may take us a little while to reach that
	  objective, but that is the objective!</para>
	
	<para>Meanwhile, you may also find the following <quote>typical
	  installation sequence</quote> to be helpful:</para>
	
	
	  <orderedlist>
	    
	    <listitem>
	      <para>Boot the boot floppy. After a boot sequence which can
		take anywhere from 30 seconds to 3 minutes, depending on your
		hardware, you should be presented with a menu of initial
		choices. If the floppy does not boot at all, or the boot
		hangs at some stage, go read the Q&amp;A section of the
		Hardware Guide for possible causes.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Press F1. You should see some basic usage instructions on
		the menu system and general navigation. If you have not used
	      this menu system before then <emphasis>please</emphasis> read this thoroughly!</para>
	    </listitem>
	    
	    <listitem>
	      <para>Select the Options item and set any special preferences
		you may have.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Select a Novice, Custom or Express install, depending on
		whether or not you would like the installation to help you
		through a typical installation, give you a high degree of
		control over each step of the installation or simply whizz
		through it (using reasonable defaults when possible) as fast
		as possible. If you have never used FreeBSD before then the
		Novice installation method is most recommended.</para>
	    </listitem>
	    
	    <listitem>
	      <para>The final configuration menu choice allows you to further
		configure your FreeBSD installation by giving you menu-driven
		access to various system defaults. Some items, like
		networking, may be especially important if you did a
		CDROM/Tape/Floppy installation and have not yet configured
		your network interfaces (assuming you have any). Properly
		configuring such interfaces here will allow FreeBSD to come up
		on the network when you first reboot from the hard
		disk.</para>
	    </listitem>
	    
	  </orderedlist>
	
	
      </sect1>
      
      <sect1>
	<title>MS-DOS User's Questions and Answers</title>
	
	<para>Many FreeBSD users wish to install FreeBSD on PCs inhabited by
	  MS-DOS. Here are some commonly asked questions about installing
	  FreeBSD on such systems.</para>
	
	<para><emphasis>Help! I have no space! Do I need to delete
	    everything first?</emphasis></para>
	
	<para>If your machine is already running MS-DOS and has little or no
	  free space available for FreeBSD's installation, all is not lost!
	  You may find the FIPS utility, provided in the <filename>tools</filename> directory on the FreeBSD CDROM or on the
	  various FreeBSD ftp sites, to be quite useful.</para>
	
	<para>FIPS allows you to split an existing MS-DOS partition into two
	  pieces, preserving the original partition and allowing you to
	  install onto the second free piece. You first defragment your
	  MS-DOS partition, using the DOS 6.xx DEFRAG utility or the Norton
	  Disk tools, then run FIPS. It will prompt you for the rest of the
	  information it needs. Afterwards, you can reboot and install
	  FreeBSD on the new free slice. See the
	  <emphasis>Distributions</emphasis> menu for an estimation of how
	  much free space you will need for the kind of installation you
	  want.</para>
	
	<para><emphasis>Can I use compressed MS-DOS filesystems from
	    FreeBSD?</emphasis></para>
	
	<para>No. If you are using a utility such as Stacker(tm) or
	  DoubleSpace(tm), FreeBSD will only be able to use whatever portion
	  of the filesystem you leave uncompressed. The rest of the
	  filesystem will show up as one large file (the stacked/dblspaced
	  file!). <emphasis>Do not remove that file!</emphasis> You
	  will probably regret it greatly!</para>
	
	<para>It is probably better to create another uncompressed MS-DOS
	  primary partition and use this for communications between MS-DOS and
	  FreeBSD.</para>
	
	<para><emphasis>Can I mount my MS-DOS extended
	    partitions?</emphasis></para>
	
	<para>Yes. DOS extended partitions are mapped in at the end of the
	  other <quote>slices</quote> in FreeBSD, e.g. your <devicename>D:</devicename> drive might be <filename>/dev/sd0s5</filename>,
	  your <devicename>E:</devicename> drive <filename>/dev/sd0s6</filename>, and so on. This example assumes, of
	  course, that your extended partition is on SCSI drive 0. For IDE
	  drives, substitute <filename>wd</filename> for <filename>sd</filename> appropriately. You otherwise
	  mount extended partitions exactly like you would mount any other DOS
	  drive, e.g.:</para>
	
	<informalexample>
	  <screen>&prompt.root; <userinput>mount -t msdos /dev/sd0s5 /dos_d</userinput></screen>
	</informalexample>
	
	<para><emphasis>Can I run MS-DOS binaries under
	    FreeBSD?</emphasis></para>
	
	<para>BSDI has donated their DOS emulator to the BSD world and this
	  has been ported to FreeBSD.</para>
	
	<para>There is also a (technically) nice application available in the
	  <xref linkend="ports" remap="The Ports Collection"> called pcemu
	  which allows you to run many basic MS-DOS text-mode binaries by
	  entirely emulating an 8088 CPU.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="basics">
      <title>Unix Basics</title>
      
      
      <sect1 id="basics-man">
	<title>The Online Manual</title>
	
	<para>The most comprehensive documentation on FreeBSD is in the form
	  of <emphasis>man pages</emphasis>. Nearly every program on the
	  system comes with a short reference manual explaining the basic
	  operation and various arguments. These manuals can be view with the
	  <command>man</command>
	  command. Use of the <command>man</command> command is simple:

	  <informalexample>
	    <screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput>
	    </screen>
	  </informalexample> where <replaceable>command</replaceable> is
	  the name of the command you wish to learn about. For example, to
	  learn more about <command>ls</command> command type:
	  <informalexample>
	    <screen>&prompt.user; <userinput>man ls</userinput></screen>
	  </informalexample>
	</para>
	
	<para>The online manual is divided up into numbered sections:</para>
	
	  <orderedlist>
	    
	    <listitem>
	      <para>User commands</para>
	    </listitem>
	    
	    <listitem>
	      <para>System calls and error numbers</para>
	    </listitem>
	    
	    <listitem>
	      <para>Functions in the C libraries</para>
	    </listitem>
	    
	    <listitem>
	      <para>Device drivers</para>
	    </listitem>
	    
	    <listitem>
	      <para>File formats</para>
	    </listitem>
	    
	    <listitem>
	      <para>Games and other diversions</para>
	    </listitem>
	    
	    <listitem>
	      <para>Miscellaneous information</para>
	    </listitem>
	    
	    <listitem>
	      <para>System maintenance and operation commands</para>
	    </listitem>
	    
	  </orderedlist>

	<para>In some cases, the same topic may appear in more than
	  one section of the on-line manual. For example, there is a
	  <command>chmod</command>
	  user command and a <function>chmod()</function> system call. In
	  this case, you can tell the <command>man</command> command which one you want by
	  specifying the section:

	  <informalexample>
	    <screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
	  </informalexample> which will display the manual page for the user
	  command <command>chmod</command>. References to a
	  particular section of the on-line manual are traditionally placed in
	  parenthesis in written documentation, so <citerefentry<refentrytitle>chmod</refentrytitle><manvolnum>1</manvolnum></citerefentry> refers to the
	  <command>chmod</command>
	  user command and <citerefentry><refentrytitle>chmod</refentrytitle><manvolnum>2</manvolnum></citerefentry> refers to the
	  system call.</para>
	
	<para>This is fine if you know the name of the command and simply wish
	  to know how to use it, but what if you cannot recall the command
	  name? You can use <command>man</command> to search for keywords in the
	  command <emphasis>descriptions</emphasis> by using the
	  <option>-k</option> switch:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>man -k mail</userinput></screen>
	  </informalexample>

	<para>With this command you will be presented with a
	  list of commands that have the keyword <quote>mail</quote> in their descriptions.
	  This is actually functionally equivalent to using the <command>apropos</command>
	  command.</para>
	
	<para>So, you are looking at all those fancy commands in
	  <filename>/usr/bin</filename> but do not even have the faintest idea
	  what most of them actually do? Simply do a
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>cd /usr/bin; man -f *</userinput></screen>
	  </informalexample>

	  or

	  <informalexample>
	    <screen>&prompt.user; <userinput>cd /usr/bin; whatis *</userinput></screen>
	  </informalexample> which does the same thing.</para>
	
      </sect1>
      
      <sect1 id="basics-info">
	<title>GNU Info Files</title>
	
	<para>FreeBSD includes many applications and utilities produced by the
	  Free Software Foundation (FSF). In addition to man pages, these
	  programs come with more extensive hypertext documents called
	  <quote>info</quote> files which can be viewed with the
	  <command>info</command> command or, if you installed
	  <command>emacs</command>, the info mode of <command>emacs</command>.</para>
	
	<para>To use the <citerefentry><refentrytitle>info</refentrytitle><manvolnum>1</manvolnum></citerefentry> command, simply type:

	  <informalexample>
	    <screen>&prompt.user; <userinput>info</userinput></screen>
	  </informalexample>

	  For a brief introduction, type <userinput>h</userinput>. For a quick
	  command reference, type <userinput>?</userinput>.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="ports">
      <title>Installing Applications: The Ports collection</title>
      
      <para><emphasis>Contributed by &a.jraynard;.</emphasis></para>
      
      <para>The FreeBSD Ports collection allows you to compile and install a
	very wide range of applications with a minimum of effort.</para>
      
      <para>For all the hype about open standards, getting a program to work
	on different versions of Unix in the real world can be a tedious and
	tricky business, as anyone who has tried it will know. You may be
	lucky enough to find that the program you want will compile cleanly on
	your system, install itself in all the right places and run flawlessly
	<quote>out of the box</quote>, but this is unfortunately rather rare. With most
	programs, you will find yourself doing a fair bit of head-scratching,
	and there are quite a few programs that will result in premature
	greying, or even chronic alopecia...</para>
      
      <para>Some software distributions have attacked this problem by
	providing configuration scripts. Some of these are very clever, but
	they have an unfortunate tendency to triumphantly announce that your
	system is something you have never heard of and then ask you lots of
	questions that sound like a final exam in system-level Unix
	programming (<literal>Does your system's gethitlist function return a const
	pointer to a fromboz or a pointer to a const fromboz? Do you have
	Foonix style unacceptable exception handling? And if not, why
	not?</literal>).</para>
      
      <para>Fortunately, with the Ports collection, all the hard work
	involved has already been done, and you can just type <command>make install</command>
	and get a working program.</para>
      
      
      <sect1>
	<title>Why Have a Ports Collection?</title>
	
	<para>The base FreeBSD system comes with a very wide range of tools
	  and system utilities, but a lot of popular programs are not in the
	  base system, for good reasons:-</para>
	
	
	  <orderedlist>
	    
	    <listitem>
	      <para>Programs that some people cannot live without and other
		people cannot stand, such as a certain Lisp-based editor.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Programs which are too specialised to put in the base
		system (CAD, databases).</para>
	    </listitem>
	    
	    <listitem>
	      <para>Programs which fall into the <quote>I must have a look at that
		when I get a spare minute</quote> category, rather than
		system-critical ones (some languages, perhaps).</para>
	    </listitem>
	    
	    <listitem>
	      <para>Programs that are far too much fun to be supplied with a
		serious operating system like FreeBSD ;-)</para>
	    </listitem>
	    
	    <listitem>
	      <para>However many programs you put in the base system, people
		will always want more, and a line has to be drawn somewhere
		(otherwise FreeBSD distributions would become absolutely
		enormous).</para>
	    </listitem>
	    
	  </orderedlist>
	
	
	<para>Obviously it would be unreasonable to expect everyone to port
	  their favourite programs by hand (not to mention a tremendous amount
	  of duplicated work), so the FreeBSD Project came up with an
	  ingenious way of using standard tools that would automate the
	  process.</para>
	
	<para>Incidentally, this is an excellent illustration of how <quote>the
	  Unix way</quote> works in practice by combining a set of simple but very
	  flexible tools into something very powerful.</para>
	
      </sect1>
      
      <sect1>
	<title>How Does the Ports Collection Work?</title>
	
	<para>Programs are typically distributed on the Internet as a 
	  <xref linkend="ports-tarball" remap="tarball"> consisting of a
	  Makefile and the source code for the program and usually some
	  instructions (which are unfortunately not always as instructive as
	  they could be), with perhaps a configuration script.</para>
	
	<para>The standard scenario is that you FTP down the tarball, extract
	  it  somewhere, glance through the instructions, make any changes
	  that seem  necessary, run the configure script to set things up and
	  use the standard  <command>make</command> program to compile and install the program
	  from the source.</para>
	
	<para>FreeBSD ports still use the tarball mechanism, but use a 
	  <xref linkend="ports-skeleton" remap="skeleton"> to hold the
	  &quot;knowledge&quot; of how to get the program working on FreeBSD,
	  rather than expecting the user to be able to work it out. They also
	  supply their own customised
	  <xref linkend="ports-makefile" remap="Makefile">, so that almost
	  every port can be built in the same way.</para>
	
	<para>If you look at a port skeleton (either on <ulink
	    URL="file://localhost/usr/ports/devel/ElectricFence">your FreeBSD
	    system</ulink> or <ulink
	    URL="ftp://ftp.freebsd.org/pub/FreeBSD/ports/devel/ElectricFence">the FTP site</ulink>) and expect to find all sorts of pointy-headed rocket science lurking there, you may be disappointed by the one or two rather unexciting-looking files and directories you find there. (We will discuss in a minute how to go about <xref
	    linkend="ports-getting" remap="Getting a port">).</para>
	
	<para><quote>How on earth can this do anything?</quote> I hear you cry. <quote>There
	  is no source code there!</quote></para>
	
	<para>Fear not, gentle reader, all will become clear (hopefully).
	  Let's see what happens if we try and install a port. I have chosen
	  <application>ElectricFence</application>, a useful tool for developers, as the skeleton is
	  more straightforward than most.</para>
	
	<note>
	  <para>If you are trying this at home, you
	  will need to be root.</para>
	</note>
	
	<informalexample>
	  <screen>&prompt.root; <userinput>cd /usr/ports/devel/ElectricFence</userinput>
&prompt.root; <userinput>make install</userinput>
&gt;&gt; Checksum OK for ElectricFence-2.0.5.tar.gz.
===&gt;  Extracting for ElectricFence-2.0.5
===&gt;  Patching for ElectricFence-2.0.5
===&gt;  Applying FreeBSD patches for ElectricFence-2.0.5
===&gt;  Configuring for ElectricFence-2.0.5
===&gt;  Building for ElectricFence-2.0.5
[lots of compiler output...]
===&gt;  Installing for ElectricFence-2.0.5
===&gt;  Warning: your umask is "0002". If this is not desired, set it to
      an appropriate value and install this port again by ``make reinstall''.
install -c -o bin -g bin -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.a /usr/local/lib
install -c -o bin -g bin -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.3 /usr/local/man/man3
===&gt;  Compressing manual pages for ElectricFence-2.0.5
===&gt;  Registering installation for ElectricFence-2.0.5</screen>
	</informalexample>
	
	<para>To avoid confusing the issue, I have completely removed the
	  build output.</para>
	
	<para>If you tried this yourself, you may well have got something like
	  this at the start:-</para>
	
	<para><anchor id="ports-fetch">
	  <informalexample>
	    <screen>&prompt.root; <userinput>make install</userinput>
&gt;&gt; ElectricFence-2.0.5.tar.gz doesn't seem to exist on this system.
&gt;&gt; Attempting to fetch from ftp://ftp.doc.ic.ac.uk/Mirrors/sunsite.unc.edu/pub/Linux/devel/lang/c/.</screen>
	  </informalexample>
	</para>
	
	<para>The <command>make</command> program has noticed that you did not have a local
	  copy of the source code and tried to FTP it down so it could get the
	  job done. I already had the source handy in my example, so it did
	  not need to fetch it.</para>
	
	<para>Let's go through this and see what the <command>make</command> program was
	  doing.</para>
	
	
	  <procedure>
	    
	    <step>
	      <para>Locate the source code <xref linkend="ports-tarball"
		  remap="tarball."> If it is not available locally, try to
		grab it from an FTP site.</para>
	    </step>
	    
	    <step>
	      <para>Run a <xref linkend="ports-checksum" remap="checksum">
		test on the tarball to make sure it has not been tampered
		with, accidentally truncated, downloaded in ASCII mode, struck
		by neutrinos while in transit, etc.</para>
	    </step>
	    
	    <step>
	      <para>Extract the tarball into a temporary work directory.</para>
	    </step>
	    
	    <step>
	      <para>Apply any <xref linkend="ports-patch" remap="patches">
		needed to get the source to compile and run under FreeBSD.</para>
	    </step>
	    
	    <step>
	      <para>Run any configuration script required by the build
		process and correctly answer any questions it asks.</para>
	    </step>
	    
	    <step>
	      <para>(Finally!) Compile the code.</para>
	    </step>
	    
	    <step>
	      <para>Install the program executable and other supporting
		files, man pages, etc. under the
		<filename>/usr/local</filename> hierarchy, where they will not
		get mixed up with system programs. This also makes sure that
		all the ports you install will go in the same place, instead
		of being flung all over your system.</para>
	    </step>
	    
	    <step>
	      <para>Register the installation in a database. This means that,
		if you do not like the program, you can cleanly <xref
		  linkend="ports-remove" remap="remove"> all traces of it from
		your system.</para>
	    </step>
	    
	  </procedure>
	
	
	<para>Scroll up to the <command>make</command> output and see if you can match these
	  steps to it. And if you were not impressed before, you should be by
	  now!</para>
	
      </sect1>
      
      <sect1 id="ports-getting">
	<title>Getting a FreeBSD Port</title>
	
	<para>There are two ways of getting hold of the FreeBSD port for a
	  program. One requires a <xref linkend="ports-cd" remap="FreeBSD
	    CDROM">, the other involves using an <xref linkend="ports-inet"
	    remap="Internet Connection."></para>
	
	
	<sect2 id="ports-cd">
	  <title>Compiling ports from CDROM</title>
	  
	  <para>If you answered yes to the question <quote>Do you want to link the
	    ports  collection to your CDROM</quote> during the FreeBSD installation,
	    the initial setting up will already have been done for you.</para>
	  
	  <para>If not, make sure the <emphasis>FreeBSD</emphasis> CDROM is in
	    the drive and mounted on, say, <filename>/cdrom</filename>. Then
	    do</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>mkdir /usr/ports</userinput>
&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>ln -s /cdrom/ports/distfiles distfiles</userinput></screen>
	  </informalexample>
	  
	  <para>to enable the ports make mechanism to find the tarballs (it
	    expects to find them in <filename>/usr/ports/distfiles</filename>,
	    which is why we sym-linked the CDROM's tarball directory to that
	    directory).</para>
	  
	  <para>Now, suppose you want to install the gnats program from the
	    databases directory. Here is how to do it:-</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>mkdir databases</userinput>
&prompt.root; <userinput>cp -R /cdrom/ports/databases/gnats databases</userinput>
&prompt.root; <userinput>cd databases/gnats</userinput>
&prompt.root; <userinput>make install</userinput></screen>
	  </informalexample>
	  
	  <para>Or if you are a serious database user and you want to compare
	    all the ones available in the Ports collection, do</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>cp -R /cdrom/ports/databases .</userinput>
&prompt.root; <userinput>cd databases</userinput>
&prompt.root; <userinput>make install</userinput></screen>
	  </informalexample>
	  
	  <para>(yes, that really is a dot on its own after the <command>cp</command> command and
	    not a mistake. It is Unix-ese for <quote>the current
	    directory</quote>)</para>
	  
	  <para>and the ports make mechanism will automatically compile and
	    install all the ports in the databases directory for you!</para>
	  
	  <para>If you do not like this method, here is a completely different
	    way of doing it:-</para>
	  
	  <para>Create a <quote>link tree</quote> to it using the
	    <citerefentry><refentrytitle>lndir</refentrytitle><manvolnum>1</manvolnum></citerefentry> command that comes with the
	    <emphasis>XFree86</emphasis> distribution. Find a location with
	    some free space, create a directory there and then cd to it. Then
	    invoke the <citerefentry><refentrytitle>lndir</refentrytitle><manvolnum>1</manvolnum></citerefentry> command with the full
	    pathname of the <filename>ports</filename> directory on the CDROM as the first
	    argument and . (the current directory) as the second. This might
	    be, for example, something like:

	    <informalexample>
	      <screen>&prompt.root; <userinput>lndir /cdrom/ports .</userinput></screen>
	    </informalexample>
	  </para>
	  
	  <para>Then you can build ports directly off the CDROM by building
	    them in the link tree you have created.</para>
	  
	  <para>Note that there are some ports for which we cannot provide the
	    original source in the CDROM due to licensing limitations. In
	    that case, you will need to look at the section on <xref
	      linkend="ports-inet"
	      remap="Compiling ports using an Internet connection."></para>
	  
	</sect2>
	
	<sect2 id="ports-inet">
	  <title>Compiling ports from the Internet</title>
	  
	  <para>If you do not have a CDROM, or you want to make sure you get
	    the very latest version of the port you want, you will need to
	    download the
	    <xref linkend="ports-skeleton" remap="skeleton"> for the port. Now
	    this  might sound like rather a fiddly job full of pitfalls, but
	    it is actually very easy.</para>
	  
	  <para>The key to it is that the FreeBSD FTP server can create
	    on-the-fly
	    <xref linkend="ports-tarball" remap="tarballs"> for you. Here is
	    how it works, with the gnats program in the databases directory as
	    an example (the bits in square brackets are comments. Do not type
	    them in if you are trying this yourself!):-</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>mkdir databases</userinput>
&prompt.root; <userinput>cd databases</userinput>
&prompt.root; <userinput>ftp ftp.freebsd.org</userinput>
[log in as `ftp' and give your email address when asked for a
password. Remember to use binary (also known as image) mode!]
<prompt>&gt;</prompt> <userinput>cd /pub/FreeBSD/ports/databases</userinput>
<prompt>&gt;</prompt> <userinput>get gnats.tar</userinput>
[tars up the gnats skeleton for us]
<prompt>&gt;</prompt> <userinput>quit</userinput>
&prompt.root; <userinput>tar xf gnats.tar</userinput>
[extract the gnats skeleton]
&prompt.root; <userinput>cd gnats</userinput>
&prompt.root; <userinput>make install</userinput>
[build and install gnats]</screen>
	  </informalexample>
	  
	  <para>What happened here? We connected to the FTP server in the
	    usual way and went to its <filename>databases</filename> sub-directory. When we gave it
	    the command <command>get gnats.tar</command>, the FTP server <xref
	      linkend="ports-tarball"
	      remap="tarred"> up the gnats directory for us.</para>
	  
	  <para>We then extracted the gnats skeleton and went into the gnats
	    directory to build the port. As we explained <xref
	      linkend="ports-fetch"
	      remap="earlier">, the make process noticed we did not have a
	    copy of the source locally, so it fetched one before extracting,
	    patching and building it.</para>
	  
	  <para>Let's try something more ambitious now. Instead of getting a
	    single port skeleton, let's get a whole sub-directory, for example
	    all the database skeletons in the ports collection. It looks
	    almost the same:-</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>ftp ftp.freebsd.org</userinput>
[log in as `ftp' and give your email address when asked for a
password. Remember to use binary (also known as image) mode!]
<prompt>&gt;</prompt> <userinput>cd /pub/FreeBSD/ports</userinput>
<prompt>&gt;</prompt> <userinput>get databases.tar</userinput>
[tars up the databases directory for us]
<prompt>&gt;</prompt> <userinput>quit</userinput>
&prompt.root; <userinput>tar xf databases.tar</userinput>
[extract all the database skeletons]
&prompt.root; <userinput>cd databases</userinput>
&prompt.root; <userinput>make install</userinput>
[build and install all the database ports]</screen>
	  </informalexample>
	  
	  <para>With half a dozen straightforward commands, we have now got a
	    set of database programs on our FreeBSD machine! All we did that
	    was different from getting a single port skeleton and building it
	    was that we got a whole directory at once, and compiled everything
	    in it at once. Pretty impressive, no?</para>
	  
	  <para>If you expect to be installing many ports, it is probably
	    worth downloading all the ports directories.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="ports-skeleton">
	<title>Skeletons</title>
	
	<para>A team of compulsive hackers who have forgotten to eat in a
	  frantic attempt to make a deadline? Something unpleasant lurking in
	  the FreeBSD  attic? No, a skeleton here is a minimal framework that
	  supplies everything needed to make the ports magic work.</para>
	
	
	<sect2 id="ports-makefile">
	  <title><filename>Makefile</filename></title>
	  
	  <para>The most important component of a skeleton is the Makefile.
	    This contains various statements that specify how the port should
	    be compiled and installed. Here is the Makefile for
	    ElectricFence:-</para>
	  
	  <programlisting>
# New ports collection makefile for:  Electric Fence
# Version required:	2.0.5
# Date created: 	13 November 1997
# Whom:			jraynard
#
# &#36;Id&#36;
#

DISTNAME=       ElectricFence-2.0.5
CATEGORIES=     devel
MASTER_SITES=   ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR=	devel/lang/c

MAINTAINER=	jraynard@freebsd.org

MAN3=           libefence.3

do-install:
        ${INSTALL_DATA} ${WRKSRC}/libefence.a ${PREFIX}/lib
        ${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3

.include &lt;bsd.port.mk&gt;
	  </programlisting>
	  
	  <para>The lines beginning with a &quot;#&quot; sign are comments for
	    the benefit of human readers (as in most Unix script
	    files).</para>
	  
	  <para><literal>DISTNAME</literal> specifies the name of the <xref
	      linkend="ports-tarball" remap="tarball">, but without the
	    extension.</para>
	  
	  <para><literal>CATEGORIES</literal> states what kind of program this is. In
	    this case, a utility for developers.</para>
	  
	  <para><literal>MASTER_SITES</literal> is the URL(s) of the master FTP site,
	    which is used to retrieve the <xref linkend="ports-tarball"
	      remap="tarball"> if it is not available on the local system.
	    This is a site which is regarded as reputable, and is normally the
	    one from which the program is officially  distributed (in so far
	    as any software is &quot;officially&quot; distributed on the
	    Internet).</para>
	  
	  <para><literal>MAINTAINER</literal> is the email address of the person who is
	    responsible for updating the skeleton if, for example a new
	    version of the program comes out.</para>
	  
	  <para>Skipping over the next few lines for a minute, the line
	    <literal>.include &lt;bsd.port.mk&gt;</literal> says
	    that the other statements and commands  needed for this port are
	    in a standard file called <filename>bsd.port.mk</filename>. As
	    these are the same for all ports, there is no point in duplicating
	    them all over the place, so they are kept in a single standard
	    file.</para>
	  
	  <para>This is probably not the place to go into a detailed
	    examination of how Makefiles work; suffice it to say that the line
	    starting with <literal>MAN3</literal> ensures that the ElectricFence man page is
	    compressed after installation, to help conserve your precious disk
	    space. The original port did not provide an <maketarget>install</maketarget> target,
	    so the three lines from <maketarget>do-install</maketarget> ensure that the files
	    produced by this port are placed in the correct
	    destination.</para>
	  
	</sect2>
	
	<sect2>
	  <title>The <filename>files</filename> directory</title>
	  
	  <para>The file containing the <xref linkend="ports-checksum"
	      remap="checksum"> for the port is called
	    <filename>md5</filename>, after the MD5 algorithm used for ports
	    checksums. It lives in a directory with the slightly confusing
	    name of <filename>files</filename>.</para>
	  
	  <para>This directory can also contain other miscellaneous files that
	    are required by the port and do not belong anywhere else.</para>
	  
	</sect2>
	
	<sect2>
	  <title>The <filename>patches</filename> directory</title>
	  
	  <para>This directory contains the <xref linkend="ports-patch"
	      remap="patches"> needed to make everything work properly under
	    FreeBSD.</para>
	  
	</sect2>
	
	<sect2>
	  <title>The <filename>pkg</filename> directory</title>
	  
	  <para>This program contains three quite useful files:-</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><filename>COMMENT</filename> &mdash; a one-line description of
		  the program.</para>
	      </listitem>
	      
	      <listitem>
		<para><filename>DESCR</filename> &mdash; a more detailed description.</para>
	      </listitem>
	      
	      <listitem>
		<para><filename>PLIST</filename> &mdash; a list of all the files
		  that will be created when the program is installed.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="ports-troubleshooting">
	<title>What to do when a port does not work.</title>
	
	<para>Oh. You can do one of four (4) things :</para>
	
	
	  <orderedlist>
	    
	    <listitem>
	      <para>Fix it yourself. Technical details on how ports work can
		be found in
		<xref linkend="porting" remap="Porting applications."></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gripe. This is done by e-mail <emphasis>only</emphasis>! Send such e-mail to
		the &a.ports; and please include the name/version of the port,
		where you got both the port source &amp; distfile(s) from, and
		what the text of the error was.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Forget it. This is the easiest for most &mdash; very few of the
		programs in ports can be classified as essential!</para>
	    </listitem>
	    
	    <listitem>
	      <para>Grab the pre-compiled package from a ftp server. The
		<quote>master</quote> package collection is on FreeBSD's FTP server in
		the <ulink
		  URL="ftp://ftp.FreeBSD.org/pub/FreeBSD/packages/">packages
		  directory</ulink>, though check your local mirror first,
		please! These are more likely to work (on the whole) than
		trying to compile from source and a lot faster besides! Use
		the <citerefentry><refentrytitle>pkg_add</refentrytitle><manvolnum>1</manvolnum></citerefentry>  program to install a
		package file on your system.</para>
	    </listitem>
	    
	  </orderedlist>
	
	
      </sect1>
      
      <sect1>
	<title>I Want to Make a Port!</title>
	
	<para>Great! Please see the <xref linkend="porting"
	    remap="guidelines"> for detailed instructions on how to do
	  this.</para>
	
      </sect1>
      
      <sect1>
	<title>Some Questions and Answers</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Q. I thought this was going to be a discussion about
		modems??!</para>
	      
	      <para>A. Ah. You must be thinking of the serial ports on the
		back of your computer. We are using <quote>port</quote> here to mean the
		result of <quote>porting</quote> a program from one version of Unix to
		another. (It is an unfortunate bad habit of computer people to
		use the same word to refer to several completely different
		things).</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I thought you were supposed to use packages to install
		extra programs?</para>
	      
	      <para>A. Yes, that is usually the quickest and easiest way of
		doing it.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. So why bother with ports then?</para>
	      
	      <para>A. Several reasons:-</para>
	      
	      
		<orderedlist>
		  
		  <listitem>
		    <para>The licensing conditions on some software
		      distributions require that they be distributed as source
		      code, not binaries.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Some people do not trust binary distributions. At
		      least with source code you can (in theory) read through
		      it and look for potential problems yourself.</para>
		  </listitem>
		  
		  <listitem>
		    <para>If you have some local patches, you will need the
		      source to add them yourself.</para>
		  </listitem>
		  
		  <listitem>
		    <para>You might have opinions on how a program should be
		      compiled that differ from the person who did the package
		      &mdash; some people have strong views on what optimisation
		      setting should be used, whether to build debug versions
		      and then strip them or not, etc. etc.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Some people like having code around, so they can
		      read it if they get bored, hack around with it, borrow
		      from it (licence terms permitting, of course!) and so
		      on.</para>
		  </listitem>
		  
		  <listitem>
		    <para>If you ain't got the source, it ain't software!
		      <!-- smiley -->;-)</para>
		  </listitem>
		  
		</orderedlist>
	      
	    </listitem>
	    
	    <listitem>
	      <para><anchor id="ports-patch"> Q. What is a patch?</para>
	      
	      <para>A. A patch is a small (usually) file that specifies how to
		go from one version of a file to another. It contains text
		that says, in effect, things like <quote>delete line 23</quote>, <quote>add
		these two lines after line 468</quote> or <quote>change line 197 to
		  this</quote>. Also known as a <quote>diff</quote>, since it is generated by a
		program of that name.</para>
	    </listitem>
	    
	    <listitem>
	      <para><anchor id="ports-tarball"> Q. What is all this about
		tarballs?</para>
	      
	      <para>A. It is a file ending in <filename>.tar</filename> or
		<filename>.tar.gz</filename> (with variations like
		<filename>.tar.Z</filename>, or even <filename>.tgz</filename>
		if you are trying to squeeze the names into a DOS
		filesystem).</para>
	      
	      <para>Basically, it is a directory tree that has been archived
		into a single file (<filename>.tar</filename>) and optionally
		compressed (<filename>.gz</filename>). This technique was
		originally used for <emphasis>T</emphasis>ape
		<emphasis>AR</emphasis>chives (hence the name <command>tar</command>), but it is
		a widely used way of distributing program source code around
		the Internet.</para>
	      
	      <para>You can see what files are in them, or even extract them
		yourself, by using the standard Unix tar program, which comes
		with the base FreeBSD system, like this:-</para>
	      
	      <informalexample>
		<screen>&prompt.user; <userinput>tar tvzf foobar.tar.gz</userinput>		
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar tvf foobar.tar</userinput>
&prompt.user; <userinput>tar xvf foobar.tar</userinput>
		</screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para><anchor id="ports-checksum"> Q. And a checksum?</para>
	      
	      <para>A. It is a number generated by adding up all the data in
		the file you want to check. If any of the characters change,
		the checksum will no longer be equal to the total, so a simple
		comparison will allow you to spot the difference. (In
		practice, it is done in a more complicated way to spot
		problems like position-swapping, which will not show up with a
		simplistic addition).</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I did what you said for <xref linkend="ports-cd"
		  remap="compiling ports from a CDROM"> and it worked great
		until I tried to install the kermit port:-

		<informalexample>
		  <screen>&prompt.root; <userinput>make install</userinput>
&gt;&gt; cku190.tar.gz doesn't seem to exist on this system.
&gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen>
		</informalexample>
		Why can it not be found? Have I got a dud CDROM?</para>
	      
	      <para>A. The licensing terms for kermit do not allow us to put
		the tarball for it on the CDROM, so you will have to fetch it
		by hand &mdash; sorry! The reason why you got all those error
		messages was because you were not connected to the Internet at
		the time. Once you have downloaded it from any of the sites
		above, you can re-start the process (try and choose the
		nearest site to you, though, to save your time and the
		Internet's bandwidth).</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I did that, but when I tried to put it into
		<filename>/usr/ports/distfiles</filename> I got some error
		about not having permission.</para>
	      
	      <para>A. The ports mechanism looks for the tarball in
		<filename>/usr/ports/distfiles</filename>, but you will not be
		able to copy anything there because it is sym-linked to the
		CDROM, which is read-only. You can tell it to look somewhere
		else by doing</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>make  DISTDIR=/where/you/put/it install</userinput></screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para>Q. Does the ports scheme only work if you have everything
		in <filename>/usr/ports</filename>? My system administrator
		says I must put everything under
		<filename>/u/people/guests/wurzburger</filename>, but it does
		not seem to work.</para>
	      
	      <para>A. You can use the <makevar>PORTSDIR</makevar> and <makevar>PREFIX</makevar> variables to tell
		the ports mechanism to use different directories. For
		instance,</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>make PORTSDIR=/u/people/guests/wurzburger/ports install</userinput></screen>
	      </informalexample>
	      
	      <para>will compile the port in
		<filename>/u/people/guests/wurzburger/ports</filename> and
		install everything under <filename>/usr/local</filename>.</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>make PREFIX=/u/people/guests/wurzburger/local install</userinput></screen>
	      </informalexample>
	      
	      <para>will compile it in <filename>/usr/ports</filename> and
		install it in
		<filename>/u/people/guests/wurzburger/local</filename>.</para>
	      
	      <para>And of course</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>make PORTSDIR=.../ports PREFIX=.../local install</userinput></screen>
	      </informalexample>
	      
	      <para>will combine the two (it is too long to fit on the page if
		I write it in full, but I am sure you get the idea).</para>
	      
	      <para>If you do not fancy typing all that in every time you
		install a port (and to be honest, who would?), it is a good
		idea to put these variables into your environment.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I do not have a FreeBSD CDROM, but I would like to have
		all the tarballs handy on my system so I do not have to wait
		for a download every time I install a port. Is there an easy
		way to get them all at once?</para>
	      
	      <para>A. To get every single tarball for the ports collection,
		do</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make fetch</userinput></screen>
	      </informalexample>
	      
	      <para>For all the tarballs for a single ports directory,
		do</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>cd /usr/ports/directory</userinput>
&prompt.root; <userinput>make fetch</userinput></screen>
	      </informalexample>
	      
	      <para>and for just one port &mdash; well, I think you have guessed
		already.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I know it is probably faster to fetch the tarballs from
		one of the FreeBSD mirror sites close by. Is there any way to
		tell the port to fetch them from servers other than ones
		listed in the MASTER_SITES?</para>
	      
	      <para>A. Yes. If you know, for example, <hostid role="fqdn">ftp.FreeBSD.ORG</hostid> is much
		closer than sites listed in <makevar>MASTER_SITES</makevar>, do as following
		example.

		<informalexample>
		  <screen>&prompt.root; <userinput>cd /usr/ports/directory</userinput>
&prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.ORG/pub/FreeBSD/distfiles/ fetch</userinput></screen>
		</informalexample>
	      </para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I want to know what files make is going to need before
		it tries to pull them down.</para>
	      
	      <para>A. <command>make fetch-list</command> will display a list of the files
		needed for a port.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. Is there any way to stop the port from compiling? I
		want to do some hacking on the source before I install it, but
		it is a bit tiresome having  to watch it and hit control-C
		every time.</para>
	      
	      <para>A. Doing <command>make extract</command> will stop it after it has fetched
		and extracted the source code.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I am trying to make my own port and I want to be able
		to stop it compiling until I have had a chance to see if my
		patches worked properly. Is there something like <command>make
		extract</command>, but for patches?</para>
	      
	      <para>A. Yep, <command>make patch</command> is what you want. You will probably
		find the <makevar>PATCH_DEBUG</makevar> option useful as well. And by the way,
		thank you for your efforts!</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I have heard that some compiler options can cause bugs.
		Is this true? How can I make sure that I compile ports with
		the right settings?</para>
	      
	      <para>A. Yes, with version 2.6.3 of <command>gcc</command> (the version shipped
		with FreeBSD 2.1.0 and 2.1.5), the <option>-O2</option> option could result in
		buggy code unless you used the <option>-fno-strength-reduce</option> option as
		well. (Most of the ports don't use <option>-O2</option>). You
		<emphasis>should</emphasis> be able to specify the compiler
		options used by something like</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen>
	      </informalexample>
	      
	      <para>or by editing <filename>/etc/make.conf</filename>, but
		unfortunately not all ports respect this. The surest way is to
		do <command>make configure</command>, then go into the source directory and
		inspect the Makefiles by hand, but this can get tedious if the
		source has lots of sub-directories, each with their own
		Makefiles.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. There are so many ports it is hard to find the one I
		want. Is there a list anywhere of what ports are available?</para>
	      
	      <para>A. Look in the <filename>INDEX</filename> file in <filename>/usr/ports</filename>.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I went to install the <literal>foo</literal> port but the system
		suddenly stopped compiling it and starting compiling the
		<literal>bar</literal>
		port. What's going on?</para>
	      
	      <para>A. The <literal>foo</literal> port needs something that is supplied with
		<literal>bar</literal> &mdash; for instance, if <literal>foo</literal> uses graphics, <literal>bar</literal> might have
		a library with useful graphics processing routines. Or <literal>bar</literal>
		might be a tool that is needed to compile the <literal>foo</literal>
		port.</para>
	    </listitem>
	    
	    <listitem>
	      <para><anchor id="ports-remove">  Q. I installed the <literal>grizzle</literal>
		program from the ports and frankly it is a complete waste of
		disk space. I want to delete it but I do not know where it put
		all the files. Any clues?</para>
	      
	      <para>A. No problem, just do</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para>
		Q. Hang on a minute, you have to know the version number to
		use that command. You do not seriously expect me to remember
		that, do you??</para>
	      
	      <para>A. Not at all, you can find it out by doing</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput>
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para>Q. Talking of disk space, the ports directory seems to be
		taking up an awful lot of room. Is it safe to go in there and
		delete things?</para>
	      
	      <para>A. Yes, if you have installed the program and are fairly
		certain you will not need the source again, there is no point
		in keeping it hanging around. The best way to do this
		is</para>
	      
	      <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make clean</userinput></screen>
	      </informalexample>
	      
	      <para>which will go through all the ports subdirectories and
		delete everything except the skeletons for each port.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I tried that and it still left all those tarballs or
		whatever you called them in the <filename>distfiles</filename>
		directory. Can I delete those as well?</para>
	      
	      <para>A. Yes, if you are sure you have finished with them, those
		can go as well.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I like having lots and lots of programs to play with.
		Is there any way of installing all the ports in one go?</para>
	      
	      <para>A. Just do</para>
	      
	      <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make install</userinput></screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para>Q. OK, I tried that, but I thought it would take a very
		long time so I went to bed and left it to get on with it. When
		I looked at the computer this morning, it had only done three
		and a half ports. Did something go wrong?</para>
	      
	      <para>A. No, the problem is that some of the ports need to ask
		you questions that we cannot answer for you (eg <quote>Do you want
		to print on A4 or US letter sized paper?</quote>) and they need to
		have someone on hand to answer them.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. I really do not want to spend all day staring at the
		monitor. Any better ideas?</para>
	      
	      <para>A. OK, do this before you go to bed/work/the local
		park:-</para>
	      
	      <informalexample>
	    <screen>&prompt.root <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make -DBATCH install</userinput></screen>
	      </informalexample>
	      
	      <para>This will install every port that does
		<emphasis>not</emphasis> require user input. Then, when you
		come back, do</para>
	      
	      <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen>
	      </informalexample>
	      
	      <para>to finish the job.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Q. At work, we are using <literal>frobble</literal>, which is in your ports
		collection, but we have altered it quite a bit to get it to do
		what we need. Is there any way of making our own packages, so
		we can distribute it more easily around our sites?</para>
	      
	      <para>A. No problem, assuming you know how to make patches for
		your changes:-</para>
	      
	      <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/ports/somewhere/frobble</userinput>
&prompt.root; <userinput>make extract</userinput>
&prompt.root; <userinput>cd work/frobble-2.8</userinput>
[Apply your patches]
&prompt.root; <userinput>cd ../..</userinput>
&prompt.root; <userinput>make package</userinput></screen>
	      </informalexample>
	    </listitem>
	    
	    <listitem>
	      <para>Q. This ports stuff is really clever. I am desperate to
		find out how you did it. What is the secret?</para>
	      
	      <para>A. Nothing secret about it at all, just look at the
		<filename>bsd.ports.mk</filename> and
		<filename>bsd.ports.subdir.mk</filename> files in your <ulink
		  URL="file://localhost/usr/share/mk/">makefiles
		  directory.</ulink></para>

	      <note>
		<para>Readers with an aversion to intricate shell-scripts are
		  advised not to follow this link...)</para>
	      </note>
	    </listitem>
	    
	  </itemizedlist>
	  
	
	
      </sect1>
    </chapter>
  </part>
  
  <part>
    <title>System Administration</title>
    
    
    <chapter id="kernelconfig">
      <title>Configuring the FreeBSD Kernel</title>
      
      <para><emphasis>Contributed by &a.jehamby;.<!-- <br> -->6 October
	  1995.</emphasis></para>
      
      <para>This large section of the handbook discusses the basics of
	building your own custom kernel for FreeBSD. This section is
	appropriate for both novice system administrators and those with
	advanced Unix experience.</para>
      
      
      <sect1>
	<title>Why Build a Custom Kernel?</title>
	
	<para>Building a custom kernel is one of the most important rites of
	  passage every Unix system administrator must endure. This process,
	  while time-consuming, will provide many benefits to your FreeBSD
	  system. Unlike the <literal>GENERIC</literal> kernel, which must support every
	  possible SCSI and network card, along with tons of other rarely used
	  hardware support, a custom kernel only contains support for
	  <emphasis>your</emphasis> PC's hardware. This has a number of
	  benefits:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>It will take less time to boot because it does not have to
		spend time probing for hardware which you do not have.</para>
	    </listitem>
	    
	    <listitem>
	      <para>A custom kernel often uses less memory, which is important
		because the kernel is the one process which must always be
		present in memory, and so all of that unused code ties up
		pages of RAM that your programs would otherwise be able to
		use. Therefore, on a system with limited RAM, building a
		custom kernel is of critical importance.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Finally, there are several kernel options which you can
		tune to fit your needs, and device driver support for things
		like sound cards which you can include in your kernel but are
		<emphasis>not</emphasis> present in the GENERIC kernel.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="kernelconfig-building">
	<title>Building and Installing a Custom Kernel</title>
	
	<para>First, let us take a quick tour of the kernel build directory.
	  All directories mentioned will be relative to the main
	  <filename>/usr/src/sys</filename> directory, which is also
	  accessible through <filename>/sys</filename>. There are a number of
	  subdirectories here representing different parts of the kernel, but
	  the most important, for our purposes, are
	  <filename>i386/conf</filename>, where you will edit your custom
	  kernel configuration, and <filename>compile</filename>,
	  which is the staging area where your kernel will be built. Notice
	  the logical organization of the directory tree, with each supported
	  device, filesystem, and option in its own subdirectory. Also,
	  anything inside the <filename>i386</filename> directory deals with
	  PC hardware only, while everything outside the
	  <filename>i386</filename> directory is common to all platforms which
	  FreeBSD could potentially be ported to.</para>
	
	<note>
	  <para>If there is <emphasis>not</emphasis> a
	    <filename>/usr/src/sys</filename> directory on your system, then
	    the kernel source has not been been installed. Follow the
	    instructions for installing packages to add this package to your
	    system.</para>
	</note>
	
	<para>Next, move to the <filename>i386/conf</filename> directory and
	  copy the <filename>GENERIC</filename> configuration file to the name
	  you want to give your kernel. For example:
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/src/sys/i386/conf</userinput>
&prompt.root; <userinput>cp GENERIC MYKERNEL</userinput></screen>
	  </informalexample> Traditionally, this name is in all capital
	  letters and, if you are maintaining multiple FreeBSD machines with
	  different hardware, it is a good idea to name it after your
	  machine's hostname. We will call it <filename>MYKERNEL</filename>
	  for the purpose of this example.</para>
	
	<note>
	  <para>You must execute these and all of the following commands
	    under the root account or you will get <errortype>permission denied</errortype>
	    errors.</para>
	</note>
	
	<para>Now, edit <filename>MYKERNEL</filename> with your favorite text
	  editor. If you are just starting out, the only editor available
	  will probably be <command>vi</command>, which is too
	  complex to explain here, but is covered well in many books in the
	  <xref
	    linkend="bibliography" remap="bibliography">. Feel free to change
	  the comment	lines at the top to reflect your configuration or the
	  changes you have made to differentiate it from
	  <filename>GENERIC</filename>.</para>
	
	<para>If you have build a kernel under SunOS or some other BSD
	  operating system, much of this file will be very familiar to you. If
	  you are coming from some other operating system such as DOS, on the
	  other hand, the <filename>GENERIC</filename> configuration file
	  might seem overwhelming to you, so follow the descriptions in the
	  <xref
	    linkend="kernelconfig-config"
	    remap="Configuration File"> section slowly and carefully.</para>
	
	<note>
	  <para>If you are trying to upgrade your kernel from an older version
	    of FreeBSD, you will probably have to get a new version of
	    <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> from the same place you got the new
	    kernel sources. It is located in
	    <filename>/usr/src/usr.sbin</filename>, so you will need to
	    download those sources as well. Re-build and install it before
	    running the next commands.</para>
	</note>
	
	<para>When you are finished, type the following to compile and install
	  your kernel:

	  <informalexample>
	    <screen>&prompt.root; <userinput>/usr/sbin/config MYKERNEL</userinput>
&prompt.root; <userinput>cd ../../compile/MYKERNEL</userinput>
&prompt.root; <userinput>make depend</userinput>
&prompt.root; <userinput>make</userinput>
&prompt.root; <userinput>make install</userinput></screen>
	  </informalexample> The new kernel will be copied to the root
	  directory as <filename>/kernel</filename> and the old kernel will be
	  moved to <filename>/kernel.old</filename>. Now, shutdown the system
	  and reboot to use your kernel. In case something goes wrong, there
	  are some <xref linkend="kernelconfig-trouble"
	    remap="troubleshooting"> instructions at the end of this document.
	  Be sure to read the section which explains how to recover in case
	  your new kernel <xref
	    linkend="kernelconfig-noboot" remap="does not boot">.</para>
	
	<note>
	  <para>If you have added any new devices (such as sound cards) you
	    may have to add some <xref
	      linkend="kernelconfig-nodes" remap="device nodes"> to your
	    <filename>/dev</filename> directory before you can use
	    them.</para>
	</note>
	
      </sect1>
      
      <sect1 id="kernelconfig-config">
	<title>The Configuration File</title>
	
	<para>The general format of a configuration file is quite simple. Each
	  line contains a keyword and one or more arguments. For simplicity,
	  most lines only contain one argument. Anything following a
	  <literal>#</literal> is considered a comment and ignored.
	  The following sections describe each keyword, generally in the order
	  they are listed in <filename>GENERIC</filename>, although some
	  related keywords have been grouped together in a single section
	  (such as Networking) even though they are actually scattered
	  throughout the <filename>GENERIC</filename> file.
	  <anchor id="kernelconfig-options"> An exhaustive list of options and
	  more detailed explanations of the device lines is present in the
	  <filename>LINT</filename> configuration file, located in the same
	  directory as <filename>GENERIC</filename>. If you are in doubt as to
	  the purpose or necessity of a line, check first in
	  <filename>LINT</filename>.</para>
	
	<para>The kernel is currently being moved to a better organization of
	  the option handling. Traditionally, each option in the config file
	  was simply converted into a <option>-D</option> switch for the
	  <acronym>CFLAGS</acronym> line of the kernel Makefile. Naturally,
	  this caused a creeping optionism, with nobody really knowing which
	  option has been referenced in what files.</para>
	
	<para>In the new scheme, every <literal>#ifdef</literal>
	  that is intended to be dependent upon an option gets this option out
	  of an <filename>opt_<replaceable>foo</replaceable>.h</filename>
	  declaration file created in the compile directory by <command>config</command>. The list of valid options for
	  <command>config</command> lives in two files: options
	  that do not depend on the architecture are listed in
	  <filename>/sys/conf/options</filename>, architecture-dependent ones
	  in
	  <filename>/sys/<replaceable>arch</replaceable>/conf/options.<replaceable>arch</replaceable></filename>, with <emphasis>arch</emphasis> being for example <filename>i386</filename>.</para>
	
	
	<sect2>
	  <title>Mandatory Keywords</title>
	  
	  <para>These keywords are required in every kernel you build.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>machine "i386"</term>
		<listitem>
		  <para>The first keyword is <literal>machine</literal>, which, since FreeBSD only
		    runs on Intel 386 and compatible chips, is i386.</para>
		  
		  <note>
		      <para>Any keyword which contains numbers used as text
		      must be enclosed in quotation marks, otherwise
		      <command>config</command> gets confused and thinks you
		      mean the actual number 386.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>cpu "<replaceable>cpu_type</replaceable>"</term>
		
		<listitem>
		  <para>The next keyword is <literal>cpu</literal>,
		    which includes support for each CPU supported by FreeBSD.
		    The possible values of <replaceable>cpu_type</replaceable>
		    include:
		    <itemizedlist>
		      
		      <listitem>
			<para>I386_CPU</para>
		      </listitem>
		      
		      <listitem>
			<para>I486_CPU</para>
		      </listitem>
		      
		      <listitem>
			<para>I586_CPU</para>
		      </listitem>
		      
		      <listitem>
			<para>I686_CPU</para>
		      </listitem>
		      
		    </itemizedlist> and multiple instances of the <literal>cpu</literal> line may be present with
		    different values of <replaceable>cpu_type</replaceable>
		    as are present in the <filename>GENERIC</filename> kernel.
		    For a custom kernel, it is best to specify only the cpu
		    you have. If, for example, you have an Intel Pentium, use
		    <literal>I586_CPU</literal> for <replaceable>cpu_type</replaceable>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>ident <replaceable>machine_name</replaceable></term>
		
		<listitem>
		  <para>Next, we have <literal>ident</literal>,
		    which is the identification of the kernel. You should
		    change this from <literal>GENERIC</literal> to whatever
		    you named your kernel, in this example,
		    <literal>MYKERNEL</literal>. The value you put in
		    <literal>ident</literal> will print when you
		    boot up the kernel, so it is useful to give a kernel a
		    different name if you want to keep it separate from your
		    usual kernel (if you want to build an experimental kernel,
		    for example). Note that, as with <literal>machine</literal> and <literal>
		      cpu</literal>, enclose your kernel's name in quotation
		    marks if it contains any numbers.</para>
		  
		  <para>Since this name is passed to the C compiler as a
		    <option>-D</option> switch, do not use names like
		    <literal>DEBUG</literal>, or something that could be
		    confused with another machine or CPU name, like <literal>vax</literal>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>maxusers <replaceable>number</replaceable></term>
		
		<listitem>
		  <para>This file sets the size of a number of important
		    system tables. This number is supposed to be roughly
		    equal to the number of simultaneous users you expect to
		    have on your machine. However, under normal
		  circumstances, you will want to set
		  <literal>maxusers</literal> to at least <literal>4</literal>,
		    especially if you are using the X Window System or
		    compiling software. The reason is that the most important
		    table set by <literal>maxusers</literal> is the
		    maximum number of processes, which is set to <literal>20 + 16 *
			maxusers</literal>, so if you set
		  <literal>maxusers</literal> to <literal>1</literal>, then you
		    can only have 36 simultaneous processes, including the 18
		    or so that the system starts up at boot time, and the 15
		    or so you will probably create when you start the X Window
		    System. Even a simple task like reading a man page will start up nine
		    processes to filter, decompress, and view it. Setting
		  <literal>maxusers</literal> to <literal>4</literal> will allow you
		    to have up to 84 simultaneous processes, which should be
		    enough for anyone. If, however, you see the dreaded
		    <errorname>proc table full</errorname> error when trying to start another
		    program, or are running a server with a large number of
		    simultaneous users (like Walnut Creek CDROM's FTP site),
		    you can always increase this number and rebuild.</para>
		  
		  <note>
		    <para><literal>maxuser</literal> does
		      <emphasis>not</emphasis> limit the number of users which
		      can log into your machine. It simply sets various table
		      sizes to reasonable values considering the maximum
		      number of users you will likely have on your system and
		      how many processes each of them will be running. One
		      keyword which <emphasis>does</emphasis> limit the number
		      of simultaneous <emphasis>remote logins</emphasis> is
			<xref
			  linkend="kernelconfig-ptys" remap="pseudo-device pty
			  16">.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>config <replaceable>kernel_name</replaceable> root on
		  <replaceable>root_device</replaceable></term>
		
		<listitem>
		  <para>This line specifies the location and name of the
		    kernel. Traditionally the kernel is called
		    <filename>vmunix</filename> but in FreeBSD, it is aptly
		    named <filename>kernel</filename>. You should always use
		    <literal>kernel</literal> for
		    <replaceable>kernel_name</replaceable> because changing it will
		    render numerous system utilities inoperative. The second
		    part of the line specifies the disk and partition where
		    the root filesystem and kernel can be found. Typically
		    this will be <literal>wd0</literal> for systems
		    with non-SCSI drives, or <literal>sd0</literal>
		    for systems with SCSI drives.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>General Options</title>
	  
	  <para>These lines provide kernel support for various filesystems and
	    other options.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>options MATH_EMULATE</term>
		<listitem>
		  <para>This line allows the kernel to simulate a math
		    co-processor if your computer does not have one (386 or
		    486SX). If you have a Pentium, a 486DX, or a 386 or 486SX
		    with a separate 387 or 487 chip, you can comment this line
		    out.</para>
		  
		  <note>
		    <para>The normal math co-processor emulation routines that
		      come with FreeBSD are <emphasis>not</emphasis> very
		      accurate. If you do not have a math co-processor, and
		      you need the best accuracy, I recommend that you change
		      this option to <literal>GPL_MATH_EMULATE</literal> to use
		      the superior GNU math support, which is not included by
		      default for licensing reasons.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options "COMPAT_43"</term>
		
		<listitem>
		  <para>Compatibility with 4.3BSD. Leave this in; some
		    programs will act strangely if you comment this
		    out.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options BOUNCE_BUFFERS</term>
		
		<listitem>
		  <para>ISA devices and EISA devices operating in an ISA
		    compatibility mode can only perform DMA (Direct Memory
		    Access) to memory below 16 megabytes. This option enables
		    such devices to work in systems with more than 16
		    megabytes of memory.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options UCONSOLE</term>
		
		<listitem>
		  <para>Allow users to grab the console, useful for X Windows.
		    For example, you can create a console xterm by typing
		    <command>xterm -C</command>, which will display any
		    <command>write</command>, <command>talk</command>, and other messages you receive, as well
		    as any console messages sent by the kernel.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options SYSVSHM</term>
		
		<listitem>
		  <para>This option provides for System V shared memory. The
		    most common use of this is the XSHM extension in X
		    Windows, which many graphics-intensive programs (such as
		    the movie player XAnim, and Linux DOOM) will automatically
		    take advantage of for extra speed. If you use the X
		    Window System, you will definitely want to include
		    this.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options SYSVSEM</term>
		
		<listitem>
		  <para>Support for System V semaphores. Less commonly used
		    but only adds a few hundred bytes to the kernel.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options SYSVMSG</term>
		
		<listitem>
		  <para>Support for System V messages. Again, only adds a few
		    hundred bytes to the kernel.</para>
		  
		  <note>
		    <para>The <citerefentry><refentrytitle>ipcs</refentrytitle><manvolnum>1</manvolnum></citerefentry> command will tell
		      will list any processes using each of these System V
		      facilities.</para>
		  </note>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Filesystem Options</title>
	  
	  <para>These options add support for various filesystems. You must
	    include at least one of these to support the device you boot from;
	    typically this will be <acronym>FFS</acronym> if you boot from a
	    hard drive, or <acronym>NFS</acronym> if you are booting a
	    diskless workstation from Ethernet. You can include other
	    commonly-used filesystems in the kernel, but feel free to comment
	    out support for filesystems you use less often (perhaps the MS-DOS
	    filesystem?), since they will be dynamically loaded from the
	    Loadable Kernel Module directory <filename>/lkm</filename> the
	    first time you mount a partition of that type.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>options FFS</term>
		<listitem>
		  <para>The basic hard drive filesystem; leave it in if you
		    boot from the hard disk.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options NFS</term>
		
		<listitem>
		  <para>Network Filesystem. Unless you plan to mount
		    partitions from a Unix file server over Ethernet, you can
		    comment this out.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options MSDOSFS</term>
		
		<listitem>
		  <para>MS-DOS Filesystem. 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 <application>mtools</application> software (in the ports
		    collection) allows you to access DOS floppies without
		    having to mount and unmount them (and does not require
		    MSDOSFS at all).</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options "CD9660"</term>
		
		<listitem>
		  <para>ISO 9660 filesystem for CD-ROMs. Comment it out if
		    you do not have a CD-ROM drive or only mount data CD's
		    occasionally (since it will be dynamically loaded the
		    first time you mount a data CD). Audio CD's do not need
		    this filesystem.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options PROCFS</term>
		
		<listitem>
		  <para>Process filesystem. This is a pretend filesystem
		    mounted on <filename>/proc</filename> which allows
		    programs like <citerefentry><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry> to give you more
		    information on what processes are running.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options MFS</term>
		
		<listitem>
		  <para>Memory-mapped file system. This is basically a RAM
		    disk for fast storage of temporary files, useful if you
		    have a lot of swap space that you want to take advantage
		    of. A perfect place to mount an MFS partition is on the
		    <filename>/tmp</filename> directory, since many programs
		    store temporary data here. To mount an MFS RAM disk on
		    <filename>/tmp</filename>, add the following line to
		    <filename>/etc/fstab</filename> and then reboot or type
		    <command>mount /tmp</command>:
		    
		    <programlisting>
/dev/wd1s2b   /tmp mfs rw 0 0
		    </programlisting>
		  </para>
		  
		  <note>
		    <para>Replace the <filename>/dev/wd1s2b</filename> with
		      the name of your swap partition, which will be listed in
		      your <filename>/etc/fstab</filename> as follows:
		      
		      <programlisting>
/dev/wd1s2b none swap sw 0 0
		      </programlisting>
		    </para>
		  </note>
		  
		  <note>
		    <para>Also, the <acronym>MFS</acronym> filesystem can
		      <emphasis>not</emphasis> be dynamically loaded, so you
		      <emphasis>must</emphasis> compile it into your kernel if
		      you want to experiment with it.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options "EXT2FS"</term>
		
		<listitem>
		  <para>Linux's native file system. With ext2fs support you
		    are able to read and write to Linux partitions. This is
		    useful if you dual-boot FreeBSD and Linux and want to
		    share data between the two systems.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options QUOTA</term>
		
		<listitem>
		  <para>Enable disk quotas. If you have a public access
		    system, and do not want users to be able to overflow the
		    <filename>/home</filename> partition, you can establish
		    disk quotas for each user. Refer to the
		    <xref linkend="quotas" remap="Disk Quotas"> section for
		    more information.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Basic Controllers and Devices</title>
	  
	  <para>These sections describe the basic disk, tape, and CD-ROM
	    controllers supported by FreeBSD. There are separate sections for
	    <xref linkend="kernelconfig-scsi"
	      remap="SCSI"> controllers and <xref
	      linkend="kernelconfig-network" remap="network"> cards.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>controller isa0</term>
		<listitem>
		  <para>All PC's supported by FreeBSD have one of these. If
		    you have an IBM PS/2 (Micro Channel Architecture), then
		    you cannot run FreeBSD at this time.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>controller pci0</term>
		
		<listitem>
		  <para>Include this if you have a PCI motherboard. This
		    enables auto-detection of PCI cards and gatewaying from
		    the PCI to the ISA bus.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>controller fdc0</term>
		
		<listitem>
		  <para>Floppy drive controller: <literal>fd0</literal> is the
		  <devicename>A:</devicename> floppy drive, and
		    <literal>fd1</literal> is the <devicename>B:</devicename> drive.
		    <literal>ft0</literal> is a QIC-80 tape drive
		    attached to the floppy controller. Comment out any lines
		    corresponding to devices you do not have.</para>
		  
		  <note>
		    <para>QIC-80 tape support requires a separate filter
		      program called <citerefentry><refentrytitle>ft</refentrytitle><manvolnum>8</manvolnum></citerefentry>, see the manual
		      page for details.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>controller wdc0</term>
		
		<listitem>
		  <para>This is the primary IDE controller. <literal>wd0</literal> and <literal>wd1</literal> are the master and slave hard
		    drive, respectively. <literal>wdc1</literal> is
		    a secondary IDE controller where you might have a third or
		    fourth hard drive, or an IDE CD-ROM. Comment out the
		    lines which do not apply (if you have a SCSI hard drive,
		    you will probably want to comment out all six lines, for
		    example).</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device wcd0<anchor id="kernelconfig-atapi"></term>
		
		<listitem>
		  <para>This device provides IDE CD-ROM support. Be sure to
		    leave <literal>wdc0</literal> uncommented, and
		    <literal>wdc1</literal> if you have more than
		    one IDE controller and your CD-ROM is on the second one
		    card. To use this, you must also include the line
		    <literal>options ATAPI</literal>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device npx0 at isa? port "IO_NPX" irq 13
		  vector npxintr</term>
		
		<listitem>
		  <para><literal>npx0</literal> is the interface to
		    the floating point math unit in FreeBSD, either the
		    hardware co-processor or the software math emulator. It
		    is <emphasis>NOT</emphasis> optional.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device wt0 at isa? port 0x300 bio irq 5 drq
		  1 vector wtintr</term>
		
		<listitem>
		  <para>Wangtek and Archive QIC-02/QIC-36 tape drive
		    support</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Proprietary CD-ROM support</term>
		
		<listitem>
		  <para>The following drivers are for the so-called
		    <emphasis>proprietary</emphasis> CD-ROM drives. These
		    drives have their own controller card or might plug into a
		    sound card such as the SoundBlaster 16. They are
		    <emphasis>not</emphasis> IDE or SCSI. Most older
		    single-speed and double-speed CD-ROMs use these
		    interfaces, while newer quad-speeds are likely to be <xref
		      linkend="kernelconfig-atapi" remap="IDE"> or <xref
		      linkend="kernelconfig-scsi" remap="SCSI">.</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>device mcd0 at isa? port 0x300 bio
			  irq 10 vector mcdintr</term>
			<listitem>
			  <para>Mitsumi CD-ROM (LU002, LU005, FX001D).</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device scd0 at isa? port 0x230
			  bio</term>
			
			<listitem>
			  <para>Sony CD-ROM (CDU31, CDU33A).</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller matcd0 at isa? port ?
			  bio</term>
			
			<listitem>
			  <para>Matsushita/Panasonic CD-ROM (sold by Creative
			    Labs for SoundBlaster).</para>
			</listitem>
		      </varlistentry>
		    </variablelist>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2 id="kernelconfig-scsi">
	  <title>SCSI Device Support</title>
	  
	  <para>This section describes the various SCSI controllers and
	    devices supported by FreeBSD.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>SCSI Controllers</term>
		<listitem>
		  <para>The next ten or so lines include support for different
		    kinds of SCSI controllers. Comment out all except for the
		    one(s) you have:</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>controller bt0 at isa? port
			  "IO_BT0" bio irq ? vector btintr</term>
			<listitem>
			  <para>Most Buslogic controllers</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller uha0 at isa? port
			  "IO_UHA0" bio irq ? drq 5 vector uhaintr</term>
			
			<listitem>
			  <para>UltraStor 14F and 34F</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller ahc0</term>
			
			<listitem>
			  <para>Adaptec 274x/284x/294x</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller ahb0    at isa? bio irq ?
			  vector ahbintr</term>
			
			<listitem>
			  <para>Adaptec 174x</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller aha0    at isa? port
			  "IO_AHA0" bio irq ? drq 5 vector ahaintr</term>
			
			<listitem>
			  <para>Adaptec 154x</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller aic0    at isa? port
			  0x340 bio irq 11 vector aicintr</term>
			
			<listitem>
			  <para>Adaptec 152x and sound cards using Adaptec
			    AIC-6360 (slow!)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller nca0    at isa? port
			  0x1f88 bio irq 10 vector ncaintr</term>
			
			<listitem>
			  <para>ProAudioSpectrum cards using NCR 5380 or
			    Trantor T130</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller sea0    at isa? bio irq 5
			  iomem 0xc8000 iosiz 0x2000 vector seaintr</term>
			
			<listitem>
			  <para>Seagate ST01/02 8 bit controller
			    (slow!)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller wds0    at isa? port
			  0x350 bio irq 15 drq 6 vector wdsintr</term>
			
			<listitem>
			  <para>Western Digital WD7000 controller</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>controller ncr0</term>
			
			<listitem>
			  <para>NCR 53C810, 53C815, 53C825, 53C860, 53C875 PCI
			    SCSI controller</para>
			</listitem>
		      </varlistentry>
		    </variablelist>
		  
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options "SCSI_DELAY=15"</term>
		
		<listitem>
		  <para>This causes the kernel to pause 15 seconds before
		    probing each SCSI device in your system. If you only have
		    IDE hard drives, you can ignore this, otherwise you will
		    probably want to lower this number, perhaps to 5 seconds,
		    to speed up booting. Of course if you do this, and
		    FreeBSD has trouble recognizing your SCSI devices, you
		    will have to raise it back up.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>controller scbus0</term>
		
		<listitem>
		  <para>If you have any SCSI controllers, this line provides
		    generic SCSI support. If you do not have SCSI, you can
		    comment this, and the following three lines, out.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device sd0</term>
		
		<listitem>
		  <para>Support for SCSI hard drives.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device st0</term>
		
		<listitem>
		  <para>Support for SCSI tape drives.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device cd0</term>
		
		<listitem>
		  <para>Support for SCSI CD-ROM drives.</para>

		  <para>Note that the number <literal>0</literal>
		    in the above entries is slightly misleading: all these
		    devices are automatically configured as they are found,
		    regardless of how many of them are hooked up to the SCSI
		    bus(es), and which target IDs they have.</para>
		  
		  <para>If you want to <quote>wire down</quote> specific target IDs to
		    particular devices, refer to the appropriate section of
		  the <filename>LINT</filename> kernel config file.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Console, Bus Mouse, and X Server Support</title>
	  
	  <para>You must choose one of these two console types, and, if you
	    plan to use the X Window System with the vt220 console, enable the
	    XSERVER option and optionally, a bus mouse or PS/2 mouse
	    device.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>device sc0 at isa? port "IO_KBD" tty irq 1
		  vector scintr</term>
		<listitem>
		  <para><literal>sc0</literal> is the default
		    console driver, which resembles an SCO console. Since most
		    full-screen programs access the console through a terminal
		    database library like <filename>termcap</filename>, it
		    should not matter much whether you use this or <literal>vt0</literal>, the VT220 compatible console
		  driver. When you log in, set your <envar>TERM</envar> variable to
		    <quote>scoansi</quote> if full-screen programs have trouble running
		    under this console.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device vt0 at isa? port "IO_KBD" tty irq 1
		  vector pcrint</term>
		
		<listitem>
		  <para>This is a VT220-compatible console driver, backwards
		    compatible to VT100/102. It works well on some laptops
		  which have hardware incompatibilities with <literal>sc0</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 the
		    <filename>termcap</filename> or
		    <filename>terminfo</filename> entries for the <devicename>sc0</devicename> device are often not available
		    &mdash; <literal>vt100</literal> should be available on virtually any
		    platform.</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>options "PCVT_FREEBSD=210"</term>
			<listitem>
			  <para>Required with the <literal>vt0</literal> console driver.</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>options XSERVER</term>
			
			<listitem>
			  <para>Only applicable with the <literal>vt0</literal> console driver. This
			    includes code required to run the <application>XFree86</application> X Window Server
			    under the <literal>vt0</literal>
			    console driver.</para>
			</listitem>
		      </varlistentry>
		    </variablelist>
		  
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device mse0 at isa? port 0x23c tty irq 5
		  vector ms</term>
		
		<listitem>
		  <para>Use this device if you have a Logitech or ATI InPort
		    bus mouse card.</para>
		  
		  <note>
		    <para>If you have a serial mouse, ignore these two lines,
		      and instead, make sure the appropriate <xref
			linkend="kernelconfig-serial"
			  remap="serial"> port is enabled (probably
		      COM1).</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device psm0 at isa? port "IO_KBD"
		  conflicts tty irq 12 vector psmintr</term>
		
		<listitem>
		  <para>Use this device if your mouse plugs into the PS/2
		    mouse port.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Serial and Parallel Ports</title>
	  
	  <para>Nearly all systems have these. If you are attaching a printer
	    to one of these ports, the <xref linkend="printing"
	      remap="Printing"> section of the handbook is very useful. If
	    you are using modem, <xref linkend="dialup"
	      remap="Dialup access"> provides extensive detail on serial port
	    configuration for use with such devices.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>device sio0 at isa? port "IO_COM1" tty irq
		  4 vector siointr<anchor id="kernelconfig-serial"></term>
		<listitem>
		  <para><literal>sio0</literal> through <literal>sio3</literal> are the four serial ports
		    referred to as COM1 through COM4 in the MS-DOS world.
		    Note that if you have an internal modem on COM4 and a
		    serial port at COM2 you will have to change the IRQ of the
		    modem to 2 (for obscure technical reasons IRQ 2 = IRQ 9)
		    in order to access it from FreeBSD. If you have a
		    multiport serial card, check the manual page for
		    <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information on the
		    proper values for these lines. Some video cards (notably
		    those based on S3 chips) use IO addresses of the form
		    <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 COM4 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
		    COM3 and COM4 cannot be used.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device lpt0 at isa? port? tty irq 7 vector
		  lptintr</term>
		
		<listitem>
		  <para><literal>lpt0</literal> through <literal>lpt2</literal> are the three printer ports you
		    could conceivably have. Most people just have one,
		    though, so feel free to comment out the other two lines if
		    you do not have them.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2 id="kernelconfig-network">
	  <title>Networking</title>
	  
	  <para>FreeBSD, as with Unix in general, places a
	    <emphasis>big</emphasis> emphasis on networking. Therefore, even
	    if you do not have an Ethernet card, pay attention to the
	    mandatory options and the dial-up networking support.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>options INET</term>
		<listitem>
		  <para>Networking support. Leave it 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>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Ethernet cards</term>
		
		<listitem>
		  <para>The next lines enable support for various Ethernet
		    cards. If you do not have a network card, you can comment
		    out all of these lines. Otherwise, you will want to leave
		    in support for your particular Ethernet card(s):</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>device de0</term>
			<listitem>
			  <para>Ethernet adapters based on Digital Equipment
			    DC21040, DC21041 or DC21140 chips</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device fxp0</term>
			
			<listitem>
			  <para>Intel EtherExpress Pro/100B</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device vx0</term>
			
			<listitem>
			  <para>3Com 3C590 and 3C595 (buggy)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device cx0 at isa? port 0x240 net
			  irq 15 drq 7 vector cxintr</term>
			
			<listitem>
			  <para>Cronyx/Sigma multiport sync/async (with Cisco
			    or PPP framing)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device ed0 at isa? port 0x280 net
			  irq 5 iomem 0xd8000 vector edintr</term>
			
			<listitem>
			  <para>Western Digital and SMC 80xx and 8216; Novell
			    NE1000 and NE2000; 3Com 3C503; HP PC Lan Plus
			    (HP27247B and HP27252A)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device el0 at isa? port 0x300 net
			  irq 9 vector elintr</term>
			
			<listitem>
			  <para>3Com 3C501 (slow!)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device eg0 at isa? port 0x310 net
			  irq 5 vector egintr</term>
			
			<listitem>
			  <para>3Com 3C505</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device ep0 at isa? port 0x300 net
			  irq 10 vector epintr</term>
			
			<listitem>
			  <para>3Com 3C509 (buggy)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device fe0 at isa? port 0x240 net
			  irq ? vector feintr</term>
			
			<listitem>
			  <para>Fujitsu MB86960A/MB86965A Ethernet</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device fea0 at isa? net irq ? vector
			  feaintr</term>
			
			<listitem>
			  <para>DEC DEFEA EISA FDDI adapter</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device ie0 at isa? port 0x360 net
			  irq 7 iomem 0xd0000 vector ieintr</term>
			
			<listitem>
			  <para>AT&amp;T StarLAN 10 and EN100; 3Com 3C507;
			    unknown NI5210</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device ix0 at isa? port 0x300 net
			  irq 10 iomem 0xd0000 iosiz 32768 vector
			  ixintr</term>
			
			<listitem>
			  <para>Intel EtherExpress 16</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device le0 at isa? port 0x300 net
			  irq 5 iomem 0xd0000 vector le_intr</term>
			
			<listitem>
			  <para>Digital Equipment EtherWorks 2 and EtherWorks
			    3 (DEPCA, DE100, DE101, DE200, DE201, DE202,
			    DE203, DE204, DE205, DE422)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device lnc0 at isa? port 0x300 net
			  irq 10 drq 0 vector lncintr</term>
			
			<listitem>
			  <para>Lance/PCnet cards (Isolan, Novell NE2100,
			    NE32-VL)</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device ze0 at isa? port 0x300 net
			  irq 5 iomem 0xd8000 vector zeintr</term>
			
			<listitem>
			  <para>IBM/National Semiconductor PCMCIA ethernet
			    controller.</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>device zp0 at isa? port 0x300 net
			  irq 10 iomem 0xd8000 vector zpintr</term>
			
			<listitem>
			  <para>3Com PCMCIA Etherlink III</para>
			</listitem>
		      </varlistentry>
		    </variablelist>
		  
		  
		  <note>
		    <para>With certain cards (notably the NE2000) you will
		      have to change the port and/or IRQ since there is no
		      <quote>standard</quote> location for these cards.</para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device loop</term>
		
		<listitem>
		  <para><literal>loop</literal> 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 pseudo-device. Mandatory.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device ether</term>
		
		<listitem>
		  <para><literal>ether</literal> is only needed if
		    you have an Ethernet card and includes generic Ethernet
		    protocol code.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device sl
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para><literal>sl</literal> is for SLIP (Serial
		    Line Internet Protocol) support. This has been almost
		    entirely supplanted by PPP, which is easier to set up,
		    better suited for modem-to-modem connections, as well as
		    more powerful. The <replaceable>number</replaceable> after
		    <literal>sl</literal> specifies how many
		    simultaneous SLIP sessions to support. This handbook has
		    more information on setting up a SLIP <xref
		      linkend="slipc"
		      remap="client"> or <xref linkend="slips"
		      remap="server">.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device ppp
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para><literal>ppp</literal> is for kernel-mode
		    PPP (Point-to-Point Protocol) support for dial-up Internet
		    connections. There is also version of PPP implemented as a
		    user application that uses the <devicename>tun</devicename> and offers more flexibility and
		    features such as demand dialing. If you still want to use
		    this PPP driver, read the <xref linkend="ppp"
		      remap="kernel-mode PPP">
		    section of the handbook. As with the <literal>sl</literal> device,
		    <replaceable>number</replaceable> specifies how many
		    simultaneous PPP connections to support.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device tun
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para><literal>tun</literal> is used by the
		    user-mode PPP software. This program is easy to set up and
		    very fast. It also has special features such as automatic
		    dial-on-demand. The number after <literal>tun</literal> specifies the number of
		    simultaneous PPP sessions to support. See the <xref
		      linkend="userppp"
		      remap="user-mode PPP"> section of the handbook for more
		    information.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device bpfilter
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para>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 <citerefentry><refentrytitle>tcpdump</refentrytitle><manvolnum>1</manvolnum></citerefentry> program.
		    Note that implementation of this capability can seriously
		    compromise your overall network security. The
		    <replaceable>number</replaceable> after bpfilter is the number
		    of interfaces that can be examined simultaneously.
		    Optional, not recommended except for those who are fully
		    aware of the potential pitfalls. Not all network cards
		    support this capability.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Sound cards</title>
	  
	  <para>This is the first section containing lines that are not in the
	    GENERIC kernel. To include sound card support, you will have to
	    copy the appropriate lines from the LINT kernel (which contains
	    support for <emphasis>every</emphasis> device) as follows:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>controller snd0</term>
		<listitem>
		  <para>Generic sound driver code. Required for all of the
		    following sound cards except <literal>pca</literal>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device pas0 at isa? port 0x388 irq 10 drq 6
		  vector pasintr</term>
		
		<listitem>
		  <para>ProAudioSpectrum digital audio and MIDI.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device sb0 at isa? port 0x220 irq 7
		  conflicts drq 1 vector sbintr</term>
		
		<listitem>
		  <para>SoundBlaster digital audio.</para>
		  
		  <note>
		    <para>If your SoundBlaster is on a different IRQ (such as
		      5), change <literal>irq 7</literal> to, for
		      example, <literal>irq 5</literal> and remove
		      the <literal>conflicts</literal> keyword.
		      Also, you must add the line: <literal>options
			"SBC_IRQ=5"</literal></para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device sbxvi0 at isa? drq 5</term>
		
		<listitem>
		  <para>SoundBlaster 16 digital 16-bit audio.</para>
		  
		  <note>
		    <para>If your SB16 is on a different 16-bit DMA channel
		      (such as 6 or 7), change the <literal>drq
			5</literal> keyword appropriately, and then add the
		      line: <literal>options "SB16_DMA=6"</literal></para>
		  </note>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device sbmidi0 at isa? port 0x330</term>
		
		<listitem>
		  <para>SoundBlaster 16 MIDI interface. If you have a
		    SoundBlaster 16, you must include this line, or the kernel
		    will not compile.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device gus0 at isa? port 0x220 irq 10 drq 1
		  vector gusintr</term>
		
		<listitem>
		  <para>Gravis Ultrasound.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device mss0 at isa? port 0x530 irq 10 drq 1
		  vector adintr</term>
		
		<listitem>
		  <para>Microsoft Sound System.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device opl0 at isa? port 0x388
		  conflicts</term>
		
		<listitem>
		  <para>AdLib FM-synthesis audio. Include this line for
		    AdLib, SoundBlaster, and ProAudioSpectrum users, if you
		    want to play MIDI songs with a program such as <command>playmidi</command> (in the ports
		    collection).</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device mpu0 at isa? port 0x330 irq 6 drq
		  0</term>
		
		<listitem>
		  <para>Roland MPU-401 stand-alone card.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device uart0 at isa? port 0x330 irq 5 vector
		  "m6850intr"</term>
		
		<listitem>
		  <para>Stand-alone 6850 UART for MIDI.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>device pca0 at isa? port "IO_TIMER1"
		  tty<anchor id="kernelconfig-pcaudio"></term>
		
		<listitem>
		  <para>Digital audio through PC speaker. This is going to be
		    very poor sound quality and quite CPU-intensive, so you
		    have been warned (but it does not require a sound
		    card).</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	  <note>
	    <para>There is some additional documentation in
	      <filename>/usr/src/sys/i386/isa/sound/sound.doc</filename>.
	      Also, if you add any of these devices, be sure to create the
	      sound <xref linkend="kernelconfig-nodes"
		remap="device nodes">.</para>
	  </note>
	  
	</sect2>
	
	<sect2>
	  <title>Pseudo-devices</title>
	  
	  <para>Pseudo-device drivers are parts of the kernel that act like
	    device drivers but do not correspond to any actual hardware in the
	    machine. The <xref linkend="kernelconfig-network"
	      remap="network-related"> pseudo-devices are in that section,
	    while the remainder are here.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>pseudo-device gzip</term>
		<listitem>
		  <para><literal>gzip</literal> allows you to run
		    FreeBSD programs that have been compressed with <command>gzip</command>. The programs in
		    <filename>/stand</filename> are compressed so it is a good
		    idea to have this option in your kernel.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device log</term>
		
		<listitem>
		  <para><literal>log</literal> is used for logging
		    of kernel error messages. Mandatory.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device pty
		  <replaceable>number</replaceable><anchor id="kernelconfig-ptys"></term>
		
		<listitem>
		  <para><literal>pty</literal> is a
		    <quote>pseudo-terminal</quote> or simulated login port. It is used
		    by incoming <command>telnet</command> and
		    <command>rlogin</command> sessions, xterm, and
		    some other applications such as emacs. The
		    <replaceable>number</replaceable> indicates the number of
		    <literal>pty</literal>s to create. If you need
		  more than <filename>GENERIC</filename> default of 16 simultaneous xterm windows
		    and/or remote logins, be sure to increase this number
		    accordingly, up to a maximum of 64.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device snp
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para>Snoop device. This pseudo-device allows one terminal
		    session to watch another using the
		    <citerefentry><refentrytitle>watch</refentrytitle><manvolnum>8</manvolnum></citerefentry> command. Note that
		    implementation of this capability has important security
		    and privacy implications. The <replaceable>number</replaceable>
		    after snp is the total number of simultaneous snoop
		    sessions. Optional.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device vn</term>
		
		<listitem>
		  <para>Vnode driver. Allows a file to be treated as a device
		    after being set up with the <citerefentry><refentrytitle>vnconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>
		    command. This driver can be useful for manipulating
		    floppy disk images and using a file as a swap device (e.g.
		    an MS Windows swap file). Optional.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device ccd
		  <replaceable>number</replaceable></term>
		
		<listitem>
		  <para>Concatenated disks. This pseudo-device allows you to
		    concatenate multiple disk partitions into one large
		    <quote>meta</quote>-disk. The <replaceable>number</replaceable> after ccd
		    is the total number of concatenated disks (not total
		    number of disks that can be concatenated) that can be
		    created. (See <citerefentry><refentrytitle>ccd</refentrytitle><manvolnum>4</manvolnum></citerefentry> and
		    <citerefentry><refentrytitle>ccdconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> man pages for more
		    details.)  Optional.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Joystick, PC Speaker, Miscellaneous</title>
	  
	  <para>This section describes some miscellaneous hardware devices
	    supported by FreeBSD. Note that none of these lines are included
	    in the GENERIC kernel, you will have to copy them from this
	    handbook or the LINT kernel (which contains support for
	    <emphasis>every</emphasis> device):</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>device joy0 at isa? port "IO_GAME"</term>
		<listitem>
		  <para>PC joystick device.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>pseudo-device speaker</term>
		
		<listitem>
		  <para>Supports IBM BASIC-style noises through the PC
		    speaker. Some fun programs which use this are
		    <filename>/usr/sbin/spkrtest</filename>, which is a shell
		    script that plays some simple songs, and
		    <filename>/usr/games/piano</filename> which lets you play
		    songs using the keyboard as a simple piano (this file only
		    exists if you have installed the
		    <literal>games</literal> package). Also, the excellent
		  text role-playing game <application>NetHack</application> (in the ports collection)
		    can be configured to use this device to play songs when
		    you play musical instruments in the game.</para>

		  <para>See also the <xref linkend="kernelconfig-pcaudio"
		      remap="pca0"> device.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="kernelconfig-nodes">
	<title>Making Device Nodes</title>
	
	<para>Almost every device in the kernel has a corresponding <quote>node</quote>
	  entry in the <filename>/dev</filename> directory. These nodes look
	  like regular files, but are actually special entries into the kernel
	  which programs use to access the device. The shell script
	  <filename>/dev/MAKEDEV</filename>, which is executed when you first
	  install the operating system, creates nearly all of the device nodes
	  supported. However, it does not create <emphasis>all</emphasis> of
	  them, so when you add support for a new device, it pays to make sure
	  that the appropriate entries are in this directory, and if not, add
	  them. Here is a simple example:</para>
	
	<para>Suppose you add the IDE CD-ROM support to the kernel. The line
	  to add is:
	  
	  <programlisting>
controller wcd0
	  </programlisting> This means that you should look for some entries
	  that start with <filename>wcd0</filename> in the
	  <filename>/dev</filename> directory, possibly followed by a letter,
	  such as <literal>c</literal>, or preceded by the letter <literal>r</literal>, which means a <quote>raw</quote>
	  device. It turns out that those files are not there, so I must
	  change to the <filename>/dev</filename> directory and type:
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>sh MAKEDEV wcd0</userinput></screen>
	  </informalexample> When this script finishes, you will find that
	  there are now <filename>wcd0c</filename> and <filename>rwcd0c</filename> entries in <filename>/dev</filename> so
	  you know that it executed correctly.</para>
	
	<para>For sound cards, the command:

	  <informalexample>
	    <screen>&prompt.root; <userinput>sh MAKEDEV snd0</userinput></screen>
	  </informalexample> creates the appropriate entries.</para>

	<note>
	  <para>When creating device nodes for devices such as sound cards, if
	    other people have access to your machine, it may be desirable to
	    protect the devices from outside access by adding them to the
	    <filename>/etc/fbtab</filename> file. See <command>man
	      fbtab</command> for more information.</para>
	</note>
	
	<para>Follow this simple procedure for any other non-<filename>GENERIC</filename>  devices
	  which do not have entries.</para>
	
	<note>
	  <para>All SCSI controllers use the same set of
	    <filename>/dev</filename> entries, so you do not need to create
	    these. Also, network cards and SLIP/PPP pseudo-devices do not
	    have entries in <filename>/dev</filename> at all, so you do not
	    have to worry about these either.</para>
	</note>
	
      </sect1>
      
      <sect1 id="kernelconfig-trouble">
	<title>If Something Goes Wrong</title>
	
	<para>There are four categories of trouble that can occur when
	  building a custom kernel. They are:</para>
	
	
	  <variablelist>
	    <varlistentry><term>Config command fails</term>
	      <listitem>
		<para>If the <command>config</command> command
		  fails when you give it your kernel description, you have
		  probably made a simple error somewhere. Fortunately,
		  <command>config</command> will print the line
		  number that it had trouble with, so you can quickly skip to
		  it with <command>vi</command>. For example, if
		  you see:
		
		  <informalexample>
		    <screen>config: line 17: syntax error</screen>
		  </informalexample> you can skip to the problem in <command>vi</command> by typing <COMMAND>17G</COMMAND> in command mode.
		  Make sure the keyword is typed correctly, by comparing it to
		  the GENERIC kernel or another reference.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Make command fails</term>
	      
	      <listitem>
		<para>If the <command>make</command> command fails,
		  it usually signals an error in your kernel description, but
		  not severe enough for <command>config</command>
		  to catch it. 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 very quickly.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Kernel will 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, BSD has an
		  excellent mechanism for recovering from incompatible
		  kernels. Simply type the name of the kernel you want to boot
		  from (i.e. <filename>kernel.old</filename>) at the FreeBSD boot prompt
		  instead of pressing return. 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
		  <citerefentry><refentrytitle>dmesg</refentrytitle><manvolnum>8</manvolnum></citerefentry> 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>kernel</filename> location or
		    commands such as <citerefentry><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry> will not work
		    properly. The proper command to <quote>unlock</quote> the
		    kernel file that <command>make</command> installs (in
		    order to move another kernel back permanently) is:
		  
		    <informalexample>
		    <screen>&prompt.root; <userinput>chflags noschg /kernel</userinput></screen>
		    </informalexample> And, if you want to
		    <quote>lock</quote> your new kernel into place, or any
		    file for that matter, so that it cannot be moved or
		    tampered with:
		  
		    <informalexample>
		    <screen>&prompt.root; <userinput>chflags schg /kernel</userinput></screen>
		    </informalexample>
		  </para>
	        </note>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Kernel works, but <command>ps</command> 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, an experimental <quote>2.2.0</quote> kernel on a
		  2.1.0-RELEASE system, many system-status commands like
		  <citerefentry><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry> and <citerefentry><refentrytitle>vmstat</refentrytitle><manvolnum>8</manvolnum></citerefentry>
		  will not work any more. You must recompile the <filename>libkvm</filename> library as well as these
		  utilities. 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>
    
    <chapter>
      <title>Security</title>
      
      
      <sect1 id="crypt">
	<title>DES, MD5, and Crypt</title>
	
	<para><emphasis>Contributed by &a.wollman;<!-- <br> -->24 September
	    1995.</emphasis></para>
	
	<para>In order to protect the security of passwords on UN*X systems
	  from being easily exposed, passwords have traditionally been
	  scrambled in some way. Starting with Bell Labs' Seventh Edition
	  Unix, passwords were encrypted using what the security people call a
	  <quote>one-way hash function</quote>. That is to say, the password is
	  transformed in such a way that the original password cannot be
	  regained except by brute-force searching the space of possible
	  passwords. Unfortunately, the only secure method that was available
	  to the AT&amp;T researchers at the time was based on DES, the Data
	  Encryption Standard. This causes only minimal difficulty for
	  commercial vendors, but is a serious problem for an operating system
	  like FreeBSD where all the source code is freely available, because
	  national governments in many places like to place restrictions on
	  cross-border transport of DES and other encryption software.</para>
	
	<para>So, the FreeBSD team was faced with a dilemma: how could we
	  provide compatibility with all those UNIX systems out there while
	  still not running afoul of the law? We decided to take a dual-track
	  approach: we would make distributions which contained only a
	  non-regulated password scrambler, and then provide as a separate
	  add-on library the DES-based password hash. The password-scrambling
	  function was moved out of the C library to a separate library,
	  called <filename>libcrypt</filename> because the name of
	  the C function to implement it is <function>crypt</function>. In FreeBSD 1.x and some pre-release
	  2.0 snapshots, the non-regulated scrambler uses an insecure function
	  written by Nate Williams; in subsequent releases this was replaced
	  by a mechanism using the RSA Data Security, Inc., MD5 one-way hash
	  function. Because neither of these functions involve encryption,
	  they are believed to be exportable from the US and importable into
	  many other countries.</para>
	
	<para>Meanwhile, work was also underway on the DES-based password hash
	  function. First, a version of the <function>crypt</function> function which was written outside the
	  US was imported, thus synchronizing the US and non-US code. Then,
	  the library was modified and split into two; the DES <filename>libcrypt</filename> contains only the code involved in
	  performing the one-way password hash, and a separate <filename>libcipher</filename> was created with the entry points
	  to actually perform encryption. The code was partitioned in this
	  way to make it easier to get an export license for the compiled
	  library.</para>
	
	
	<sect2>
	  <title>Recognizing your <command>crypt</command>
	    mechanism</title>
	  
	  <para>It is fairly easy to recognize whether a particular password
	    string was created using the DES- or MD5-based hash function. MD5
	    password strings always begin with the characters <literal>&#36;1&#36;</literal>. DES password strings do not
	    have any particular identifying characteristics, but they are
	    shorter than MD5 passwords, and are coded in a 64-character
	    alphabet which does not include the <literal>&#36;</literal> character, so a relatively short
	    string which doesn't begin with a dollar sign is very likely a DES
	    password.</para>
	  
	  <para>Determining which library is being used on your system is
	    fairly easy for most programs, except for those like <command>init</command> which are statically linked. (For
	    those programs, the only way is to try them on a known password
	    and see if it works.)  Programs which use <function>crypt</function> are linked against <filename>libcrypt</filename>, which for each type of library is
	    a symbolic link to the appropriate implementation. For example,
	    on a system using the DES versions:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user;<userinput> cd /usr/lib</userinput>
&prompt.user; <userinput>ls -l /usr/lib/libcrypt*</userinput>
lrwxr-xr-x  1 bin  bin  13 Sep  5 12:50 libcrypt.a -&gt; libdescrypt.a
lrwxr-xr-x  1 bin  bin  18 Sep  5 12:50 libcrypt.so.2.0 -&gt; libdescrypt.so.2.0
lrwxr-xr-x  1 bin  bin  15 Sep  5 12:50 libcrypt_p.a -&gt; libdescrypt_p.a</screen>
	    </informalexample>
	  
	  
	  <para>On a system using the MD5-based libraries, the same links will
	    be present, but the target will be <filename>libscrypt</filename>
	    rather than <filename>libdescrypt</filename>.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="skey">
	<title>S/Key</title>
	
	<para><emphasis>Contributed by &a.wollman;<!-- <br> -->25 September
	    1995.</emphasis></para>
	
	<para>S/Key is a one-time password scheme based on a one-way hash
	  function (in our version, this is MD4 for compatibility; other
	  versions have used MD5 and DES-MAC). S/Key has been a standard part
	  of all FreeBSD distributions since version 1.1.5, and is also
	  implemented on a large and growing number of other systems. S/Key
	  is a registered trademark of Bell Communications Research,
	  Inc.</para>
	
	<para>There are three different sorts of passwords which we will talk
	  about in the discussion below. The first is your usual UNIX-style
	  or Kerberos password; we will call this a <quote>UNIX password</quote>. The
	  second sort is the one-time password which is generated by the S/Key
	  <command>key</command> program and accepted by the
	  <command>keyinit</command> program and the login
	  prompt; we will call this a <quote>one-time password</quote>. The final sort
	  of password is the secret password which you give to the <command>key</command> program (and sometimes the <command>keyinit</command> program) which it uses to generate
	  one-time passwords; we will call it a <quote>secret password</quote> or just
	  unqualified <quote>password</quote>.</para>
	
	<para>The secret password does not necessarily have anything to do
	  with your UNIX password (while they can be the same, this is not
	  recommended). While UNIX passwords are limited to eight characters
	  in length, your S/Key secret password can be as long as you like; I
	  use seven-word phrases. In general, the S/Key system operates
	  completely independently of the UNIX password system.</para>
	
	<para>There are in addition two other sorts of data involved in the
	  S/Key system; one is called the <quote>seed</quote> or (confusingly) <quote>key</quote>,
	  and consists of two letters and five digits, and the other is the
	  <quote>iteration count</quote> and is a number between 100 and 1. S/Key
	  constructs a one-time password from these components by
	  concatenating the seed and the secret password, then applying a
	  one-way hash (the RSA Data Security, Inc., MD4 secure hash function)
	  iteration-count times, and turning the result into six short English
	  words. The <command>login</command> and <command>su</command> programs keep track of the last one-time
	  password used, and the user is authenticated if the hash of the
	  user-provided password is equal to the previous password. Because a
	  one-way hash function is used, it is not possible to generate future
	  one-time passwords having overheard one which was successfully used;
	  the iteration count is decremented after each successful login to
	  keep the user and login program in sync. (When you get the
	  iteration count down to 1, it is time to reinitialize S/Key.)</para>
	
	<para>There are four programs involved in the S/Key system which we
	  will discuss below. The <command>key</command> program
	  accepts an iteration count, a seed, and a secret password, and
	  generates a one-time password. The <command>keyinit</command> program is used to initialized S/Key,
	  and to change passwords, iteration counts, or seeds; it takes either
	  a secret password, or an iteration count, seed, and one-time
	  password. The <command>keyinfo</command> program
	  examines the <filename>/etc/skeykeys</filename> file and prints out
	  the invoking user's current iteration count and seed. Finally, the
	  <command>login</command> and <command>su</command> programs contain the necessary logic to
	  accept S/Key one-time passwords for authentication. The <command>login</command> program is also capable of disallowing
	  the use of UNIX passwords on connections coming from specified
	  addresses.</para>
	
	<para>There are four different sorts of operations we will cover. The
	  first is using the <command>keyinit</command> program
	  over a secure connection to set up S/Key for the first time, or to
	  change your password or seed. The second operation is using the
	  <command>keyinit</command> program over an insecure
	  connection, in conjunction with the <command>key</command> program over a secure connection, to do
	  the same. The third is using the <command>key</command> program to log in over an insecure
	  connection. The fourth is using the <command>key</command> program to generate a number of keys
	  which can be written down or printed out to carry with you when
	  going to some location without secure connections to anywhere (like
	  at a conference).</para>
	
	
	<sect2>
	  <title>Secure connection initialization</title>
	  
	  <para>To initialize S/Key, change your password, or change your seed
	    while logged in over a secure connection (e.g., on the console of
	    a machine), use the <command>keyinit</command>
	    command without any parameters while logged in as yourself:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; keyinit
Updating wollman:			) these will not appear if you
Old key: ha73895  		        ) have not used S/Key before
Reminder - Only use this method if you are directly connected.
If you are using telnet or rlogin exit with no password and use keyinit -s.
<prompt>Enter secret password:</prompt>			) I typed my pass phrase here
<prompt>Again secret password:</prompt>			) I typed it again ID

wollman s/key is 99 ha73896		) discussed below SAG
HAS FONT GOUT FATE BOOM		        )</screen>
	    </informalexample>
	  
	  
	  <para>There is a lot of information here. At the<prompt>Enter secret
	    password:</prompt> prompt, you should enter some password or phrase (I use
	    phrases of minimum seven words) which will be needed to generate
	    login keys. The line starting `ID' gives the parameters of your
	    particular S/Key instance: your login name, the iteration count,
	    and seed. When logging in with S/Key, the system will remember
	    these parameters and present them back to you so you do not have
	    to remember them. The last line gives the particular one-time
	    password which corresponds to those parameters and your secret
	    password; if you were to re-login immediately, this one-time
	    password is the one you would use.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Insecure connection initialization</title>
	  
	  <para>To initialize S/Key or change your password or seed over an
	    insecure connection, you will need to already have a secure
	    connection to some place where you can run the <command>key</command> program; this might be in the form of a
	    desk accessory on a Macintosh, or a shell prompt on a machine you
	    trust (we will show the latter). You will also need to make up an
	    iteration count (100 is probably a good value), and you may make
	    up your own seed or use a randomly-generated one. Over on the
	    insecure connection (to the machine you are initializing), use the
	    <command>keyinit -s</command> command:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>keyinit -s</userinput>
Updating wollman: Old key: kh94741
Reminder you need the 6 English words from the skey command.
<prompt>Enter sequence count from 1 to 9999:</prompt> <userinput>100</userinput>	) I typed this
<prompt>Enter new key [default kh94742]:</prompt>
s/key 100 kh94742</screen>
	    </informalexample>
	  
	  
	  <para>To accept the default seed (which the <command>keyinit</command> program
	    confusingly calls a <literal>key</literal>), press return. Then move over to your
	    secure connection or S/Key desk accessory, and give it the same
	    parameters:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>key 100 kh94742</userinput>
Reminder - Do not use this program while logged in via telnet or rlogin.
<prompt>Enter secret password:</prompt>             ) I typed my secret password
HULL NAY YANG TREE TOUT VETO</screen>
	    </informalexample>
	  
	  
	  <para>Now switch back over to the insecure connection, and copy the
	    one-time password generated by <command>key</command>
	    over to the <command>keyinit</command>
	    program:</para>
	  
	  
	    <informalexample>
	      <screen><prompt>s/key access password:</prompt> <userinput>HULL NAY YANG TREE TOUT VETO</userinput>
ID wollman s/key is 100 kh94742
HULL NAY YANG TREE TOUT VETO</screen>
	    </informalexample>
	  
	  
	  <para>The rest of the description from the previous section applies
	    here as well.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Diversion: a login prompt</title>
	  
	  <para>Before explaining how to generate one-time passwords, we
	    should go over an S/Key login prompt:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>telnet himalia</userinput>
Trying 18.26.0.186...
Connected to himalia.lcs.mit.edu.
Escape character is '^]'.
s/key 92 hi52030
<prompt>Password:</prompt></screen>
	    </informalexample>
	  
	  
	  <para>Note that, before prompting for a password, the login program
	    prints out the iteration number and seed which you will need in
	    order to generate the appropriate key. You will also find a
	    useful feature (not shown here): if you press return at the
	    password prompt, the login program will turn echo on, so you can
	    see what you are typing. This can be extremely useful if you are
	    attempting to type in an S/Key by hand, such as from a
	    printout.</para>
	  
	  <para>If this machine were configured to disallow UNIX passwords
	    over a connection from my machine, the prompt would have also
	    included the annotation <literal>(s/key
	      required)</literal>, indicating that only S/Key one-time
	    passwords will be accepted.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Generating a single one-time password</title>
	  
	  <para>Now, to generate the one-time password needed to answer this
	    login prompt, we use a trusted machine and the <command>key</command> program. (There are versions of the
	    <command>key</command> program from DOS and Windows
	    machines, and there is an S/Key desk accessory for Macintosh
	    computers as well.)  The command-line <command>key</command> program takes as its parameters the
	    iteration count and seed; you can cut-and-paste right from the
	    login prompt starting at <literal>key</literal> to
	    the end of the line. Thus:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>key 92 hi52030</userinput>		     ) pasted from previous section
Reminder - Do not use this program while logged in via telnet or rlogin.
<prompt>Enter secret password:</prompt>		) I typed my secret password
ADEN BED WOLF HAW HOT STUN</screen>
	    </informalexample>
	  
	  
	  <para>And in the other window:</para>
	  
	  
	    <informalexample>
	      <screen>s/key 92 hi52030				) from previous section
<prompt>Password:</prompt>
  (turning echo on)
<prompt>Password:</prompt>ADEN BED WOLF HAW HOT STUN
Last login: Wed Jun 28 15:31:00 from halloran-eldar.l
[etc.]</screen>
	    </informalexample>
	  
	  
	  <para>This is the easiest mechanism <emphasis>if</emphasis> you have
	    a trusted machine. There is a Java S/Key <command>key</command> applet, <ulink
	      URL="http://www.cs.umd.edu/~harry/jotp/src.html">The Java OTP
	      Calculator</ulink>, that you can download and run locally on any
	    Java supporting brower.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Generating multiple one-time passwords</title>
	  
	  <para>Sometimes we have to go places where no trusted machines or
	    connections are available. In this case, it is possible to use
	    the <command>key</command> command to generate a
	    number of one-time passwords in the same command; these can then
	    be printed out. For example:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>key -n 25 57 zz99999</userinput>
Reminder - Do not use this program while logged in via telnet or rlogin.
<prompt>Enter secret password:</prompt>
33: WALT THY MALI DARN NIT HEAD
34: ASK RICE BEAU GINA DOUR STAG
&hellip;
56: AMOS BOWL LUG FAT CAIN INCH
57: GROW HAYS TUN DISH CAR BALM</screen>
	    </informalexample>
	  
	  
	  <para>The <option>-n 25</option> requests twenty-five keys in
	    sequence; the <option>57</option> indicates the
	    <emphasis>ending</emphasis> iteration number; and the rest is as
	    before. Note that these are printed out in
	    <emphasis>reverse</emphasis> order of eventual use. If you are
	    really paranoid, you might want to write the results down by hand;
	    otherwise you can cut-and-paste into <command>lpr</command>. Note that each line shows both the
	    iteration count and the one-time password; you may still find it
	    handy to scratch off passwords as you use them.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Restricting use of UNIX passwords</title>
	  
	  <para>The configuration file <filename>/etc/skey.access</filename>
	    can be used to configure restrictions on the use of UNIX passwords
	    based on the host name, user name, terminal port, or IP address of
	    a login session. The complete format of the file is documented in
	    the <citerefentry><refentrytitle>skey.access</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page; there are
	    also some security cautions there which should be read before
	    depending on this file for security.</para>
	  
	  <para>If there is no <filename>/etc/skey.access</filename> file
	    (which is the default state as FreeBSD is shipped), then all users
	    will be allowed to use UNIX passwords. If the file exists,
	    however, then all users will be required to use S/Key unless
	    explicitly permitted to do otherwise by configuration statements
	    in the <filename>skey.access</filename> file. In all cases, UNIX
	    passwords are permitted on the console.</para>
	  
	  <para>Here is a sample configuration file which illustrates the
	    three most common sorts of configuration statements:</para>
	  
	  <programlisting>
permit internet 18.26.0.0 255.255.0.0
permit user jrl
permit port ttyd0
	  </programlisting>
	  
	  <para>The first line (<literal>permit
	      internet</literal>) allows users whose IP source address
	    (which is vulnerable to spoofing) matches the specified value and
	    mask, to use UNIX passwords. This should not be considered a
	    security mechanism, but rather, a means to remind authorized users
	    that they are using an insecure network and need to use S/Key for
	    authentication.</para>
	  
	  <para>The second line (<literal>permit user</literal>)
	    allows the specified user to use UNIX passwords at any time.
	    Generally speaking, this should only be used for people who are
	    either unable to use the <command>key</command>
	    program, like those with dumb terminals, or those who are
	    uneducable.</para>
	  
	  <para>The third line (<literal>permit port</literal>)
	    allows all users logging in on the specified terminal line to use
	    UNIX passwords; this would be used for dial-ups.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="kerberos">
	<title>Kerberos</title>
	
	<para><emphasis>Contributed by &a.markm; (based on contribution by
	    &a.md;).</emphasis></para>
	
	<para>Kerberos is a network add-on system/protocol that allows users
	  to authenticate themselves through the services of a secure server.
	  Services such as remote login, remote copy, secure inter-system file
	  copying and other high-risk tasks are made considerably safer and
	  more controllable.</para>
	
	<para>The following instructions can be used as a guide on how to set
	  up Kerberos as distributed for FreeBSD. However, you should refer to
	  the relevant manual pages for a complete description.</para>
	
	<para>In FreeBSD, the Kerberos is not that from the original
	  4.4BSD-Lite, distribution, but eBones, which had been previously
	  ported to FreeBSD 1.1.5.1, and was sourced from outside the
	  USA/Canada, and is thus available to system owners outside those
	  countries.</para>
	
	<para>For those needing to get a legal foreign distribution of this
	  software, please <emphasis>do not</emphasis> get it from a USA or
	  Canada site. You will get that site in <emphasis>big</emphasis>
	  trouble! A legal copy of this is available from
	  <hostid role="fqdn">skeleton.mikom.csir.co.za</hostid>, which is in South
	  Africa.</para>
	
	
	<sect2>
	  <title>Creating the initial database</title>
	  
	  <para>This is done on the Kerberos server only. First make sure that
	    you do not have any old Kerberos databases around. You should
	    change to the directory <filename>/etc/kerberosIV</filename> and
	    check that only the following files are present:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /etc/kerberosIV</userinput>
&prompt.root; <userinput>ls</userinput>
README		krb.conf        krb.realms</screen>
	    </informalexample>
	  
	  
	  <para>If any additional files (such as
	    <filename>principal.*</filename> or <symbol>master_key</symbol>)
	    exist, then use the <symbol>kdb_destroy</symbol> command to
	    destroy the old Kerberos database, of if Kerberos is not running,
	    simply delete the extra files with <command>rm</command>.</para>
	  
	  <para>You should now edit the <filename>krb.conf</filename> and
	    <filename>krb.realms</filename> files to define your Kerberos
	    realm. In this case the realm will be
	    <filename>GRONDAR.ZA</filename> and the server is
	    <filename>grunt.grondar.za</filename>. We edit or create the
	    <filename>krb.conf</filename> file:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cat krb.conf</userinput>
GRONDAR.ZA
GRONDAR.ZA grunt.grondar.za admin server
CS.BERKELEY.EDU okeeffe.berkeley.edu
ATHENA.MIT.EDU kerberos.mit.edu
ATHENA.MIT.EDU kerberos-1.mit.edu
ATHENA.MIT.EDU kerberos-2.mit.edu
ATHENA.MIT.EDU kerberos-3.mit.edu
LCS.MIT.EDU kerberos.lcs.mit.edu
TELECOM.MIT.EDU bitsy.mit.edu
ARC.NASA.GOV trident.arc.nasa.gov</screen>
	  </informalexample>
	  
	  <para>In this case, the other realms do not need to be there. They
	    are here as an example of how a machine may be made aware of
	    multiple realms. You may wish to not include them for
	    simplicity.</para>
	  
	  <para>The first line names the realm in which this system works. The
	    other lines contain realm/host entries. The first item on a line
	    is a realm, and the second is a host in that realm that is acting
	    as a <quote>key distribution centre</quote>. The words <literal>admin server</literal>
	    following a hosts name means that host also provides an
	    administrative database server. For further explanation of these
	    terms, please consult the Kerberos man pages.</para>
	  
	  <para>Now we have to add <hostid role="fqdn">grunt.grondar.za</hostid> to
	    the <filename>GRONDAR.ZA</filename> realm and also add an entry to
	    put all hosts in the <hostid role="domainname">.grondar.za</hostid> domain in
	    the <filename>GRONDAR.ZA</filename> realm. The
	    <filename>krb.realms</filename> file would be updated as
	    follows:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cat krb.realms</userinput>
grunt.grondar.za GRONDAR.ZA
.grondar.za GRONDAR.ZA
.berkeley.edu CS.BERKELEY.EDU
.MIT.EDU ATHENA.MIT.EDU
.mit.edu ATHENA.MIT.EDU</screen>
	  </informalexample>
	  
	  <para>Again, the other realms do not need to be there. They are here
	    as an example of how a machine may be made aware of multiple
	    realms. You may wish to remove them to simplify things.</para>
	  
	  <para>The first line puts the <emphasis>specific</emphasis>
	    system into the named realm. The rest of the lines show how to
	    default systems of a particular subdomain to a named realm.</para>
	  
	  <para>Now we are ready to create the database. This only needs to
	    run on the Kerberos server (or Key Distribution Centre). Issue the
	    <command>kdb_init</command> command to do this:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kdb_init</userinput>
<prompt>Realm name [default  ATHENA.MIT.EDU ]:</prompt> <userinput>GRONDAR.ZA</userinput>
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
		
<prompt>Enter Kerberos master key:</prompt> </screen>
	  </informalexample>
	  
	  <para>Now we have to save the key so that servers on the local
	    machine can pick it up. Use the <command>kstash</command> command to do this.</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kstash</userinput>
	      
<prompt>Enter Kerberos master key:</prompt>

Current Kerberos master key version is 1.

Master key entered. BEWARE!</screen>
	  </informalexample>
	  
	  <para>This saves the encrypted master password in
	    <filename>/etc/kerberosIV/master_key</filename>.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Making it all run</title>
	  
	  <para>Two principals need to be added to the database for <emphasis>each</emphasis> system that will be secured with
	    Kerberos. Their names are <literal>kpasswd</literal>
	    and <literal>rcmd</literal> These two principals are
	    made for each system, with the instance being the name of the
	    individual system.</para>
	  
	  <para>These daemons, <command>kpasswd</command> and
	    <command>rcmd</command> allow other systems to change
	    Kerberos passwords and run commands like <command>rcp</command>, <command>rlogin</command>
	    and <command>rsh</command>.</para>
	  
	  <para>Now let's add these entries:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>kdb_edit</userinput>
Opening database...

<prompt>Enter Kerberos master key:</prompt>

Current Kerberos master key version is 1.

Master key entered.  BEWARE!
Previous or default values are in [brackets] ,
enter return to leave the same, or new value.

<prompt>Principal name:</prompt> <userinput>passwd</userinput>
<prompt>Instance:</prompt> <userinput>grunt</userinput>

&lt;Not found&gt;, <prompt>Create [y] ?</prompt> <userinput>y</userinput>

Principal: passwd, Instance: grunt, kdc_key_ver: 1
<prompt>New Password:</prompt>                    &lt;---- enter RANDOM here
Verifying password

<prompt>New Password:</prompt> &lt;---- enter RANDOM here

<prompt>Random password [y] ?</prompt> <userinput>y</userinput>

Principal's new key version = 1
<prompt>Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ?</prompt>
<prompt>Max ticket lifetime (*5 minutes) [ 255 ] ?</prompt>
<prompt>Attributes [ 0 ] ?</prompt>
Edit O.K.
<prompt>Principal name:</prompt> <userinput>rcmd</userinput>
<prompt>Instance:</prompt> <userinput>grunt</userinput>

&lt;Not found&gt;, <prompt>Create [y] ?</prompt>

Principal: rcmd, Instance: grunt, kdc_key_ver: 1
<prompt>New Password:</prompt>		&lt;---- enter RANDOM here
Verifying password

<prompt>New Password:</prompt>           &lt;---- enter RANDOM here

<prompt>Random password [y] ?</prompt>

Principal's new key version = 1
<prompt>Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ?</prompt>
<prompt>Max ticket lifetime (*5 minutes) [ 255 ] ?</prompt>
<prompt>Attributes [ 0 ] ?</prompt>
Edit O.K.
<prompt>Principal name:</prompt>         &lt;---- null entry here will cause an exit</screen>
	    </informalexample>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Creating the server file</title>
	  
	  <para>We now have to extract all the instances which define the
	    services on each machine. For this we use the
	    <command>ext_srvtab</command> command. This will create a file which
	    must be copied or moved <emphasis>by secure
	      means</emphasis> to each Kerberos client's /etc/kerberosIV
	    directory. This file must be present on each server and client,
	    and is crucial to the operation of Kerberos.</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ext_srvtab grunt</userinput>
<prompt>Enter Kerberos master key:</prompt>
		
Current Kerberos master key version is 1.

Master key entered. BEWARE!
Generating 'grunt-new-srvtab'....</screen>
	  </informalexample>
	  
	  <para>Now, this command only generates a temporary file which must
	    be renamed to <filename>srvtab</filename> so that all the
	    server can pick it up. Use the <command>mv</command>
	    command to move it into place on the original system:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>mv grunt-new-srvtab srvtab</userinput></screen>
	  </informalexample>
	  
	  <para>If the file is for a client system, and the network is not
	    deemed safe, then copy the <filename><replaceable>client</replaceable>-new-srvtab</filename> to removable media
	    and transport it by secure physical means. Be sure to rename it to
	    <filename>srvtab</filename> in the client's
	    <filename>/etc/kerberosIV</filename> directory, and make sure it
	    is mode 600:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>mv grumble-new-srvtab srvtab</userinput>
&prompt.root; <userinput>chmod 600 srvtab</userinput></screen>
	  </informalexample>
	</sect2>
	
	<sect2>
	  <title>Populating the database</title>
	  
	  <para>We now have to add some user entries into the database. First
	    let's create an entry for the user <username>jane</username>. Use
	    the <command>kdb_edit</command> command to do this:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kdb_edit</userinput>
Opening database...

<prompt>Enter Kerberos master key:</prompt>

Current Kerberos master key version is 1.

Master key entered.  BEWARE!
Previous or default values are in [brackets] ,
enter return to leave the same, or new value.

<prompt>Principal name:</prompt> <userinput>jane</userinput>
<prompt>Instance:</prompt>

&lt;Not found&gt;, <prompt>Create [y] ?</prompt> <userinput>y</userinput>

Principal: jane, Instance: , kdc_key_ver: 1
<prompt>New Password:</prompt>                &lt;---- enter a secure password here
Verifying password

<prompt>New Password:</prompt>                &lt;---- re-enter the password here
Principal's new key version = 1
<prompt>Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ?</prompt>
<prompt>Max ticket lifetime (*5 minutes) [ 255 ] ?</prompt>
<prompt>Attributes [ 0 ] ?</prompt>
Edit O.K.
<prompt>Principal name:</prompt>		   &lt;---- null entry here will cause an exit</screen>
	  </informalexample>
	</sect2>
	
	<sect2>
	  <title>Testing it all out</title>
	  
	  <para>First we have to start the Kerberos daemons. NOTE that if you
	    have correctly edited your <filename>/etc/rc.conf</filename> then
	    this will happen automatically when you reboot. This is only
	    necessary on the Kerberos server. Kerberos clients will
	    automagically get what they need from the
	    <filename>/etc/kerberosIV</filename> directory.</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kerberos &amp;</userinput>
Kerberos server starting
Sleep forever on error
Log file is /var/log/kerberos.log
Current Kerberos master key version is 1.

Master key entered. BEWARE!

Current Kerberos master key version is 1
Local realm: GRONDAR.ZA
&prompt.root; <userinput>kadmind -n &amp;</userinput>
KADM Server KADM0.0A initializing
Please do not use 'kill -9' to kill this job, use a
regular kill instead

Current Kerberos master key version is 1.

Master key entered.  BEWARE!</screen>
	  </informalexample>
	  
	  <para>Now we can try using the <command>kinit</command>
	    command to get a ticket for the id <username>jane</username> that we created above:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>kinit jane</userinput>
MIT Project Athena (grunt.grondar.za)
Kerberos Initialization for "jane"
<prompt>Password:</prompt> </screen>
	  </informalexample>
	  
	  <para>Try listing the tokens using <command>klist</command> to see if we really have them:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>klist</userinput>
Ticket file:    /tmp/tkt245
Principal:      jane@GRONDAR.ZA

  Issued           Expires          Principal
Apr 30 11:23:22  Apr 30 19:23:22  krbtgt.GRONDAR.ZA@GRONDAR.ZA</screen>
	  </informalexample>
	  
	  <para>Now try changing the password using <command>passwd</command> to check if the kpasswd daemon can
	    get authorization to the Kerberos database:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>passwd</userinput>
realm GRONDAR.ZA
<prompt>Old password for jane:</prompt>
<prompt>New Password for jane:</prompt>
Verifying password
<prompt>New Password for jane:</prompt>
Password changed.</screen>
	  </informalexample>
	</sect2>
	
	<sect2>
	  <title>Adding <command>su</command> privileges</title>
	  
	  <para>Kerberos allows us to give <emphasis>each</emphasis>
	    user who needs root privileges their own <emphasis>separate</emphasis> <command>su</command>password. We could now add an id which is
	    authorized to <command>su</command> to <username>root</username>. This is controlled by having an
	    instance of <username>root</username> associated with a
	    principal. Using <command>kdb_edit</command> we can create the
	    entry <literal>jane.root</literal> in the Kerberos
	    database:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kdb_edit</userinput>
Opening database...

<prompt>Enter Kerberos master key:</prompt>

Current Kerberos master key version is 1.

Master key entered.  BEWARE!
Previous or default values are in [brackets] ,
enter return to leave the same, or new value.

<prompt>Principal name:</prompt> <userinput>jane</userinput>
<prompt>Instance:</prompt> <userinput>root</userinput>

&lt;Not found&gt;, Create [y] ? y

Principal: jane, Instance: root, kdc_key_ver: 1
<prompt>New Password:</prompt>                    &lt;---- enter a SECURE password here
Verifying password

<prompt>New Password:</prompt>    	 	 &lt;---- re-enter the password here

Principal's new key version = 1
<prompt>Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ?</prompt>
<prompt>Max ticket lifetime (*5 minutes) [ 255 ] ?</prompt> <userinput>12</userinput> &lt;--- Keep this short!
<prompt>Attributes [ 0 ] ?</prompt>
Edit O.K.
<prompt>Principal name:</prompt>		         &lt;---- null entry here will cause an exit</screen>
	  </informalexample>
	  
	  <para>Now try getting tokens for it to make sure it works:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>kinit jane.root</userinput>
MIT Project Athena (grunt.grondar.za)
Kerberos Initialization for "jane.root"
<prompt>Password:</prompt></screen>
	  </informalexample>
	  
	  <para>Now we need to add the user to root's
	    <filename>.klogin</filename> file:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cat /root/.klogin</userinput>
jane.root@GRONDAR.ZA</screen>
	  </informalexample>
	  	  
	  <para>Now try doing the <command>su</command>:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <prompt>su</prompt>
<prompt>Password:</prompt></screen>
	  </informalexample>
	  
	  <para>and take a look at what tokens we have:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; klist
Ticket file:	/tmp/tkt_root_245
Principal:      jane.root@GRONDAR.ZA

  Issued           Expires          Principal
May  2 20:43:12  May  3 04:43:12  krbtgt.GRONDAR.ZA@GRONDAR.ZA</screen>
	  </informalexample>
	</sect2>
	
	<sect2>
	  <title>Using other commands</title>
	  
	  <para>In an earlier example, we created a principal called
	    <literal>jane</literal> with an instance <literal>root</literal>. This was based on a user with the same
	    name as the principal, and this is a Kerberos default; that a
	    <literal>&lt;principal&gt;.&lt;instance&gt;</literal> of the
	    form <literal>&lt;username&gt;.</literal><literal>root</literal> will allow that
	    <literal>&lt;username&gt;</literal> to <command>su</command> to root if the necessary entries are in
	    the <filename>.klogin</filename> file in <username>root</username>'s home directory:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cat /root/.klogin</userinput>
jane.root@GRONDAR.ZA</screen>
	  </informalexample>
	  
	  <para>Likewise, if a user has in their own home directory lines of
	    the form:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>cat ~/.klogin</userinput>
jane@GRONDAR.ZA
jack@GRONDAR.ZA</screen>
	  </informalexample>
	  
	  <para>This allows anyone in the <filename>GRONDAR.ZA</filename>
	    realm who has authenticated themselves to
	    <username>jane</username> or <username>jack</username> (via
	    <command>kinit</command>, see above) access to
	    <command>rlogin</command> to
	    <username>jane</username>'s account or files on this system
	    (<hostid>grunt</hostid>) via <command>rlogin</command>, <command>rsh</command> or
	    <command>rcp</command>.</para>
	  
	  <para>For example, Jane now logs into another system, using
	    Kerberos:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>kinit</userinput>
MIT Project Athena (grunt.grondar.za)
<prompt>Password:</prompt>
%prompt.user; <userinput>rlogin grunt</userinput>
Last login: Mon May  1 21:14:47 from grumble
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.   All rights reserved.

FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen>
	  </informalexample>
	  
	  <para>Or Jack logs into Jane's account on the same machine (Jane
	    having set up the <filename>.klogin</filename> file as above, and
	    the person in charge of Kerberos having set up principal
	    <emphasis>jack</emphasis> with a null instance:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>kinit</userinput>
&prompt.user; <userinput>rlogin grunt -l jane</userinput>
MIT Project Athena (grunt.grondar.za)
<prompt>Password:</prompt>
Last login: Mon May  1 21:16:55 from grumble
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.   All rights reserved.
FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen>
	  </informalexample>
	</sect2>
      </sect1>
      
      <sect1 id="firewalls">
	<title>Firewalls</title>
	
	<para><emphasis>Contributed by &a.gpalmer; and
	    &a.alex;.</emphasis></para>
	
	<para>Firewalls are an area of increasing interest for people who are
	  connected to the Internet, and are even finding applications on
	  private networks to provide enhanced security. This section will
	  hopefully explain what firewalls are, how to use them, and how to
	  use the facilities provided in the FreeBSD kernel to implement
	  them.</para>
	
	<note>
	  <para>People often think that having a firewall between your
	    companies internal network and the <quote>Big Bad Internet</quote>
	    will solve all your security problems.</para>
	    
	  <para>It may help, but a poorly setup firewall system is more of a
	    security risk than not having one at all. A firewall can only add
	    another layer of security to your systems, but they will not be
	    able to stop a really determined hacker from penetrating your
	    internal network. If you let internal security lapse because you
	    believe your firewall to be impenetrable, you have just made the
	    hackers job that bit easier.</para>
	</note>
	
	
	<sect2>
	  <title>What is a firewall?</title>
	  
	  <para>There are currently two distinct types of firewalls in common
	    use on the Internet today. The first type is more properly called
	    a <emphasis>packet filtering router</emphasis>, where the
	    kernel on a multi-homed machine chooses whether to forward or
	    block packets based on a set of rules. The second type, known as
	    <emphasis>proxy servers</emphasis>, rely on daemons to
	    provide authentication and to forward packets, possibly on a
	    multi-homed machine which has kernel packet forwarding
	    disabled.</para>
	  
	  <para>Sometimes sites combine the two types of firewalls, so that
	    only a certain machine (known as a <emphasis>bastion
	      host</emphasis>) is allowed to send packets through a packet
	    filtering router onto an internal network. Proxy services are run
	    on the bastion host, which are generally more secure than normal
	    authentication mechanisms.</para>
	  
	  <para>FreeBSD comes with a kernel packet filter (known as
	    <application>IPFW</application>), which is what the rest of this section
	    will concentrate on. Proxy servers can be built on FreeBSD from
	    third party software, but there is such a variety of proxy servers
	    available that it would be impossible to cover them in this
	    document.</para>
	  
	  
	  <sect3 id="firewalls-packet-filters">
	    <title>Packet filtering routers</title>
	    
	    <para>A router is a machine which forwards packets between two or
	      more networks. A packet filtering router has an extra piece of
	      code in its kernel, which compares each packet to a list of
	      rules before deciding if it should be forwarded or not. Most
	      modern IP routing software has packet filtering code in it,
	      which defaults to forwarding all packets. To enable the filters,
	      you need to define a set of rules for the filtering code, so
	      that it can decide if the packet should be allowed to pass or
	      not.</para>
	    
	    <para>To decide if a packet should be passed on or not, the code
	      looks through its set of rules for a rule which matches the
	      contents of this packets headers. Once a match is found, the
	      rule action is obeyed. The rule action could be to drop the
	      packet, to forward the packet, or even to send an ICMP message
	      back to the originator. Only the first match counts, as the
	      rules are searched in order. Hence, the list of rules can be
	      referred to as a <quote>rule chain</quote>.</para>
	    
	    <para>The packet matching criteria varies depending on the
	      software used, but typically you can specify rules which depend
	      on the source IP address of the packet, the destination IP
	      address, the source port number, the destination port number
	      (for protocols which support ports), or even the packet type
	      (UDP, TCP, ICMP, etc).</para>
	    
	  </sect3>
	  
	  <sect3 id="firewalls-proxy-servers">
	    <title>Proxy servers</title>
	    
	    <para>Proxy servers are machines which have had the normal system
	      daemons (telnetd, ftpd, etc) replaced with special servers.
	      These servers are called <emphasis>proxy
		servers</emphasis> as they normally only allow onward
	      connections to be made. This enables you to run (for example) a
	      proxy telnet server on your firewall host, and people can telnet
	      in to your firewall from the outside, go through some
	      authentication mechanism, and then gain access to the internal
	      network (alternatively, proxy servers can be used for signals
	      coming from the internal network and heading out).</para>
	    
	    <para>Proxy servers are normally more secure than normal servers,
	      and often have a wider variety of authentication mechanisms
	      available, including <quote>one-shot</quote> password systems so that even
	      if someone manages to discover what password you used, they will
	      not be able to use it to gain access to your systems as the
	      password instantly expires. As they do not actually give users
	      access to the host machine, it becomes a lot more difficult for
	      someone to install backdoors around your security system.</para>
	    
	    <para>Proxy servers often have ways of restricting access further,
	      so that only certain hosts can gain access to the servers, and
	      often they can be set up so that you can limit which users can
	      talk to which destination machine. Again, what facilities are
	      available depends largely on what proxy software you
	      choose.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>What does IPFW allow me to do?</title>
	  
	  <para><application>IPFW</application>, the software supplied with FreeBSD,
	    is a packet filtering and accounting system which resides in the
	    kernel, and has a user-land control utility,
	    <citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Together, they allow you to define and
	    query the rules currently used by the kernel in its routing
	    decisions.</para>
	  
	  <para>There are two related parts to <application>IPFW</application>. The
	    firewall section allows you to perform packet filtering. There is
	    also an IP accounting section which allows you to track usage of
	    your router, based on similar rules to the firewall section. This
	    allows you to see (for example) how much traffic your router is
	    getting from a certain machine, or how much WWW (World Wide Web)
	    traffic it is forwarding.</para>
	  
	  <para>As a result of the way that <application>IPFW</application> is
	    designed, you can use <application>IPFW</application> on non-router
	    machines to perform packet filtering on incoming and outgoing
	    connections. This is a special case of the more general use of
	    <application>IPFW</application>, and the same commands and techniques
	    should be used in this situation.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Enabling IPFW on FreeBSD</title>
	  
	  <para>As the main part of the <application>IPFW</application> system lives
	    in the kernel, you will need to add one or more options to your
	    kernel configuration file, depending on what facilities you want,
	    and recompile your kernel. See
	    <xref linkend="kernelconfig" remap="reconfiguring the kernel"> for
	    more details on how to recompile your kernel.</para>
	  
	  <para>There are currently three kernel configuration options
	    relevant to IPFW:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>options IPFIREWALL</term>
		<listitem>
		  <para>Compiles into the kernel the code for packet
		    filtering.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options IPFIREWALL_VERBOSE</term>
		
		<listitem>
		  <para>Enables code to allow logging of packets through
		    <citerefentry><refentrytitle>syslogd</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Without this option, even
		    if you specify that packets should be logged in the filter
		    rules, nothing will happen.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>options IPFIREWALL_VERBOSE_LIMIT=10</term>
		
		<listitem>
		  <para>Limits the number of packets logged through
		    <citerefentry><refentrytitle>syslogd</refentrytitle><manvolnum>8</manvolnum></citerefentry> on a per entry basis. You
		    may wish to use this option in hostile environments in
		    which you want to log firewall activity, but do not want
		    to be open to a denial of service attack via syslog
		    flooding.</para>

		  <para>When a chain entry reaches the packet limit specified,
		    logging is turned off for that particular entry. To
		    resume logging, you will need to reset the associated
		    counter using the <citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry>
		    utility:</para>
		  
		  <informalexample>
		    <screen>&prompt.root; <userinput>ipfw zero 4500</userinput></screen>
		  </informalexample>
		  
		  <para>Where 4500 is the chain entry you wish to continue
		    logging.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	  <para>Previous versions of FreeBSD contained an
	    <literal>IPFIREWALL_ACCT</literal>  option. This is now obsolete as
	    the firewall code automatically  includes accounting
	    facilities.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Configuring IPFW</title>
	  
	  <para>The configuration of the <application>IPFW</application> software is
	    done through the <citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry> utility. The syntax
	    for this command looks quite complicated, but it is relatively
	    simple once you understand its structure.</para>
	  
	  <para>There are currently four different command categories used by
	    the utility: addition/deletion, listing, flushing, and clearing.
	    Addition/deletion is used to build the rules that control how
	    packets are accepted, rejected, and logged. Listing is used to
	    examine the contents of your rule set (otherwise known as the
	    chain) and packet counters (accounting). Flushing is used to
	    remove all entries from the chain. Clearing is used to zero out
	    one or more accounting entries.</para>
	  
	  
	  <sect3>
	    <title>Altering the IPFW rules</title>
	    
	    <para>The syntax for this form of the command is:
	      <cmdsynopsis>
		<command>ipfw</command>
		<arg>-N</arg>
		<arg choice="plain">command</arg>
		<arg>index</arg>
		<arg choice="plain">action</arg>
		<arg>log</arg>
		<arg choice="plain">protocol</arg>
		<arg choice="plain">addresses</arg>
		<arg>options</arg>
	      </cmdsynopsis></para>
	    
	    <para>There is one valid flag when using this form of the
	      command:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>-N</term>
		  <listitem>
		    <para>Resolve addresses and service names in
		      output.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>The <emphasis>command</emphasis> given can be shortened to
	      the shortest unique form. The valid
	      <emphasis>commands</emphasis> are:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>add</term>
		  <listitem>
		    <para>Add an entry to the firewall/accounting rule
		      list</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>delete</term>
		  
		  <listitem>
		    <para>Delete an entry from the firewall/accounting rule
		      list</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>Previous versions of <application>IPFW</application> used separate
	      firewall and accounting entries. The present version provides
	      packet accounting with each firewall entry.</para>
	    
	    <para>If an <emphasis>index</emphasis> value is supplied,
	      it used to place the entry at a specific point in the chain.
	      Otherwise, the entry is placed at the end of the chain at an
	      index 100 greater than the last chain entry (this does not
	      include the default policy, rule 65535, deny).</para>
	    
	    <para>The <literal>log</literal> option causes matching
	      rules to be output to the system console if the kernel was
	      compiled with <literal>IPFIREWALL_VERBOSE</literal>.</para>
	    
	    <para>Valid <emphasis>actions</emphasis> are:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>reject</term>
		  <listitem>
		    <para>Drop the packet, and send an ICMP host or port
		      unreachable (as appropriate) packet to the
		      source.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>allow</term>
		  
		  <listitem>
		    <para>Pass the packet on as normal. (aliases:
		    <literal>pass</literal> and <literal>accept</literal>)</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>deny</term>
		  
		  <listitem>
		    <para>Drop the packet. The source is not notified via an
		      ICMP message (thus it appears that the packet never
		      arrived at the destination).</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>count</term>
		  
		  <listitem>
		    <para>Update packet counters but do not allow/deny the
		      packet based on this rule. The search continues with
		      the next chain entry.</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>Each <emphasis>action</emphasis> will be recognized by the
	      shortest unambiguous prefix.</para>
	    
	    <para>The <emphasis>protocols</emphasis> which can be specified
	      are:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>all</term>
		  <listitem>
		    <para>Matches any IP packet</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>icmp</term>
		  
		  <listitem>
		    <para>Matches ICMP packets</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>tcp</term>
		  
		  <listitem>
		    <para>Matches TCP packets</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>udp</term>
		  
		  <listitem>
		    <para>Matches UDP packets</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>The <emphasis>address</emphasis> specification is:</para>

	    <cmdsynopsis>
	      <arg choice="plain">from</arg>
	      <arg choice="plain"><replaceable>address/mask</replaceable></arg><arg><replaceable>port</replaceable></arg>
	      <arg choice="plain">to</arg>
	      <arg choice="plain"><replaceable>address/mark</replaceable></arg><arg><replaceable>port</replaceable></arg>
	      <arg>via <replaceable>interface</replaceable></arg>
	    </cmdsynopsis>
	    
	    <para>You can only specify <replaceable>port</replaceable> in
	      conjunction with <emphasis>protocols</emphasis> which support
	      ports (UDP and TCP).</para>
	    
	    <para>The <option>via</option> is optional and may
	      specify the IP address or domain name of a local IP interface,
	      or an interface name (e.g. <devicename>ed0</devicename>) to
	      match only packets coming through this interface. Interface unit
	      numbers can be specified with an optional wildcard. For example,
	      <literal>ppp*</literal> would match all kernel PPP
	      interfaces.</para>
	    
	    <para>The syntax used to specify an
	      <replaceable>address/mask</replaceable> is:
	      
	      <informalexample>
		<screen><replaceable>address</replaceable></screen>
	      </informalexample>

	      or
	      
	      <informalexample>
		<screen><replaceable>address</replaceable>/<replaceable>mask-bits</replaceable></screen>
	      </informalexample>
	      
	      or

	      <informalexample>
		<screen><replaceable>address</replaceable>:<replaceable>mask-pattern</replaceable></screen>
	      </informalexample></para>
	    
	    <para>A valid hostname may be specified in place of the IP
	      address. <option><replaceable>mask-bits</replaceable></option> is a decimal
	      number representing how many bits in the address mask should be
	      set. e.g. specifying <literal>192.216.222.1/24</literal> will create a mask which will allow any
	      address in a class C subnet (in this case, 192.216.222) to be
	      matched. <option><replaceable>mask-pattern</replaceable></option> is an IP
	      address which will be logically AND'ed with the address given.
	      The keyword <literal>any</literal> may be used to
	      specify <quote>any IP address</quote>.</para>
	    
	    <para>The port numbers to be blocked are specified as:

	      <cmdsynopsis>
		<arg choice="plain"><replaceable>port</replaceable><arg>,<replaceable>port</replaceable><arg>,<replaceable>port</replaceable><arg>&hellip;</arg></arg></arg></arg>
	      </cmdsynopsis>to specify either a single port or a list of
	      ports, or

	      <cmdsynopsis>
		<arg choice="plain"><replaceable>port</replaceable>-<replaceable>port</replaceable></arg>
	      </cmdsynopsis> to specify a range of ports. You may also
	      combine a single range with a list, but the range must always be
	      specified first.</para>
	    
	    <para>The <emphasis>options</emphasis> available are:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>frag</term>
		  <listitem>
		    <para>Matches if the packet is not the first fragment of
		      the datagram.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>in</term>
		  
		  <listitem>
		    <para>Matches if the packet is on the way in.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>out</term>
		  
		  <listitem>
		    <para>Matches if the packet is on the way out.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>ipoptions <replaceable>spec</replaceable></term>
		  
		  <listitem>
		    <para>Matches if the IP header contains the comma
		      separated list of options specified in
		      <replaceable>spec</replaceable>. The supported list of IP
		      options are: <literal>ssrr</literal> (strict
		      source route), <literal>lsrr</literal> (loose
		      source route), <literal>rr</literal> (record
		      packet route), and <literal>ts</literal>
		      (timestamp). The absence of a particular option may be
		      denoted with a leading <literal>!</literal>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>established</term>
		  
		  <listitem>
		    <para>Matches if the packet is part of an already
		      established TCP connection (i.e. it has the RST or ACK
		      bits set). You can optimize the performance of the
		      firewall by placing <emphasis>established</emphasis>
		      rules early in the chain.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>setup</term>
		  
		  <listitem>
		    <para>Matches if the packet is an attempt to establish a
		      TCP connection (the SYN bit set is set but the ACK bit
		      is not).</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>tcpflags <replaceable>flags</replaceable></term>
		  
		  <listitem>
		    <para>Matches if the TCP header contains the comma
		      separated list of <replaceable>flags</replaceable>. The
		      supported flags are <literal>fin</literal>,
		      <literal>syn</literal>, <literal>rst</literal>,
		    <literal>psh</literal>, <literal>ack</literal>, and
		    <literal>urg</literal>. The absence of a particular
		    flag may be indicated by a leading <literal>!</literal>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>icmptypes <replaceable>types</replaceable></term>
		  
		  <listitem>
		    <para>Matches if the ICMP type is present in the list
		      <replaceable>types</replaceable>. The list may be specified
		      as any combination of ranges and/or individual types
		      separated by commas. Commonly used ICMP types are:
		      <literal>0</literal> echo reply (ping reply),
		      <literal>5</literal> redirect, <literal>8</literal> echo request (ping request), and
		      <literal>11</literal> time exceeded (used to
		      indicate TTL expiration as with
		      <citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>).</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Listing the IPFW rules</title>
	    
	    <para>The syntax for this form of the command is:
	      <cmdsynopsis>
		<command>ipfw</command>
		<arg>-a</arg>
		<arg>-t</arg>
		<arg>-N</arg>
		<arg choice="plain">l</arg>
	      </cmdsynopsis></para>
	    
	    <para>There are three valid flags when using this form of the
	      command:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>-a</term>
		  <listitem>
		    <para>While listing, show counter values. This option is
		      the only way to see accounting counters.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-t</term>
		  
		  <listitem>
		    <para>Display the last match times for each chain entry.
		      The time listing is incompatible with the input syntax
		      used by the <citerefentry><refentrytitle>ipfw</refentrytitle><manvolnum>8</manvolnum></citerefentry> utility.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-N</term>
		  
		  <listitem>
		    <para>Attempt to resolve given addresses and service
		      names.</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Flushing the IPFW rules</title>
	    
	    <para>The syntax for flushing the chain is:
	      <cmdsynopsis>
		<command>ipfw</command>
		<arg choice="plain">flush</arg>
	      </cmdsynopsis></para>
	    
	    <para>This causes all entries in the firewall chain to be removed
	      except the fixed default policy enforced by the kernel (index
	      65535). Use caution when flushing rules, the default deny
	      policy will leave your system cut off from the network until
	      allow entries are added to the chain.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Clearing the IPFW packet counters</title>
	    
	    <para>The syntax for clearing one or more packet counters is:
	      <cmdsynopsis>
		<command>ipfw</command>
		<arg choice="plain">zero</arg>
		<arg choice="opt"><replaceable>index</replaceable></arg>
	      </cmdsynopsis></para>
	    
	    <para>When used without an <replaceable>index</replaceable> argument,
	      all packet counters are cleared. If an
	      <replaceable>index</replaceable> is supplied, the clearing operation
	      only affects a specific chain entry.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Example commands for ipfw</title>
	  
	  <para>This command will deny all packets from the host
	    <hostid role="fqdn">evil.hacker.org</hostid> to the telnet port of the
	    host <hostid role="fqdn">nice.people.org</hostid> by being forwarded by
	    the router:</para>
	  
	  <informalexample>
	    <screen>&prompt.root <userinput>ipfw add deny tcp from evil.hacker.org to nice.people.org 23</userinput></screen>
	  </informalexample>
	  
	  <para>The next example denies and logs any TCP traffic from the
	    entire <hostid role="domainname">hacker.org</hostid> network (a class C) to the
	    <hostid role="fqdn">nice.people.org</hostid> machine (any port).</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ipfw add deny log tcp from evil.hacker.org/24 to nice.people.org</userinput></screen>
	  </informalexample>
	  
	  <para>If you do not want people sending X sessions to your internal
	    network (a subnet of a class C), the following command will do the
	    necessary filtering:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ipfw add deny tcp from any to my.org/28 6000 setup</userinput></screen>
	  </informalexample>
	  
	  <para>To see the accounting records:
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>ipfw -a list</userinput></screen>
	    </informalexample> or in the short form
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>ipfw -a l</userinput></screen>
	    </informalexample> You can also see the last time a chain entry
	    was matched with:</para>
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>ipfw -at l</userinput></screen>
	    </informalexample>
	  
	</sect2>
	
	<sect2>
	  <title>Building a packet filtering firewall</title>
	  
	  <note>
	    <para>The following suggestions are just that: suggestions. The
	      requirements of each firewall are different and I cannot tell
	      you how to build a firewall to meet your particular
	      requirements.</para>
	  </note>
	  
	  <para>When initially setting up your firewall, unless you have a
	    test bench setup where you can configure your firewall host in a
	    controlled environment, I strongly recommend you use the logging
	    version of the commands and enable logging in the kernel. This
	    will allow you to quickly identify problem areas and cure them
	    without too much disruption. Even after the initial setup phase is
	    complete, I recommend using the logging for of `deny' as it allows
	    tracing of possible attacks and also modification of the firewall
	    rules if your requirements alter.</para>
	  
	  <note>
	    <para>If you use the logging versions of the <command>accept</command> command, it can generate
	      <emphasis>large</emphasis> amounts of log data as one log line
	      will be generated for every packet that passes through the
	      firewall, so large ftp/http transfers, etc, will really slow the
	      system down. It also increases the latencies on those packets as
	      it requires more work to be done by the kernel before the packet
	      can be passed on. syslogd with also start using up a lot more
	      processor time as it logs all the extra data to disk, and it
	      could quite easily fill the partition
	      <filename>/var/log</filename> is located on.</para>
	  </note>
	  
	  <para>As currently supplied, FreeBSD does not have the ability to
	    load firewall rules at boot time. My suggestion is to put a call
	    to a shell script in the <filename>/etc/netstart</filename>
	    script. Put the call early enough in the netstart file so that the
	    firewall is configured before any of the IP interfaces are
	    configured. This means that there is no window during which time
	    your network is open.</para>
	  
	  <para>The actual script used to load the rules is entirely up to
	    you. There is currently no support in the <command>ipfw</command> utility for loading multiple rules in
	    the one command. The system I use is to use the command:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ipfw list</userinput></screen>
	  </informalexample>
	  
	  <para>to write a list of the current rules out to a file, and then
	    use a text editor to prepend <literal>ipfw
	    </literal> before all the lines. This will allow the script to
	    be fed into /bin/sh and reload the rules into the kernel. Perhaps
	    not the most efficient way, but it works.</para>
	  
	  <para>The next problem is what your firewall should actually
	    <emphasis>do</emphasis>! This is largely dependent on what access to
	    your network you want to allow from the outside, and how much
	    access to the outside world you want to allow from the inside.
	    Some general rules are:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Block all incoming access to ports below 1024 for TCP.
		  This is where most of the security sensitive services are,
		  like finger, SMTP (mail) and telnet.</para>
	      </listitem>
	      
	      <listitem>
		<para>Block <emphasis>all</emphasis> incoming UDP
		  traffic. There are very few useful services that travel over
		  UDP, and what useful traffic there is is normally a security
		  threat (e.g. Suns RPC and NFS protocols). This has its
		  disadvantages also, since UDP is a connectionless protocol,
		  denying incoming UDP traffic also blocks the replies to
		  outgoing UDP traffic. This can cause a problem for people
		  (on the inside) using external archie (prospero) servers.
		  If you want to allow access to archie, you'll have to allow
		  packets coming from ports 191 and 1525 to any internal UDP
		  port through the firewall. ntp is another service you may
		  consider allowing through, which comes from port 123.</para>
	      </listitem>
	      
	      <listitem>
		<para>Block traffic to port 6000 from the outside. Port 6000
		  is the port used for access to X11 servers, and can be a
		  security threat (especially if people are in the habit of
		  doing <command>xhost +</command> on their
		  workstations). X11 can actually use a range of ports
		  starting at 6000, the upper limit being how many X displays
		  you can run on the machine. The upper limit as defined by
		  RFC 1700 (Assigned Numbers) is 6063.</para>
	      </listitem>
	      
	      <listitem>
		<para>Check what ports any internal servers use (e.g. SQL
		  servers, etc). It is probably a good idea to block those as
		  well, as they normally fall outside the 1-1024 range
		  specified above.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>Another checklist for firewall configuration is available from
	    CERT at <ulink
	      URL="ftp://ftp.cert.org/pub/tech_tips/packet_filtering">ftp://ftp.cert.org/pub/tech_tips/packet_filtering</ulink></para>
	  
	  <para>As I said above, these are only
	    <emphasis>guidelines</emphasis>. You will have to decide what
	    filter rules you want to use on your firewall yourself. I cannot
	    accept ANY responsibility if someone breaks into your network,
	    even if you follow the advice given above.</para>
	  
	</sect2>
      </sect1>
    </chapter>
    
    <chapter id="printing">
      <title>Printing</title>
      
      <para><emphasis>Contributed by &a.kelly;<!-- <br> -->30 September
	  1995</emphasis></para>
      
      <para>In order to use printers with FreeBSD, you will need to set them
	up to work with the Berkeley line printer spooling system, also known
	as the LPD spooling system. It is the standard printer control system
	in FreeBSD. This section introduces the LPD spooling system, often
	simply called LPD.</para>
      
      <para>If you are already familiar with LPD or another printer spooling
	system, you may wish to skip to section <xref
	  linkend="printing-intro-setup" remap="Setting up the spooling
	  system">.</para>
      
      
      <sect1 id="printing-intro-spooler">
	<title>What the Spooler Does</title>
	
	<para>LPD controls everything about a host's printers. It is
	  responsible for a number of things:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>It controls access to attached printers and printers
		attached to other hosts on the network.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It enables users to submit files to be printed; these
		submissions are known as <emphasis>jobs</emphasis>.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It prevents multiple users from accessing a printer at the
		same time by maintaining a <emphasis>queue</emphasis> for each
		printer.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It can print <emphasis>header pages</emphasis> (also known
		as <emphasis>banner</emphasis> or <emphasis>burst</emphasis>
		pages) so users can easily find jobs they have printed in a
		stack of printouts.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It takes care of communications parameters for printers
		connected on serial ports.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It can send jobs over the network to another LPD spooler
		on another host.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It can run special filters to format jobs to be printed
		for various printer languages or printer capabilities.</para>
	    </listitem>
	    
	    <listitem>
	      <para>It can account for printer usage.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>Through a configuration file, and by providing the special
	  filter programs, you can enable the LPD system to do all or some
	  subset of the above for a great variety of printer hardware.</para>
	
      </sect1>
      
      <sect1 id="printing-intro-why">
	<title>Why You Should Use the Spooler</title>
	
	<para>If you are the sole user of your system, you may be wondering
	  why you should bother with the spooler when you do not need access
	  control, header pages, or printer accounting. While it is possible
	  to enable direct access to a printer, you should use the spooler
	  anyway since</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>LPD prints jobs in the background; you do not have to wait
		for data to be copied to the printer.</para>
	    </listitem>
	    
	    <listitem>
	      <para>LPD can conveniently run a job to be printed through
		filters to add date/time headers or convert a special file
		format (such as a TeX DVI file) into a format the printer will
		understand. You will not have to do these steps manually.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Many free and commercial programs that provide a print
		feature usually expect to talk to the spooler on your system.
		By setting up the spooling system, you will more easily
		support other software you may later add or already
		have.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="printing-intro-setup">
	<title>Setting Up the Spooling System</title>
	
	<para>To use printers with the LPD spooling system, you will need to
	  set up both your printer hardware and the LPD software. This
	  document describes two levels of setup:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>See section <xref linkend="printing-simple" remap="Simple
		  Printer Setup"> to learn how to connect a printer, tell LPD
		how to communicate with it, and print plain text files to the
		printer.</para>
	    </listitem>
	    
	    <listitem>
	      <para>See section <xref linkend="printing-advanced"
		  remap="Advanced Printer Setup"> to find out how to print a
		variety of special file formats, to print header pages, to
		print across a network, to control access to printers, and to
		do printer accounting.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="printing-simple">
	<title>Simple Printer Setup</title>
	
	<para>This section tells how to configure printer hardware and the
	  LPD software to use the printer. It teaches the basics:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Section <xref linkend="printing-hardware" remap="Hardware
		  Setup"> gives some hints on connecting the printer to a port
		on your computer.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Section <xref linkend="printing-software" remap="Software
		  Setup"> shows how to setup the LPD spooler configuration
		file <filename>/etc/printcap</filename>.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>If you are setting up a printer that uses a network protocol to
	  accept data to print instead of a serial or parallel interface, see
	  <xref linkend="printing-advanced-network-net-if" remap="Printers
	    With Networked Data Stream Interaces">.</para>
	
	<para>Although this section is called <quote>Simple Printer Setup,</quote> it is
	  actually fairly complex. Getting the printer to work with your
	  computer and the LPD spooler is the hardest part. The advanced
	  options like header pages and accounting are fairly easy once you
	  get the printer working.</para>
	
	
	<sect2 id="printing-hardware">
	  <title>Hardware Setup</title>
	  
	  <para>This section tells about the various ways you can connect a
	    printer to your PC. It talks about the kinds of ports and cables,
	    and also the kernel configuration you may need to enable FreeBSD
	    to speak to the printer.</para>
	  
	  <para>If you have already connected your printer and have
	    successfully printed with it under another operating system, you
	    can probably skip to section <xref linkend="printing-software"
	      remap="Software Setup">.</para>
	  
	  
	  <sect3 id="printing-ports">
	    <title>Ports and Cables</title>
	    
	    <para>Nearly all printers you can get for a PC today support one
	      or both of the following interfaces:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><emphasis>Serial</emphasis> interfaces use a serial
		    port on your computer to send data to the printer. Serial
		    interfaces are common in the computer industry and cables
		    are readily available and also easy to construct. Serial
		    interfaces sometimes need special cables and might require
		    you to configure somewhat complex communications options.</para>
		</listitem>
		
		<listitem>
		  <para><emphasis>Parallel</emphasis> interfaces use a
		    parallel port on your computer to send data to the
		    printer. Parallel interfaces are common in the PC market.
		    Cables are readily available but more difficult to
		    construct by hand. There are usually no communications
		    options with parallel interfaces, making their
		    configuration exceedingly simple.</para>
		  
		  <para>Parallel interfaces are sometimes known as
		    <quote>Centronics</quote> interfaces, named after the connector type
		    on the printer.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>In general, serial interfaces are slower than parallel
	      interfaces. Parallel interfaces usually offer just one-way
	      communication (computer to printer) while serial gives you
	      two-way. Many newer parallel ports can also receive data from
	      the printer, but only few printers need to send data back to the
	      computer. And FreeBSD does not support two-way parallel
	      communication yet.</para>
	    
	    <para>Usually, the only time you need two-way communication with
	      the printer is if the printer speaks PostScript. PostScript
	      printers can be very verbose. In fact, PostScript jobs are
	      actually programs sent to the printer; they need not produce
	      paper at all and may return results directly to the computer.
	      PostScript also uses two-way communication to tell the computer
	      about problems, such as errors in the PostScript program or
	      paper jams. Your users may be appreciative of such information.
	      Furthermore, the best way to do effective accounting with a
	      PostScript printer requires two-way communication: you ask the
	      printer for its page count (how many pages it has printed in its
	      lifetime), then send the user's job, then ask again for its page
	      count. Subtract the two values and you know how much paper to
	      charge the user.</para>
	    
	    <para>So, which interface should you use?</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>If you need two-way communication, use a serial port.
		    FreeBSD does not yet support two-way communication over a
		    parallel port.</para>
		</listitem>
		
		<listitem>
		  <para>If you do not need two-way communication and can pick
		    parallel or serial, prefer the parallel interface. It
		    keeps a serial port free for other peripherals&mdash;such as a
		    terminal or a modem&mdash;and is faster most of the time. It
		    is also easier to configure.</para>
		</listitem>
		
		<listitem>
		  <para>Finally, use whatever works.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	  </sect3>
	  
	  <sect3 id="printing-parallel">
	    <title>Parallel Ports</title>
	    
	    <para>To hook up a printer using a parallel interface, connect
	      the Centronics cable between the printer and the computer. The
	      instructions that came with the printer, the computer, or both
	      should give you complete guidance.</para>
	    
	    <para>Remember which parallel port you used on the computer. The
	      first parallel port is <filename>/dev/lpt0</filename> to FreeBSD; the second is
	      <filename>/dev/lpt1</filename>, and so on.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-serial">
	    <title>Serial Ports</title>
	    
	    <para>To hook up a printer using a serial interface, connect the
	      proper serial cable between the printer and the computer. The
	      instructions that came with the printer, the computer, or both
	      should give you complete guidance.</para>
	    
	    <para>If you are unsure what the <quote>proper serial cable</quote> is, you
	      may wish to try one of the following alternatives:
	      <itemizedlist>
		
		<listitem>
		  <para>A <emphasis>modem</emphasis> cable connects each pin
		    of the connector on one end of the cable straight through
		    to its corresponding pin of the connector on the other
		    end. This type of cable is also known as a <quote>DTE-to-DCE</quote>
		    cable.</para>
		</listitem>
		
		<listitem>
		  <para>A <emphasis>null-modem</emphasis> cable connects some
		    pins straight through, swaps others (send data to receive
		    data, for example), and shorts some internally in each
		    connector hood. This type of cable is also known as a
		    <quote>DTE-to-DTE</quote> cable.</para>
		</listitem>
		
		<listitem>
		  <para>A <emphasis>serial printer</emphasis> cable, required
		    for some unusual printers, is like the null modem cable,
		    but sends some signals to their counterparts instead of
		    being internally shorted.</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	    
	    <para>You should also set up the communications parameters for the
	      printer, usually through front-panel controls or DIP switches on
	      the printer. Choose the highest bps (bits per second, sometimes
	      <emphasis>baud rate</emphasis>) rate that both your computer and
	      the printer can support. Choose 7 or 8 data bits; none, even,
	      or odd parity; and 1 or 2 stop bits. Also choose a flow control
	      protocol: either none, or XON/XOFF (also known as
	      <quote>in-band</quote> or <quote>software</quote>)
	      flow control. Remember these settings for the software
	      configuration that follows.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-software">
	  <title>Software Setup</title>
	  
	  <para>This section describes the software setup necessary to print
	    with the LPD spooling system in FreeBSD.</para>
	  
	  <para>Here is an outline of the steps involved:</para>
	  
	    <procedure>
	      
	      <step>
		<para>Configure your kernel, if necessary, for the port you
		  are using for the printer; section <xref
		    linkend="printing-kernel" remap="Kernel Configuration">
		  tells you what you need to do.</para>
	      </step>
	      
	      <step>
		<para>Set the communications mode for the parallel port, if
		  you are using a parallel port; section <xref
		    linkend="printing-parallel-port-mode" remap="Setting the
		    Communication Mode for the Parallel Port"> gives details.</para>
	      </step>
	      
	      <step>
		<para>Test if the operating system can send data to the
		  printer. Section <xref linkend="printing-testing"
		    remap="Checking Printer Communications"> gives some
		  suggestions on how to do this.</para>
	      </step>
	      
	      <step>
		<para>Set up LPD for the printer by modifying the file
		  <filename>/etc/printcap</filename>. Section <xref
		    linkend="printing-printcap" remap="The /etc/printcap
		    File"> shows you how.</para>
	      </step>
	      
	    </procedure>
	  
	  <sect3 id="printing-kernel">
	    <title>Kernel Configuration</title>
	    
	    <para>The operating system kernel is compiled to work with a
	      specific set of devices. The serial or parallel interface for
	      your printer is a part of that set. Therefore, it might be
	      necessary to add support for an additional serial or parallel
	      port if your kernel is not already configured for one.</para>
	    
	    <para>To find out if the kernel you are currently using supports a
	      serial interface, type
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>dmesg | grep sio<replaceable>N</replaceable></userinput></screen>
	      </informalexample> where <replaceable>N</replaceable> is the
	      number of the serial port, starting from zero. If you see
	      output similar to the following
	      
	      <informalexample>
		<screen>sio2 at 0x3e8-0x3ef irq 5 on isa
sio2: type 16550A</screen>
	      </informalexample> then the kernel supports the port.</para>
	    
	    <para>To find out if the kernel supports a parallel interface,
	      type
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>dmesg | grep lpt<replaceable>N</replaceable></userinput></screen>
	      </informalexample> where <replaceable>N</replaceable> is the
	      number of the parallel port, starting from zero. If you see
	      output similar to the following
	      
	      <informalexample>
		<screen>lpt0 at 0x378-0x37f on isa</screen>
	      </informalexample> then the kernel supports the port.</para>
	    
	    <para>You might have to reconfigure your kernel in order for the
	      operating system to recognize and use the parallel or serial
	      port you are using for the printer.</para>
	    
	    <para>To add support for a serial port, see the section on kernel
	      configuration. To add support for a parallel port, see that
	      section <emphasis>and</emphasis> the section that
	      follows.</para>
	    
	    
	    <sect4 id="printing-dev-ports">
	      <title>Adding <filename>/dev</filename> Entries for the Ports</title>
	      
	      <para>Even though the kernel may support communication along a
		serial or parallel port, you will still need a software
		interface through which programs running on the system can
		send and receive data. That is what entries in the
		<filename>/dev</filename> directory are for.</para>
	      
	      <para><emphasis>To add a <filename>/dev</filename>
		  entry for a port:</emphasis></para>
	      
		<procedure>
		  
		  <step>
		    <para>Become root with the  <citerefentry>
			<refentrytitle>su</refentrytitle></citerefentry>
		      command. Enter the root password when prompted.</para>
		  </step>
		  
		  <step>
		    <para>Change to the <filename>/dev</filename> directory:
		    
		      <informalexample>
			<screen>&prompt.root; cd /dev</screen>
		      </informalexample></para>
		  </step>
		  
		  <step>
		    <para>Type
		    
		      <informalexample>
			<screen>&prompt.root; <userinput>./MAKEDEV <replaceable>port</replaceable></userinput></screen>
		      </informalexample> where <replaceable>port</replaceable> is the device entry for the
		      port you want to make. Use <literal>lpt0</literal> for the first parallel port,
		      <literal>lpt1</literal> for the second, and
		      so on; use <literal>ttyd0</literal> for the
		      first serial port, <literal>ttyd1</literal>
		      for the second, and so on.</para>
		  </step>
		  
		  <step>
		    <para>Type
		    
		      <informalexample>
			<screen>&prompt.root; <userinput>ls -l <replaceable>port</replaceable></userinput></screen>
		      </informalexample> to make sure the device entry got
		      created.</para>
		  </step>
		  
		</procedure>
	      
	    </sect4>
	    
	    <sect4 id="printing-parallel-port-mode">
	      <title>Setting the Communication Mode for the Parallel Port</title>
	      
	      <para>When you are using the parallel interface, you can choose
		whether FreeBSD should use interrupt-driven or polled
		communication with the printer.</para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para>The <emphasis>interrupt-driven</emphasis> method is
		      the default with the GENERIC kernel. With this method,
		      the operating system uses an IRQ line to determine when
		      the printer is ready for data.</para>
		  </listitem>
		  
		  <listitem>
		    <para>The <emphasis>polled</emphasis> method directs the
		      operating system to repeatedly ask the printer if it is
		      ready for more data. When it responds ready, the kernel
		      sends more data.</para>
		  </listitem>
		  
		</itemizedlist>
	      
	      
	      <para>The interrupt-driven method is somewhat faster but uses up
		a precious IRQ line. You should use whichever one
		works.</para>
	      
	      <para>You can set the communications mode in two ways: by
		configuring the kernel or by using the  <citerefentry>
		  <refentrytitle>lptcontrol</refentrytitle></citerefentry></para>
	      
	      <para>program.</para>
	      
	      <para><emphasis>To set the communications mode by
		  configuring the kernel:</emphasis></para>

		<procedure>
		  
		  <step>
		    <para>Edit your kernel configuration file. Look for or
		      add an <literal>lpt0</literal> entry. If you
		      are setting up the second parallel port, use <literal>lpt1</literal> instead. Use <literal>lpt2</literal> for the third port, and so
		      on.
		      <itemizedlist>
			
			<listitem>
			  <para>If you want interrupt-driven mode, add the
			    <literal>irq</literal> specifier:
			  
			    <programlisting>
device lpt0 at isa? port? tty irq <replaceable>N</replaceable> vector lptintr
			    </programlisting> where <replaceable>N</replaceable> is the IRQ number for your
			    computer's parallel port.</para>
			</listitem>
			
			<listitem>
			  <para>If you want polled mode, do not add the
			    <literal>irq</literal> specifier:</para>
			  
			    <programlisting>
device lpt0 at isa? port? tty vector lptintr
			    </programlisting>
			</listitem>
			
		      </itemizedlist>
		    </para>
		  </step>
		  
		  <step>
		    <para>Save the file. Then configure, build, and install
		      the kernel, then reboot. See <xref
			linkend="kernelconfig" remap="kernel configuration">
		      for more details.</para>
		  </step>
		  
		</procedure>
	      
	      <para><emphasis>To set the communications mode
		  with</emphasis> <citerefentry>
		  <refentrytitle>lptcontrol</refentrytitle></citerefentry>:</para>
	      
		<procedure>
		  
		  <step>
		    <para>Type
		    
		      <informalexample>
			<screen>&prompt.root; <userinput>lptcontrol -i -u <replaceable>N</replaceable></userinput></screen>
		      </informalexample> to set interrupt-driven mode for
		      <literal>lpt<replaceable>N</replaceable></literal>.</para>
		  </step>
		  
		  <step>
		    <para>Type
		    
		      <informalexample>
			<screen>&prompt.root; <userinput>lptcontrol -p -u <replaceable>N</replaceable></userinput></screen>
		      </informalexample> to set polled-mode for <literal>lpt<replaceable>N</replaceable></literal>.</para>
		  </step>
		  
		</procedure>

	      <para>You could put these commands in your
		<filename>/etc/rc.local</filename> file to set the mode each
		time your system boots. See  <citerefentry><refentrytitle>lptcontrol</refentrytitle><manvolnum>8</manvolnum></citerefentry> for more information.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-testing">
	      <title>Checking Printer Communications</title>
	      
	      <para>Before proceeding to configure the spooling system, you
		should make sure the operating system can successfully send
		data to your printer. It is a lot easier to debug printer
		communication and the spooling system separately.</para>
	      
	      <para>To test the printer, we will send some text to it. For
		printers that can immediately print characters sent to them,
		the program  <citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
	      
	      <para>For a PostScript (or other language-based) printer, we
		will need a more sophisticated test. A small PostScript
		program, such as the following, will suffice:

		<programlisting>
%!PS
100 100 moveto 300 300 lineto stroke
310 310 moveto /Helvetica findfont 12 scalefont setfont
(Is this thing working?) show
showpage
		</programlisting>
	      </para>
	      
	      <note>
		<para>When this document refers to a printer language, I am
		  assuming a language like PostScript, and not Hewlett
		  Packard's PCL. Although PCL has great functionality, you can
		  intermingle plain text with its escape sequences.
		  PostScript cannot directly print plain text, and that is the
		  kind of printer language for which we must make special
		  accommodations.</para>
	      </note>
	      
	      <sect5 id="printing-checking-parallel">
		<title>Checking a Parallel Printer</title>
		
		<para>This section tells you how to check if FreeBSD can
		  communicate with a printer connected to a parallel
		  port.</para>
		
		<para><emphasis>To test a printer on a parallel
		    port:</emphasis></para>
		
		  <procedure>
		    
		    <step>
		      <para>Become root with  <citerefentry>
			  <refentrytitle>su</refentrytitle></citerefentry>.</para>
		    </step>
		    
		    <step>
		      <para>Send data to the printer.
			<itemizedlist>
			  
			  <listitem>
			    <para>If the printer can print plain text, then
			      use <citerefentry>
				<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
			    
			      <informalexample>
				<screen>&prompt.root; <userinput>lptest &gt; /dev/lpt<replaceable>N</replaceable></userinput></screen>
			      </informalexample> where <replaceable>N</replaceable> is the number of the
			      parallel port, starting from zero.</para>
			  </listitem>
			  
			  <listitem>
			    <para>If the printer understands PostScript or
			      other printer language, then send a small
			      program to the printer. Type
			    
			      <informalexample>
				<screen>&prompt.root; <userinput>cat &gt; /dev/lpt<replaceable>N</replaceable></userinput></screen>
			      </informalexample> Then, line by line, type the
			      program <emphasis>carefully</emphasis> as you
			      cannot edit a line once you have pressed RETURN
			      or ENTER. When you have finished entering the
			      program, press CONTROL+D, or whatever your end
			      of file key is.</para>
			    
			    <para>Alternatively, you can put the program in a
			      file and type
			    
			      <informalexample>
				<screen>&prompt.root; <userinput>cat <replaceable>file</replaceable> &gt; /dev/lpt<replaceable>N</replaceable></userinput></screen>
			      </informalexample> where <replaceable>file</replaceable> is the name of the
			      file containing the program you want to send to
			      the printer.</para>
			  </listitem>
			  
			</itemizedlist>
		      </para>
		    </step>
		    
		  </procedure>
		
		<para>You should see something print. Do not worry if the
		  text does not look right; we will fix such things
		  later.</para>
		
	      </sect5>
	      
	      <sect5 id="printing-checking-serial">
		<title>Checking a Serial Printer</title>
		
		<para>This section tells you how to check if FreeBSD can
		  communicate with a printer on a serial port.</para>
		
		<para><emphasis>To test a printer on a serial
		    port:</emphasis></para>
		
		  <procedure>
		    
		    <step>
		      <para>Become root with  <citerefentry>
			  <refentrytitle>su</refentrytitle></citerefentry>.</para>
		    </step>
		    
		    <step>
		      <para>Edit the file <filename>/etc/remote</filename>.
			Add the following entry:
		      
			<programlisting>
printer:dv=/dev/<replaceable>port</replaceable>:br#<replaceable>bps-rate</replaceable>:pa=<replaceable>parity</replaceable>
			</programlisting> where <replaceable>port</replaceable> is the device entry for the
			serial port (<literal>ttyd0</literal>,
			<literal>ttyd1</literal>, etc.), <replaceable>bps-rate</replaceable> is the bits-per-second
			rate at which the printer communicates, and
			<replaceable>parity</replaceable> is the parity required by
			the printer (either <literal>even</literal>, <literal>odd</literal>, <literal>none</literal>, or <literal>zero</literal>).</para>
		      
		      <para>Here is a sample entry for a printer connected via
			a serial line to the third serial port at 19200 bps
			with no parity:</para>
		      
			<programlisting>
printer:dv=/dev/ttyd2:br#19200:pa=none
			</programlisting>
		    </step>
		    
		    <step>
		      <para>Connect to the printer with  <citerefentry>
			  <refentrytitle>tip</refentrytitle></citerefentry>. Type:
			<informalexample>
			  <screen>&prompt.root; <userinput>tip printer</userinput></screen>
			</informalexample> If this step does not work, edit
			the file <filename>/etc/remote</filename> again and
			try using
			<filename>/dev/cuaa<replaceable>N</replaceable></filename> instead of <filename>/dev/ttyd<replaceable>N</replaceable></filename>.</para>
		    </step>
		    
		    <step>
		      <para>Send data to the printer.
			<itemizedlist>
			  
			  <listitem>
			    <para>If the printer can print plain text, then
			      use  <citerefentry>
				<refentrytitle>lptest</refentrytitle></citerefentry>. Type:</para>
			    
			      <informalexample>
				<screen><prompt>~</prompt><userinput>$lptest</userinput></screen>
			      </informalexample>
			  </listitem>
			  
			  <listitem>
			    <para>If the printer understands PostScript or
			      other printer language, then send a small
			      program to the printer. Type the program, line
			      by line, <emphasis>very carefully</emphasis> as
			      backspacing or other editing keys may be
			      significant to the printer. You may also need to
			      type a special end-of-file key for the printer
			      so it knows it received the whole program. For
			      PostScript printers, press CONTROL+D.</para>
			    
			    <para>Alternatively, you can put the program in a
			      file and type
			    
			      <informalexample>
				<screen><prompt>~</prompt><userinput>&gt;<replaceable>file</replaceable></userinput></screen>
			      </informalexample> where <replaceable>file</replaceable> is the name of the
			      file containing the program. After
			      <citerefentry>
				<refentrytitle>tip</refentrytitle></citerefentry> sends the file, press any required end-of-file key.</para>
			  </listitem>
			  
			</itemizedlist>
		      </para>
		    </step>
		    
		  </procedure>
		
		<para>You should see something print. Do not worry if the
		  text does not look right; we will fix that later.</para>
		
	      </sect5>
	    </sect4>
	  </sect3>
	  
	  <sect3 id="printing-printcap">
	    <title>Enabling the Spooler: The
	      <filename>/etc/printcap</filename> File</title>
	    
	    <para>At this point, your printer should be hooked up, your
	      kernel configured to communicate with it (if necessary), and you
	      have been able to send some simple data to the printer. Now, we
	      are ready to configure LPD to control access to your
	      printer.</para>
	    
	    <para>You configure LPD by editing the file
	      <filename>/etc/printcap</filename>. The LPD spooling system
	      reads this file each time the spooler is used, so updates to the
	      file take immediate effect.</para>
	    
	    <para>The format of the  <citerefentry>
		<refentrytitle>printcap</refentrytitle></citerefentry> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the  <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
	    
	    <para>The simple spooler configuration consists of the following
	      steps:</para>
	      
	      <procedure>
		
		<step>
		  <para>Pick a name (and a few convenient aliases) for the
		    printer, and put them in the
		    <filename>/etc/printcap</filename> file; see <xref
		      linkend="printing-naming" remap="Naming the Printer">.</para>
		</step>
		
		<step>
		  <para>Turn off header pages (which are on by default) by
		    inserting the <literal>sh</literal> capability;
		    see <xref linkend="printing-no-header-pages"
		      remap="Suppressing Header   Pages">.</para>
		</step>
		
		<step>
		  <para>Make a spooling directory, and specify its location
		    with the <literal>sd</literal> capability; see
		    <xref linkend="printing-spooldir"
		      remap="Making the Spooling   Directory">.</para>
		</step>
		
		<step>
		  <para>Set the <filename>/dev</filename> entry to use for the
		    printer, and note it in <filename>/etc/printcap</filename>
		    with the <literal>lp</literal> capability; see
		    <xref
		      linkend="printing-device" remap="Identifying the Printer
		      Device">. Also, if the printer is on a serial port, set
		    up the communication parameters with the
		  <literal>fs</literal>, <literal>fc</literal>,
		  <literal>xs</literal>, and <literal>xc</literal> capabilities; see <xref
		      linkend="printing-commparam" remap="Configuring Spooler
		      Communications Parameters">.</para>
		</step>
		
		<step>
		  <para>Install a plain text input filter; see <xref
		      linkend="printing-textfilter" remap="Installing the Text
		      Filter"></para>
		</step>
		
		<step>
		  <para>Test the setup by printing something with the
		    <citerefentry>
		      <refentrytitle>lpr</refentrytitle></citerefentry>
		    command; see <xref linkend="printing-trying" remap="Trying
		      It Out"> and <xref linkend="printing-troubleshooting"
		      remap="Troubleshooting">.</para>
		</step>
		
	      </procedure>

	    <note>
	      <para>Language-based printers, such as PostScript printers,
		cannot directly print plain text. The simple setup outlined
		above and described in the following sections assumes that if
		you are installing such a printer you will print only files
		that the printer can understand.</para>
	    </note>
	    
	    <para>Users often expect that they can print plain text to any of
	      the printers installed on your system. Programs that interface
	      to LPD to do their printing usually make the same assumption.
	      If you are installing such a printer and want to be able to
	      print jobs in the printer language <emphasis>and</emphasis>
	      print plain text jobs, you are strongly urged to add an
	      additional step to the simple setup outlined above: install an
	      automatic plain-text-to-PostScript (or other printer language)
	      conversion program. Section <xref
		linkend="printing-advanced-if-conversion" remap="Accommodating
		Plain Text Jobs on PostScript Printers"> tells how to do
	      this.</para>
	    
	    
	    <sect4 id="printing-naming">
	      <title>Naming the Printer</title>
	      
	      <para>The first (easy) step is to pick a name for your printer.
		It really does not matter whether you choose functional or
		whimsical names since you can also provide a number aliases
		for the printer.</para>
	      
	      <para>At least one of the printers specified in the
		<filename>/etc/printcap</filename> should have the alias
		<literal>lp</literal>. This is the default
		printer's name. If users do not have the PRINTER environment
		variable nor specify a printer name on the command line of any
		of the LPD commands, then <literal>lp</literal>
		will be the default printer they get to use.</para>
	      
	      <para>Also, it is common practice to make the last alias for a
		printer be a full description of the printer, including make
		and model.</para>
	      
	      <para>Once you have picked a name and some common aliases, put
		them in the <filename>/etc/printcap</filename> file. The name
		of the printer should start in the leftmost column. Separate
		each alias with a vertical bar and put a colon after the last
		alias.</para>
	      
	      <para>In the following example, we start with a skeletal
		<filename>/etc/printcap</filename> that defines two printers
		(a Diablo 630 line printer and a Panasonic KX-P4455 PostScript
		laser printer):

		<programlisting>
#
#  /etc/printcap for host rose
#
rattan|line|diablo|lp|Diablo 630 Line Printer:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:
		</programlisting>
		 In this example, the first printer is named
		<literal>rattan</literal> and has as aliases
		<literal>line</literal>, <literal>diablo</literal>,
		<literal>lp</literal>, and <literal>Diablo 630
		  Line Printer</literal>. Since it has the alias <literal>lp</literal>, it is also the default printer. The
		second is named <literal>bamboo</literal>, and has
		as aliases <literal>ps</literal>,
		<literal>PS</literal>, <literal>S</literal>,
		<literal>panasonic</literal>, and <literal>Panasonic KX-P4455 PostScript
		  v51.4</literal>.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-no-header-pages">
	      <title>Suppressing Header Pages</title>
	      
	      <para>The LPD spooling system will by default print a
		<emphasis>header page</emphasis> for each job. The header
		page contains the user name who requested the job, the host
		from which the job came, and the name of the job, in nice
		large letters. Unfortunately, all this extra text gets in the
		way of debugging the simple printer setup, so we will suppress
		header pages.</para>
	      
	      <para>To suppress header pages, add the <literal>sh</literal> capability to the entry for the
		printer in <filename>/etc/printcap</filename>. Here is the
		example <filename>/etc/printcap</filename> with <literal>sh</literal> added:</para>
		
		<programlisting>
#
#  /etc/printcap for host rose - no header pages anywhere
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:
		</programlisting>

	      <para>Note how we used the correct format: the
		first line starts in the leftmost column, and subsequent lines
		are indented with a single TAB. Every line in an entry except
		the last ends in a backslash character.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-spooldir">
	      <title>Making the Spooling Directory</title>
	      
	      <para>The next step in the simple spooler setup is to make a
		<emphasis>spooling directory</emphasis>, a directory where
		print jobs reside until they are printed, and where a number
		of other spooler support files live.</para>
	      
	      <para>Because of the variable nature of spooling directories, it
		is customary to put these directories under
		<filename>/var/spool</filename>. It is not necessary to
		backup the contents of spooling directories, either.
		Recreating them is as simple as running  <citerefentry>
		  <refentrytitle>mkdir</refentrytitle></citerefentry>.</para>
	      
	      <para>It is also customary to make the directory with a name
		that is identical to the name of the printer, as shown below:
		
		<informalexample>
		  <screen>&prompt.root; <userinput>mkdir /var/spool/<replaceable>printer-name</replaceable></userinput></screen>
		</informalexample> However, if you have a lot of printers on
		your network, you might want to put the spooling directories
		under a single directory that you reserve just for printing
		with LPD. We will do this for our two example printers
		<literal>rattan</literal> and <literal>bamboo</literal>:</para>
		
		<informalexample>
		  <screen>&prompt.root; <userinput>mkdir /var/spool/lpd</userinput>
&prompt.root; <userinput>mkdir /var/spool/lpd/rattan</userinput>
&prompt.root; <userinput>mkdir /var/spool/lpd/bamboo</userinput></screen>
		</informalexample>

	      <note>
		<para>If you are concerned about the privacy of jobs that
		  users print, you might want to protect the spooling
		  directory so it is not publicly accessible. Spooling
		  directories should be owned and be readable, writable, and
		  searchable by user daemon and group daemon, and no one else.
		  We will do this for our example printers:</para>
		
		
		  <informalexample>
		    <screen>&prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/rattan</userinput>
&prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/bamboo</userinput>
&prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan</userinput>
&prompt.root; <userinput>chmod 770 /var/spool/lpd/bamboo</userinput></screen>
		  </informalexample>
	      </note>
	      
	      <para>Finally, you need to tell LPD about these directories
		using the <filename>/etc/printcap</filename> file. You
		specify the pathname of the spooling directory with the
		<literal>sd</literal> capability:</para>

		<programlisting>
#
#  /etc/printcap for host rose - added spooling directories
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:
		</programlisting>

	      <para>Note that the name of the printer starts in
		the first column but all other entries describing the printer
		should be indented with a tab and each line escaped with a
		backslash.</para>
	      
	      <para>If you do not specify a spooling directory with <literal>sd</literal>, the spooling system will use
		<filename>/var/spool/lpd</filename> as a default.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-device">
	      <title>Identifying the Printer Device</title>
	      
	      <para>In section <xref linkend="printing-dev-ports"
		  remap="Adding   /dev Entries for the Ports">, we identified
		which entry in the <filename>/dev</filename> directory FreeBSD
		will use to communicate with the printer. Now, we tell LPD
		that information. When the spooling system has a job to
		print, it will open the specified device on behalf of the
		filter program (which is responsible for passing data to the
		printer).</para>
	      
	      <para>List the <filename>/dev</filename> entry pathname in the
		<filename>/etc/printcap</filename> file using the <literal>lp</literal> capability.</para>
	      
	      <para>In our running example, let us assume that <hostid>rattan</hostid> is on the first parallel port,
		and <hostid>bamboo</hostid> is on a sixth serial
		port; here are the additions to
		<filename>/etc/printcap</filename>:</para>
		
		<programlisting>
#
#  /etc/printcap for host rose - identified what devices to use
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:\
        :lp=/dev/ttyd5:
		</programlisting>
	      
	      <para>If you do not specify the <literal>lp</literal>
		capability for a printer in your
		<filename>/etc/printcap</filename> file, LPD uses
		<filename>/dev/lp</filename> as a default.
		<filename>/dev/lp</filename> currently does not exist in
		FreeBSD.</para>
	      
	      <para>If the printer you are installing is connected to a
		parallel port, skip to the section <xref
		  linkend="printing-textfilter" remap="Installing        the
		  Text Filter">. Otherwise, be sure to follow the
		instructions in the next section.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-commparam">
	      <title>Configuring Spooler Communication Parameters</title>
	      
	      <para>For printers on serial ports, LPD can set up the bps
		rate, parity, and other serial communication parameters on
		behalf of the filter program that sends data to the printer.
		This is advantageous since
		
		<itemizedlist>
		  
		  <listitem>
		    <para>It lets you try different communication parameters
		      by simply editing the <filename>/etc/printcap</filename>
		      file; you do not have to recompile the filter program.</para>
		  </listitem>
		  
		  <listitem>
		    <para>It enables the spooling system to use the same
		      filter program for multiple printers which may have
		      different serial communication settings.</para>
		  </listitem>
		  
		</itemizedlist>
	      </para>
	      
	      <para>The following <filename>/etc/printcap</filename>
		capabilities control serial communication parameters of the
		device listed in the <literal>lp</literal>
		capability:

		<variablelist>
		  <varlistentry><term><literal>br#<replaceable>bps-rate</replaceable></literal></term>
		    <listitem>
		      <para>Sets the communications speed of the device to
			<replaceable>bps-rate</replaceable>, where
			<replaceable>bps-rate</replaceable> can be 50, 75,
			110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
			9600, 19200, or 38400 bits-per-second.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term><literal>fc#<replaceable>clear-bits</replaceable></literal></term>
		    
		    <listitem>
		      <para>Clears the flag bits
			<replaceable>clear-bits</replaceable> in the
			<replaceable>sgttyb</replaceable> structure after opening
			the device.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term><literal>fs#<replaceable>set-bits</replaceable></literal></term>
		    
		    <listitem>
		      <para>Sets the flag bits
			<replaceable>set-bits</replaceable> in the
			<replaceable>sgttyb</replaceable> structure.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term><literal>xc#<replaceable>clear-bits</replaceable></literal></term>
		    
		    <listitem>
		      <para>Clears local mode bits <replaceable>clear-bits</replaceable> after opening the
			device.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term><literal>xs#<replaceable>set-bits</replaceable></literal></term>
		    
		    <listitem>
		      <para>Sets local mode bits <replaceable>set-bits</replaceable>.</para>
		      
		    </listitem>
		  </varlistentry>
		</variablelist> For more information on the bits for the
		<literal>fc</literal>, <literal>fs</literal>, <literal>xc</literal>,
		and <literal>xs</literal> capabilities, see the
		file
		<filename>/usr/include/sys/ioctl_compat.h</filename>.</para>
	      
	      <para>When LPD opens the device specified by the <literal>lp</literal> capability, it reads the flag bits in
		the <literal>sgttyb</literal> structure; it clears
		any bits in the <literal>fc</literal> capability,
		then sets bits in the <literal>fs</literal>
		capability, then applies the resultant setting. It does the
		same for the local mode bits as well.</para>
	      
	      <para>Let us add to our example printer on the sixth serial
		port. We will set the bps rate to 38400. For the flag bits,
		we will set the TANDEM, ANYP, LITOUT, FLUSHO, and PASS8 flags.
		For the local mode bits, we will set the LITOUT and PASS8
		flags:</para>

		<programlisting>
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:\
        :lp=/dev/ttyd5:fs#0x82000c1:xs#0x820:
		</programlisting>
	      
	    </sect4>
	    
	    <sect4 id="printing-textfilter">
	      <title>Installing the Text Filter</title>
	      
	      <para>We are now ready to tell LPD what text filter to use to
		send jobs to the printer. A <emphasis>text filter</emphasis>,
		also known as an <emphasis>input filter</emphasis>, is a
		program that LPD runs when it has a job to print. When LPD
		runs the text filter for a printer, it sets the filter's
		standard input to the job to print, and its standard output to
		the printer device specified with the <literal>lp</literal> capability. The filter is expected
		to read the job from standard input, perform any necessary
		translation for the printer, and write the results to standard
		output, which will get printed. For more information on the
		text filter, see section <xref
		  linkend="printing-advanced-filters"
		  remap="Filters">.</para>
	      
	      <para>For our simple printer setup, the text filter can be a
		small shell script that just executes
		<command>/bin/cat</command> to send the job to the printer.
		FreeBSD comes with another filter called <filename>lpf</filename> that handles backspacing and
		underlining for printers that might not deal with such
		character streams well. And, of course, you can use any other
		filter program you want. The filter <command>lpf</command> is described in detail in section
		<xref linkend="printing-advanced-lpf" remap="lpf: a
		  Text Filter">.</para>
	      
	      <para>First, let us make the shell script
		<filename>/usr/local/libexec/if-simple</filename> be a simple
		text filter. Put the following text into that file with your
		favorite text editor:
		
		<programlisting>
#!/bin/sh
#
# if-simple - Simple text input filter for lpd
# Installed in /usr/local/libexec/if-simple
#
# Simply copies stdin to stdout.  Ignores all filter arguments.

/bin/cat &amp;&amp; exit 0
exit 2
		</programlisting>
		Make the file executable:</para>
		
		<informalexample>
		  <screen>&prompt.root; <userinput>chmod 555 /usr/local/libexec/if-simple</userinput></screen>
		</informalexample>
	      
	      <para>And then tell LPD to use it by specifying it with the
		<literal>if</literal> capability in
		<filename>/etc/printcap</filename>. We will add it to the two
		printers we have so far in the example
		<filename>/etc/printcap</filename>:</para>
		
		<programlisting>
#
#  /etc/printcap for host rose - added text filter
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\
        :if=/usr/local/libexec/if-simple:
		</programlisting>
	      
	    </sect4>
	    
	    <sect4 id="printing-trying">
	      <title>Trying It Out</title>
	      
	      <para>You have reached the end of the simple LPD setup.
		Unfortunately, congratulations are not quite yet in order,
		since we still have to test the setup and correct any
		problems. To test the setup, try printing something. To
		print with the LPD system, you use the command  <citerefentry>
		  <refentrytitle>lpr</refentrytitle></citerefentry>,
		which submits a job for printing.</para>
	      
	      <para>You can combine  <citerefentry>
		  <refentrytitle>lpr</refentrytitle></citerefentry>
		with the  <citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry> program, introduced in section <xref linkend="printing-testing"
		  remap="Checking Printer Communications"> to generate some
		test text.</para>
	      
	      <para><emphasis>To test the simple LPD
		  setup:</emphasis></para>
	      
	      <para>Type:</para>
		
		<informalexample>
		  <screen>&prompt.root; <userinput>lptest 20 5 | lpr -P<replaceable>printer-name</replaceable></userinput></screen>
		</informalexample>

	      <para>Where <replaceable>printer-name</replaceable> is a the name of a printer
		(or an alias) specified in <filename>/etc/printcap</filename>.
		To test the default printer, type  <citerefentry>
		  <refentrytitle>lpr</refentrytitle></citerefentry>
		without any <option>-P</option> argument. Again, if you are
		testing a printer that expects PostScript, send a PostScript
		program in that language instead of using  <citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry>. You
		can do so by putting the program in a file and typing <command>lpr <replaceable>file</replaceable></command>.</para>
	      
	      <para>For a PostScript printer, you should get the results of
		the program. If you are using  <citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry>, then your results should look like the following:</para>
	      
	      <programlisting>
!"#$%&amp;'()*+,-./01234
"#$%&amp;'()*+,-./012345
#$%&amp;'()*+,-./0123456
$%&amp;'()*+,-./01234567
%&amp;'()*+,-./012345678
	      </programlisting>
	      
	      <para>To further test the printer, try downloading larger
		programs (for language-based printers) or running</para>
	      
	      <para><citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
	      
	      <para>If the printer did not work, see the next section, <xref
		  linkend="printing-troubleshooting"
		  remap="Troubleshooting">.</para>
	      
	    </sect4>
	    
	    <sect4 id="printing-troubleshooting">
	      <title>Troubleshooting</title>
	      
	      <para>After performing the simple test with  <citerefentry>
		  <refentrytitle>lptest</refentrytitle></citerefentry>, you
		might have gotten one of the following results instead of the
		correct printout:</para>
	      
		<variablelist>
		  <varlistentry><term>It worked, after awhile; or, it did not
		      eject a full sheet.</term>
		    <listitem>
		      <para>The printer printed the above, but it sat for
			awhile and did nothing. In fact, you might have
			needed to press a PRINT REMAINING or FORM FEED button
			on the printer to get any results to appear.</para>
		      
		      <para>If this is the case, the printer was probably
			waiting to see if there was any more data for your job
			before it printed anything. To fix this problem, you
			can have the text filter send a FORM FEED character
			(or whatever is necessary) to the printer. This is
			usually sufficient to have the printer immediately
			print any text remaining in its internal buffer. It
			is also useful to make sure each print job ends on a
			full sheet, so the next job does not start somewhere
			on the middle of the last page of the previous
			job.</para>
		      
		      <para>The following replacement for the shell script
			<filename>/usr/local/libexec/if-simple</filename>
			prints a form feed after it sends the job to the
			printer:</para>

			<programlisting>
#!/bin/sh
#
# if-simple - Simple text input filter for lpd
# Installed in /usr/local/libexec/if-simple
#
# Simply copies stdin to stdout.  Ignores all filter arguments.
# Writes a form feed character (\f) after printing job.

/bin/cat &amp;&amp; printf "\f" &amp;&amp; exit 0
exit 2
			</programlisting>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>It produced the <quote>staircase
		      effect.</quote></term>
		    
		    <listitem>
		      <para>You got the following on paper:

			<programlisting>
!"#$%&amp;'()*+,-./01234
			    "#$%&amp;'()*+,-./012345
			                                 #$%&amp;'()*+,-./0123456
			</programlisting>
			You have become another victim of
			the <emphasis>staircase effect</emphasis>, caused by
			conflicting interpretations of what characters should
			indicate a new-line. UNIX-style operating systems use
			a single character: ASCII code 10, the line feed (LF).
			MS-DOS, OS/2, and others uses a pair of characters,
			ASCII code 10 <emphasis>and</emphasis> ASCII code 13
			(the carriage return or CR). Many printers use the
			MS-DOS convention for representing new-lines.</para>
		      
		      <para>When you print with FreeBSD, your text used just
			the line feed character. The printer, upon seeing a
			line feed character, advanced the paper one line, but
			maintained the same horizontal position on the page
			for the next character to print. That is what the
			carriage return is for: to move the location of the
			next character to print to the left edge of the
			paper.</para>

		      <!-- This para needs to be rewritten - Nik -->
		      <para>Here is what FreeBSD wants your printer to
		      do:</para>
		    
			<informalexample>
			  <screen>Printer received CR		Printer prints
			    CR Printer received LF		Printer prints
			    CR + LF</screen>
			</informalexample>
		      
		      <para>Here are some ways to achieve this:
			<itemizedlist>
			  
			  <listitem>
			    <para>Use the printer's configuration switches or
			      control panel to alter its interpretation of
			      these characters. Check your printer's manual
			      to find out how to do this.</para>

			    <note>
			      <para>If you boot your system into other
				operating systems besides FreeBSD, you may
				have to <emphasis>reconfigure</emphasis> the
				printer to use a an interpretation for CR and
				LF characters that those other operating
				systems use. You might prefer one of the
				other solutions, below.</para>
			    </note>
			  </listitem>
			  
			  <listitem>
			    <para>Have FreeBSD's serial line driver
			      automatically convert LF to CR+LF. Of course,
			      this works with printers on serial ports
			      <emphasis>only</emphasis>. To enable this
			      feature, set the CRMOD bit in <emphasis
				remap=tt>fs</emphasis> capability in the
			      <filename>/etc/printcap</filename> file for the
			      printer.</para>
			  </listitem>
			  
			  <listitem>
			    <para>Send an <emphasis>escape code</emphasis> to
			      the printer to have it temporarily treat LF
			      characters differently. Consult your printer's
			      manual for escape codes that your printer might
			      support. When you find the proper escape code,
			      modify the text filter to send the code first,
			      then send the print job.</para>
			    
			    <para>Here is an example text filter for printers
			      that understand the Hewlett-Packard PCL escape
			      codes. This filter makes the printer treat LF
			      characters as a LF and CR; then it sends the
			      job; then it sends a form feed to eject the last
			      page of the job. It should work with nearly all
			      Hewlett Packard printers.</para>
			    
			    <programlisting>
#!/bin/sh
#
# hpif - Simple text input filter for lpd for HP-PCL based printers
# Installed in /usr/local/libexec/hpif
#
# Simply copies stdin to stdout.  Ignores all filter arguments.
# Tells printer to treat LF as CR+LF. Writes a form feed character
# after printing job.

printf "\033&amp;k2G" &amp;&amp; cat &amp;&amp; printf "\f" &amp;&amp; exit 0
exit 2
			    </programlisting>
			    
			    <para>Here is an example
			      <filename>/etc/printcap</filename> from a host
			      called orchid. It has a single printer attached
			      to its first parallel port, a Hewlett Packard
			      LaserJet 3Si named <hostid>teak</hostid>. It is using the
			      above script as its text filter:</para>

			      <programlisting>
#
#  /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
        :lp=/dev/lpt0:sh:sd=/var/spool/lpd/teak:mx#0:\
        :if=/usr/local/libexec/hpif:
			      </programlisting>
			  </listitem>
			  
			</itemizedlist>
		      </para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>It overprinted each line.</term>
		    
		    <listitem>
		      <para>The printer never advanced a line. All of the
			lines of text were printed on top of each other on one
			line.</para>
		      
		      <para>This problem is the <quote>opposite</quote> of the staircase
			effect, described above, and is much rarer. Somewhere,
			the LF characters that FreeBSD uses to end a line are
			being treated as CR characters to return the print
			location to the left edge of the paper, but not also
			down a line.</para>

		      <!-- Need to rewrite this para -->
		      <para>Use the printer's configuration switches or
			control panel to enforce the following interpretation
			of LF and CR characters:</para>

		    <informaltable>
		      <tgroup cols="2">
			<thead>
			  <row>
			    <entry>Printer receives</entry>
			    <entry>Printer prints</entry>
			  </row>
			</thead>

			<tbody>
			  <row>
			    <entry>CR</entry>
			    <entry>CR</entry>
			  </row>

			  <row>
			    <entry>LF</entry>
			    <entry>CR + LF</entry>
			  </row>
			</tbody>
		      </tgroup>
		    </informaltable>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>The printer lost characters.</term>
		    
		    <listitem>
		      <para>While printing, the printer did not print a few
			characters in each line. The problem might have
			gotten worse as the printer ran, losing more and more
			characters.</para>
		      
		      <para>The problem is that the printer cannot keep up
			with the speed at which the computer sends data over a
			serial line. (This problem should not occur with
			printers on parallel ports.)  There are two ways to
			overcome the problem:
			<itemizedlist>
			  
			  <listitem>
			    <para>If the printer supports XON/XOFF flow
			      control, have FreeBSD use it by specifying the
			      TANDEM bit in the <literal>fs</literal> capability.</para>
			  </listitem>
			  
			  <listitem>
			    <para>If the printer supports carrier flow
			      control, specify the MDMBUF bit in the <literal>fs</literal> capability. Make sure
			      the cable connecting the printer to the computer
			      is correctly wired for carrier flow control.</para>
			  </listitem>
			  
			  <listitem>
			    <para>If the printer does not support any flow
			      control, use some combination of the NLDELAY,
			      TBDELAY, CRDELAY, VTDELAY, and BSDELAY bits in
			      the <literal>fs</literal> capability
			      to add appropriate delays to the stream of data
			      sent to the printer.</para>
			  </listitem>
			  
			</itemizedlist>
		      </para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>It printed garbage.</term>
		    
		    <listitem>
		      <para>The printer printed what appeared to be random
			garbage, but not the desired text.</para>
		      
		      <para>This is usually another symptom of incorrect
			communications parameters with a serial printer.
			Double-check the bps rate in the <literal>br</literal> capability, and the parity
			bits in the <literal>fs</literal> and
			<literal>fc</literal> capabilities; make
			sure the printer is using the same settings as
			specified in the <filename>/etc/printcap</filename>
			file.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>Nothing happened.</term>
		    
		    <listitem>
		      <para>If nothing happened, the problem is probably
			within FreeBSD and not the hardware. Add the log file
			(<literal>lf</literal>) capability to the
			entry for the printer you are debugging in the
			<filename>/etc/printcap</filename> file. For example,
			here is the entry for <literal>rattan</literal>, with
		      the <literal>lf</literal> capability:

			<programlisting>
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple:\
        :lf=/var/log/rattan.log
			</programlisting>
			Then, try printing again. Check
			the log file (in our example,
			<filename>/var/log/rattan.log</filename>) to see any
			error messages that might appear. Based on the
			messages you see, try to correct the problem.</para>
		      
		      <para>If you do not specify a <literal>lf</literal> capability, LPD uses
			<filename>/dev/console</filename> as a default.</para>
		      
		    </listitem>
		  </varlistentry>
		</variablelist>
	      
	    </sect4>
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="printing-using">
	<title>Using Printers</title>
	
	<para>This section tells you how to use printers you have setup with
	  FreeBSD. Here is an overview of the user-level commands:</para>
	
	  <variablelist>
	    <varlistentry><term><citerefentry>
		  <refentrytitle>lpr</refentrytitle></citerefentry></term>
	      <listitem>
		<para>Print jobs</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><citerefentry>
		  <refentrytitle>lpq</refentrytitle></citerefentry></term>
	      
	      <listitem>
		<para>Check printer queues</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><citerefentry>
		  <refentrytitle>lprm</refentrytitle></citerefentry></term>
	      
	      <listitem>
		<para>Remove jobs from a printer's queue</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
		
	<para>There is also an administrative command, <citerefentry>
	    <refentrytitle>lpc</refentrytitle></citerefentry>,
	  described in the section <xref linkend="printing-lpc"
	    remap="Administrating the
	    LPD Spooler">, used to control printers and their queues.</para>
	
	<para>All three of the commands  <citerefentry>
	    <refentrytitle>lpr</refentrytitle></citerefentry>, <citerefentry>
	    <refentrytitle>lprm</refentrytitle></citerefentry>, and
	  <citerefentry>
	    <refentrytitle>lpq</refentrytitle></citerefentry>
	  accept an option <option>-P <replaceable>printer-name</replaceable></option> to specify on which
	  printer/queue to operate, as listed in the
	  <filename>/etc/printcap</filename> file. This enables you to
	  submit, remove, and check on jobs for various printers. If you do
	  not use the <option>-P</option> option, then these commands use the
	  printer specified in the <envar>PRINTER</envar> environment variable. Finally, if
	  you do not have a <envar>PRINTER</envar> environment variable, these commands
	  default to the printer named <literal>lp</literal>.</para>
	
	<para>Hereafter, the terminology <emphasis>default printer</emphasis>
	  means the printer named in the <envar>PRINTER</envar> environment variable, or the
	  printer named <literal>lp</literal> when there is no
	  <envar>PRINTER</envar> environment variable.</para>
	
	
	<sect2 id="printing-lpr">
	  <title>Printing Jobs</title>
	  
	  <para>To print files, type
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>lpr <replaceable>filename</replaceable> <replaceable>...</replaceable></userinput></screen>
	    </informalexample> This prints each of the listed files to the
	    default printer. If you list no files, <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry> reads
	    data to print from standard input. For example, this command
	    prints some important system files:
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>lpr /etc/host.conf /etc/hosts.equiv</userinput></screen>
	    </informalexample> To select a specific printer, type
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>lpr -P <replaceable>printer-name</replaceable> <replaceable>filename</replaceable> <replaceable>...</replaceable></userinput></screen>
	    </informalexample> This example prints a long listing of the
	    current directory to the printer named <literal>rattan</literal>:
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>ls -l | lpr -P rattan</userinput></screen>
	    </informalexample> Because no files were listed for the
	    <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry>
	    command, <command>lpr</command> read the data to print
	    from standard input, which was the output of the <command>ls
	      -l</command> command.</para>
	  
	  <para>The <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry> command
	    can also accept a wide variety of options to control formatting,
	    apply file conversions, generate multiple copies, and so forth.
	    For more information, see the section <xref
	      linkend="printing-lpr-options"
	      remap="Printing Options">.</para>
	  
	</sect2>
	
	<sect2 id="printing-lpq">
	  <title>Checking Jobs</title>
	  
	  <para>When you print with  <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry>, the
	    data you wish to print is put together in a package called a
	    <quote>print job</quote>, which is sent to the LPD spooling
	    system. Each printer has a queue of jobs, and your job waits in
	    that queue along with other jobs from yourself and from other
	    users. The printer prints those jobs in a first-come, first-served
	    order.</para>
	  
	  <para>To display the queue for the default printer, type
	    <citerefentry>
	      <refentrytitle>lpq</refentrytitle></citerefentry>. For a
	    specific printer, use the <option>-P</option> option. For
	    example, the command
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>lpq -P bamboo</userinput></screen>
	    </informalexample> shows the queue for the printer named <hostid>bamboo</hostid>. Here is an example of the output of
	    the <command>lpq</command> command:
	    
	    <informalexample>
	      <screen>bamboo is ready and printing
Rank  Owner	Job  Files                              Total Size
active kelly    9    /etc/host.conf, /etc/hosts.equiv   88 bytes
2nd    kelly    10   (standard input)                   1635 bytes
3rd    mary     11   ...                                78519 bytes</screen>
	    </informalexample> This shows three jobs in the queue for
	    <literal>bamboo</literal>. The first job, submitted by
	    user kelly, got assigned <quote>job number</quote> 9. Every
	    job for a printer gets a unique job number. Most of the time you
	    can ignore the job number, but you will need it if you want to
	    cancel the job; see section
	    <xref linkend="printing-lprm" remap="Removing Jobs"> for
	    details.</para>
	  
	  <para>Job number nine consists of two files; multiple files given on
	    the  <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry> command
	    line are treated as part of a single job. It is the currently
	    active job (note the word <literal>active</literal>
	    under the <quote>Rank</quote> column), which means the printer should be
	    currently printing that job. The second job consists of data
	    passed as the standard input to the</para>
	  
	  <para><citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry>
	    command. The third job came from user mary; it is a much larger
	    job. The pathname of the files she's trying to print is too long
	    to fit, so the  <citerefentry>
	      <refentrytitle>lpq</refentrytitle></citerefentry> command
	    just shows three dots.</para>
	  
	  <para>The very first line of the output from  <citerefentry>
	      <refentrytitle>lpq</refentrytitle></citerefentry> is also
	    useful: it tells what the printer is currently doing (or at least
	    what LPD thinks the printer is doing).</para>
	  
	  <para>The  <citerefentry>
	      <refentrytitle>lpq</refentrytitle></citerefentry> command
	    also support a <option>-l</option> option to generate a detailed
	    long listing. Here is an example of <command>lpq -l</command>:</para>
	    
	    <informalexample>
	      <screen>waiting for bamboo to become ready (offline ?)
kelly: 1st				 [job 009rose]
       /etc/host.conf                    73 bytes
       /etc/hosts.equiv                  15 bytes

kelly: 2nd				 [job 010rose]
       (standard input)		         1635 bytes

mary: 3rd                                [job 011rose]
      /home/orchid/mary/research/venus/alpha-regio/mapping 78519 bytes</screen>
	    </informalexample>
	  
	</sect2>
	
	<sect2 id="printing-lprm">
	  <title>Removing Jobs</title>
	  
	  <para>If you change your mind about printing a job, you can remove
	    the job from the queue with the  <citerefentry>
	      <refentrytitle>lprm</refentrytitle></citerefentry>
	    command. Often, you can even use  <citerefentry>
	      <refentrytitle>lprm</refentrytitle></citerefentry> to
	    remove an active job, but some or all of the job might still get
	    printed.</para>
	  
	  <para>To remove a job from the default printer, first use
	    <citerefentry>
	      <refentrytitle>lpq</refentrytitle></citerefentry> to find
	    the job number. Then type:</para>
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>lprm <replaceable>job-number</replaceable></userinput></screen>
	    </informalexample>

	  <para>To remove the job from a specific printer, add
	    the <option>-P</option> option. The following command removes job
	    number 10 from the queue for the printer
	    <hostid>bamboo</hostid>:</para>
	  
	    <informalexample>
	      <screen>&prompt.user; <userinput>lprm -P bamboo 10</userinput></screen>
	    </informalexample>

	  <para>The  <citerefentry>
	      <refentrytitle>lprm</refentrytitle></citerefentry>
	    command has a few shortcuts:</para>
	  
	    <variablelist>
	      <varlistentry><term>lprm -</term>
		<listitem>
		  <para>Removes all jobs (for the default printer) belonging
		    to you.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>lprm <replaceable>user</replaceable></term>
		
		<listitem>
		  <para>Removes all jobs (for the default printer) belonging
		    to <replaceable>user</replaceable>. The superuser can
		    remove other users' jobs; you can remove only your own
		    jobs.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>lprm</term>
		
		<listitem>
		  <para>With no job number, user name, or
		    <option>-</option> appearing on the command line,
		    <citerefentry>
		      <refentrytitle>lprm</refentrytitle></citerefentry> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  <para>Just use the <option>-P</option> option with the above
	    shortcuts to operate on a specific printer instead of the default.
	    For example, the following command removes all jobs for the
	    current user in the queue for the printer named <literal>rattan</literal>:</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>lprm -P rattan -</userinput></screen>
	  </informalexample>

	  <note>
	    <para>If you are working in a networked
	      environment, <citerefentry>
		<refentrytitle>lprm</refentrytitle></citerefentry>
	      will let you remove jobs only from the host from which the jobs
	      were submitted, even if the same printer is available from other
	      hosts. The following command sequence demonstrates this:</para>
	      
	      <informalexample>
		<screen>&prompt.user; <userinput>lpr -P rattan myfile</userinput>
&prompt.user; <userinput>rlogin orchid</userinput>
&prompt.user; <userinput>lpq -P rattan</userinput>
Rank   Owner	  Job  Files                          Total Size
active seeyan	  12	...                           49123 bytes
2nd    kelly      13   myfile                         12 bytes
&prompt.user; <userinput>lprm -P rattan 13</userinput>
rose: Permission denied
&prompt.user; <userinput>logout</userinput>
&prompt.user; <userinput>lprm -P rattan 13</userinput>
dfA013rose dequeued
cfA013rose dequeued
		</screen>
	      </informalexample>
	  </note>
	</sect2>
	
	<sect2 id="printing-lpr-options">
	  <title>Beyond Plain Text: Printing Options</title>
	  
	  <para>The  <citerefentry>
	      <refentrytitle>lpr</refentrytitle></citerefentry> command
	    supports a number of options that control formatting text,
	    converting graphic and other file formats, producing multiple
	    copies, handling of the job, and more. This section describes the
	    options.</para>
	  
	  
	  <sect3 id="printing-lpr-options-format">
	    <title>Formatting and Conversion Options</title>
	    
	    <para>The following  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>
	      options control formatting of the files in the job. Use these
	      options if the job does not contain plain text or if you want
	      plain text formatted through the  <citerefentry>
		<refentrytitle>pr</refentrytitle></citerefentry>
	      utility.</para>
	    
	    <para>For example, the following command prints a DVI file (from
	      the TeX typesetting system) named
	      <filename>fish-report.dvi</filename> to the printer named
	      <literal>bamboo</literal>:</para>
	      <informalexample>
		<screen>&prompt.user; <userinput>lpr -P bamboo -d fish-report.dvi</userinput></screen>
	      </informalexample>

	    <para>These options apply to every file in the job,
	      so you cannot mix (say) DVI and ditroff files together in a job.
	      Instead, submit the files as separate jobs, using a different
	      conversion option for each job.</para>

	    <note>
	      <para>All of these options except <option>-p</option> and
		<option>-T</option> require conversion filters installed for
		the destination printer. For example, the <option>-d</option>
		option requires the DVI conversion filter. Section <xref
		linkend="printing-advanced-convfilters" remap="Conversion
		Filters"> gives details.</para>
	    </note>
	    
	    
	      <variablelist>
		<varlistentry><term><option>-c</option></term>
		  <listitem>
		    <para>Print cifplot files.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-d</option></term>
		  
		  <listitem>
		    <para>Print DVI files.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-f</option></term>
		  
		  <listitem>
		    <para>Print FORTRAN text files.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-g</option></term>
		  
		  <listitem>
		    <para>Print plot data.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-i
		      <replaceable>number</replaceable></option></term>
		  
		  <listitem>
		    <para>Indent the output by <replaceable>number</replaceable> columns; if you omit
		      <replaceable>number</replaceable>, indent by 8
		      columns. This option works only with certain conversion
		      filters.</para>

		    <note>
		      <para>Do not put any space between the
			<option>-i</option> and the number.</para>
		    </note>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-l</option></term>
		  
		  <listitem>
		    <para>Print literal text data, including control
		      characters.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-n</option></term>
		  
		  <listitem>
		    <para>Print ditroff (device independent troff)
		      data.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-p</term>
		  
		  <listitem>
		    <para>Format plain text with  <citerefentry>
			<refentrytitle>pr</refentrytitle></citerefentry>
		      before printing. See <citerefentry><refentrytitle>pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more information.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-T
		      <replaceable>title</replaceable></option></term>
		  
		  <listitem>
		    <para>Use <replaceable>title</replaceable> on the
		      <citerefentry>
			<refentrytitle>pr</refentrytitle></citerefentry>
		      header instead of the file name. This option has effect
		      only when used with the <option>-p</option>
		      option.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-t</option></term>
		  
		  <listitem>
		    <para>Print troff data.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-v</option></term>
		  
		  <listitem>
		    <para>Print raster data.</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>Here is an example: this command prints a nicely formatted
	      version of the  <citerefentry>
		<refentrytitle>ls</refentrytitle></citerefentry> manual
	      page on the default printer:</para>
	    
	      <informalexample>
		<screen>&prompt.user; <userinput>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr -t</userinput></screen>
	      </informalexample>

	    <para>The  <citerefentry>
		<refentrytitle>zcat</refentrytitle></citerefentry>
	      command uncompresses the source of the</para>
	    
	    <para><citerefentry>
		<refentrytitle>ls</refentrytitle></citerefentry> manual
	      page and passes it to the  <citerefentry>
		<refentrytitle>troff</refentrytitle></citerefentry>
	      command, which formats that source and makes GNU troff output
	      and passes it to  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>,
	      which submits the job to the LPD spooler. Because we used the
	      <option>-t</option> option to</para>
	    
	    <para><citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>, the
	      spooler will convert the GNU troff output into a format the
	      default printer can understand when it prints the job.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-lpr-options-job-handling">
	    <title>Job Handling Options</title>
	    
	    <para>The following options to  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry> tell
	      LPD to handle the job specially:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>-# <replaceable>copies</replaceable></term>
		  <listitem>
		    <para>Produce a number of <replaceable>copies</replaceable> of each file in the job
		      instead of just one copy. An administrator may disable
		      this option to reduce printer wear-and-tear and
		      encourage photocopier usage. See section <xref
			linkend="printing-advanced-restricting-copies"
			remap="Restricting Multiple Copies">.</para>

		    <para>This example prints three copies of
		      <filename>parser.c</filename> followed by three copies
		      of <filename>parser.h</filename> to the default
		      printer:</para>
		    
		      <informalexample>
			<screen>&prompt.user; <userinput>lpr -#3 parser.c parser.h</userinput></screen>
		      </informalexample>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-m</term>
		  
		  <listitem>
		    <para>Send mail after completing the print job. With this
		      option, the LPD system will send mail to your account
		      when it finishes handling your job. In its message, it
		      will tell you if the job completed successfully or if
		      there was an error, and (often) what the error
		      was.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-s</term>
		  
		  <listitem>
		    <para>Do not copy the files to the spooling directory, but
		      make symbolic links to them instead.</para>
		    
		    <para>If you are printing a large job, you probably want
		      to use this option. It saves space in the spooling
		      directory (your job might overflow the free space on the
		      filesystem where the spooling directory resides). It
		      saves time as well since LPD will not have to copy each
		      and every byte of your job to the spooling
		      directory.</para>
		    
		    <para>There is a drawback, though: since LPD will refer to
		      the original files directly, you cannot modify or remove
		      them until they have been printed.</para>

		    <note>
		      <para>If you are printing to a remote printer, LPD will
			eventually have to copy files from the local host to
			the remote host, so the <option>-s</option> option
			will save space only on the local spooling directory,
			not the remote. It is still useful, though.</para>
		    </note>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-r</term>
		  
		  <listitem>
		    <para>Remove the files in the job after copying them to
		      the spooling directory, or after printing them with the
		      <option>-s</option> option. Be careful with this
		      option!</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	  
	  <sect3 id="printing-lpr-options-misc">
	    <title>Header Page Options</title>
	    
	    <para>These options to  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>
	      adjust the text that normally appears on a job's header page.
	      If header pages are suppressed for the destination printer,
	      these options have no effect. See section <xref
		linkend="printing-advanced-header-pages" remap="Header Pages">
	      for information about setting up header pages.</para>
	    
	    
	      <variablelist>
		<varlistentry><term>-C <replaceable>text</replaceable></term>
		  <listitem>
		    <para>Replace the hostname on the header page with
		      <replaceable>text</replaceable>. The hostname is
		      normally the name of the host from which the job was
		      submitted.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-J <replaceable>text</replaceable></term>
		  
		  <listitem>
		    <para>Replace the job name on the header page with
		      <replaceable>text</replaceable>. The job name is
		      normally the name of the first file of the job, or
		      <filename>stdin</filename> if you are printing standard input.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>-h</term>
		  
		  <listitem>
		    <para>Do not print any header page.</para>

		    <note>
		      <para>At some sites, this option may have no effect due
			to the way header pages are generated. See <xref
			linkend="printing-advanced-header-pages" remap="Header
			Pages"> for details.</para>
		    </note>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-lpc">
	  <title>Administrating Printers</title>
	  
	  <para>As an administrator for your printers, you have had to
	    install, set up, and test them. Using the  <citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry>
	    command, you can interact with your printers in yet more ways.
	    With</para>
	  
	  <para><citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry>, you
	    can</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Start and stop the printers</para>
	      </listitem>
	      
	      <listitem>
		<para>Enable and disable their queues</para>
	      </listitem>
	      
	      <listitem>
		<para>Rearrange the order of the jobs in each queue.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>First, a note about terminology: if a printer is
	    <emphasis>stopped</emphasis>, it will not print anything in its
	    queue. Users can still submit jobs, which will wait in the queue
	    until the printer is <emphasis>started</emphasis> or the queue is
	    cleared.</para>
	  
	  <para>If a queue is <emphasis>disabled</emphasis>, no user (except
	    root) can submit jobs for the printer. An
	    <emphasis>enabled</emphasis> queue allows jobs to be submitted. A
	    printer can be <emphasis>started</emphasis> for a disabled queue,
	    in which case it will continue to print jobs in the queue until
	    the queue is empty.</para>
	  
	  <para>In general, you have to have root privileges to use the</para>
	  
	  <para><citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry>
	    command. Ordinary users can use the  <citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry> command
	    to get printer status and to restart a hung printer only.</para>
	  
	  <para>Here is a summary of the  <citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry>
	    commands. Most of the commands takes a <replaceable>printer-name</replaceable> argument to tell on which
	    printer to operate. You can use <literal>all</literal>
	    for the <replaceable>printer-name</replaceable> to mean all
	    printers listed in <filename>/etc/printcap</filename>.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term><command>abort
		    <replaceable>printer-name</replaceable></command></term>
		<listitem>
		  <para>Cancel the current job and stop the printer. Users
		    can still submit jobs if the queue's enabled.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>clean
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Remove old files from the printer's spooling
		    directory. Occasionally, the files that make up a job are
		    not properly removed by LPD, particularly if there have
		    been errors during printing or a lot of administrative
		    activity. This command finds files that do not belong in
		    the spooling directory and removes them.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>disable
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Disable queuing of new jobs. If the printer's
		    started, it will continue to print any jobs remaining in
		    the queue. The superuser (root) can always submit jobs,
		    even to a disabled queue.</para>
		  
		  <para>This command is useful while you are testing a new
		    printer or filter installation: disable the queue and
		    submit jobs as root. Other users will not be able to
		    submit jobs until you complete your testing and re-enable
		    the queue with the <command>enable</command>
		    command.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>down
		    <replaceable>printer-name</replaceable>
		    <replaceable>message</replaceable></command></term>
		
		<listitem>
		  <para>Take a printer down. Equivalent to
		  <command>disable</command> followed by
		  <command>stop</command>. The <replaceable>message</replaceable> appears as the printer's
		    status whenever a user checks the printer's queue with
		    <citerefentry>
		      <refentrytitle>lpq</refentrytitle></citerefentry>
		    or status with <command>lpc
		      status</command>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>enable
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Enable the queue for a printer. Users can submit jobs
		    but the printer will not print anything until it is
		    started.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>help
		    <replaceable>command-name</replaceable></command></term>
		
		<listitem>
		  <para>Print help on the command
		  <replaceable>command-name</replaceable>. With no
		  <replaceable>command-name</replaceable>, print a summary of the
		    commands available.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>restart
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Start the printer. Ordinary users can use this
		    command if some extraordinary circumstance hangs LPD, but
		    they cannot start a printer stopped with either the
		    <command>stop</command> or <command>down</command> commands. The <command>restart</command> command is equivalent to
		    <command>abort</command> followed by <command>start</command>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>start
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Start the printer. The printer will print jobs in its
		    queue.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>stop
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Stop the printer. The printer will finish the current
		    job and will not print anything else in its queue. Even
		    though the printer is stopped, users can still submit jobs
		    to an enabled queue.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>topq
		    <replaceable>printer-name</replaceable>
		    <replaceable>job-or-username</replaceable></command></term>
		
		<listitem>
		  <para>Rearrange the queue for <replaceable>printer-name</replaceable> by placing the jobs
		    with the listed <replaceable>job</replaceable> numbers
		    or the jobs belonging to <replaceable>username</replaceable> at the top of the queue.
		    For this command, you cannot use <literal>all</literal> as
		  the <replaceable>printer-name</replaceable>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term><command>up
		    <replaceable>printer-name</replaceable></command></term>
		
		<listitem>
		  <para>Bring a printer up; the opposite of the <command>down</command> command. Equivalent to
		    <command>start</command> followed by <command>enable</command>.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	  <para><citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry> accepts
	    the above commands on the command line. If you do not enter any
	    commands, <citerefentry>
	      <refentrytitle>lpc</refentrytitle></citerefentry> enters
	    an interactive mode, where you can enter commands until you type
	    <command>exit</command>, <command>quit</command>, or end-of-file.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="printing-advanced">
	<title>Advanced Printer Setup</title>
	
	<para>This section describes filters for printing specially formatted
	  files, header pages, printing across networks, and restricting and
	  accounting for printer usage.</para>
	
	
	<sect2 id="printing-advanced-filter-intro">
	  <title>Filters</title>
	  
	  <para>Although LPD handles network protocols, queuing, access
	    control, and other aspects of printing, most of the
	    <emphasis>real</emphasis> work happens in the
	    <emphasis>filters</emphasis>. Filters are programs that
	    communicate with the printer and handle its device dependencies
	    and special requirements. In the simple printer setup, we
	    installed a plain text filter&mdash;an extremely simple one that
	    should work with most printers (section <xref
	      linkend="printing-textfilter" remap="Installing the
	      Text Filter">).</para>
	  
	  <para>However, in order to take advantage of format conversion,
	    printer accounting, specific printer quirks, and so on, you should
	    understand how filters work. It will ultimately be the filter's
	    responsibility to handle these aspects. And the bad news is that
	    most of the time <emphasis>you</emphasis> have to provide filters
	    yourself. The good news is that many are generally available;
	    when they are not, they are usually easy to write.</para>
	  
	  <para>Also, FreeBSD comes with one,
	    <filename>/usr/libexec/lpr/lpf</filename>, that works with many
	    printers that can print plain text. (It handles backspacing and
	    tabs in the file, and does accounting, but that is about all it
	    does.)  There are also several filters and filter components in
	    the FreeBSD ports collection.</para>
	  
	  <para>Here is what you will find in this section:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Section <xref linkend="printing-advanced-filters"
		    remap="How Filters Work">, tries to give an overview of a
		  filter's role in the printing process. You should read this
		  section to get an understanding of what is happening <quote>under
		  the hood</quote> when LPD uses filters. This knowledge could help
		  you anticipate and debug problems you might encounter as you
		  install more and more filters on each of your printers.</para>
	      </listitem>
	      
	      <listitem>
		<para>LPD expects every printer to be able to print plain text
		  by default. This presents a problem for PostScript (or
		  other language-based printers) which cannot directly print
		  plain text. Section <xref
		    linkend="printing-advanced-if-conversion"
		    remap="Accommodating        Plain Text Jobs on PostScript
		    Printers"> tells you what you should do to overcome this
		  problem. I recommend reading this section if you have a
		  PostScript printer.</para>
	      </listitem>
	      
	      <listitem>
		<para>PostScript is a popular output format for many programs.
		  Even some people (myself included) write PostScript code
		  directly. But PostScript printers are expensive. Section
		  <xref linkend="printing-advanced-ps"
		    remap="Simulating PostScript on Non-PostScript Printers">
		  tells how you can further modify a printer's text filter to
		  accept and print PostScript data on a
		  <emphasis>non-PostScript</emphasis> printer. I recommend
		  reading this section if you do not have a PostScript
		  printer.</para>
	      </listitem>
	      
	      <listitem>
		<para>Section <xref linkend="printing-advanced-convfilters"
		    remap="Conversion Filters"> tells about a way you can
		  automate the conversion of specific file formats, such as
		  graphic or typesetting data, into formats your printer can
		  understand. After reading this section, you should be able
		  to set up your printers such that users can type
		  <command>lpr -t</command> to print troff data, or
		  <command>lpr -d</command> to print TeX DVI data, or
		  <command>lpr -v</command> to print raster image data, and so
		  forth. I recommend reading this section.</para>
	      </listitem>
	      
	      <listitem>
		<para>Section <xref linkend="printing-advanced-of"
		    remap="Output   Filters"> tells all about a not often used
		  feature of LPD: output filters. Unless you are printing
		  header pages (see <xref
		    linkend="printing-advanced-header-pages"
		    remap="Header Pages">), you can probably skip that section
		  altogether.</para>
	      </listitem>
	      
	      <listitem>
		<para>Section <xref linkend="printing-advanced-lpf"
		    remap="lpf: a Text Filter"> describes <command>lpf</command>, a fairly complete if simple text
		  filter for line printers (and laser printers that act like
		  line printers) that comes with FreeBSD. If you need a quick
		  way to get printer accounting working for plain text, or if
		  you have a printer which emits smoke when it sees backspace
		  characters, you should definitely consider <command>lpf</command>.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <sect3 id="printing-advanced-filters">
	    <title>How Filters Work</title>
	    
	    <para>As mentioned before, a filter is an executable program
	      started by LPD to handle the device-dependent part of
	      communicating with the printer.</para>
	    
	    <para>When LPD wants to print a file in a job, it starts a filter
	      program. It sets the filter's standard input to the file to
	      print, its standard output to the printer, and its standard
	      error to the error logging file (specified in the <literal>lf</literal> capability in
	      <filename>/etc/printcap</filename>, or
	      <filename>/dev/console</filename> by default).</para>
	    
	    <para>Which filter LPD starts and the filter's arguments depend on
	      what is listed in the <filename>/etc/printcap</filename> file
	      and what arguments the user specified for the job on the</para>
	    
	    <para><citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>
	      command line. For example, if the user typed <command>lpr
		-t</command>, LPD would start the troff filter, listed in the
	      <literal>tf</literal> capability for the destination
	      printer. If the user wanted to print plain text, it would start
	      the <literal>if</literal> filter (this is mostly
	      true:
	      see <xref linkend="printing-advanced-of" remap="Output Filters">
	      for details).</para>
	    
	    <para>There are three kinds of filters you can specify in
	      <filename>/etc/printcap</filename>:</para>
	    
	      <itemizedlist>
		
		<listitem>
		  <para>The <emphasis>text filter</emphasis>, confusingly
		    called the <emphasis>input filter</emphasis> in LPD
		    documentation, handles regular text printing. Think of it
		    as the default filter. LPD expects every printer to be
		    able to print plain text by default, and it is the text
		    filter's job to make sure backspaces, tabs, or other
		    special characters do not confuse the printer. If you are
		    in an environment where you have to account for printer
		    usage, the text filter must also account for pages
		    printed, usually by counting the number of lines printed
		    and comparing that to the number of lines per page the
		    printer supports. The text filter is started with the
		    following argument list:
		  
		    <cmdsynopsis>
		      <command>filter-name</command>
		      <arg>-c</arg>
		      <arg choice="plain">-w<replaceable>width</replaceable></arg>
		      <arg choice="plain">-l<replaceable>length</replaceable></arg>
		      <arg choice="plain">-i<replaceable>indent</replaceable></arg>
		      <arg choice="plain">-n <replaceable>login</replaceable></arg>
		      <arg choice="plain">-h <replaceable>host</replaceable></arg>
		      <arg choice="plain"><replaceable>acct-file</replaceable></arg>
		    </cmdsynopsis> where
		  
		    <variablelist>
		      <varlistentry><term><option>-c</option></term>
			<listitem>
			  <para>appears if the job's submitted with
			    <command>lpr -l</command></para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>width</replaceable></term>
			
			<listitem>
			  <para>is the value from the <literal>pw</literal> (page width) capability
			    specified in <filename>/etc/printcap</filename>,
			    default 132</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>length</replaceable></term>
			
			<listitem>
			  <para>is the value from the <literal>pl</literal> (page length) capability,
			    default 66</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>indent</replaceable></term>
			
			<listitem>
			  <para>is the amount of the indentation from
			    <command>lpr -i</command>, default 0</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>login</replaceable></term>
			
			<listitem>
			  <para>is the account name of the user printing the
			    file</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>host</replaceable></term>
			
			<listitem>
			  <para>is the host name from which the job was
			    submitted</para>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term><replaceable>acct-file</replaceable></term>
			
			<listitem>
			  <para>is the name of the accounting file from the
			    <literal>af</literal>
			    capability.</para>
			</listitem>
		      </varlistentry>
		    </variablelist>
		    
		  </para>
		</listitem>
		
		<listitem>
		  <para>A <emphasis>conversion filter</emphasis> converts a
		    specific file format into one the printer can render onto
		    paper. For example, ditroff typesetting data cannot be
		    directly printed, but you can install a conversion filter
		    for ditroff files to convert the ditroff data into a form
		    the printer can digest and print. Section
		    <xref linkend="printing-advanced-convfilters"
		      remap="Conversion Filters"> tells all about them.
		    Conversion filters also need to do accounting, if you need
		    printer accounting. Conversion filters are started with
		    the following arguments:
		  
		    <cmdsynopsis>
		      <command>filter-name</command>
		      <arg
			choice="plain">-x<replaceable>pixel-width</replaceable></arg>
		      <arg choice="plain">-y<replaceable>pixel-height</replaceable></arg>
		      <arg choice="plain">-n <replaceable>login</replaceable></arg>
		      <arg choice="plain">-h <replaceable>host</replaceable></arg>
		      <arg choice="plain"><replaceable>acct-file</replaceable></arg>
		    </cmdsynopsis> where <replaceable>pixel-width</replaceable> is the value from the
		    <literal>px</literal> capability (default 0)
		    and <replaceable>pixel-height</replaceable> is the
		    value from the <literal>py</literal> capability
		    (default 0).</para>
		</listitem>
		
		<listitem>
		  <para>The <emphasis>output filter</emphasis> is used only if
		    there is no text filter, or if header pages are enabled.
		    In my experience, output filters are rarely used. Section
		    <xref linkend="printing-advanced-of" remap="Output
		      Filters"> describe them. There are only two arguments
		    to an output filter:
		  
		    <cmdsynopsis>
		      <command>filter-name</command>
		      <arg choice="plain">-w<replaceable>width</replaceable></arg>

		      <arg choice="plain">-l<replaceable>length</replaceable></arg>
		    </cmdsynopsis> which are identical to the text filters
		    <option>-w</option> and <option>-l</option>
		    arguments.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    <para>Filters should also <emphasis>exit</emphasis> with the
	      following exit status:</para>
	    
	      <variablelist>
		<varlistentry><term>exit 0</term>
		  <listitem>
		    <para>If the filter printed the file successfully.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>exit 1</term>
		  
		  <listitem>
		    <para>If the filter failed to print the file but wants LPD
		      to try to print the file again. LPD will restart a
		      filter if it exits with this status.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>exit 2</term>
		  
		  <listitem>
		    <para>If the filter failed to print the file and does not
		      want LPD to try again. LPD will throw out the
		      file.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    <para>The text filter that comes with the FreeBSD release,
	      <filename>/usr/libexec/lpr/lpf</filename>, takes advantage of
	      the page width and length arguments to determine when to send a
	      form feed and how to account for printer usage. It uses the
	      login, host, and accounting file arguments to make the
	      accounting entries.</para>
	    
	    <para>If you are shopping for filters, see if they are
	      LPD-compatible. If they are, they must support the argument
	      lists described above. If you plan on writing filters for
	      general use, then have them support the same argument lists and
	      exit codes.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-if-conversion">
	    <title>Accommodating Plain Text Jobs on PostScript Printers</title>
	    
	    <para>If you are the only user of your computer and PostScript
	      (or other language-based) printer, and you promise to never send
	      plain text to your printer and to never use features of various
	      programs that will want to send plain text to your printer, then
	      you do not need to worry about this section at all.</para>
	    
	    <para>But, if you would like to send both PostScript and plain
	      text jobs to the printer, then you are urged to augment your
	      printer setup. To do so, we have the text filter detect if the
	      arriving job is plain text or PostScript. All PostScript jobs
	      must start with <literal>%!</literal> (for other
	      printer languages, see your printer documentation). If those are
	      the first two characters in the job, we have PostScript, and can
	      pass the rest of the job directly. If those are not the first
	      two characters in the file, then the filter will convert the
	      text into PostScript and print the result.</para>
	    
	    <para>How do we do this?</para>
	    
	    <para>If you have got a serial printer, a great way to do it is to
	      install <command>lprps</command>. <command>lprps</command> is a PostScript printer filter which
	      performs two-way communication with the printer. It updates the
	      printer's status file with verbose information from the printer,
	      so users and administrators can see exactly what the state of
	      the printer is (such as <errorname>toner low</errorname> or <errorname>paper jam</errorname>). But
	      more importantly, it includes a program called <command>psif</command> which detects whether the incoming
	      job is plain text and calls <command>textps</command>
	      (another program that comes with <command>lprps</command>) to convert it to PostScript. It
	      then uses <command>lprps</command> to send the job to
	      the printer.</para>
	    
	    <para><command>lprps</command> is part of the FreeBSD
	      ports collection (see <xref linkend="ports" remap="The Ports
		Collection">). You
	      can fetch, build and install it yourself, of course. After
	      installing <command>lprps</command>, just specify the
	      pathname to the <command>psif</command> program that
	      is part of <command>lprps</command>. If you
	      installed <command>lprps</command> from the ports
	      collection, use the following in the serial PostScript printer's
	      entry in <filename>/etc/printcap</filename>:</para>
	      
	      <programlisting>
:if=/usr/local/libexec/psif:
	      </programlisting>

	    <para>You should also specify the <literal>rw</literal> capability; that tells LPD to open the
	      printer in read-write mode.</para>
	    
	    <para>If you have a parallel PostScript printer (and therefore
	      cannot use two-way communication with the printer, which
	      <command>lprps</command> needs), you can use the
	      following shell script as the text filter:</para>

		<programlisting>
#!/bin/sh
#
#  psif - Print PostScript or plain text on a PostScript printer
#  Script version; NOT the version that comes with lprps
#  Installed in /usr/local/libexec/psif
#

read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  PostScript job, print it.
    #
    echo $first_line &amp;&amp; cat &amp;&amp; printf "\004" &amp;&amp; exit 0
    exit 2
else
    #
    #  Plain text, convert it, then print it.
    #
    ( echo $first_line; cat ) | /usr/local/bin/textps &amp;&amp; printf "\004" &amp;&amp; exit 0
    exit 2
fi
	      </programlisting>
	    
	    <para>In the above script, <command>textps</command> is a program we installed
	      separately to convert plain text to PostScript. You can use any
	      text-to-PostScript program you wish. The FreeBSD ports
	      collection (see <xref linkend="ports" remap="The Ports
		Collection">) includes a full featured text-to-PostScript
	      program called  <citerefentry>
		<refentrytitle>a2ps</refentrytitle></citerefentry> that you might want to investigate.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-ps">
	    <title>Simulating PostScript on Non-PostScript Printers</title>
	    
	    <para>PostScript is the <emphasis>de facto</emphasis>
	      standard for high quality typesetting and printing. PostScript
	      is, however, an <emphasis>expensive</emphasis> standard.
	      Thankfully, Alladin Enterprises has a free PostScript work-alike
	      called <application>Ghostscript</application> that runs with
	      FreeBSD. Ghostscript can read most PostScript files and can
	      render their pages onto a variety of devices, including many
	      brands of non-PostScript printers. By installing Ghostscript
	      and using a special text filter for your printer, you can make
	      your non-PostScript printer act like a real PostScript
	      printer.</para>
	    
	    <para>Ghostscript should be in the FreeBSD ports collection, if
	      you would like to install it from there. You can fetch, build,
	      and install it quite easily yourself, as well.</para>
	    
	    <para>To simulate PostScript, we have the text filter detect if it
	      is printing a PostScript file. If it is not, then the filter
	      will pass the file directly to the printer; otherwise, it will
	      use Ghostscript to first convert the file into a format the
	      printer will understand.</para>
	    
	    <para>Here is an example: the following script is a text filter
	      for Hewlett Packard DeskJet 500 printers. For other printers,
	      substitute the <option>-sDEVICE</option> argument to the</para>
	    
	    <para><citerefentry>
		<refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)</para>

		<programlisting>
#!/bin/sh
#
#  ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500
#  Installed in /usr/local/libexec/hpif

#
#  Treat LF as CR+LF:
#
printf "\033&amp;k2G" || exit 2

#
#  Read first two characters of the file
#
read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  It is PostScript; use Ghostscript to scan-convert and print it
    #
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOutputFile=- - \
        &amp;&amp; exit 0
else
    #
    #  Plain text or HP/PCL, so just print it directly; print a form
    #  at the end to eject the last page.
    #
    echo $first_line &amp;&amp; cat &amp;&amp; printf "\f" &amp;&amp; exit 0
fi

exit 2
	      </programlisting>

	    <para>Finally, you need to notify LPD of the filter
	      via the <literal>if</literal> capability:</para>
	    
	      <programlisting>
:if=/usr/local/libexec/hpif:
	      </programlisting>

	    <para>That is it. You can type <command>lpr plain.text</command> and <filename>lpr
		whatever.ps</filename> and both should print
	      successfully.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-convfilters">
	    <title>Conversion Filters</title>
	    
	    <para>After completing the simple setup described in <xref
		linkend="printing-simple" remap="Simple Printer Setup">, the
	      first thing you will probably want to do is install conversion
	      filters for your favorite file formats (besides plain ASCII
	      text).</para>
	    
	    
	    <sect4>
	      <title>Why Install Conversion Filters?</title>
	      
	      <para>Conversion filters make printing various kinds of files
		easy. As an example, suppose we do a lot of work with the TeX
		typesetting system, and we have a PostScript printer. Every
		time we generate a DVI file from TeX, we cannot print it
		directly until we convert the DVI file into PostScript. The
		command sequence goes like this:</para>
		
		<informalexample>
		  <screen>&prompt.user; <userinput>dvips seaweed-analysis.dvi</userinput>
&prompt.user; <userinput>lpr seaweed-analysis.ps</userinput></screen>
		</informalexample>

	      <para>By installing a conversion filter for DVI
		files, we can skip the hand conversion step each time by
		having LPD do it for us. Now, each time we get a DVI file, we
		are just one step away from printing it:</para>
	      
		<informalexample>
		  <screen>&prompt.user; <userinput>lpr -d seaweed-analysis.dvi</userinput></screen>
		</informalexample>

	      <para>We got LPD to do the DVI file conversion
		for us by specifying the <option>-d</option> option. Section
		<xref
		  linkend="printing-lpr-options-format" remap="Formatting and
		  Conversion Options"> lists the conversion options.</para>
	      
	      <para>For each of the conversion options you want a printer to
		support, install a <emphasis>conversion filter</emphasis> and
		specify its pathname in <filename>/etc/printcap</filename>. A
		conversion filter is like the text filter for the simple
		printer setup (see section <xref linkend="printing-textfilter"
		  remap="Installing the Text Filter">) except that instead of
		printing plain text, the filter converts the file into a
		format the printer can understand.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Which Conversions Filters Should I Install?</title>
	      
	      <para>You should install the conversion filters you expect to
		use. If you print a lot of DVI data, then a DVI conversion
		filter is in order. If you have got plenty of troff to print
		out, then you probably want a troff filter.</para>
	      
	      <para>The following table summarizes the filters that LPD works
		with, their capability entries for the
		<filename>/etc/printcap</filename> file, and how to invoke
		them with the <command>lpr</command> command:</para>

		<informaltable frame="none">
		  <tgroup cols="3">
		    <thead>
		      <row>
			<entry>File type</entry>
			<entry><filename>/etc/printcap</filename>
			  capability</entry>
			<entry><command>lpr</command> option</entry>
		      </row>
		    </thead>
		    <tbody>
		      <row>
			<entry>cifplot</entry>
			<entry><literal>cf</literal></entry>
			<entry><option>-c</option></entry>
		      </row>

		      <row>
			<entry>DVI</entry>
			<entry><literal>df</literal></entry>
			<entry><option>-d</option></entry>
		      </row>

		      <row>
			<entry>plot</entry>
			<entry><literal>gf</literal></entry>
			<entry><option>-g</option></entry>
		      </row>

		      <row>
			<entry>ditroff</entry>
			<entry><literal>nf</literal></entry>
			<entry><option>-n</option></entry>
		      </row>

		      <row>
			<entry>FORTRAN text</entry>
			<entry><literal>rf</literal></entry>
			<entry><option>-f</option></entry>
		      </row>

		      <row>
			<entry>troff</entry>
			<entry><literal>rf</literal></entry>
			<entry><option>-f</option></entry>
		      </row>

		      <row>
			<entry>raster</entry>
			<entry><literal>vf</literal></entry>
			<entry><option>-v</option></entry>
		      </row>

		      <row>
			<entry>plain text</entry>
			<entry><literal>if</literal></entry>
			<entry>none, <option>-p</option>, or <option>-l</option></entry>
		      </row>
		    </tbody>
		  </tgroup>
		</informaltable>
	      
	      <para>In our example, using <command>lpr -d</command> means the
		printer needs a <literal>df</literal> capability in
		its entry in <filename>/etc/printcap</filename>.</para>
	      
	      <para>Despite what others might contend, formats like FORTRAN
		text and plot are probably obsolete. At your site, you can
		give new meanings to these or any of the formatting options
		just by installing custom filters. For example, suppose you
		would like to directly print Printerleaf files (files from the
		Interleaf desktop publishing program), but will never print
		plot files. You could install a Printerleaf conversion filter
		under the <literal>gf</literal> capability and then
		educate your users that <command>lpr -g</command> mean <quote>print
		Printerleaf files.</quote></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Installing Conversion Filters</title>
	      
	      <para>Since conversion filters are programs you install outside
		of the base FreeBSD installation, they should probably go
		under <filename>/usr/local</filename>. The directory
		<filename>/usr/local/libexec</filename> is a popular location,
		since they are specialized programs that only LPD will run;
		regular users should not ever need to run them.</para>
	      
	      <para>To enable a conversion filter, specify its pathname under
		the appropriate capability for the destination printer in
		<filename>/etc/printcap</filename>.</para>
	      
	      <para>In our example, we will add the DVI conversion filter to
		the entry for the printer named <literal>bamboo</literal>. Here is the example
		<filename>/etc/printcap</filename> file again, with the new
		<literal>df</literal> capability for the printer
		<literal>bamboo</literal>.</para>

		<programlisting>
#
#  /etc/printcap for host rose - added df filter for bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\
        :if=/usr/local/libexec/psif:\
        :df=/usr/local/libexec/psdf:
		</programlisting>

	      <para>The DVI filter is a shell script named
		<filename>/usr/local/libexec/psdf</filename>. Here is that
		script:</para>

		<programlisting>
#!bin/sh
#
#  psdf - DVI to PostScript printer filter
#  Installed in /usr/local/libexec/psdf
#
# Invoked by lpd when user runs lpr -d
#
exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@"
		</programlisting>

	      <para>This script runs  <citerefentry>
		  <refentrytitle>dvips</refentrytitle></citerefentry> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
		  remap="Accommodating Plain Text Jobs on PostScript
		  Printers">) with the arguments LPD passed to this script.
		<command>lprps</command> will use those arguments
		to account for the pages printed.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>More Conversion Filter Examples</title>
	      
	      <para>Since there is no fixed set of steps to install
		conversion filters, let me instead provide more examples. Use
		these as guidance to making your own filters. Use them
		directly, if appropriate.</para>
	      
	      <para>This example script is a raster (well, GIF file, actually)
		conversion filter for a Hewlett Packard LaserJet III-Si
		printer:</para>

		<programlisting>
#!/bin/sh
#
#  hpvf - Convert GIF files into HP/PCL, then print
#  Installed in /usr/local/libexec/hpvf
		  
PATH=/usr/X11R6/bin:$PATH; export PATH giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \
    &amp;&amp; exit 0 \
    || exit 2
		</programlisting>

	      <para>It works by converting the GIF file into a
		portable anymap, converting that into a portable graymap,
		converting that into a portable bitmap, and converting that
		into LaserJet/PCL-compatible data.</para>
	      
	      <para>Here is the <filename>/etc/printcap</filename> file with
		an entry for a printer using the above filter:</para>

		  <programlisting>
#
#  /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
        :lp=/dev/lpt0:sh:sd=/var/spool/lpd/teak:mx#0:\
        :if=/usr/local/libexec/hpif:\
        :vf=/usr/local/libexec/hpvf:
		</programlisting>
	      
	      <para>The following script is a conversion filter for troff data
		from the groff typesetting system for the PostScript printer
		named <literal>bamboo</literal>:</para>

		<programlisting>
#!/bin/sh
#
#  pstf - Convert groff's troff data into PS, then print.
#  Installed in /usr/local/libexec/pstf
#
exec grops | /usr/local/libexec/lprps "$@"
		</programlisting>
	      
	      <para>The above script makes use of <command>lprps</command> again to handle the communication
		with the printer. If the printer were on a parallel port, we
		would use this script instead:</para>

		<programlisting>
#!/bin/sh
#
#  pstf - Convert groff's troff data into PS, then print.
#  Installed in /usr/local/libexec/pstf
#
exec grops
		</programlisting>
	      
	      <para>That is it. Here is the entry we need to
		add to <filename>/etc/printcap</filename> to enable the
		filter:</para>
		
		<programlisting>
:tf=/usr/local/libexec/pstf:
		</programlisting>
	      
	      <para>Here is an example that might make old hands at FORTRAN
		blush. It is a FORTRAN-text filter for any printer that can
		directly print plain text. We will install it for the printer
		<literal>teak</literal>:</para>

		  <programlisting>
#!/bin/sh
#
# hprf - FORTRAN text filter for LaserJet 3si:
# Installed in /usr/local/libexec/hprf
#

printf "\033&amp;k2G" &amp;&amp; fpr &amp;&amp; printf "\f" &amp;&amp; exit 0
exit 2
		</programlisting>
	      
	      <para>And we will add this line to the
		<filename>/etc/printcap</filename> for the printer
		<literal>teak</literal> to enable this filter:</para>
	      
		<programlisting>
:rf=/usr/local/libexec/hprf:
		</programlisting>
	      
	      <para>Here is one final, somewhat complex example. We will add
		a DVI filter to the LaserJet printer <literal>teak</literal> introduced earlier. First, the
		easy part: updating <filename>/etc/printcap</filename> with
		the location of the DVI filter:</para>
	      
		<programlisting>
:df=/usr/local/libexec/hpdf:
		</programlisting>
	      
	      <para>Now, for the hard part: making the filter. For that, we
		need a DVI-to-LaserJet/PCL conversion program. The FreeBSD
		ports collection (see <xref linkend="ports" remap="The
		  Ports Collection">) has one: <citerefentry>
		  <refentrytitle>dvi2xx</refentrytitle></citerefentry> is the
		name of the package. Installing this package gives us the
		program we need, <citerefentry>
		  <refentrytitle>dvilj2p</refentrytitle></citerefentry>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
	      
	      <para><citerefentry>
		  <refentrytitle>dvilj2p</refentrytitle></citerefentry> makes
		the filter <command>hpdf</command> quite complex since
		<citerefentry>
		  <refentrytitle>dvilj2p</refentrytitle></citerefentry> cannot
		read from standard input. It wants to work with a filename.
		What is worse, the filename has to end in
		<filename>.dvi</filename> so using
		<filename>/dev/fd/0</filename> for standard input is
		problematic. We can get around that problem by linking
		(symbolically) a temporary file name (one that ends in
		<filename>.dvi</filename>) to <filename>/dev/fd/0</filename>,
		thereby forcing  <citerefentry>
		  <refentrytitle>dvilj2p</refentrytitle></citerefentry> to read from standard input.</para>
	      
	      <para>The only other fly in the ointment is the fact that we
		cannot use <filename>/tmp</filename> for the temporary link.
		Symbolic links are owned by user and group
		<username>bin</username>. The filter runs as user <username>daemon</username>. And the
		<filename>/tmp</filename> directory has the sticky bit set.
		The filter can create the link, but it will not be able clean
		up when done and remove it since the link will belong to a
		different user.</para>
	      
	      <para>Instead, the filter will make the symbolic link in the
		current working directory, which is the spooling directory
		(specified by the <literal>sd</literal> capability
		in <filename>/etc/printcap</filename>). This is a perfect
		place for filters to do their work, especially since there is
		(sometimes) more free disk space in the spooling directory
		than under <filename>/tmp</filename>.</para>
	      
	      <para>Here, finally, is the filter:</para>

		<programlisting>
#!/bin/sh
#
#  hpdf - Print DVI data on HP/PCL printer
#  Installed in /usr/local/libexec/hpdf

PATH=/usr/local/bin:$PATH; export PATH

#
#  Define a function to clean up our temporary files.  These exist
#  in the current directory, which will be the spooling directory
#  for the printer.
#
cleanup() {
   rm -f hpdf$$.dvi
}

#
#  Define a function to handle fatal errors: print the given message
#  and exit 2.  Exiting with 2 tells LPD to do not try to reprint the
#  job.
#
fatal() {
    echo "$@" 1&gt;&amp;2
    cleanup
    exit 2
}

#
#  If user removes the job, LPD will send SIGINT, so trap SIGINT
#  (and a few other signals) to clean up after ourselves.
#
trap cleanup 1 2 15 

#
#  Make sure we are not colliding with any existing files.
#
cleanup

#
#  Link the DVI input file to standard input (the file to print).
#
ln -s /dev/fd/0 hpdf$$.dvi || fatal "Cannot symlink /dev/fd/0"

#
#  Make LF = CR+LF
#
printf "\033&amp;k2G" || fatal "Cannot initialize printer"

# 
#  Convert and print.  Return value from dvilj2p does not seem to be
#  reliable, so we ignore it.
#
dvilj2p -M1 -q -e- dfhp$$.dvi

#
#  Clean up and exit
#
cleanup
exit 0		  
		</programlisting>
	      
	    </sect4>
	    
	    <sect4 id="printing-advanced-autoconv">
	      <title>Automated Conversion: An Alternative To Conversion
		Filters</title>
	      
	      <para>All these conversion filters accomplish a lot for your
		printing environment, but at the cost forcing the user to
		specify (on the  <citerefentry>
		  <refentrytitle>lpr</refentrytitle></citerefentry>
		command line) which one to use. If your users are not
		particularly computer literate, having to specify a filter
		option will become annoying. What is worse, though, is that
		an incorrectly specified filter option may run a filter on the
		wrong type of file and cause your printer to spew out hundreds
		of sheets of paper.</para>
	      
	      <para>Rather than install conversion filters at all, you might
		want to try having the text filter (since it is the default
		filter) detect the type of file it has been asked to print and
		then automatically run the right conversion filter. Tools
		such as <command>file</command> can be of help
		here. Of course, it will be hard to determine the differences
		between <emphasis>some</emphasis> file types&mdash;and, of course,
		you can still provide conversion filters just for them.</para>
	      
	      <para>The FreeBSD ports collection has a text filter that
		performs automatic conversion called  <citerefentry>
		  <refentrytitle>apsfilter</refentrytitle></citerefentry>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="printing-advanced-of">
	    <title>Output Filters</title>
	    
	    <para>The LPD spooling system supports one other type of filter
	      that we have not yet explored: an output filter. An output
	      filter is intended for printing plain text only, like the text
	      filter, but with many simplifications. If you are using an
	      output filter but no text filter, then
	      <itemizedlist>
		
		<listitem>
		  <para>LPD starts an output filter once for the entire job
		    instead of once for each file in the job.</para>
		</listitem>
		
		<listitem>
		  <para>LPD does not make any provision to identify the start
		    or the end of files within the job for the output filter.</para>
		</listitem>
		
		<listitem>
		  <para>LPD does not pass the user's login or host to the
		    filter, so it is not intended to do accounting. In fact,
		    it gets only two arguments:
		    
		    <cmdsynopsis>
		      <command>filter-name</command>
		      <arg choice="plain">-w<replaceable>width</replaceable></arg>
		      <arg choice="plain">-l<replaceable>length</replaceable></arg>
		    </cmdsynopsis> where <replaceable>width</replaceable> is
		    from the <literal>pw</literal> capability and
		    <replaceable>length</replaceable> is from the <literal>pl</literal> capability for the printer in
		    question.</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	    
	    <para>Do not be seduced by an output filter's simplicity. If you
	      would like each file in a job to start on a different page an
	      output filter <emphasis>will not work</emphasis>. Use a text
	      filter (also known as an input filter); see section <xref
		linkend="printing-textfilter" remap="Installing the Text
		Filter">. Furthermore, an output filter is actually
	      <emphasis>more complex</emphasis> in that it has to examine the
	      byte stream being sent to it for special flag characters and
	      must send signals to itself on behalf of LPD.</para>
	    
	    <para>However, an output filter is <emphasis>necessary</emphasis>
	      if you want header pages and need to send escape sequences or
	      other initialization strings to be able to print the header
	      page. (But it is also <emphasis>futile</emphasis> if you want
	      to charge header pages to the requesting user's account, since
	      LPD does not give any user or host information to the output
	      filter.)</para>
	    
	    <para>On a single printer, LPD allows both an output filter and
	      text or other filters. In such cases, LPD will start the output
	      filter to print the header page (see section <xref
		linkend="printing-advanced-header-pages" remap="Header
		Pages">) only. LPD then expects the output filter to
	      <emphasis>stop itself</emphasis> by sending two bytes to the
	      filter: ASCII 031 followed by ASCII 001. When an output filter
	      sees these two bytes (031, 001), it should stop by sending
	      SIGSTOP to itself. When LPD's done running other filters, it
	      will restart the output filter by sending SIGCONT to it.</para>
	    
	    <para>If there is an output filter but <emphasis>no</emphasis>
	      text filter and LPD is working on a plain text job, LPD uses the
	      output filter to do the job. As stated before, the output
	      filter will print each file of the job in sequence with no
	      intervening form feeds or other paper advancement, and this is
	      probably <emphasis>not</emphasis> what you want. In almost all
	      cases, you need a text filter.</para>
	    
	    <para>The program <command>lpf</command>, which we
	      introduced earlier as a text filter, can also run as an output
	      filter. If you need a quick-and-dirty output filter but do not
	      want to write the byte detection and signal sending code, try
	      <command>lpf</command>. You can also wrap <command>lpf</command> in a shell script to handle any
	      initialization codes the printer might require.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-lpf">
	    <title><command>lpf</command>: a Text Filter</title>
	    
	    <para>The program <filename>/usr/libexec/lpr/lpf</filename> that
	      comes with FreeBSD binary distribution is a text filter (input
	      filter) that can indent output (job submitted with <command>lpr -i</command>), allow literal characters to pass
	      (job submitted with <command>lpr -l</command>), adjust the
	      printing position for backspaces and tabs in the job, and
	      account for pages printed. It can also act like an output
	      filter.</para>
	    
	    <para><command>lpf</command> is suitable for many
	      printing environments. And although it has no capability to
	      send initialization sequences to a printer, it is easy to write
	      a shell script to do the needed initialization and then execute
	      <command>lpf</command>.</para>
	    
	    <para>In order for <command>lpf</command> to do page
	      accounting correctly, it needs correct values filled in for the
	      <literal>pw</literal> and <literal>pl</literal> capabilities in the
	      <filename>/etc/printcap</filename> file. It uses these values
	      to determine how much text can fit on a page and how many pages
	      were in a user's job. For more information on printer
	      accounting, see <xref
		linkend="printing-advanced-acct" remap="Accounting for Printer
		Usage">.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-advanced-header-pages">
	  <title>Header Pages</title>
	  
	  <para>If you have <emphasis>lots</emphasis> of users, all of them
	    using various printers, then you probably want to consider
	    <emphasis>header pages</emphasis> as a necessary evil.</para>
	  
	  <para>Header pages, also known as <emphasis>banner</emphasis> or
	    <emphasis>burst pages</emphasis> identify to whom jobs belong
	    after they are printed. They are usually printed in large, bold
	    letters, perhaps with decorative borders, so that in a stack of
	    printouts they stand out from the real documents that comprise
	    users' jobs. They enable users to locate their jobs quickly. The
	    obvious drawback to a header page is that it is yet one more sheet
	    that has to be printed for every job, their ephemeral usefulness
	    lasting not more than a few minutes, ultimately finding themselves
	    in a recycling bin or rubbish heap. (Note that header pages go
	    with each job, not each file in a job, so the paper waste might
	    not be that bad.)</para>
	  
	  <para>The LPD system can provide header pages automatically for your
	    printouts <emphasis>if</emphasis> your printer can directly print
	    plain text. If you have a PostScript printer, you will need an
	    external program to generate the header page; see <xref
	      linkend="printing-advanced-header-pages-ps" remap="Header Pages
	      on    PostScript Printers">.</para>
	  
	  
	  <sect3 id="printing-advanced-header-pages-enabling">
	    <title>Enabling Header Pages</title>
	    
	    <para>In the <xref linkend="printing-simple" remap="Simple
		Printer        Setup">, we turned off header pages by
	      specifying <literal>sh</literal> (meaning <quote>suppress
	      header</quote>) in the <filename>/etc/printcap</filename> file. To
	      enable header pages for a printer, just remove the <literal>sh</literal> capability.</para>
	    
	    <para>Sounds too easy, right?</para>
	    
	    <para>You are right. You <emphasis>might</emphasis> have to
	      provide an output filter to send initialization strings to the
	      printer. Here is an example output filter for Hewlett Packard
	      PCL-compatible printers:</para>

		<programlisting>
#!/bin/sh
#
#  hpof - Output filter for Hewlett Packard PCL-compatible printers
#  Installed in /usr/local/libexec/hpof

printf "\033&amp;k2G" || exit 2 exec
/usr/libexec/lpr/lpf
	      </programlisting>
	    
	    <para>Specify the path to the output filter in the
	      <literal>of</literal> capability. See <xref
		linkend="printing-advanced-of"
		remap="Output Filters"> for more information.</para>
	    
	    <para>Here is an example <filename>/etc/printcap</filename> file
	      for the printer <literal>teak</literal> that we
	      introduced earlier; we enabled header pages and added the above
	      output filter:</para>

		<programlisting>
#
#  /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
        :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:\
        :if=/usr/local/libexec/hpif:\
        :vf=/usr/local/libexec/hpvf:\
        :of=/usr/local/libexec/hpof:
	      </programlisting>
	    
	    <para>Now, when users print jobs to <literal>teak</literal>, they get a header page with each
	      job. If users want to spend time searching for their printouts,
	      they can suppress header pages by submitting the job with
	      <command>lpr -h</command>; see <xref
		linkend="printing-lpr-options-misc" remap="Header Page
		Options"> for more  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>
	      options.</para>

	    <note>
	      <para>LPD prints a form feed character after the header page.
		If your printer uses a different character or sequence of
		characters to eject a page, specify them with the <literal>ff</literal> capability in
		<filename>/etc/printcap</filename>.</para>
	    </note>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-header-pages-controlling">
	    <title>Controlling Header Pages</title>
	    
	    <para>By enabling header pages, LPD will produce a <emphasis>long
		header</emphasis>, a full page of large letters identifying
	      the user, host, and job. Here is an example (kelly printed the
	      job named outline from host rose):</para>
	    
	      <programlisting>
      k                   ll       ll
      k                    l        l
      k                    l        l
      k   k     eeee       l        l     y    y
      k  k     e    e      l        l     y    y
      k k      eeeeee      l        l     y    y
      kk k     e           l        l     y    y
      k   k    e    e      l        l     y   yy
      k    k    eeee      lll      lll     yyy y
                                               y
                                          y    y
                                           yyyy


                                   ll
                          t         l        i
                          t         l
       oooo    u    u   ttttt       l       ii     n nnn     eeee
      o    o   u    u     t         l        i     nn   n   e    e
      o    o   u    u     t         l        i     n    n   eeeeee
      o    o   u    u     t         l        i     n    n   e
      o    o   u   uu     t  t      l        i     n    n   e    e
       oooo     uuu u      tt      lll      iii    n    n    eeee









      r rrr     oooo     ssss     eeee
      rr   r   o    o   s    s   e    e
      r        o    o    ss      eeeeee
      r        o    o      ss    e
      r        o    o   s    s   e    e
      r         oooo     ssss     eeee







                                              Job:  outline
                                              Date: Sun Sep 17 11:04:58 1995
	      </programlisting>

	    <para>LPD appends a form feed after this text so
	      the job starts on a new page (unless you have <literal>sf</literal> (suppress form feeds) in the
	      destination printer's entry in
	      <filename>/etc/printcap</filename>).</para>
	    
	    <para>If you prefer, LPD can make a <emphasis>short
		header</emphasis>; specify <literal>sb</literal>
	      (short banner) in the <filename>/etc/printcap</filename> file.
	      The header page will look like this:</para>
	    
	      <programlisting>
rose:kelly  Job: outline  Date: Sun Sep 17 11:07:51 1995
	      </programlisting>

	    <para>Also by default, LPD prints the header page
	      first, then the job. To reverse that, specify <literal>hl</literal> (header last) in
	      <filename>/etc/printcap</filename>.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-header-pages-accounting">
	    <title>Accounting for Header Pages</title>
	    
	    <para>Using LPD's built-in header pages enforces a particular
	      paradigm when it comes to printer accounting: header pages must
	      be <emphasis>free of charge</emphasis>.</para>
	    
	    <para>Why?</para>
	    
	    <para>Because the output filter is the only external program that
	      will have control when the header page is printed that could do
	      accounting, and it is not provided with any <emphasis>user or
		host</emphasis> information or an accounting file, so it has
	      no idea whom to charge for printer use. It is also not enough
	      to just <quote>add one page</quote> to the text filter or any of the
	      conversion filters (which do have user and host information)
	      since users can suppress header pages with <command>lpr
		-h</command>. They could still be charged for header pages
	      they did not print. Basically, <command>lpr -h</command> will
	      be the preferred option of environmentally-minded users, but you
	      cannot offer any incentive to use it.</para>
	    
	    <para>It is <emphasis>still not enough</emphasis> to have each of
	      the filters generate their own header pages (thereby being able
	      to charge for them). If users wanted the option of suppressing
	      the header pages with <command>lpr -h</command>, they will still
	      get them and be charged for them since LPD does not pass any
	      knowledge of the <option>-h</option> option to any of the
	      filters.</para>
	    
	    <para>So, what are your options?</para>
	    
	    <para>You can
	      <itemizedlist>
		
		<listitem>
		  <para>Accept LPD's paradigm and make header pages free.</para>
		</listitem>
		
		<listitem>
		  <para>Install an alternative to LPD, such as LPDng or PLP.
		    Section <xref linkend="printing-lpd-alternatives"
		      remap="Alternatives to the Standard   Spooler"> tells
		    more about other spooling software you can substitute for
		    LPD.</para>
		</listitem>
		
		<listitem>
		  <para>Write a <emphasis>smart</emphasis> output filter.
		    Normally, an output filter is not meant to do anything
		    more than initialize a printer or do some simple character
		    conversion. It is suited for header pages and plain text
		    jobs (when there is no text (input) filter). But, if there
		    is a text filter for the plain text jobs, then LPD will
		    start the output filter only for the header pages. And
		    the output filter can parse the header page text that LPD
		    generates to determine what user and host to charge for
		    the header page. The only other problem with this method
		    is that the output filter still does not know what
		    accounting file to use (it is not passed the name of the
		    file from the <literal>af</literal>
		    capability), but if you have a well-known accounting file,
		    you can hard-code that into the output filter. To
		    facilitate the parsing step, use the <literal>sh</literal> (short header) capability in
		    <filename>/etc/printcap</filename>. Then again, all that
		    might be too much trouble, and users will certainly
		    appreciate the more generous system administrator who
		    makes header pages free.</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-header-pages-ps">
	    <title>Header Pages on PostScript Printers</title>
	    
	    <para>As described above, LPD can generate a plain text header
	      page suitable for many printers. Of course, PostScript cannot
	      directly print plain text, so the header page feature of LPD is
	      useless&mdash;or mostly so.</para>
	    
	    <para>One obvious way to get header pages is to have every
	      conversion filter and the text filter generate the header page.
	      The filters should should use the user and host arguments to
	      generate a suitable header page. The drawback of this method is
	      that users will always get a header page, even if they submit
	      jobs with <command>lpr -h</command>.</para>
	    
	    <para>Let us explore this method. The following script takes
	      three arguments (user login name, host name, and job name) and
	      makes a simple PostScript header page:</para>

	      <programlisting>
#!/bin/sh
#
#  make-ps-header - make a PostScript header page on stdout
#  Installed in /usr/local/libexec/make-ps-header
#

#
#  These are PostScript units (72 to the inch).  Modify for A4 or
#  whatever size paper you are using:
#
page_width=612
page_height=792
border=72

#
#  Check arguments
#
if [ $# -ne 3 ]; then
    echo "Usage: `basename $0` &lt;user&gt; &lt;host&gt; &lt;job&gt;" 1&gt;&amp;2
    exit 1
fi

#
#  Save these, mostly for readability in the PostScript, below.
#
user=$1
host=$2
job=$3
date=`date`

#
#  Send the PostScript code to stdout.
#
exec cat &lt;&lt;EOF
%!PS

%
%  Make sure we do not interfere with user's job that will follow
%
save

%
%  Make a thick, unpleasant border around the edge of the paper.
%
$border $border moveto
$page_width $border 2 mul sub 0 rlineto
0 $page_height $border 2 mul sub rlineto
currentscreen 3 -1 roll pop 100 3 1 roll setscreen
$border 2 mul $page_width sub 0 rlineto closepath
0.8 setgray 10 setlinewidth stroke 0 setgray

%
%  Display user's login name, nice and large and prominent
%
/Helvetica-Bold findfont 64 scalefont setfont
$page_width ($user) stringwidth pop sub 2 div $page_height 200 sub moveto
($user) show

%
%  Now show the boring particulars
%
/Helvetica findfont 14 scalefont setfont
/y 200 def
[ (Job:) (Host:) (Date:) ] {
200 y moveto show /y y 18 sub def }
forall

/Helvetica-Bold findfont 14 scalefont setfont
/y 200 def
[ ($job) ($host) ($date) ] {
        270 y moveto show /y y 18 sub def
} forall

%
% That is it
%
restore
showpage
EOF
	      </programlisting>

	    <para>Now, each of the conversion filters and the
	      text filter can call this script to first generate the header
	      page, and then print the user's job. Here is the DVI conversion
	      filter from earlier in this document, modified to make a header
	      page:</para>

	      <programlisting>
#!/bin/sh
#
#  psdf - DVI to PostScript printer filter
#  Installed in /usr/local/libexec/psdf
#
#  Invoked by lpd when user runs lpr -d
#
		
orig_args="$@"

fail() {
    echo "$@" 1&gt;&amp;2
    exit 2
}

while getopts "x:y:n:h:" option; do
    case $option in
        x|y)  ;; # Ignore
        n)    login=$OPTARG ;;
        h)    host=$OPTARG ;;
        *)    echo "LPD started `basename $0` wrong." 1&gt;&amp;2
              exit 2
              ;;
    esac
done

[ "$login" ] || fail "No login name"
[ "$host" ] || fail "No host name"

( /usr/local/libexec/make-ps-header $login $host "DVI File"
  /usr/local/bin/dvips -f ) | eval /usr/local/libexec/lprps $orig_args
	      </programlisting>

	    <para>Notice how the filter has to parse the
	      argument list in order to determine the user and host name. The
	      parsing for the other conversion filters is identical. The text
	      filter takes a slightly different set of arguments, though (see
	      section <xref linkend="printing-advanced-filters"
		remap="How      Filters Work">).</para>
	    
	    <para>As we have mentioned before, the above scheme, though fairly
	      simple, disables the <quote>suppress header page</quote> option (the
	      <option>-h</option> option) to <command>lpr</command>. If users wanted to save a tree (or a
	      few pennies, if you charge for header pages), they would not be
	      able to do so, since every filter's going to print a header page
	      with every job.</para>
	    
	    <para>To allow users to shut off header pages on a per-job basis,
	      you will need to use the trick introduced in section
	      <xref linkend="printing-advanced-header-pages-accounting"
		remap="Accounting for Header Pages">: write an output filter
	      that parses the LPD-generated header page and produces a
	      PostScript version. If the user submits the job with
	      <command>lpr -h</command>, then LPD will not generate a header
	      page, and neither will your output filter. Otherwise, your
	      output filter will read the text from LPD and send the
	      appropriate header page PostScript code to the printer.</para>
	    
	    <para>If you have a PostScript printer on a serial line, you can
	      make use of <command>lprps</command>, which comes
	      with an output filter, <command>psof</command>, which
	      does the above. Note that <command>psof</command>
	      does not charge for header pages.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-advanced-network-printers">
	  <title>Networked Printing</title>
	  
	  <para>FreeBSD supports networked printing: sending jobs to remote
	    printers. Networked printing generally refers to two different
	    things:
	    <itemizedlist>
	      
	      <listitem>
		<para>Accessing a printer attached to a remote host. You
		  install a printer that has a conventional serial or parallel
		  interface on one host. Then, you set up LPD to enable
		  access to the printer from other hosts on the network.
		  Section <xref
		    linkend="printing-advanced-network-rm" remap="Printers
		    Installed on Remote Hosts"> tells how to do this.</para>
	      </listitem>
	      
	      <listitem>
		<para>Accessing a printer attached directly to a network. The
		  printer has a network interface in addition (or in place of)
		  a more conventional serial or parallel interface. Such a
		  printer might work as follows:
		  
		  <itemizedlist>
		    
		    <listitem>
		      <para>It might understand the LPD protocol and can even
			queue jobs from remote hosts. In this case, it acts
			just like a regular host running LPD. Follow the same
			procedure in section <xref
			  linkend="printing-advanced-network-rm"
			  remap="Printers     Installed on Remote Hosts"> to
			set up such a printer.</para>
		    </listitem>
		    
		    <listitem>
		      <para>It might support a data stream network connection.
			In this case, you <quote>attach</quote> the printer to one host
			on the network by making that host responsible for
			spooling jobs and sending them to the printer.
			Section <xref
			  linkend="printing-advanced-network-net-if"
			  remap="Printers     with Networked Data Stream
			  Interfaces"> gives some suggestions on installing
			such printers.</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	      
	    </itemizedlist>
	  </para>
	  
	  
	  <sect3 id="printing-advanced-network-rm">
	    <title>Printers Installed on Remote Hosts</title>
	    
	    <para>The LPD spooling system has built-in support for sending
	      jobs to other hosts also running LPD (or are compatible with
	      LPD). This feature enables you to install a printer on one host
	      and make it accessible from other hosts. It also works with
	      printers that have network interfaces that understand the LPD
	      protocol.</para>
	    
	    <para>To enable this kind of remote printing, first install a
	      printer on one host, the <emphasis>printer host</emphasis>,
	      using the simple printer setup described in <xref
		linkend="printing-simple" remap="Simple Printer Setup">. Do
	      any advanced setup in <xref linkend="printing-advanced"
		remap="Advanced Printer Setup"> that you need. Make sure to
	      test the printer and see if it works with the features of LPD
	      you have enabled.</para>
	    
	    <para>If you are using a printer with a network interface that is
	      compatible with LPD, then the <emphasis>printer host</emphasis>
	      in the discussion below is the printer itself, and the
	      <emphasis>printer name</emphasis> is the name you configured for
	      the printer. See the documentation that accompanied your
	      printer and/or printer-network interface.</para>
	    
	    <para>Then, on the other hosts you want to have access to the
	      printer, make an entry in their
	      <filename>/etc/printcap</filename> files with the following:
	      <orderedlist>
		
		<listitem>
		  <para>Name the entry anything you want. For simplicity,
		    though, you probably want to use the same name and aliases
		    as on the printer host.</para>
		</listitem>
		
		<listitem>
		  <para>Leave the <literal>lp</literal> capability
		    blank, explicitly (<literal>:lp=:</literal>).</para>
		</listitem>
		
		<listitem>
		  <para>Make a spooling directory and specify its location in
		    the <literal>sd</literal> capability. LPD will
		    store jobs here before they get sent to the printer host.</para>
		</listitem>
		
		<listitem>
		  <para>Place the name of the printer host in the <literal>rm</literal> capability.</para>
		</listitem>
		
		<listitem>
		  <para>Place the printer name on the <emphasis>printer
		      host</emphasis> in the <literal>rp</literal>
		    capability.</para>
		</listitem>
		
	      </orderedlist> That is it. You do not need to list conversion
	      filters, page dimensions, or anything else in the
	      <filename>/etc/printcap</filename> file.</para>
	    
	    <para>Here is an example. The host <hostid>rose</hostid> has two printers,
	      <literal>bamboo</literal> and <literal>rattan</literal>. We will enable users on the host
	      orchid to print to those printers. Here is the
	      <filename>/etc/printcap</filename> file for <hostid>orchid</hostid> (back from
	      section
	      <xref linkend="printing-advanced-header-pages-enabling"
		remap="Enabling Header Pages">). It already had the entry for
	      the printer <literal>teak</literal>; we have added
	      entries for the two printers on the host rose:</para>
	      
	      <programlisting>
#
#  /etc/printcap for host orchid - added (remote) printers on rose
#

#
#  teak is local; it is connected directly to orchid:
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
        :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:\
        :if=/usr/local/libexec/ifhp:\
        :vf=/usr/local/libexec/vfhp:\
        :of=/usr/local/libexec/ofhp:

#
#  rattan is connected to rose; send jobs for rattan to rose:
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :lp=:rm=rose:rp=rattan:sd=/var/spool/lpd/rattan:

#
#  bamboo is connected to rose as well:
#
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:
	      </programlisting>

	    <para>Then, we just need to make spooling
	      directories on <hostid>orchid</hostid>:</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>mkdir -p /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput>
&prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput>
&prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput></screen>
	      </informalexample>
	    
	    <para>Now, users on <hostid>orchid</hostid> can print to
	      <literal>rattan</literal> and <literal>bamboo</literal>. If, for example, a user on orchid
	      typed
	      
	      <informalexample>
		<screen>&prompt.user; <userinput>lpr -P bamboo -d sushi-review.dvi</userinput></screen>
	      </informalexample> the LPD system on orchid would copy the job
	      to the spooling directory
	      <filename>/var/spool/lpd/bamboo</filename> and note that it was
	      a DVI job. As soon as the host rose has room in its <hostid>bamboo</hostid> spooling directory, the two LPDs
	      would transfer the file to rose. The file would wait in rose's
	      queue until it was finally printed. It would be converted from
	      DVI to PostScript (since bamboo is a PostScript printer) on
	      rose.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-network-net-if">
	    <title>Printers with Networked Data Stream Interfaces</title>
	    
	    <para>Often, when you buy a network interface card for a printer,
	      you can get two versions: one which emulates a spooler (the more
	      expensive version), or one which just lets you send data to it
	      as if you were using a serial or parallel port (the cheaper
	      version). This section tells how to use the cheaper version.
	      For the more expensive one, see the previous section <xref
		linkend="printing-advanced-network-rm" remap="Printers
		Installed on Remote Hosts">.</para>
	    
	    <para>The format of the <filename>/etc/printcap</filename> file
	      lets you specify what serial or parallel interface to use, and
	      (if you are using a serial interface), what baud rate, whether
	      to use flow control, delays for tabs, conversion of newlines,
	      and more. But there is no way to specify a connection to a
	      printer that is listening on a TCP/IP or other network
	      port.</para>
	    
	    <para>To send data to a networked printer, you need to develop a
	      communications program that can be called by the text and
	      conversion filters. Here is one such example: the script
	      <command>netprint</command> takes all data on
	      standard input and sends it to a network-attached printer. We
	      specify the hostname of the printer as the first argument and
	      the port number to which to connect as the second argument to
	      <command>netprint</command>. Note that this supports
	      one-way communication only (FreeBSD to printer); many network
	      printers support two-way communication, and you might want to
	      take advantage of that (to get printer status, perform
	      accounting, etc.).</para>

	      <programlisting>
#!/usr/bin/perl
#
#  netprint - Text filter for printer attached to network
#  Installed in /usr/local/libexec/netprint
#
$#ARGV eq 1 || die "Usage: $0 &lt;printer-hostname&gt; &lt;port-number&gt;";

$printer_host = $ARGV[0];
$printer_port = $ARGV[1];

require 'sys/socket.ph';

($ignore, $ignore, $protocol) = getprotobyname('tcp');
($ignore, $ignore, $ignore, $ignore, $address)
    = gethostbyname($printer_host);

$sockaddr = pack('S n a4 x8', &amp;AF_INET, $printer_port, $address);

socket(PRINTER, &amp;PF_INET, &amp;SOCK_STREAM, $protocol)
    || die "Can't create TCP/IP stream socket: $!";
connect(PRINTER, $sockaddr) || die "Can't contact $printer_host: $!";
while (&lt;STDIN&gt;) { print PRINTER; }
exit 0;
	      </programlisting>
	    
	    <para>We can then use this script in various
	      filters. Suppose we had a Diablo 750-N line printer connected
	      to the network. The printer accepts data to print on port
	      number 5100. The host name of the printer is scrivener. Here
	      is the text filter for the printer:</para>

	      <programlisting>
#!/bin/sh
#
#  diablo-if-net - Text filter for Diablo printer `scrivener' listening
#  on port 5100.   Installed in /usr/local/libexec/diablo-if-net # exec
/usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100
	      </programlisting>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-advanced-restricting">
	  <title>Restricting Printer Usage</title>
	  
	  <para>This section gives information on restricting printer usage.
	    The LPD system lets you control who can access a printer, both
	    locally or remotely, whether they can print multiple copies, how
	    large their jobs can be, and how large the printer queues can
	    get.</para>
	  
	  
	  <sect3 id="printing-advanced-restricting-copies">
	    <title>Restricting Multiple Copies</title>
	    
	    <para>The LPD system makes it easy for users to print multiple
	      copies of a file. Users can print jobs with <command>lpr
		-#5</command> (for example) and get five copies of each file
	      in the job. Whether this is a good thing is up to you.</para>
	    
	    <para>If you feel multiple copies cause unnecessary wear and tear
	      on your printers, you can disable the <option>-#</option> option
	      to  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry> by
	      adding the <literal>sc</literal> capability to the
	      <filename>/etc/printcap</filename> file. When users submit jobs
	      with the <option>-#</option> option, they will see:</para>
	      
	      <informalexample>
		<screen>lpr: multiple copies are not allowed</screen>
	      </informalexample>
	    
	    <para>Note that if you have set up access to a printer remotely
	      (see section <xref linkend="printing-advanced-network-rm"
		remap="Printers Installed on Remote      Hosts">), you need
	      the <literal>sc</literal> capability on the remote
	      <filename>/etc/printcap</filename> files as well, or else users
	      will still be able to submit multiple-copy jobs by using another
	      host.</para>
	    
	    <para>Here is an example. This is the
	      <filename>/etc/printcap</filename> file for the host <hostid>rose</hostid>. The
	      printer <literal>rattan</literal> is quite hearty, so
	      we will allow multiple copies, but the laser printer <literal>bamboo</literal>'s a bit more delicate, so we will
	      disable multiple copies by adding the <literal>sc</literal> capability:</para>

	      <programlisting>
#
#  /etc/printcap for host rose - restrict multiple copies on bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:sc:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\
        :if=/usr/local/libexec/psif:\
        :df=/usr/local/libexec/psdf:
	      </programlisting>
	    
	    <para>Now, we also need to add the <literal>sc</literal> capability on the host <hostid>orchid</hostid>'s
	      <filename>/etc/printcap</filename> (and while we are at it, let
	      us disable multiple copies for the printer <literal>teak</literal>):</para>

	      <programlisting>
#
#  /etc/printcap for host orchid - no multiple copies for local
#  printer teak or remote printer bamboo
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
        :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:sc:\
        :if=/usr/local/libexec/ifhp:\
        :vf=/usr/local/libexec/vfhp:\
        :of=/usr/local/libexec/ofhp:

rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :lp=:rm=rose:rp=rattan:sd=/var/spool/lpd/rattan:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc:
	      </programlisting>
	    
	    <para>By using the <literal>sc</literal>
	      capability, we prevent the use of <command>lpr -#</command>, but
	      that still does not prevent users from running  <citerefentry>
		<refentrytitle>lpr</refentrytitle></citerefentry>
	      multiple times, or from submitting the same file multiple times
	      in one job like this:</para>
	      
	      <informalexample>
		<screen>&prompt.user; <userinput>lpr forsale.sign forsale.sign forsale.sign forsale.sign forsale.sign</userinput></screen>
	      </informalexample>

	    <para>There are many ways to prevent this abuse
	      (including ignoring it) which you are free to explore.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-restricting-access">
	    <title>Restricting Access To Printers</title>
	    
	    <para>You can control who can print to what printers by using the
	      UNIX group mechanism and the <literal>rg</literal>
	      capability in <filename>/etc/printcap</filename>. Just place
	      the users you want to have access to a printer in a certain
	      group, and then name that group in the <literal>rg</literal> capability.</para>
	    
	    <para>Users outside the group (including root) will be greeted
	      with
	      
	      <informalexample>
		<screen>lpr: Not a member of the restricted group</screen>
	      </informalexample>

	      if they try to print to the controlled
	      printer.</para>
	    
	    <para>As with the <literal>sc</literal> (suppress
	      multiple copies) capability, you need to specify <literal>rg</literal> on remote hosts that also have access
	      to your printers, if you feel it is appropriate (see section
	      <xref linkend="printing-advanced-network-rm"
		remap="Printers Installed on Remote Hosts">).</para>
	    
	    <para>For example, we will let anyone access the printer
	      <literal>rattan</literal>, but only those in group
	      <literal>artists</literal> can use <literal>bamboo</literal>. Here is the familiar
	      <filename>/etc/printcap</filename> for host <hostid>rose</hostid>:</para>

	      <programlisting>
#
#  /etc/printcap for host rose - restricted group for bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\
        :if=/usr/local/libexec/psif:\
        :df=/usr/local/libexec/psdf:
	      </programlisting>

	    <para>Let us leave the other example
	      <filename>/etc/printcap</filename> file (for the host <hostid>orchid</hostid>)
	      alone. Of course, anyone on <hostid>orchid</hostid> can print to
	      <literal>bamboo</literal>. It might be the case that we only
	      allow certain logins on <hostid>orchid</hostid> anyway, and want them to have
	      access to the printer. Or not.</para>

	    <note>
	      <para>There can be only one restricted group per printer.</para>
	    </note>
	  </sect3>
	  
	  <sect3 id="printing-advanced-restricting-sizes">
	    <title>Controlling Sizes of Jobs Submitted</title>
	    
	    <para>If you have many users accessing the printers, you probably
	      need to put an upper limit on the sizes of the files users can
	      submit to print. After all, there is only so much free space on
	      the filesystem that houses the spooling directories, and you
	      also need to make sure there is room for the jobs of other
	      users.</para>
	    
	    <para>LPD enables you to limit the maximum byte size a file in a
	      job can be with the <literal>mx</literal> capability.
	      The units are in BUFSIZ blocks, which are 1024 bytes. If you
	      put a zero for this capability, there will be no limit on file
	      size.</para>

	    <note>
	      <para>The limit applies to <emphasis>files</emphasis> in a job,
		and <emphasis>not</emphasis> the total job size.</para>
	    </note>
	    
	    <para>LPD will not refuse a file that is larger than the limit you
	      place on a printer. Instead, it will queue as much of the file
	      up to the limit, which will then get printed. The rest will be
	      discarded. Whether this is correct behavior is up for
	      debate.</para>
	    
	    <para>Let us add limits to our example printers
	      <literal>rattan</literal> and <literal>bamboo</literal>. Since those artists' PostScript
	      files tend to be large, we will limit them to five megabytes.
	      We will put no limit on the plain text line printer:</para>

	      <programlisting>
#
#  /etc/printcap for host rose
#

#
#  No limit on job size:
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
        :sh:sd=/var/spool/lpd/rattan:\
        :lp=/dev/lpt0:\
        :if=/usr/local/libexec/if-simple:

#
#  Limit of five megabytes:
#
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\
        :if=/usr/local/libexec/psif:\
        :df=/usr/local/libexec/psdf:
	      </programlisting>

	    <para>Again, the limits apply to the local users
	      only. If you have set up access to your printers remotely,
	      remote users will not get those limits. You will need to
	      specify the <literal>mx</literal> capability in the
	      remote <filename>/etc/printcap</filename> files as well. See
	      section <xref
		linkend="printing-advanced-network-rm" remap="Printers
		Installed      on Remote Hosts"> for more information on
	      remote printing.</para>
	    
	    <para>There is another specialized way to limit job sizes from
	      remote printers; see section <xref
		linkend="printing-advanced-restricting-remote"
		remap="Restricting Jobs from Remote Printers">.</para>
	    
	  </sect3>
	  
	  <sect3 id="printing-advanced-restricting-remote">
	    <title>Restricting Jobs from Remote Printers</title>
	    
	    <para>The LPD spooling system provides several ways to restrict
	      print jobs submitted from remote hosts:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>Host restrictions</term>
		  <listitem>
		    <para>You can control from which remote hosts a local LPD
		      accepts requests with the files
		      <filename>/etc/hosts.equiv</filename> and
		      <filename>/etc/hosts.lpd</filename>. LPD checks to see
		      if an incoming request is from a host listed in either
		      one of these files. If not, LPD refuses the
		      request.</para>
		    
		    <para>The format of these files is simple: one host name
		      per line. Note that the file
		      <filename>/etc/hosts.equiv</filename> is also used by
		      the
		      <citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like  <citerefentry>
			<refentrytitle>rsh</refentrytitle></citerefentry> and
		      <citerefentry>
			<refentrytitle>rcp</refentrytitle></citerefentry>, so be careful.</para>
		    
		    <para>For example, here is the
		      <filename>/etc/hosts.lpd</filename> file on the host
		    <hostid>rose</hostid>:

		      <programlisting>
orchid
violet
madrigal.fishbaum.de
		      </programlisting>
		    
		    This means <hostid>rose</hostid> will accept requests
		    from the hosts <hostid>orchid</hostid>,
		    <hostid>violet</hostid>, and <hostid role="fqdn">madrigal.fishbaum.de</hostid>.
		    If any other host tries to access <hostid>rose</hostid>'s LPD, LPD will
		      refuse them.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Size restrictions</term>
		  
		  <listitem>
		    <para>You can control how much free space there needs to
		      remain on the filesystem where a spooling directory
		      resides. Make a file called
		      <filename>minfree</filename> in the spooling directory
		      for the local printer. Insert in that file a number
		      representing how many disk blocks (512 bytes) of free
		      space there has to be for a remote job to be
		      accepted.</para>
		    
		    <para>This lets you insure that remote users will not fill
		      your filesystem. You can also use it to give a certain
		      priority to local users: they will be able to queue jobs
		      long after the free disk space has fallen below the
		      amount specified in the <filename>minfree</filename>
		      file.</para>
		    
		    <para>For example, let us add a
		      <filename>minfree</filename> file for the printer
		      <hostid>bamboo</hostid>. We examine
		      <filename>/etc/printcap</filename> to find the spooling
		      directory for this printer; here is
		    <hostid>bamboo</hostid>'s entry:</para>
		  
		      <programlisting>
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
        :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\
        :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:mx#5000:\
        :if=/usr/local/libexec/psif:\
        :df=/usr/local/libexec/psdf:
		      </programlisting>

		  <para>The spooling directory is the given
		      in the <literal>sd</literal> capability. We
		      will make three megabytes (which is 6144 disk blocks)
		      the amount of free disk space that must exist on the
		      filesystem for LPD to accept remote jobs:</para>
		  
		      <informalexample>
			<screen>&prompt.root; <userinput>echo 6144 &gt; /var/spool/lpd/bamboo/minfree</userinput></screen>
		      </informalexample>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>User restrictions</term>
		  
		  <listitem>
		    <para>You can control which remote users can print to
		      local printers by specifying the <literal>rs</literal> capability in
		      <filename>/etc/printcap</filename>. When <literal>rs</literal> appears in the entry for a
		      locally-attached printer, LPD will accept jobs from
		      remote hosts <emphasis>if</emphasis> the user submitting
		      the job also has an account of the same login name on
		      the local host. Otherwise, LPD refuses the job.</para>
		    
		    <para>This capability is particularly useful in an
		      environment where there are (for example) different
		      departments sharing a network, and some users transcend
		      departmental boundaries. By giving them accounts on
		      your systems, they can use your printers from their own
		      departmental systems. If you would rather allow them to
		      use <emphasis>only</emphasis> your printers and not your
		      compute resources, you can give them <quote>token</quote> accounts,
		      with no home directory and a useless shell like
		      <filename>/usr/bin/false</filename>.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	</sect2>
	
	<sect2 id="printing-advanced-acct">
	  <title>Accounting for Printer Usage</title>
	  
	  <para>So, you need to charge for printouts. And why not? Paper
	    and ink cost money. And then there are maintenance
	    costs&mdash;printers are loaded with moving parts and tend to break
	    down. You have examined your printers, usage patterns, and
	    maintenance fees and have come up with a per-page (or per-foot,
	    per-meter, or per-whatever) cost. Now, how do you actually start
	    accounting for printouts?</para>
	  
	  <para>Well, the bad news is the LPD spooling system does not provide
	    much help in this department. Accounting is highly dependent on
	    the kind of printer in use, the formats being printed, and
	    <emphasis>your</emphasis> requirements in charging for printer
	    usage.</para>
	  
	  <para>To implement accounting, you have to modify a printer's text
	    filter (to charge for plain text jobs) and the conversion filters
	    (to charge for other file formats), to count pages or query the
	    printer for pages printed. You cannot get away with using the
	    simple output filter, since it cannot do accounting. See section
	    <xref
	      linkend="printing-advanced-filter-intro"
	      remap="Filters">.</para>
	  
	  <para>Generally, there are two ways to do accounting:
	    <itemizedlist>
	      
	      <listitem>
		<para><emphasis>Periodic accounting</emphasis> is the more
		  common way, possibly because it is easier. Whenever someone
		  prints a job, the filter logs the user, host, and number of
		  pages to an accounting file. Every month, semester, year,
		  or whatever time period you prefer, you collect the
		  accounting files for the various printers, tally up the
		  pages printed by users, and charge for usage. Then you
		  truncate all the logging files, starting with a clean slate
		  for the next period.</para>
	      </listitem>
	      
	      <listitem>
		<para><emphasis>Timely accounting</emphasis> is less common,
		  probably because it is more difficult. This method has the
		  filters charge users for printouts as soon as they use the
		  printers. Like disk quotas, the accounting is immediate.
		  You can prevent users from printing when their account goes
		  in the red, and might provide a way for users to check and
		  adjust their <quote>print quotas.</quote> But this method requires some
		  database code to track users and their quotas.</para>
	      </listitem>
	      
	    </itemizedlist>
	  </para>
	  
	  <para>The LPD spooling system supports both methods easily: since
	    you have to provide the filters (well, most of the time), you also
	    have to provide the accounting code. But there is a bright side:
	    you have enormous flexibility in your accounting methods. For
	    example, you choose whether to use periodic or timely accounting.
	    You choose what information to log: user names, host names, job
	    types, pages printed, square footage of paper used, how long the
	    job took to print, and so forth. And you do so by modifying the
	    filters to save this information.</para>
	  
	  
	  <sect3>
	    <title>Quick and Dirty Printer Accounting</title>
	    
	    <para>FreeBSD comes with two programs that can get you set up
	      with simple periodic accounting right away. They are the text
	      filter <command>lpf</command>, described in section
	      <xref linkend="printing-advanced-lpf" remap="lpf: a Text
		Filter">, and</para>
	    
	    <para><citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>, a
	      program to gather and total entries from printer accounting
	      files.</para>
	    
	    <para>As mentioned in the section on filters (<xref
		linkend="printing-advanced-filters" remap="Filters">), LPD
	      starts the text and the conversion filters with the name of the
	      accounting file to use on the filter command line. The filters
	      can use this argument to know where to write an accounting file
	      entry. The name of this file comes from the <literal>af</literal> capability in
	      <filename>/etc/printcap</filename>, and if not specified as an
	      absolute path, is relative to the spooling directory.</para>
	    
	    <para>LPD starts <command>lpf</command> with page width
	      and length arguments (from the <literal>pw</literal>
	      and <literal>pl</literal> capabilities). <command>lpf</command> uses these arguments to determine how
	      much paper will be used. After sending the file to the printer,
	      it then writes an accounting entry in the accounting file. The
	      entries look like this:</para>

	      <programlisting>
2.00 rose:andy
3.00 rose:kelly
3.00 orchid:mary
5.00 orchid:mary
2.00 orchid:zhang</programlisting>
	    
	    <para>You should use a separate accounting file for
	      each printer, as <command>lpf</command> has no file
	      locking logic built into it, and two <command>lpf</command>s might corrupt each other's entries if
	      they were to write to the same file at the same time. A easy way
	      to insure a separate accounting file for each printer is to use
	      <literal>af=acct</literal> in
	      <filename>/etc/printcap</filename>. Then, each accounting file
	      will be in the spooling directory for a printer, in a file named
	      <filename>acct</filename>.</para>
	    
	    <para>When you are ready to charge users for printouts, run
	      the <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>
	      program. Just change to the spooling directory for the printer
	      you want to collect on and type  <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>. You
	      will get a dollar-centric summary like the following:</para>
	    
	      <informalexample>
		<screen>  Login               pages/feet   runs    price
orchid:kelly                5.00    1   $  0.10
orchid:mary                31.00    3   $  0.62
orchid:zhang                9.00    1   $  0.18
rose:andy                   2.00    1   $  0.04
rose:kelly                177.00  104   $  3.54
rose:mary                  87.00   32   $  1.74
rose:root                  26.00   12   $  0.52

total                     337.00  154   $  6.74</screen>
	      </informalexample>

	    <para>These are the arguments  <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>
	      expects:</para>
	    
	      <variablelist>
		<varlistentry><term><option>-P<replaceable>printer</replaceable></option></term>
		  <listitem>
		    <para>Which <replaceable>printer</replaceable> to
		      summarize. This option works only if there is an
		      absolute path in the <literal>af</literal>
		      capability in <filename>/etc/printcap</filename>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-c</option></term>
		  
		  <listitem>
		    <para>Sort the output by cost instead of alphabetically by
		      user name.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-m</option></term>
		  
		  <listitem>
		    <para>Ignore host name in the accounting files. With this
		    option, user <username>smith</username> on host <hostid>alpha</hostid> is the same user <username>smith</username>
		    on host <hostid>gamma</hostid>. Without, they are different
		      users.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-p<replaceable>price</replaceable></option></term>
		  
		  <listitem>
		    <para>Compute charges with <replaceable>price</replaceable> dollars per page or per foot
		      instead of the price from the <literal>pc</literal> capability in
		      <filename>/etc/printcap</filename>, or two cents (the
		      default). You can specify <replaceable>price</replaceable> as a floating point
		      number.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-r</option></term>
		  
		  <listitem>
		    <para>Reverse the sort order.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><option>-s</option></term>
		  
		  <listitem>
		    <para>Make an accounting summary file and truncate the
		      accounting file.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><replaceable>name</replaceable> <replaceable>&hellip;</replaceable></term>
		  
		  <listitem>
		    <para>Print accounting information for the given user
		      <replaceable>names</replaceable> only.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    <para>In the default summary that  <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>
	      produces, you see the number of pages printed by each user from
	      various hosts. If, at your site, host does not matter (because
	      users can use any host), run <command>pac -m</command>, to
	      produce the following summary:</para>
	    
	      <informalexample>
		<screen>  Login               pages/feet   runs    price
andy                        2.00    1   $  0.04
kelly                     182.00  105   $  3.64
mary                      118.00   35   $  2.36
root                       26.00   12   $  0.52
zhang                       9.00    1   $  0.18

total                     337.00  154   $  6.74</screen>
	      </informalexample>

	    <para>To compute the dollar amount due,
	      <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry> uses
	      the <literal>pc</literal> capability in the
	      <filename>/etc/printcap</filename> file (default of 200, or 2
	      cents per page). Specify, in hundredths of cents, the price per
	      page or per foot you want to charge for printouts in this
	      capability. You can override this value when you run
	      <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry> with
	      the <option>-p</option> option. The units for the
	      <option>-p</option> option are in dollars, though, not
	      hundredths of cents. For example,
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>pac -p1.50</userinput></screen>
	      </informalexample>

	      makes each page cost one dollar and fifty
	      cents. You can really rake in the profits by using this
	      option.</para>
	    
	    <para>Finally, running <command>pac -s</command> will save the
	      summary information in a summary accounting file, which is named
	      the same as the printer's accounting file, but with
	      <literal>_sum</literal> appended to the name. It then truncates
	      the accounting file. When you run  <citerefentry>
		<refentrytitle>pac</refentrytitle></citerefentry>
	      again, it rereads the summary file to get starting totals, then
	      adds information from the regular accounting file.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>How Can You Count Pages Printed?</title>
	    
	    <para>In order to perform even remotely accurate accounting, you
	      need to be able to determine how much paper a job uses. This is
	      the essential problem of printer accounting.</para>
	    
	    <para>For plain text jobs, the problem's not that hard to solve:
	      you count how many lines are in a job and compare it to how many
	      lines per page your printer supports. Do not forget to take
	      into account backspaces in the file which overprint lines, or
	      long logical lines that wrap onto one or more additional
	      physical lines.</para>
	    
	    <para>The text filter <command>lpf</command>
	      (introduced in <xref linkend="printing-advanced-lpf" remap="lpf:
		a Text Filter">) takes into account these things when it does
	      accounting. If you are writing a text filter which needs to do
	      accounting, you might want to examine <command>lpf</command>'s source code.</para>
	    
	    <para>How do you handle other file formats, though?</para>
	    
	    <para>Well, for DVI-to-LaserJet or DVI-to-PostScript conversion,
	      you can have your filter parse the diagnostic output of</para>
	    
	    <para><citerefentry>
		<refentrytitle>dvilj</refentrytitle></citerefentry> or
	      <citerefentry>
		<refentrytitle>dvips</refentrytitle></citerefentry> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
	    
	    <para>But these methods suffer from the fact that the printer may
	      not actually print all those pages. For example, it could jam,
	      run out of toner, or explode&mdash;and the user would still get
	      charged.</para>
	    
	    <para>So, what can you do?</para>
	    
	    <para>There is only one <emphasis>sure</emphasis> way to do
	      <emphasis>accurate</emphasis> accounting. Get a printer that
	      can tell you how much paper it uses, and attach it via a serial
	      line or a network connection. Nearly all PostScript printers
	      support this notion. Other makes and models do as well
	      (networked Imagen laser printers, for example). Modify the
	      filters for these printers to get the page usage after they
	      print each job and have them log accounting information based on
	      that value <emphasis>only</emphasis>. There is no line counting
	      nor error-prone file examination required.</para>
	    
	    <para>Of course, you can always be generous and make all printouts
	      free.</para>
	    
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="printing-lpd-alternatives">
	<title>Alternatives to the Standard Spooler</title>
	
	<para>If you have been reading straight through this manual, by now
	  you have learned just about everything there is to know about the
	  LPD spooling system that comes with FreeBSD. You can probably
	  appreciate many of its shortcomings, which naturally leads to the
	  question: <quote>What other spooling systems are out there (and work with
	  FreeBSD)?</quote></para>
	
	<para>Unfortunately, I have located only <emphasis>two</emphasis>
	  alternatives&mdash;and they are almost identical to each other! They
	  are:</para>
	
	  <variablelist>
	    <varlistentry><term>PLP, the Portable Line Printer Spooler
		System</term>
	      <listitem>
		<para>PLP was based on software developed by Patrick Powell
		  and then maintained by an Internet-wide group of developers.
		  The main site for the software is at  <ulink
		    URL="ftp://ftp.iona.ie/pub/plp">ftp://ftp.iona.ie/pub/plp</ulink>. There is also a <ulink URL="http://www.iona.ie:8000/www/hyplan/jmason/plp.html">web page</ulink>.</para>
		
		<para>It is quite similar to the BSD LPD spooler, but boasts a
		  host of features, including:
		  <itemizedlist>
		    
		    <listitem>
		      <para>Better network support, including built-in support
			for networked printers, NIS-maintained printcaps, and
			NFS-mounted spooling directories</para>
		    </listitem>
		    
		    <listitem>
		      <para>Sophisticated queue management, allowing multiple
			printers on a queue, transfer of jobs between queues,
			and queue redirection</para>
		    </listitem>
		    
		    <listitem>
		      <para>Remote printer control functions</para>
		    </listitem>
		    
		    <listitem>
		      <para>Prioritization of jobs</para>
		    </listitem>
		    
		    <listitem>
		      <para>Expansive security and access options</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>LPRng</term>
	      
	      <listitem>
		<para>LPRng, which purportedly means <quote>LPR: the Next
		  Generation</quote> is a complete rewrite of PLP. Patrick Powell
		  and Justin Mason (the principal maintainer of PLP)
		  collaborated to make LPRng. The main site for LPRng is
		  <ulink
		    URL="ftp://dickory.sdsu.edu/pub/LPRng">ftp://dickory.sdsu.edu/pub/LPRng</ulink>.</para>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
      </sect1>
      
      <sect1>
	<title>Acknowledgments</title>
	
	<para>I would like to thank the following people who have assisted in
	  the development of this document:</para>
	
	
	  <variablelist>
	    <varlistentry><term>Daniel Eischen
		<email>deischen@iworks.interworks.org</email></term>
	      <listitem>
		<para>For providing a plethora of HP filter programs for
		  perusal.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>&a.jehamby;</term>
	      
	      <listitem>
		<para>For the Ghostscript-to-HP filter.</para>
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>My wife, Mary Kelly
		<email>urquhart@argyre.colorado.edu</email></term>
	      
	      <listitem>
		<para>For allowing me to spend more time with FreeBSD than
		  with her.</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	  
      </sect1>
    </chapter>
    
    <chapter id="quotas">
      <title>Disk Quotas</title>
      
      <para><emphasis>Contributed by &a.mpp;.<!-- <br> -->26 February
	  1996</emphasis></para>
      
      <para>Quotas are an optional feature of the operating system that allow
	you to limit the amount of disk space and/or the number of files a
	user, or members of a group, may allocate on a per-file system basis.
	This is used most often on timesharing systems where it is desirable
	to limit the amount of resources any one user or group of users may
	allocate. This will prevent one user from consuming all of the
	available disk space.</para>
      
      
      <sect1>
	<title>Configuring Your System to Enable Disk Quotas</title>
	
	<para>Before attempting to use disk quotas it is necessary to make
	  sure that quotas are configured in your kernel. This is done by
	  adding the following line to your kernel configuration file:</para>

	  <programlisting>
options QUOTA
	  </programlisting>

	<para>The
	  stock <filename>GENERIC</filename> kernel does not have this enabled
	  by default, so you will have to configure, build and install a
	  custom kernel in order to use  disk quotas. Please refer to the
	  <xref linkend="kernelconfig" remap="Configuring the FreeBSD Kernel">
	  section for more information on kernel configuration.</para>
	
	<para>Next you will need to enable disk quotas in
	  <filename>/etc/sysconfig</filename>. This is done by changing the
	  line:
	  
	  <programlisting>
quotas=NO
	  </programlisting>

	  to:
	  
	  <programlisting>
quotas=YES
	  </programlisting></para>
	
	<para>If you are running FreeBSD 2.2.2 or later, the configuration
	  file will be <filename>/etc/rc.conf</filename> instead and the
	  variable name changed to:</para>
	  
	  <programlisting>
check_quotas=YES
	  </programlisting>
	
	<para>Finally you will need to edit <filename>/etc/fstab</filename> to
	  enable  disk quotas on a per-file system basis. This is where you
	  can either enable user or group quotas or both for all of your file
	  systems.</para>
	
	<para>To enable per-user quotas on a file system, add the  <literal>userquota</literal> option to the options field in the
	  <filename>/etc/fstab</filename> entry for the file system you want
	  to to enable quotas on. For example:</para>

	  <programlisting>
/dev/sd1s2g   /home    ufs rw,userquota 1 2
	  </programlisting>
	
	<para>Similarly, to enable group quotas, use the
	  <literal>groupquota</literal> option instead of the <literal>userquota</literal> keyword. To enable both user and
	  group quotas, change the entry as follows:</para>

	  <programlisting>
/dev/sd1s2g    /home    ufs rw,userquota,groupquota 1 2
	  </programlisting>
	
	<para>By default the quota files are stored in the root directory of
	  the file system with the names <filename>quota.user</filename> and
	  <filename>quota.group</filename> for user and group quotas
	  respectively. See <command>man fstab</command> for more
	  information. Even though that man page says that you can specify an
	  alternate location for the quota files, this is not recommended
	  since all of the various quota utilities do not seem to handle this
	  properly.</para>
	
	<para>At this point you should reboot your system with your new
	  kernel. <filename>/etc/rc</filename> will automatically run the
	  appropriate commands to  create the initial quota files for all of
	  the quotas you enabled in <filename>/etc/fstab</filename>, so there
	  is no need to manually create any zero length quota files.</para>
	
	<para>In the normal course of operations you should not be required to
	  run the <command>quotacheck</command>, <command>quotaon</command>, or <command>quotaoff</command> commands manually. However, you may
	  want to read their man pages just to be familiar with their
	  operation.</para>
	
      </sect1>
      
      <sect1>
	<title>Setting Quota Limits</title>
	
	<para>Once you have configured your system to enable quotas, verify
	  that they really are enabled. An easy way to do this is to run</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>quota -v</userinput></screen>
	  </informalexample>
	
	<para>You should see a one line summary of
	  disk usage and current quota limits for each file system that quotas
	  are enabled on.</para>
	
	<para>You are now ready to start assigning quota limits with the
	  <command>edquota</command> command.</para>
	
	<para>You have several options on how to enforce limits on the amount
	  of disk space a user or group may allocate, and how many files they
	  may create. You may limit allocations based on disk space (block
	  quotas) or number of files (inode quotas) or a combination of both.
	  Each of these limits are further broken down into two categories:
	  hard and soft limits.</para>
	
	<para>A hard limit may not be exceeded. Once a user reaches their
	  hard limit they may not make any further allocations on the file
	  system in question. For example, if the user has a hard limit of
	  500 blocks on a file system and is currently using 490 blocks, the
	  user can only allocate an additional 10 blocks. Attempting to
	  allocate an additional 11 blocks  will fail.</para>
	
	<para>Soft limits on the other hand can be exceeded for a limited
	  amount of time. This period of time is known as the grace period,
	  which is one week by default. If a user stays over his or her soft
	  limit longer than their grace period, the soft limit will turn into
	  a hard limit and no further allocations will be allowed. When the
	  user drops back below the soft limit, the grace period will be
	  reset.</para>
	
	<para>The following is an example of what you might see when you run
	  then <command>edquota</command> command. When the
	  <command>edquota</command> command is invoked, you are
	  placed into the editor specified by the <envar>EDITOR</envar>
	  environment variable, or in the <command>vi</command>
	  editor  if the <envar>EDITOR</envar> variable is not set, to
	  allow you to edit the quota limits.</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>edquota -u test</userinput></screen>
	  </informalexample>

	  <programlisting>
Quotas for user test:
/usr: blocks in use: 65, limits (soft = 50, hard = 75)
        inodes in use: 7, limits (soft = 50, hard = 60)
/usr/var: blocks in use: 0, limits (soft = 50, hard = 75)
        inodes in use: 0, limits (soft = 50, hard = 60)
	  </programlisting>

	<para>You will
	  normally see two lines for each file system that has quotas enabled.
	  One line for the block limits, and one line for inode limits.
	  Simply change the value you want updated to modify the quota limit.
	  For example, to raise this users block limit from a soft limit of 50
	  and a hard limit of 75 to a soft limit of 500 and a hard limit of
	  600, change:

	  <programlisting>
/usr: blocks in use: 65, limits (soft = 50, hard = 75)
	  </programlisting> to:

	  <programlisting>
/usr: blocks in use: 65, limits (soft = 500, hard = 600)
	  </programlisting></para>

	<para>The new
	  quota limits will be in place when you exit the editor.</para>
	
	<para>Sometimes it is desirable to set quota limits on a range of
	  uids. This can be done by use of the <option>-p</option> option on
	  the <command>edquota</command> command. First, assign
	  the desired quota limit to a user, and then run  <command>edquota -p
	    protouser startuid-enduid</command>. For example, if user
	  <username>test</username> has the desired quota limits, the
	  following command can be used to duplicate those quota limits for
	  uids 10,000 through 19,999:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>edquota -p test 10000-19999</userinput></screen>
	  </informalexample>
	
	<para>The ability to specify uid ranges was added to the system after
	  2.1 was released. If you need this feature on a 2.1 system, you
	  will need to obtain a newer copy of edquota.</para>
	
	<para>See <command>man edquota</command> for more detailed
	  information.</para>
	
      </sect1>
      
      <sect1>
	<title>Checking Quota Limits and Disk Usage</title>
	
	<para>You can use either the <command>quota</command> or
	  the <command>repquota</command> commands to check quota
	  limits and disk usage. The <command>quota</command>
	  command can be used to check individual user and group quotas and
	  disk usage. Only the super-user may examine quotas and usage for
	  other users, or for groups that they are not a member of. The
	  <command>repquota</command> command can be used to get a
	  summary of all quotas and disk usage for file systems with quotas
	  enabled.</para>
	
	<para>The following is some sample output from the <command>quota
	    -v</command> command for a user that has quota limits on two file
	  systems.</para>
	
	
	  <programlisting>
Disk quotas for user test (uid 1002):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
           /usr      65*     50      75   5days       7      50      60
       /usr/var       0      50      75               0      50      60
	  </programlisting>

	<para>On the <filename>/usr</filename> file system in the above example this
	  user is  currently 15 blocks over their soft limit of 50 blocks and
	  has 5 days of  their grace period left. Note the asterisk <literal>*</literal> which
	  indicates that the user is currently over their quota limit.</para>
	
	<para>Normally file systems that the user is not using any disk space
	  on will not show up in the output from the <command>quota</command> command, even if they have a quota limit
	  assigned for that file system. The <option>-v</option> option will
	  display those file systems, such as  the
	  <filename>/usr/var</filename> file system in the above
	  example.</para>
	
      </sect1>
      
      <sect1>
	<title>* Quotas over NFS</title>
	
	<para>This section is still under development.</para>
	
      </sect1>
    </chapter>
    
    <chapter>
      <title>The X Window System</title>
      
      <para>Pending the completion of this section, please refer to
	documentation supplied by the <ulink URL="http://www.xfree86.org/">The
	  XFree86 Project, Inc</ulink>.</para>
      
    </chapter>
    
    <chapter id="hw">
      <title>PC Hardware compatibility</title>
      
      <para>Issues of hardware compatibility are among the most troublesome in
	the computer industry today and FreeBSD is by no means immune to
	trouble. In this respect, FreeBSD's advantage of being able to run on
	inexpensive commodity PC hardware is also its liability when it comes
	to support for the amazing variety of components on the market. While
	it would be impossible to provide a exhaustive listing of hardware
	that FreeBSD supports, this section serves as a catalog of the device
	drivers included with FreeBSD and the hardware each drivers supports.
	Where possible and appropriate, notes about specific products are
	included. You may also want to refer to <xref
	  linkend="kernelconfig-config"
	  remap="the kernel configuration file"> section in this handbook for
	a list of supported devices.</para>
      
      <para>As FreeBSD is a volunteer project without a funded testing
	department, we depend on you, the user, for much of the information
	contained in this catalog. If you have direct experience of hardware
	that does or does not work with FreeBSD, please let us know by sending
	e-mail to the &a.doc;. Questions about supported hardware should be
	directed to the &a.questions; (see
	<xref linkend="eresources-mail" remap="Mailing Lists"> for more
	information). When submitting information or asking a question,
	please remember to specify exactly what version of FreeBSD you are
	using and include as many details of your hardware as possible.</para>
      
      
      <sect1>
	<title>Resources on the Internet</title>
	
	<para>The following links have proven useful in selecting hardware.
	  Though some of what you see won't necessarily be specific (or even
	  applicable) to FreeBSD, most of the hardware information out there
	  is OS independent. Please check with the FreeBSD hardware guide to
	  make sure that your chosen configuration is supported before making
	  any purchases.</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><ulink URL="http://www.tomshardware.com/">The Pentium
		  Systems Hardware Performance Guide</ulink></para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="hw-configs">
	<title>Sample Configurations</title>
	
	<para>The following list of sample hardware configurations by no means
	  constitutes an endorsement of a given hardware vendor or product by
	  <emphasis>The FreeBSD Project</emphasis>. This information is
	  provided only as a public service and merely catalogs some of the
	  experiences that various individuals have had with different
	  hardware combinations. Your mileage may vary. Slippery when wet.
	  Beware of dog.</para>
	
	
	<sect2 id="hw-jordans-picks">
	  <title>Jordan's Picks</title>
	  
	  <para>I have had fairly good luck building workstation and server
	    configurations with the following components. I can't guarantee
	    that you will too, nor that any of the companies here will remain
	    <quote>best buys</quote> forever. I will try, when I can, to keep this list
	    up-to-date but cannot obviously guarantee that it will be at any
	    given time.</para>
	  
	  
	  <sect3 id="hw-mb">
	    <title>Motherboards</title>
	    
	    <para>For Pentium Pro (P6) systems, I'm quite fond of the <ulink
		URL="http://www.tyan.com/html/products.html">Tyan</ulink>
	      S1668 dual-processor motherboard. It makes a dandy little
	      single or dual processor system (which is supported in FreeBSD
	      3.0) and the price of the Pentium Pro 180/256K chip has fallen
	      to truly affordable levels. The Pentium Pro remains my favorite
	      processor solution server systems (Megahertz ratings aren't
	      everything).</para>
	    
	    <para>For the Pentium II, I'm rather partial to the <ulink
		URL="http://www.asus.com.tw">ASUS</ulink> <ulink
		URL="http://www.asus.com.tw/Products/Motherboard/Pentiumpro/P2l97-s/index.html">P2l97-S</ulink> motherboard with the on-board Adaptec SCSI WIDE controller.</para>
	    
	    <para>For Pentium machines, the ASUS <ulink
		URL="http://www.asus.com.tw/Products/Motherboard/Pentium/P55tp4/index.html">P55T2P4</ulink> motherboard appears to be a good choice for mid-to-high range Pentium server and workstation systems. You might also wish to investigate ASUS's <ulink URL="http://asustek.asus.com.tw/FTP/ASUS/Info/Spec/pvi-486sp3.txt">486SP3G</ulink> offering if it's a 486-class motherboard you're looking for.</para>
	    
	    <note>
	      <para>These have become increasingly hard to get as ASUS
		apparently no longer manufactures them).</para>
	    </note>
	    
	    <para>Those wishing to build more fault-tolerant systems should
	      also be sure to use Parity memory or, for truly 24/7
	      applications, ECC memory.</para>

	    <note>
	      <para>ECC memory does involve a slight performance trade-off
		(which may or may not be noticeable depending on your
		application) but buys you significantly increased
		fault-tolerance to memory errors.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title>Disk Controllers</title>
	    
	    <para>This one is a bit trickier, and while I used to recommend
	      the <ulink URL="http://www.buslogic.com">Buslogic</ulink>
	      controllers unilaterally for everything from ISA to PCI, now I
	      tend to lean towards the <ulink
		URL="http://www.adaptec.com">Adaptec</ulink> 1542CF for ISA,
	      Buslogic Bt747c for EISA and Adaptec 2940UW for PCI.</para>
	    
	    <para>The NCR/Symbios cards for PCI have also worked well for me,
	      though you need to make sure that your motherboard supports the
	      BIOS-less model if you're using one of those (if your card has
	      nothing which looks even vaguely like a ROM chip on it, you've
	      probably got one which expects its BIOS to be on your
	      motherboard).</para>
	    
	    <para>If you should find that you need more than one SCSI
	      controller in a PCI machine, you may wish to consider conserving
	      your scarce PCI bus resources by buying the Adaptec 3940 card,
	      which puts two SCSI controllers (and internal busses) in a
	      single slot.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-disks">
	    <title>Disk drives</title>
	    
	    <para>In this particular game of Russian roulette, I'll make few
	      specific recommendations except to say <quote>SCSI over IDE whenever
	      you can afford it.</quote> Even in small desktop configurations, SCSI
	      often makes more sense since it allows you to easily migrate
	      drives from server to desktop as falling drive prices make it
	      economical to do so. If you have more than one machine to
	      administer then think of it not simply as storage, think of it
	      as a food chain!</para>
	    
	    <para>I do not currently see SCSI WIDE drives as a necessary
	      expense unless you're putting together an NFS or NEWS server
	      that will be doing a lot of multiuser disk I/O.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-jordans-picks-cdrom">
	    <title>CDROM drives</title>
	    
	    <para>My SCSI preferences extend to SCSI CDROM drives as well, and
	      while the <ulink URL="http://www.toshiba.com">Toshiba</ulink>
	      XM-3501B (also released in a caddy-less model called the
	      XM-5401B) drive has always performed well for me, I'm now a
	      great fan of the <ulink
		URL="http://www.plextor.com">Plextor</ulink> PX-12CS drive.
	      It's a 12 speed drive with excellent performance and
	      reliability.</para>
	    
	    <para>Generally speaking, most SCSI CDROM drives I've seen have
	      been of pretty solid construction and you probably won't go
	      wrong with an HP or NEC SCSI CDROM drive either. SCSI CDROM
	      prices also appear to have dropped considerably in the last few
	      months and are now quite competitive with IDE CDROMs while
	      remaining a technically superior solution. I now see no reason
	      whatsoever to settle for an IDE CDROM drive if given a choice
	      between the two.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-worm">
	    <title>CD Recordable (WORM) drives</title>
	    
	    <para>At the time of this writing, FreeBSD supports 3 types of CDR
	      drives (though I believe they all ultimately come from Phillips
	      anyway): The Phillips CDD 522 (Acts like a Plasmon), the PLASMON
	      RF4100 and the HP 6020i. I myself use the HP 6020i for burning
	      CDROMs (with 2.2-current &mdash; it does not work with 2.1.5 or
	      earlier releases of the SCSI code) and it works very well. See
	      <ulink
		URL="file:/usr/share/examples/worm">/usr/share/examples/worm</ulink> on your 2.2 system for example scripts used to created ISO9660 filesystem images (with RockRidge extensions) and burn them onto an HP6020i CDR.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-tape">
	    <title>Tape drives</title>
	    
	    <para>I've had pretty good luck with both <ulink
		URL="http://www.Exabyte.COM:80/Products/8mm/8505XL/Rfeatures.html">8mm drives</ulink> from <ulink URL="http://www.exabyte.com">Exabyte</ulink> and  <ulink URL="http://www-dmo.external.hp.com:80/tape/_cpb0001.htm">4mm (DAT)</ulink> drives from <ulink URL="http://www.hp.com">HP</ulink>.</para>
	    
	    <para>For backup purposes, I'd have to give the higher
	      recommendation to the Exabyte due to the more robust nature (and
	      higher storage capacity) of 8mm tape.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-video">
	    <title>Video Cards</title>
	    
	    <para>If you can also afford to buy a commercial X server for
	      US&#36;99 from <ulink URL="http://www.xig.com/">Xi Graphics,
		Inc. (formerly X Inside, Inc)</ulink> then I can heartily
	      recommend the <ulink URL="http://www.matrox.com/">Matrox</ulink>
	      <ulink
		URL="http://www.matrox.com/mgaweb/brochure.htm">Millenium</ulink> card. Note that support for this card is also excellent with the <ulink URL="http://www.xfree86.org/">XFree86</ulink> server, which is now at version 3.3.2.</para>
	    
	    <para>You also certainly can't go wrong with one of <ulink
		URL="http://www.nine.com/">Number 9's</ulink> cards &mdash; their S3
	      Vision 868 and 968 based cards (the 9FX series) also being quite
	      fast and very well supported by XFree86's S3 server.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-monitors">
	    <title>Monitors</title>
	    
	    <para>I have had very good luck with the <ulink
		URL="http://cons3.sel.sony.com/SEL/ccpg/display/ms17se2.html">Sony Multiscan 17seII monitors</ulink>, as have I with  the Viewsonic offering in the same (Trinitron) tube. For larger than 17", all I can recommend at the time of this writing is to not spend any less than U.S. &#36;2,500 for a 21" monitor or &#36;1,700 for a 20" monitor if that's what you really need. There are good monitors available in the &gt;=20" range and there are also cheap monitors in the &gt;=20" range. Unfortunately, very few are both cheap and good!</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-networking">
	    <title>Networking</title>
	    
	    <para>I can recommend the <ulink
		URL="http://www.smc.com/">SMC</ulink> Ultra 16 controller for
	      any ISA application and the SMC EtherPower or Compex ENET32
	      cards for any serious PCI based networking. Both of the PCI
	      cards are based around DEC's DC21041 Ethernet controller chip
	      and other cards using it, such as the Zynx ZX342 or DEC DE435,
	      will generally work as well. For 100Mbit networking, either the
	      SMC SMC9332DST 10/100MB or Intel EtherExpress Pro/100B cards
	      will do a fine job, the Intel EtherExpress generally getting my
	      vote.</para>
	    
	    <para>If what you're looking for is, on the other hand, the
	      cheapest possible solution which will still work reasonably
	      well, then almost any NE2000 clone is a good choice.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-serial">
	    <title>Serial</title>
	    
	    <para>If you're looking for high-speed serial networking
	      solutions, then <ulink URL="http://www.dgii.com/">Digi
		International</ulink> makes the <ulink
		URL="http://www.dgii.com/prodprofiles/profiles-prices/digiprofiles/digispecs/sync570.html">SYNC/570</ulink> series, with drivers now in FreeBSD-current. <ulink URL="http://www.etinc.com">Emerging Technologies</ulink> also manufactures a board with T1/E1 capabilities, using software they provide. I have no direct experience using either product, however.</para>
	    
	    <para>Multiport card options are somewhat more numerous, though it
	      has to be said that FreeBSD's support for <ulink
		URL="http://www.cyclades.com/">Cyclades</ulink>'s products is
	      probably the tightest, primarily as a result of that company's
	      commitment to making sure that we are adequately supplied with
	      evaluation boards and technical specs. I've heard that the
	      Cyclom-16Ye offers the best price/performance, though I've not
	      checked the prices lately. Other multiport cards I've heard good
	      things about are the BOCA and AST cards, and <ulink
		URL="http://www.stallion.com/">Stallion
		Technologies</ulink> apparently offers an unofficial driver
	      for their  cards at <ulink
		URL="ftp://ftp.stallion.com/drivers/unsupported/freebsd/stalbsd-0.0.4.tar.gz">this</ulink> location.</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-audio">
	    <title>Audio</title>
	    
	    <para>I currently use a <ulink
		URL="http://www.creaf.com/">Creative Labs</ulink> AWE32 though
	      just about anything from Creative Labs will generally work these
	      days. This is not to say that other types of sound cards don't
	      also work, simply that I have little experience with them (I was
	      a former GUS fan, but Gravis's soundcard situation has been dire
	      for some time).</para>
	    
	  </sect3>
	  
	  <sect3 id="hw-vgrabbers">
	    <title>Video</title>
	    
	    <para>For video capture, there are two good choices &mdash; any card
	      based on the Brooktree BT848 chip, such as the Hauppage or WinTV
	      boards, will work very nicely with FreeBSD. Another board which
	      works for me is the <ulink
		URL="http://www.matrox.com/">Matrox</ulink> <ulink
		URL="http://www.matrox.com/imgweb/meteor.htm">Meteor</ulink>
	      card. FreeBSD also supports the older video spigot card from
	      Creative Labs, but those are getting somewhat difficult to find.
	      Note that the Meteor frame grabber card <emphasis>will not
		work</emphasis> with motherboards based on the 440FX chipset!
	      See the
	      <xref linkend="hw-mb" remap="motherboard reference"> section for
	      details. In such cases, it's better to go with a BT848 based
	      board.</para>
	    
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="hw-core">
	<title>Core/Processing</title>
	
	
	<sect2>
	  <title>Motherboards, busses, and chipsets</title>
	  
	  
	  <sect3>
	    <title>* ISA</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>* EISA</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>* VLB</title>

	    <para></para>
	  </sect3>
	  
	  <sect3 id="hw-mb-pci">
	    <title>PCI</title>
	    
	    <para><emphasis>Contributed by &a.rgrimes;.<!-- <br> -->25 April
		1995.</emphasis></para>
	    
	    <para><emphasis>Continuing updates by &a.jkh;.</emphasis><!-- <br>
	      -->Last update on <emphasis>26 August 1996.</emphasis></para>
	    
	    <para>Of the Intel PCI chip sets, the following list describes
	      various types of known-brokenness and the degree of breakage,
	      listed from worst to best.</para>
	    
	    
	      <variablelist>
		<varlistentry><term>Mercury:</term>
		  <listitem>
		    <para>Cache coherency problems, especially if there are
		      ISA bus masters behind the ISA to PCI bridge chip.
		      Hardware flaw, only known work around is to turn the
		      cache off.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Saturn-I <emphasis>(ie, 82424ZX at rev 0,
		      1 or 2)</emphasis>:</term>
		  
		  <listitem>
		    <para>Write back cache coherency problems. Hardware flaw,
		      only known work around is to set the external cache to
		      write-through mode. Upgrade to Saturn-II.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Saturn-II <emphasis>(ie, 82424ZX at rev 3
		      or 4)</emphasis>:</term>
		  
		  <listitem>
		    <para>Works fine, but many MB manufactures leave out the
		      external dirty bit SRAM needed for write back operation.
		      Work arounds are either run it in write through mode, or
		      get the dirty bit SRAM installed. (I have these for the
		      ASUS PCI/I-486SP3G rev 1.6 and later boards).</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Neptune:</term>
		  
		  <listitem>
		    <para>Can not run more than 2 bus master devices.
		      Admitted Intel design flaw. Workarounds include do not
		      run more than 2 bus masters, special hardware design to
		      replace the PCI bus arbiter (appears on Intel Altair
		      board and several other Intel server group MB's). And
		      of course Intel's official answer, move to the Triton
		      chip set, we <quote>fixed it there</quote>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Triton <emphasis>(ie,
		      430FX)</emphasis>:</term>
		  
		  <listitem>
		    <para>No known cache coherency or bus master problems,
		      chip set does not implement parity checking. Workaround
		      for parity issue. Use Triton-II based motherboards if
		      you have the choice.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Triton-II <emphasis>(ie,
		      430HX)</emphasis>:</term>
		  
		  <listitem>
		    <para>All reports on motherboards using this chipset have
		      been favorable so far. No known problems.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Orion:</term>
		  
		  <listitem>
		    <para>Early versions of this chipset suffered from a PCI
		      write-posting bug which can cause noticeable performance
		      degradation in applications where large amounts of PCI
		      bus traffic is involved. B0 stepping or later revisions
		      of the chipset fixed this problem.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><ulink
		      URL="http://developer.intel.com/design/pcisets/desktop.htm#440FX">440FX</ulink>:</term>
		  
		  <listitem>
		    <para>This <ulink
			URL="http://www.intel.com/procs/ppro/index.htm">Pentium Pro</ulink> support chipset seems to work well, and does not suffer from any of the early Orion chipset problems. It also supports a wider variety of memory, including ECC and parity. The only known problem with it is that the Matrox Meteor frame grabber card doesn't like it.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>CPUs/FPUs</title>
	  
	  <para><emphasis>Contributed by &a.asami;.<!-- <br> -->26 December
	      1997.</emphasis></para>
	  
	  
	  <sect3>
	    <title>P6 class (Pentium Pro/Pentium II)</title>
	    
	    <para>Both the Pentium Pro and Pentium II work fine with FreeBSD.
	      In fact, our main ftp site <ulink
		URL="ftp://ftp.freebsd.org/">ftp.freebsd.org</ulink> (also
	      known as "<filename>ftp.cdrom.com</filename>", world's largest
	      ftp site) runs FreeBSD on a Pentium Pro. <ulink
		URL="ftp://ftp.cdrom.com/archive-info/wcarchive.txt">Configurations details</ulink> are available for interested parties.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Pentium class</title>
	    
	    <para>The Intel Pentium (P54C), Pentium MMX (P55C), AMD K6 and
	      Cyrix/IBM 6x86MX processors are all reported to work with
	      FreeBSD. I will not go into details of which processor is
	      faster than what, there are zillions of web sites on the
	      Internet that tells you one way or another. <!-- smiley --><emphasis>:)</emphasis></para>

	    <note>
	      <para>Various CPUs have different voltage/cooling requirements.
		Make sure your motherboard can supply the exact voltage needed
		by the CPU. For instance, many recent MMX chips require split
		voltage (e.g., 2.9V core, 3.3V I/O). Also, some AMD and
		Cyrix/IBM chips run hotter than Intel chips. In that case,
		make sure you have good heatsink/fans (you can get the list of
		certified parts from their web pages).</para>
	    </note>
	    
	    <sect4>
	      <title>Clock speeds</title>
	      
	      <para><emphasis>Contributed by &a.rgrimes;.<!-- <br> -->1
		  October 1996.</emphasis></para>
	      
	      <para><emphasis>Updated by &a.asami;.<!-- <br> -->27 December
		  1997.</emphasis></para>
	      
	      <para>Pentium class machines use different clock speeds for the
		various parts of the system. These being the speed of the
		CPU, external memory bus, and the PCI bus. It is not always
		true that a <quote>faster</quote> processor will make a system faster than
		a <quote>slower</quote> one, due to the various clock speeds used. Below is
		a table showing the differences:</para>

	      <informaltable frame="none">
		<tgroup cols="4">
		  <thead>
		    <row>
		      <entry>Rated CPU MHz</entry>
		      <entry>External Clock and Memory Bus MHz<footnote>
			  <para>66MHz may actually be 66.667MHz, but don't
			    assume so.</para>
			</footnote>
		      </entry>
		      <entry>External to Internal Clock Multiplier</entry>
		      <entry>PCI Bus Clock MHz</entry>
		    </row>
		  </thead>
		  <tbody>
		    <row>
		      <entry>60</entry>
		      <entry>60</entry>
		      <entry>1.0</entry>
		      <entry>30</entry>
		    </row>

		    <row>
		      <entry>66</entry>
		      <entry>66</entry>
		      <entry>1.0</entry>
		      <entry>33</entry>
		    </row>

		    <row>
		      <entry>75</entry>
		      <entry>50</entry>
		      <entry>1.5</entry>
		      <entry>25</entry>
		    </row>

		    <row>
		      <entry>90</entry>
		      <entry>60</entry>
		      <entry>1.5</entry>
		      <entry>30</entry>
		    </row>

		    <row>
		      <entry>100</entry>
		      <entry>50<footnote>
			  <para>The Pentium 100 can be run at either 50MHz
			    external clock with a multiplier of 2 or at 66MHz
			    and a multipler of 1.5</para>
			</footnote>
		      </entry>
		      <entry>2</entry>
		      <entry>25</entry>
		    </row>

		    <row>
		      <entry>100</entry>
		      <entry>66</entry>
		      <entry>1.5</entry>
		      <entry>33</entry>
		    </row>

		    <row>
		      <entry>120</entry>
		      <entry>60</entry>
		      <entry>2</entry>
		      <entry>30</entry>
		    </row>

		    <row>
		      <entry>133</entry>
		      <entry>66</entry>
		      <entry>2</entry>
		      <entry>33</entry>
		    </row>

		    <row>
		      <entry>150</entry>
		      <entry>60</entry>
		      <entry>2.5</entry>
		      <entry>30 (Intel, AMD)</entry>
		    </row>

		    <row>
		      <entry>150</entry>
		      <entry>75</entry>
		      <entry>2</entry>
		      <entry>37.5 (Cyrix/IBM 6x86MX)</entry>
		    </row>

		    <row>
		      <entry>166</entry>
		      <entry>66</entry>
		      <entry>2.5</entry>
		      <entry>33</entry>
		    </row>

		    <row>
		      <entry>180</entry>
		      <entry>60</entry>
		      <entry>3</entry>
		      <entry>30</entry>
		    </row>

		    <row>
		      <entry>200</entry>
		      <entry>66</entry>
		      <entry>3</entry>
		      <entry>33</entry>
		    </row>

		    <row>
		      <entry>233</entry>
		      <entry>66</entry>
		      <entry>3.5</entry>
		      <entry>33</entry>
		    </row>
		  </tbody>
		</tgroup>
	      </informaltable>
	      
	      <para>As can be seen the best parts to be using are the 100,
		133, 166, 200 and 233, with the exception that at a multiplier
		of 3 or more  the CPU starves for memory.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>The AMD K6 Bug</title>
	      
	      <para>In 1997, there have been reports of the AMD K6 seg
		faulting during heavy compilation. That problem has been
		fixed in 3Q '97. According to reports, K6 chips with date mark
		<quote>9733</quote> or larger (i.e., manufactured in the 33rd week of '97
		or later) do not have this bug.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>* 486 class</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>* 386 class</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>286 class</title>
	    
	    <para>Sorry, FreeBSD does not run on 80286 machines. It is nearly
	      impossible to run today's large full-featured UNIXes on such
	      hardware.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>* Memory</title>
	  
	  <para>The minimum amount of memory you must have to install FreeBSD
	    is 5 MB. Once your system is up and running you can <xref
	      linkend="kernelconfig-building" remap="build a custom kernel">
	    that will use less memory. If you use the <filename>boot4.flp</filename> you can get
	    away with having only 4 MB.</para>
	  
	</sect2>
	
	<sect2>
	  <title>* BIOS</title>

	  <para></para>
	</sect2>
      </sect1>
      
      <sect1 id="hw-io">
	<title>Input/Output Devices</title>
	
	
	<sect2>
	  <title>* Video cards</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Sound cards</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>Serial ports and multiport cards</title>
	  
	  
	  <sect3 id="uart">
	    <title>The UART: What it is and how it works</title>
	    
	    <para><emphasis>Copyright &copy; 1996 &a.uhclem;, All Rights
		Reserved.<!-- <br> --> 13 January 1996.</emphasis></para>
	    
	    <para>The Universal Asynchronous Receiver/Transmitter (UART)
	      controller is the key component of the serial communications
	      subsystem of a computer. The UART takes bytes of data and
	      transmits the individual bits in a sequential fashion. At the
	      destination, a second UART re-assembles the bits into complete
	      bytes.</para>
	    
	    <para>Serial transmission is commonly used with modems and for
	      non-networked communication between computers, terminals and
	      other devices.</para>
	    
	    <para>There are two primary forms of serial transmission:
	      Synchronous and Asynchronous. Depending on the modes that are
	      supported by the  hardware, the name of the communication
	      sub-system will usually include a <literal>A</literal> if it supports
	      Asynchronous communications, and a <literal>S</literal> if it supports
	      Synchronous communications. Both forms are described
	      below.</para>
	    
	    <para>Some common acronyms are:
	      <blockquote>
		<para>UART	Universal Asynchronous
		  Receiver/Transmitter</para>
	      </blockquote>
	      
	      <blockquote>
		<para>USART	Universal Synchronous-Asynchronous
		  Receiver/Transmitter</para>
	      </blockquote></para>
	    
	    
	    <sect4>
	      <title>Synchronous Serial Transmission</title>
	      
	      <para>Synchronous serial transmission requires that the sender
		and receiver share a clock with one another, or that the
		sender provide a strobe or other timing signal so that the
		receiver knows when to <quote>read</quote> the next bit of the data. In
		most forms of serial Synchronous communication, if there is no
		data available at a given instant to transmit, a fill
		character must be sent instead so that data is always being
		transmitted. Synchronous communication is usually more
		efficient because only data bits are transmitted between
		sender and receiver, and synchronous communication can be more
		more costly if extra wiring and circuits are required to share
		a clock signal between the sender and receiver.</para>
	      
	      <para>A form of Synchronous transmission is used with printers
		and fixed disk devices in that the data is sent on one set of
		wires while a clock or strobe is sent on a different wire.
		Printers and fixed disk devices are not normally serial
		devices because most fixed disk interface standards send an
		entire word of data for each clock or strobe signal by using a
		separate wire for each bit of the word. In the PC industry,
		these are known as Parallel devices.</para>
	      
	      <para>The standard serial communications hardware in the PC does
		not support Synchronous operations. This mode is described
		here for comparison purposes only.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Asynchronous Serial Transmission</title>
	      
	      <para>Asynchronous transmission allows data to be transmitted
		without the sender having to send a clock signal to the
		receiver. Instead, the sender and receiver must agree on
		timing parameters in advance and special bits are added to
		each word which are used to synchronize the sending and
		receiving units.</para>
	      
	      <para>When a word is given to the UART for Asynchronous
		transmissions, a bit called the "Start Bit" is added to the
		beginning of each word  that is to be transmitted. The Start
		Bit is used to alert the receiver that a word of data is about
		to be sent, and to force the clock in the receiver into
		synchronization with the clock in the transmitter. These two
		clocks must be accurate enough to not  have the frequency
		drift by more than 10% during the transmission of the
		remaining bits in the word. (This requirement was set in the
		days of mechanical teleprinters and is easily met by modern
		electronic equipment.)</para>
	      
	      <para>After the Start Bit, the individual bits of the word of
		data are sent, with the Least Significant Bit (LSB) being sent
		first. Each  bit in the transmission is transmitted for
		exactly the same amount of time as all of the other bits, and
		the receiver <quote>looks</quote> at the wire at approximately halfway
		through the period assigned to each bit to determine if the
		bit is a <literal>1</literal> or a <literal>0</literal>. For example, if it takes two seconds
		to send each bit, the receiver will examine the signal to
		determine if it is a <literal>1</literal> or a <literal>0</literal> after one second has passed,
		then it will wait two seconds and then examine the value of
		the next bit, and so on.</para>
	      
	      <para>The sender does not know when the receiver has <quote>looked</quote> at
		the value of the bit. The sender only knows when the clock
		says to begin transmitting the next bit of the word.</para>
	      
	      <para>When the entire data word has been sent, the transmitter
		may add a Parity Bit that the transmitter generates. The
		Parity Bit may be used by the receiver to perform simple error
		checking. Then at least one Stop Bit is sent by the
		transmitter.</para>
	      
	      <para>When the receiver has received all of the bits in the data
		word, it may check for the Parity Bits (both sender and
		receiver must agree on whether a Parity Bit is to be used),
		and then the receiver looks for a Stop Bit. If the Stop Bit
		does not appear when it is supposed to, the UART considers the
		entire word to be garbled and will report a Framing Error to
		the host processor when the data word is read. The usual
		cause of a Framing Error is that the sender and receiver
		clocks were not running at the same speed, or that the signal
		was interrupted.</para>
	      
	      <para>Regardless of whether the data was received correctly or
		not, the UART automatically discards the Start, Parity and
		Stop bits. If the sender and receiver are configured
		identically, these bits are not passed to the host.</para>
	      
	      <para>If another word is ready for transmission, the Start Bit
		for the new word can be sent as soon as the Stop Bit for the
		previous word has been sent.</para>
	      
	      <para>Because asynchronous data is <quote>self synchronizing</quote>, if
		there is no data to transmit, the transmission line can be
		idle.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Other UART Functions</title>
	      
	      <para>In addition to the basic job of converting data from
		parallel to serial for transmission and from serial to
		parallel on reception, a UART will usually provide additional
		circuits for signals that can be used to indicate the state of
		the transmission media, and to regulate the flow of data in
		the event that the remote device is not prepared to accept
		more data. For example, when the  device connected to the
		UART is a modem, the modem may report the presence of a
		carrier on the phone line while the computer may be able to
		instruct the modem to reset itself or to not take calls by
		asserting or deasserting one more more of these extra signals.
		The function of each of these additional signals is defined in
		the EIA RS232-C standard.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>The RS232-C and V.24 Standards</title>
	      
	      <para>In most computer systems, the UART is connected to
		circuitry that generates signals that comply with the EIA
		RS232-C specification. There is also a CCITT standard named
		V.24 that mirrors the specifications included in
		RS232-C.</para>
	      
	      
	      <sect5>
		<title>RS232-C Bit Assignments (Marks and Spaces)</title>
		
		<para>In RS232-C, a value of <literal>1</literal> is called a <literal>Mark</literal> and a
		  value of <literal>0</literal> is called a <literal>Space</literal>. When a communication line
		  is idle, the line is said to be <quote>Marking</quote>, or transmitting
		  continuous <literal>1</literal> values.</para>
		
		<para>The Start bit always has a value of <literal>0</literal> (a Space). The
		  Stop Bit always has a value of <literal>1</literal>  (a Mark). This means
		  that there will always be a Mark (1) to Space (0) transition
		  on the line at the start of every word, even when multiple
		  word are transmitted back to back. This guarantees that
		  sender and receiver can resynchronize their clocks
		  regardless of the content of the data bits that are being
		  transmitted.</para>
		
		<para>The idle time between Stop and Start bits does not have
		  to be an exact multiple (including zero) of the bit rate of
		  the communication link, but most UARTs are designed this way
		  for simplicity.</para>
		
		<para>In RS232-C, the "Marking" signal (a <literal>1</literal>) is represented
		  by a voltage between -2 VDC and -12 VDC, and a "Spacing"
		  signal (a <literal>0</literal>) is represented by a voltage between 0 and +12
		  VDC. The transmitter is supposed to send +12 VDC or -12
		  VDC, and the receiver is supposed to allow for some voltage
		  loss in long cables. Some transmitters in low power devices
		  (like portable computers) sometimes use only +5 VDC and -5
		  VDC, but these values are still acceptable to a RS232-C
		  receiver, provided that the cable lengths are short.</para>
		
	      </sect5>
	      
	      <sect5>
		<title>RS232-C Break Signal</title>
		
		<para>RS232-C also specifies a signal called a <literal>Break</literal>, which
		  is caused by sending continuous Spacing values (no Start or
		  Stop bits). When there is no electricity present on the
		  data circuit, the line is considered to be sending <literal>Break</literal>.</para>
		
		<para>The <literal>Break</literal> signal must be of a duration longer than the
		  time it takes to send a complete byte plus Start, Stop and
		  Parity bits. Most UARTs can distinguish between a Framing
		  Error and a Break, but if the UART cannot do this, the
		  Framing Error detection can be used to identify
		  Breaks.</para>
		
		<para>In the days of teleprinters, when numerous printers
		  around the country were wired in series (such as news
		  services), any unit could cause a <literal>Break</literal> by temporarily
		  opening the entire circuit so that no current flowed. This
		  was used to allow a location with urgent news to interrupt
		  some other location that was currently sending
		  information.</para>
		
		<para>In modern systems there are two types of Break signals.
		  If the Break is longer than 1.6 seconds, it is considered a
		  "Modem Break", and some modems can be programmed to
		  terminate the conversation and go on-hook or enter the
		  modems' command mode when the modem detects this signal. If
		  the Break is smaller than 1.6 seconds, it signifies a Data
		  Break and it is up to the remote computer to respond to this
		  signal. Sometimes this form of Break is used as an
		  Attention or Interrupt signal and sometimes is accepted as a
		  substitute for the ASCII CONTROL-C character.</para>
		
		<para>Marks and Spaces are also equivalent to <quote>Holes</quote> and <quote>No
		  Holes</quote> in paper tape systems.</para>

		<note>
		  <para>Breaks cannot be generated from paper tape or from any
		    other byte value, since bytes are always sent with Start
		    and Stop bit. The UART is usually capable of generating
		    the continuous Spacing signal in response to a special
		    command from the host processor.</para>
		</note>
		
	      </sect5>
	      
	      <sect5>
		<title>RS232-C DTE and DCE Devices</title>
		
		<para>The RS232-C specification defines two types of
		  equipment: the Data Terminal Equipment (DTE) and the Data
		  Carrier Equipment (DCE). Usually, the DTE device is the
		  terminal (or computer), and the DCE is a modem. Across the
		  phone line at the other end of a conversation, the receiving
		  modem is also a DCE device and the computer that is
		  connected to that modem is a DTE device. The DCE device
		  receives signals on the pins that the DTE device transmits
		  on, and vice versa.</para>
		
		<para>When two devices that are both DTE or both DCE must be
		  connected together without a modem or a similar media
		  translater between them, a NULL modem must be used. The
		  NULL modem electrically re-arranges the cabling so that the
		  transmitter output is connected to the receiver input on the
		  other device, and vice versa. Similar translations are
		  performed on all of the control signals so that each device
		  will see what it thinks are DCE (or DTE) signals from the
		  other device.</para>
		
		<para>The number of signals generated by the DTE and DCE
		  devices are not symmetrical. The DTE device generates fewer
		  signals for the DCE device than the DTE device receives from
		  the DCE.</para>
		
	      </sect5>
	      
	      <sect5>
		<title>RS232-C Pin Assignments</title>
		
		<para>The EIA RS232-C specification (and the ITU equivalent,
		  V.24) calls for a twenty-five pin connector (usually a DB25)
		  and defines the purpose of most of the pins in that
		  connector.</para>
		
		<para>In the IBM Personal Computer and similar systems, a
		  subset of RS232-C signals are provided via nine pin
		  connectors (DB9). The signals that are not included on the
		  PC connector deal mainly with synchronous operation, and
		  this transmission mode is not supported by the UART that IBM
		  selected for use in the IBM PC.</para>
		
		<para>Depending on the computer manufacturer, a DB25, a DB9,
		  or both types of connector may be used for RS232-C
		  communications. (The IBM PC also uses a DB25 connector for
		  the parallel printer interface which causes some
		  confusion.)</para>
		
		<para>Below is a table of the RS232-C signal assignments in
		  the DB25 and DB9 connectors.</para>

		<informaltable frame="none">
		  <tgroup cols="7">
		    <thead>
		      <row>
			<entry>DB25 RS232-C Pin</entry>
			<entry>DB9 IBM PC Pin</entry>
			<entry>EIA Circuit Symbol</entry>
			<entry>CCITT Circuit Symbol</entry>
			<entry>Common Name</entry>
			<entry>Signal Source</entry>
			<entry>Description</entry>
		      </row>
		    </thead>

		    <tbody>
		      <row>
			<entry>1</entry>
			<entry>-</entry>
			<entry>AA</entry>
			<entry>101</entry>
			<entry>PG/FG</entry>
			<entry>-</entry>
			<entry>Frame/Protective Ground</entry>
		      </row>

		      <row>
			<entry>2</entry>
			<entry>3</entry>
			<entry>BA</entry>
			<entry>103</entry>
			<entry>TD</entry>
			<entry>DTE</entry>
			<entry>Transmit Data</entry>
		      </row>

		      <row>
			<entry>3</entry>
			<entry>2</entry>
			<entry>BB</entry>
			<entry>104</entry>
			<entry>RD</entry>
			<entry>DCE</entry>
			<entry>Receive Data</entry>
		      </row>

		      <row>
			<entry>4</entry>
			<entry>7</entry>
			<entry>CA</entry>
			<entry>105</entry>
			<entry>RTS</entry>
			<entry>DTE</entry>
			<entry>Request to Send</entry>
		      </row>

		      <row>
			<entry>5</entry>
			<entry>8</entry>
			<entry>CB</entry>
			<entry>106</entry>
			<entry>CTS</entry>
			<entry>DCE</entry>
			<entry>Clear to Send</entry>
		      </row>

		      <row>
			<entry>6</entry>
			<entry>6</entry>
			<entry>CC</entry>
			<entry>107</entry>
			<entry>DSR</entry>
			<entry>DCE</entry>
			<entry>Data Set Ready</entry>
		      </row>

		      <row>
			<entry>7</entry>
			<entry>5</entry>
			<entry>AV</entry>
			<entry>102</entry>
			<entry>SG/GND</entry>
			<entry>-</entry>
			<entry>Signal Ground</entry>
		      </row>

		      <row>
			<entry>8</entry>
			<entry>1</entry>
			<entry>CF</entry>
			<entry>109</entry>
			<entry>DCD/CD</entry>
			<entry>DCE</entry>
			<entry>Data Carrier Detect</entry>
		      </row>

		      <row>
			<entry>9</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>Reserved for Test</entry>
		      </row>
		      
		      <row>
			<entry>10</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>Reserved for Test</entry>
		      </row>
		      
		      <row>
			<entry>11</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>Reserved for Test</entry>
		      </row>

		      <row>
			<entry>12</entry>
			<entry>-</entry>
			<entry>CI</entry>
			<entry>122</entry>
			<entry>SRLSD</entry>
			<entry>DCE</entry>
			<entry>Sec. Recv. Line Signal Detector</entry>
		      </row>

		      <row>
			<entry>13</entry>
			<entry>-</entry>
			<entry>SCB</entry>
			<entry>121</entry>
			<entry>SCTS</entry>
			<entry>DCE</entry>
			<entry>Secondary Clear to Send</entry>
		      </row>

		      <row>
			<entry>14</entry>
			<entry>-</entry>
			<entry>SBA</entry>
			<entry>118</entry>
			<entry>STD</entry>
			<entry>DTE</entry>
			<entry>Secondary Transmit Data</entry>
		      </row>

		      <row>
			<entry>15</entry>
			<entry>-</entry>
			<entry>DB</entry>
			<entry>114</entry>
			<entry>TSET</entry>
			<entry>DCE</entry>
			<entry>Trans. Sig. Element Timing</entry>
		      </row>

		      <row>
			<entry>16</entry>
			<entry>-</entry>
			<entry>SBB</entry>
			<entry>119</entry>
			<entry>SRD</entry>
			<entry>DCE</entry>
			<entry>Secondary Received Data</entry>
		      </row>

		      <row>
			<entry>17</entry>
			<entry>-</entry>
			<entry>DD</entry>
			<entry>115</entry>
			<entry>RSET</entry>
			<entry>DCE</entry>
			<entry>Receiver Signal Element Timing</entry>
		      </row>

		      <row>
			<entry>18</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>141</entry>
			<entry>LOOP</entry>
			<entry>DTE</entry>
			<entry>Local Loopback</entry>
		      </row>

		      <row>
			<entry>19</entry>
			<entry>-</entry>
			<entry>SCA</entry>
			<entry>120</entry>
			<entry>SRS</entry>
			<entry>DTE</entry>
			<entry>Secondary Request to Send</entry>
		      </row>

		      <row>
			<entry>20</entry>
			<entry>4</entry>
			<entry>CD</entry>
			<entry>108.2</entry>
			<entry>DTR</entry>
			<entry>DTE</entry>
			<entry>Data Terminal Ready</entry>
		      </row>

		      <row>
			<entry>21</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>RDL</entry>
			<entry>DTE</entry>
			<entry>Remote Digital Loopback</entry>
		      </row>

		      <row>
			<entry>22</entry>
			<entry>9</entry>
			<entry>CE</entry>
			<entry>125</entry>
			<entry>RI</entry>
			<entry>DCE</entry>
			<entry>Ring Indicator</entry>
		      </row>

		      <row>
			<entry>23</entry>
			<entry>-</entry>
			<entry>CH</entry>
			<entry>111</entry>
			<entry>DSRS</entry>
			<entry>DTE</entry>
			<entry>Data Signal Rate Selector</entry>
		      </row>

		      <row>
			<entry>24</entry>
			<entry>-</entry>
			<entry>DA</entry>
			<entry>113</entry>
			<entry>TSET</entry>
			<entry>DTE</entry>
			<entry>Trans. Sig. Element Timing</entry>
		      </row>

		      <row>
			<entry>25</entry>
			<entry>-</entry>
			<entry>-</entry>
			<entry>142</entry>
			<entry>-</entry>
			<entry>DCE</entry>
			<entry>Test Mode</entry>
		      </row>
		    </tbody>
		  </tgroup>
		</informaltable>
	      </sect5>
	    </sect4>
	    
	    <sect4>
	      <title>Bits, Baud and Symbols</title>
	      
	      <para>Baud is a measurement of transmission speed in
		asynchronous communication. Because of advances in modem
		communication technology, this term is frequently misused when
		describing the data rates in newer devices.</para>
	      
	      <para>Traditionally, a Baud Rate represents the number of bits
		that are actually being sent over the media, not the amount of
		data that is actually moved from one DTE device to the other.
		The Baud count includes the overhead bits Start, Stop and
		Parity that are generated by the sending UART and removed by
		the receiving UART. This means that seven-bit words of data
		actually take 10 bits to be completely transmitted. Therefore,
		a modem capable of moving 300 bits per second from one place
		to another can normally only move 30 7-bit words if Parity is
		used and one Start and Stop bit are present.</para>
	      
	      <para>If 8-bit data words are used and Parity bits are also
		used, the data rate falls to 27.27 words per second, because
		it now takes 11 bits to send the eight-bit words, and the
		modem still only sends 300 bits per second.</para>
	      
	      <para>The formula for converting bytes per second into a baud
		rate and vice versa was simple until error-correcting modems
		came along. These modems receive the serial stream of bits
		from the UART in the host computer (even when internal modems
		are used the data is still frequently serialized) and converts
		the bits back into bytes. These bytes are then combined into
		packets and sent over the phone line using a Synchronous
		transmission method. This means that the Stop, Start, and
		Parity bits added by the UART in the DTE (the computer) were
		removed by the modem before transmission by the sending modem.
		When these bytes are received by the remote modem, the remote
		modem adds Start, Stop and Parity bits to the words, converts
		them to a serial format and then sends them to the receiving
		UART in the remote computer, who then strips the Start, Stop
		and Parity bits.</para>
	      
	      <para>The reason all these extra conversions are done is so that
		the two modems can perform error correction, which means that
		the receiving modem is able to ask the sending modem to resend
		a block of data that was not received with the correct
		checksum. This checking is handled by the modems, and the DTE
		devices are usually unaware that the process is
		occurring.</para>
	      
	      <para>By striping the Start, Stop and Parity bits, the
		additional bits of data that the two modems must share between
		themselves to perform error-correction are mostly concealed
		from the effective transmission rate seen by the sending and
		receiving DTE equipment. For example, if a modem sends ten
		7-bit words to another modem without including the Start, Stop
		and Parity bits, the sending modem will be able to add 30 bits
		of its own information that the receiving modem can use to do
		error-correction without impacting the transmission speed of
		the real data.</para>
	      
	      <para>The use of the term Baud is further confused by modems
		that perform compression. A single 8-bit word passed over the
		telephone line might represent a dozen words that were
		transmitted to the sending modem. The receiving modem will
		expand the data back to its original content and pass that
		data to the receiving DTE.</para>
	      
	      <para>Modern modems also include buffers that allow the rate
		that bits move across the phone line (DCE to DCE) to be a
		different speed than the speed that the bits move between the
		DTE and DCE on both ends of the conversation. Normally the
		speed between the DTE and DCE is higher than the DCE to DCE
		speed because of the use of compression by the modems.</para>
	      
	      <para>Because the number of bits needed to describe a byte
		varied during the trip between the two machines plus the
		differing  bits-per-seconds speeds that are used present on
		the DTE-DCE and DCE-DCE links, the usage of the term Baud to
		describe the overall communication speed causes problems and
		can misrepresent the true transmission speed. So Bits Per
		Second (bps) is the correct term to use to describe the
		transmission rate seen at the DCE to DCE interface and Baud or
		Bits Per Second are acceptable terms to use when a connection
		is made between two systems with a wired connection, or if a
		modem is in use that is not performing error-correction or
		compression.</para>
	      
	      <para>Modern high speed modems (2400, 9600, 14,400, and
		19,200bps) in reality still operate at or below 2400 baud, or
		more accurately, 2400 Symbols per second. High speed modem
		are able to encode more bits of data into each Symbol using a
		technique called Constellation Stuffing, which is why the
		effective bits per second rate of the modem is higher, but the
		modem continues to operate within the limited audio bandwidth
		that the telephone system provides. Modems operating at 28,800
		and higher speeds have variable Symbol rates, but the
		technique is the same.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>The IBM Personal Computer UART</title>
	      
	      <para>Starting with the original IBM Personal Computer, IBM
		selected the National Semiconductor INS8250 UART for use in
		the IBM PC Parallel/Serial Adapter. Subsequent generations of
		compatible computers from IBM and other vendors continued to
		use the INS8250 or improved versions of the National
		Semiconductor UART family.</para>
	      
	      
	      <sect5>
		<title>National Semiconductor UART Family Tree</title>
		
		<para>There have been several versions and subsequent
		  generations of the INS8250 UART. Each major version is
		  described below.</para>

		<!-- This should really be a graphic -->
		<programlisting>
INS8250  -&gt; INS8250B
  \
   \
    \-&gt; INS8250A -&gt; INS82C50A
             \
              \
               \-&gt; NS16450 -&gt; NS16C450
                        \
                         \
                          \-&gt; NS16550 -&gt; NS16550A -&gt; PC16550D
		</programlisting>
		
		
		  <variablelist>
		    <varlistentry><term>INS8250</term>
		      <listitem>
			<para>This part was used in the original IBM PC and
			  IBM PC/XT. The original name for this part was the
			  INS8250 ACE (Asynchronous Communications Element)
			  and it is made from NMOS technology.</para>
			
			<para>The 8250 uses eight I/O ports and has a one-byte
			  send and a one-byte receive buffer. This original
			  UART has several race conditions and other flaws.
			  The original IBM BIOS includes code to work around
			  these flaws, but this made the BIOS dependent on the
			  flaws being present, so subsequent parts like the
			  8250A, 16450  or 16550 could not be used in the
			  original IBM PC or IBM PC/XT.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>INS8250-B</term>
		      
		      <listitem>
			<para>This is the slower speed of the INS8250 made
			  from NMOS technology. It contains the same problems
			  as the original INS8250.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>INS8250A</term>
		      
		      <listitem>
			<para>An improved version of the INS8250 using XMOS
			  technology with various functional flaws corrected.
			  The INS8250A was used initially in PC clone
			  computers by vendors who used <quote>clean</quote> BIOS designs.
			  Because of the corrections in the chip, this part
			  could not be used with a BIOS compatible with the
			  INS8250 or INS8250B.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>INS82C50A</term>
		      
		      <listitem>
			<para>This is a CMOS version (low power consumption)
			  of the INS8250A and has similar functional
			  characteristics.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>NS16450</term>
		      
		      <listitem>
			<para>Same as NS8250A with improvements so it can be
			  used with faster CPU bus designs. IBM used this
			  part in the IBM AT and updated the IBM BIOS to no
			  longer rely on the bugs in the INS8250.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>NS16C450</term>
		      
		      <listitem>
			<para>This is a CMOS version (low power consumption)
			  of the NS16450.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>NS16550</term>
		      
		      <listitem>
			<para>Same as NS16450 with a 16-byte send and receive
			  buffer but the buffer design was flawed and could
			  not be reliably be used.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>NS16550A</term>
		      
		      <listitem>
			<para>Same as NS16550 with the buffer flaws corrected.
			  The 16550A and its successors have become the most
			  popular UART design in the PC industry, mainly due
			  it its ability to reliably handle higher data rates
			  on operating systems with sluggish interrupt
			  response times.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>NS16C552</term>
		      
		      <listitem>
			<para>This component consists of two NS16C550A CMOS
			  UARTs in a single package.</para>
		      </listitem>
		    </varlistentry>
		    
		    <varlistentry><term>PC16550D</term>
		      
		      <listitem>
			<para>Same as NS16550A with subtle flaws corrected.
			  This is revision D of the 16550 family and is the
			  latest design available from National Semiconductor.</para>
			
		      </listitem>
		    </varlistentry>
		  </variablelist>
		
		
	      </sect5>
	      
	      <sect5>
		<title>The NS16550AF and the PC16550D are the same
		  thing</title>
		
		<para>National reorganized their part numbering system a few
		  years ago, and the NS16550AFN no longer exists by that name.
		  (If you have a NS16550AFN, look at the date code on the
		  part, which is a four digit number that usually starts with
		  a nine. The first two digits of the number are the year,
		  and the last two digits are the week in that year when the
		  part was packaged. If you have a NS16550AFN, it is probably
		  a few years old.)</para>
		
		<para>The new numbers are like PC16550DV, with minor
		  differences in the suffix letters depending on the package
		  material and its shape. (A description of the numbering
		  system can be found below.)</para>
		
		<para>It is important to understand that in some stores, you
		  may pay &#36;15(US) for a NS16550AFN made in 1990 and in the
		  next bin are the new PC16550DN parts with minor fixes that
		  National has made since the AFN part was in production, the
		  PC16550DN was probably made in the past six months and it
		  costs half (as low as &#36;5(US) in volume) as much as the
		  NS16550AFN because they are readily available.</para>
		
		<para>As the supply of NS16550AFN chips continues to shrink,
		  the price will probably continue to increase until more
		  people discover and accept that the PC16550DN really has the
		  same function as the old part number.</para>
		
	      </sect5>
	      
	      <sect5>
		<title>National Semiconductor Part Numbering System</title>
		
		<para>The older  NS<replaceable>nnnnnrqp</replaceable>  part numbers
		  are now of the format
		  PC<replaceable>nnnnnrgp</replaceable>.</para>
		
		<para>The <replaceable>r</replaceable> is the revision field. The
		  current revision of the 16550 from National Semiconductor is
		  <literal>D</literal>.</para>
		
		<para>The <replaceable>p</replaceable> is the package-type field.
		  The types are:</para>

		  <informaltable frame="none">
		    <tgroup cols="3">
		      <tbody>
			<row>
			  <entry>"F"</entry>
			  <entry>QFP</entry>
			  <entry>(quad flat pack) L lead type</entry>
			</row>

			<row>
			  <entry>"N"</entry>
			  <entry>DIP</entry>
			  <entry>(dual inline package) through hole straight
			    lead type</entry>
			</row>

			<row>
			  <entry>"V"</entry>
			  <entry>LPCC</entry>
			  <entry>(lead plastic chip carrier) J lead type</entry>
			</row>
		      </tbody>
		    </tgroup>
		  </informaltable>
		
		<para>The <replaceable>g</replaceable> is the product grade field.
		  If an <literal>I</literal> precedes the package-type letter, it indicates an
		  <quote>industrial</quote> grade part, which has higher specs than a
		  standard part but not as high as Military Specification
		  (Milspec) component. This is an optional field.</para>
		
		<para>So what we used to call a NS16550AFN (DIP Package) is
		  now called a PC16550DN or PC16550DIN.</para>
		
	      </sect5>
	    </sect4>
	    
	    <sect4>
	      <title>Other Vendors and Similar UARTs</title>
	      
	      <para>Over the years, the 8250, 8250A, 16450 and 16550 have been
		licensed or copied by other chip vendors. In the case of the
		8250, 8250A and 16450, the exact circuit (the <quote>megacell</quote>) was
		licensed to many vendors, including Western Digital and Intel.
		Other vendors reverse-engineered the part or produced
		emulations that had similar behavior.</para>
	      
	      <para>In internal modems, the modem designer will frequently
		emulate the 8250A/16450 with the modem microprocessor, and the
		emulated UART will frequently have a hidden buffer consisting
		of several hundred bytes. Because of the size of the buffer,
		these emulations can be as reliable as a 16550A in their
		ability to handle high speed data. However, most operating
		systems will still report that the UART is only a 8250A or
		16450, and may not make effective use of the extra buffering
		present in the emulated UART unless special drivers are
		used.</para>
	      
	      <para>Some modem makers are driven by market forces to abandon a
		design that has hundreds of bytes of buffer and instead use a
		16550A UART so that the product will compare favorably in
		market comparisons even though the effective performance may
		be lowered by this action.</para>
	      
	      <para>A common misconception is that all parts with <quote>16550A</quote>
		written on them are identical in performance. There are
		differences, and in some cases, outright flaws in most of
		these 16550A clones.</para>
	      
	      <para>When the NS16550 was developed, the National Semiconductor
		obtained several patents on the design and they also limited
		licensing, making it harder for other vendors to provide a
		chip with similar features. Because of the patents,
		reverse-engineered designs and emulations had to avoid
		infringing the claims covered by the patents. Subsequently,
		these copies almost never perform exactly the same as the
		NS16550A or PC16550D, which are the parts most computer and
		modem makers want to buy but are sometimes unwilling to pay
		the price required to get the genuine part.</para>
	      
	      <para>Some of the differences in the clone 16550A parts are
		unimportant, while others can prevent the device from being
		used at all with a given operating system or driver. These
		differences may show up when using other drivers, or when
		particular combinations of events occur that were not well
		tested or considered in the Windows driver. This is because
		most modem vendors and 16550-clone makers use the Microsoft
		drivers from Windows for Workgroups 3.11 and the Microsoft MSD
		utility as the primary tests for compatibility with the
		NS16550A. This over-simplistic criteria means that if a
		different operating system is used, problems could appear due
		to subtle differences between the clones and genuine
		components.</para>
	      
	      <para>National Semiconductor has made available a program named
		<application>COMTEST</application> that performs compatibility tests independent of any
		OS drivers. It should be remembered that the purpose of this
		type of program is to demonstrate the flaws in the products of
		the competition, so the program will report major as well as
		extremely subtle differences in behavior in the part being
		tested.</para>
	      
	      <para>In a series of tests performed by the author of this
		document in 1994, components made by National Semiconductor,
		TI, StarTech, and CMD as well as megacells and emulations
		embedded in internal modems were tested with COMTEST. A
		difference count for some of these components is listed below.
		Because these tests were performed in 1994, they may not
		reflect the current performance of the given product from a
		vendor.</para>
	      
	      <para>It should be noted that COMTEST normally aborts when an
		excessive number or certain types of problems have been
		detected. As part of this testing, COMTEST was modified so
		that it would not abort no matter how many differences were
		encountered.</para>

	      <informaltable frame="none">
		<tgroup cols="3">
		  <thead>
		    <row>
		      <entry>Vendor</entry>
		      <entry>Part Number</entry>
		      <entry>Errors (aka "differences" reported)</entry>
		    </row>
		  </thead>
		  
		  <tbody>
		    <row>
		      <entry>National</entry>
		      <entry>(PC16550DV)</entry>
		      <entry>0<footnote>
			  <para>To date, the author of this document has not
			    found any non-National parts that report zero
			    differences using the COMTEST program. It should
			    also be noted that National has had five versions
			    of the 16550 over the years and the newest parts
			    behave a bit differently than the classic
			    NS16550AFN that is considered the benchmark for
			    functionality. COMTEST appears to turn a blind eye
			    to the differences within the National product
			    line and reports no errors on the National parts
			    (except for the original 16550) even when there
			    are official erratas that describe bugs in the A,
			    B and C revisions of the parts, so this bias in
			    COMTEST must be taken into account.</para>
			</footnote>
		      </entry>
		    </row>

		    <row>
		      <entry>National</entry>
		      <entry>(NS16550AFN)</entry>
		      <entry>0</entry>
		    </row>

		    <row>
		      <entry>National</entry>
		      <entry>(NS16C552V)</entry>
		      <entry>0</entry>
		    </row>

		    <row>
		      <entry>TI</entry>
		      <entry>(TL16550AFN)</entry>
		      <entry>3</entry>
		    </row>

		    <row>
		      <entry>CMD</entry>
		      <entry>(16C550PE)</entry>
		      <entry>19</entry>
		    </row>

		    <row>
		      <entry>StarTech</entry>
		      <entry>(ST16C550J)</entry>
		      <entry>23</entry>
		    </row>

		    <row>
		      <entry>Rockwell</entry>
		      <entry>Reference modem with internal 16550 or an
			emulation (RC144DPi/C3000-25)</entry>
		      <entry>117</entry>
		    </row>

		    <row>
		      <entry>Sierra</entry>
		      <entry>Modem with an internal 16550
			(SC11951/SC11351)</entry>
		      <entry>91</entry>
		    </row>
		  </tbody>
		</tgroup>
	      </informaltable>
	      
	      <para>It is important to understand that a simple count of
		differences from COMTEST does not reveal a lot about what
		differences are important and which are not. For example,
		about half of the differences reported in the two modems
		listed above that have internal UARTs were caused by the clone
		UARTs not supporting five- and six-bit character modes. The
		real 16550, 16450, and 8250 UARTs all support these modes and
		COMTEST checks the functionality of these modes so over fifty
		differences are reported. However, almost no modern modem
		supports five- or six-bit characters, particularly those with
		error-correction and compression capabilities. This means
		that the differences related to five- and six-bit character
		modes can be discounted.</para>
	      
	      <para>Many of the differences COMTEST reports have to do with
		timing. In many of the clone designs, when the host reads
		from one port, the status bits in some other port may not
		update in the same amount of time (some faster, some slower)
		as a <emphasis>real</emphasis> NS16550AFN and COMTEST looks
		for these differences. This means that the number of
		differences can be misleading in that one device may only have
		one or two differences but they are extremely serious, and
		some other device that updates the status registers faster or
		slower than the reference part (that would probably never
		affect the operation of a properly written driver) could have
		dozens of differences reported.</para>
	      
	      <para>COMTEST can be used as a screening tool to alert the
		administrator to the presence of potentially incompatible
		components that might cause problems or have to be handled as
		a special case.</para>
	      
	      <para>If you run COMTEST on a 16550 that is in a modem or a
		modem is attached to the serial port, you need to first issue
		a ATE0&amp;W command to the modem so that the modem will not
		echo any of the test characters. If you forget to do this,
		COMTEST will report at least this one difference:</para>

		<informalexample>
		  <screen>Error (6)...Timeout interrupt failed: IIR = c1  LSR = 61</screen>
		</informalexample>
	      
	    </sect4>
	    
	    <sect4>
	      <title>8250/16450/16550 Registers</title>
	      
	      <para>The 8250/16450/16550 UART occupies eight contiguous I/O
		port addresses. In the IBM PC, there are two defined
		locations for these eight ports and they are known
		collectively as COM1 and COM2. The makers of PC-clones and
		add-on cards have created two additional areas known as COM3
		and COM4, but these extra COM ports conflict with other
		hardware on some systems. The most common conflict is with
		video adapters that provide IBM 8514 emulation.</para>
	      
	      <para>COM1 is located from 0x3f8 to 0x3ff and normally uses IRQ
		4 COM2 is located from 0x2f8 to 0x2ff and normally uses IRQ 3
		COM3 is located from 0x3e8 to 0x3ef and has no standardized
		IRQ COM4 is located from 0x2e8 to 0x2ef and has no
		standardized IRQ.</para>
	      
	      <para>A description of the I/O ports of the 8250/16450/16550
		UART is provided below.</para>

	      <informaltable frame="none">
		<tgroup cols="3">
		  <thead>
		    <row>
		      <entry>I/O Port</entry>
		      <entry>Access Allowed</entry>
		      <entry>Description</entry>
		    </row>
		  </thead>
		  
		  <tbody>
		    <row>
		      <entry>+0x00</entry>
		      <entry>write (DLAB==0)</entry>
		      <entry><para>Transmit Holding Register (THR).</para><para>Information written to this port are treated as
			  data words and will be transmitted by the
			  UART.</para></entry>
		    </row>

		    <row>
		      <entry>+0x00</entry>
		      <entry>read (DLAB==0)</entry>
		      <entry><para>Receive Buffer Register (RBR).</para><para>Any data words received by the UART form the
			  serial link are accessed by the host by reading this
			  port.</para></entry>
		    </row>

		    <row>
		      <entry>+0x00</entry>
		      <entry>write/read (DLAB==1)</entry>
		      <entry><para>Divisor Latch LSB (DLL)</para><para>This
			  value will be divided from the master input clock
			  (in the IBM PC, the master clock is 1.8432MHz) and
			  the resulting clock will determine the baud rate of
			  the UART. This register holds bits 0 thru 7 of the
			  divisor.</para></entry>
		    </row>

		    <row>
		      <entry>+0x01</entry>
		      <entry>write/read (DLAB==1)</entry>
		      <entry><para>Divisor Latch MSB (DLH)</para><para>This
			  value will be divided from the master input clock
			  (in the IBM PC, the master clock is 1.8432MHz) and
			  the resulting clock will determine the baud rate of
			  the UART. This register holds bits 8 thru 15 of the
			  divisor.</para></entry>
		    </row>

		    <row>
		      <entry>+0x01</entry>
		      <entry>write/read (DLAB==0)</entry>
		      <entrytbl cols="2">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<spanspec namest="col1" nameend="col2" spanname="1to2">
			<tbody>
			  <row>
			    <entry spanname="1to2"><para>Interrupt Enable
				Register (IER)</para><para>The 8250/16450/16550 UART classifies
				events into one of four categories. Each
				category can be configured to generate an
				interrupt when any of the events occurs. The
				8250/16450/16550 UART generates a single
				external interrupt signal regardless of how
				many events in the enabled categories have
				occurred. It is up to the host processor to
				respond to the interrupt and then poll the
				enabled interrupt categories (usually all
				categories have interrupts enabled) to
				determine the true cause(s) of the
				interrupt.</para></entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>
			  
			  <row>
			    <entry>Bit 6</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry>Enable Modem Status Interrupt (EDSSI).
				    Setting this bit to "1" allows the UART to
				    generate an interrupt when a change occurs
				    on one or more of the status lines.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry>Enable Receiver Line Status Interrupt (ELSI)
				    Setting this bit to "1" causes the UART to
				    generate an interrupt when the an error
				    (or a BREAK signal) has been detected in
				    the incoming data.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry>Enable Transmitter Holding Register Empty
				    Interrupt (ETBEI) Setting this bit to "1"
				    causes the UART to generate an interrupt
				    when the UART has room for one or more
				    additional characters that are to be
				    transmitted.</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry>Enable Received Data Available Interrupt
				    (ERBFI) Setting this bit to "1" causes the
				    UART to generate an interrupt when the
				    UART has received enough characters to
				    exceed the trigger level of the FIFO, or
				    the FIFO timer has expired (stale data),
				    or a single character has been received
				    when the FIFO is disabled.</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x02</entry>
		      <entry>write</entry>
		      <entrytbl cols="4">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<colspec colnum="3" colname="col3">
			<colspec colnum="4" colname="col4">
			<spanspec namest="col1" nameend="col4" spanname="1to4">
			<spanspec namest="col2" nameend="col4" spanname="2to4">

			<tbody>
			  <row>
			    <entry spanname="1to4">FIFO Control Register (FCR)
			      (This port does not exist on the 8250 and 16450
			      UART.)</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry spanname="2to4">Receiver Trigger Bit
			      #1</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry spanname="2to4"><para>Receiver Trigger Bit
				#0</para><para>These two bits control at what
				point the receiver is to generate an interrupt
				when the FIFO is active.</para></entry>
			  </row>

			  <row>
			    <entry colname="col2">7</entry>
			    <entry colname="col3">6</entry>
			    <entry colname="col4">How many words are received
			      before an interrupt is generated</entry>
			  </row>
			  
			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4">1</entry>
			  </row>

			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">4</entry>
			  </row>

			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4">8</entry>
			  </row>

			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">14</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry spanname="2to4">Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry spanname="2to4">Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry spanname="2to4">DMA Mode Select. If Bit 0
			      is set to "1" (FIFOs enabled), setting this bit
			      changes the operation of the -RXRDY and -TXRDY
			      signals from Mode 0 to Mode 1.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry spanname="2to4">Transmit FIFO Reset. When a
			      "1" is written to this bit, the contents of the
			      FIFO are discarded. Any word currently being
			      transmitted will be sent intact. This function
			      is useful in aborting transfers.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry spanname="2to4">Receiver FIFO Reset. When a
			      "1" is written to this bit, the contents of the
			      FIFO are discarded. Any word currently being
			      assembled in the shift register will be received
			      intact.</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry spanname="2to4">16550 FIFO Enable. When
			      set, both the transmit and receive FIFOs are
			      enabled. Any contents in the holding register,
			      shift registers or FIFOs are lost when FIFOs are
			      enabled or disabled.</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x02</entry>
		      <entry>read</entry>
		      <entrytbl cols="6">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<colspec colnum="3" colname="col3">
			<colspec colnum="4" colname="col4">
			<colspec colnum="5" colname="col5">
			<colspec colnum="6" colname="col6">
			<spanspec namest="col1" nameend="col6" spanname="1to6">
			<spanspec namest="col2" nameend="col6" spanname="2to6">
			<tbody>
			  <row>
			    <entry spanname="1to6">Interrupt Identification
			      Register</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry spanname="2to6">FIFOs enabled. On the
			      8250/16450 UART, this bit is zero.</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry spanname="2to6">FIFOs enabled. On the
			      8250/16450 UART, this bit is zero.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry spanname="2to6">Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry spanname="2to6">Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry spanname="2to6">Interrupt ID Bit #2. On the
			      8250/16450 UART, this bit is zero.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry spanname="2to6">Interrupt ID Bit #1</entry>
			  </row>
			      
			  <row>
			    <entry>Bit 1</entry>
			    <entry spanname="2to6">Interrupt ID Bit #0.These
			      three bits combine to report the category of
			      event that caused the interrupt that is in
			      progress. These categories have priorities, so
			      if  multiple categories of events occur at the
			      same time, the UART will report the more
			      important events first and the host must resolve
			      the events in the order they are reported. All
			      events that caused the current interrupt must be
			      resolved before any new interrupts will be
			      generated. (This is a limitation of the PC
			      architecture.)</entry>
			  </row>

			  <row>
			    <entry colname="col2">2</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">0</entry>
			    <entry colname="col5">Priority</entry>
			    <entry colname="col6">Description</entry>
			  </row>

			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">1</entry>
			    <entry colname="col5">First</entry>
			    <entry colname="col6">Received Error (OE, PE, BI,
			      or FE)</entry>
			  </row>

			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">0</entry>
			    <entry colname="col5">Second</entry>
			    <entry colname="col6">Received Data
			      Available</entry>
			  </row>
			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4">0</entry>
			    <entry colname="col5">Second</entry>
			    <entry colname="col6">Trigger level identification
			      (Stale data in receive buffer)</entry>
			  </row>
			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4">1</entry>
			    <entry colname="col5">Third</entry>
			    <entry colname="col6">Transmitter has room for
			      more words (THRE)</entry>
			  </row>
			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4">0</entry>
			    <entry colname="col5">Fourth</entry>
			    <entry colname="col6">Modem Status Change (-CTS,
			      -DSR, -RI, or -DCD)</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry spanname="2to6">Interrupt Pending Bit. If
			      this bit is set to "0", then at least one
			      interrupt is pending.</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x03</entry>
		      <entry>write/read</entry>
		      <entrytbl cols="5">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<colspec colnum="3" colname="col3">
			<colspec colnum="4" colname="col4">
			<colspec colnum="5" colname="col5">
			<spanspec namest="col1" nameend="col5" spanname="1to5">
			<spanspec namest="col2" nameend="col5" spanname="2to5">
			<spanspec namest="col4" nameend="col5" spanname="4to5">
			<tbody>
			  <row>
			    <entry spanname="1to5">Line Control
			      Register (LCR)</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry spanname="2to5">Divisor Latch Access Bit
			      (DLAB). When set, access to the data
			      transmit/receive register (THR/RBR) and the
			      Interrupt Enable Register (IER) is disabled. Any
			      access to these ports is now redirected to the
			      Divisor Latch Registers. Setting this bit,
			      loading the Divisor Registers, and clearing DLAB
			      should be done with interrupts disabled.</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry spanname="2to5">Set Break. When set to "1",
			      the transmitter begins to transmit continuous
			      Spacing until this bit is set to "0". This
			      overrides any bits of characters that are being
			      transmitted.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry spanname="2to5">Stick Parity. When parity
			      is enabled, setting this bit causes parity to
			      always be "1" or "0", based on the value of Bit
			      4.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry spanname="2to5">Even Parity Select (EPS).
			      When parity is enabled and Bit 5 is "0", setting
			      this bit causes even parity to be transmitted
			      and expected. Otherwise, odd parity is
			      used.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry spanname="2to5">Parity Enable (PEN). When
			      set to "1", a parity bit is inserted between the
			      last bit of the data and the Stop Bit. The UART
			      will also expect parity to be present in the
			      received data.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry spanname="2to5">Number of Stop Bits (STB).
			      If set to "1" and using 5-bit data words, 1.5
			      Stop Bits are transmitted and expected in each
			      data word. For 6, 7 and 8-bit data words, 2
			      Stop Bits are transmitted and expected. When
			      this bit is set to "0", one Stop Bit is used on
			      each data word.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry spanname="2to5">Word Length Select Bit #1
			      (WLSB1)</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry spanname="2to5">Word Length Select Bit #0
			      (WLSB0)</entry>
			  </row>

			  <row>
			    <entry colname="col2" spanname="2to5">Together
			      these bits specify the number of bits in each
			      data word.</entry>
			  </row>

			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4" spanname="4to5">Word
			      Length</entry>
			  </row>

			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4" spanname="4to5">5 Data
			      Bits</entry>
			  </row>

			  <row>
			    <entry colname="col2">0</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4" spanname="4to5">6 Data
			      Bits</entry>
			  </row>

			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">0</entry>
			    <entry colname="col4" spanname="4to5">7 Data
			      Bits</entry>
			  </row>

			  <row>
			    <entry colname="col2">1</entry>
			    <entry colname="col3">1</entry>
			    <entry colname="col4" spanname="4to5">8 Data
			      Bits</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x04</entry>
		      <entry>write/read</entry>
		      <entrytbl cols="2">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<spanspec namest="col1" nameend="col2" spanname="1to2">
			<tbody>
			  <row>
			    <entry spanname="1to2">Modem Control Register
			      (MCR)</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry>Reserved, always 0.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry>Loop-Back Enable. When set to "1", the UART
			      transmitter and receiver are internally
			      connected together to allow diagnostic
			      operations. In addition, the UART modem control
			      outputs are connected to the UART modem  control
			      inputs. CTS is connected to RTS, DTR is
			      connected to DSR, OUT1 is connected to RI, and
			      OUT 2 is connected to DCD.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry>OUT 2. An auxiliary output that the host
			      processor may set high or low. In the IBM PC
			      serial adapter (and most clones), OUT 2 is used
			      to tri-state (disable) the interrupt signal from
			      the 8250/16450/16550 UART.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry>OUT 1. An auxiliary output that the host
			      processor may set high or low. This output is
			      not used on the IBM PC serial adapter.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry>Request to Send (RTS). When set to "1", the
			      output of the UART -RTS line is Low
			      (Active).</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry>Data Terminal Ready (DTR). When set to "1",
			      the output of the UART -DTR line is Low
			      (Active).</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x05</entry>
		      <entry>write/read</entry>
		      <entrytbl cols="2">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<spanspec namest="col1" nameend="col2" spanname="1to2">
			<tbody>
			  <row>
			    <entry spanname="1to2">Line Status Register
			      (LSR)</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry>Error in Receiver FIFO. On the 8250/16450
			      UART, this bit is zero. This bit is set to "1"
			      when any of the bytes in the FIFO have one or
			      more of the following error conditions: PE, FE,
			      or BI.</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry>Transmitter Empty (TEMT). When set to "1",
			      there are no words  remaining in the transmit
			      FIFO or the transmit shift register. The
			      transmitter is completely idle.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry>Transmitter Holding Register Empty
			      (THRE). When set to "1", the FIFO (or holding
			      register) now has room for at least one
			      additional word to transmit. The transmitter may
			      still be transmitting when this bit is set to
			      "1".</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry>Break Interrupt (BI). The receiver has
			      detected a Break signal.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry>Framing Error (FE). A Start Bit was
			      detected but the Stop Bit did not appear at the
			      expected time. The received word is probably
			      garbled.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry>Parity Error (PE). The parity bit was
			      incorrect for the word received.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry>Overrun Error (OE). A new word was received
			      and therewas no room in the receive buffer. The
			      newly-arrived word in the shift register is
			      discarded. On 8250/16450 UARTs, the word in the
			      holding register is discarded and the newly-
			      arrived word is put in the holding
			      register.</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry>Data Ready (DR) One or more words are in
			      the receive FIFO that the host may read. A word
			      must be completely received and moved from the
			      shift register into the FIFO (or holding
			      register for 8250/16450 designs) before this bit
			      is set.</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x06</entry>
		      <entry>write/read</entry>
		      <entrytbl cols="2">
			<colspec colnum="1" colname="col1">
			<colspec colnum="2" colname="col2">
			<spanspec namest="col1" nameend="col2" spanname="1to2">
			<tbody>
			  <row>
			    <entry spanname="1to2">Modem Status Register
			      (MSR)</entry>
			  </row>

			  <row>
			    <entry>Bit 7</entry>
			    <entry>Data Carrier Detect (DCD). Reflects the
			      state of the DCD line on the UART.</entry>
			  </row>

			  <row>
			    <entry>Bit 6</entry>
			    <entry>Ring Indicator (RI). Reflects the state of
			      the RI line on the UART.</entry>
			  </row>

			  <row>
			    <entry>Bit 5</entry>
			    <entry>Data Set Ready (DSR). Reflects the state of
			      the DSR line on the UART.</entry>
			  </row>

			  <row>
			    <entry>Bit 4</entry>
			    <entry>Clear To Send (CTS). Reflects the state of
			      the CTS line on the UART.</entry>
			  </row>

			  <row>
			    <entry>Bit 3</entry>
			    <entry>Delta Data Carrier Detect (DDCD). Set to
			      "1" if the -DCD line has changed state one more
			      more times since the last time the MSR was read
			      by the host.</entry>
			  </row>

			  <row>
			    <entry>Bit 2</entry>
			    <entry>Trailing Edge Ring Indicator (TERI). Set to
			      "1" if the -RI line has had a low to high
			      transition since the last time the MSR was read
			      by the host.</entry>
			  </row>

			  <row>
			    <entry>Bit 1</entry>
			    <entry>Delta Data Set Ready (DDSR). Set to "1" if
			      the -DSR line has changed state one more more
			      times since the last time the MSR was read by
			      the host.</entry>
			  </row>

			  <row>
			    <entry>Bit 0</entry>
			    <entry>Delta Clear To Send (DCTS). Set to "1" if
			      the -CTS line has changed state one more more
			      times since the last time the MSR was read by
			      the host.</entry>
			  </row>
			</tbody>
		      </entrytbl>
		    </row>

		    <row>
		      <entry>+0x07</entry>
		      <entry>write/read</entry>
		      <entry>Scratch Register (SCR). This register performs no
			function in the UART. Any value can be written by the
			host to this location and read by the host later
			on.</entry>
		    </row>
		  </tbody>
		</tgroup>
	      </informaltable>
	    </sect4>
	    
	    <sect4>
	      <title>Beyond the 16550A UART</title>
	      
	      <para>Although National Semiconductor has not offered any
		components compatible with the 16550 that provide additional
		features, various other vendors have. Some of these
		components are described below. It should be understood that
		to effectively utilize these improvements, drivers may have to
		be provided by the chip vendor since most of the popular
		operating systems do not support features beyond those
		provided by the 16550.</para>
	      
	      
		<variablelist>
		  <varlistentry><term>ST16650</term>
		    <listitem>
		      <para>By default this part is similar to the NS16550A,
			but an extended 32-byte send and receive buffer can be
			optionally enabled. Made by Startech.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>TIL16660</term>
		    
		    <listitem>
		      <para>By default this part behaves similar to the
			NS16550A, but an extended 64-byte send and receive
			buffer can be optionally enabled. Made by Texas
			Instruments.</para>
		    </listitem>
		  </varlistentry>
		  
		  <varlistentry><term>Hayes ESP</term>
		    
		    <listitem>
		      <para>This proprietary plug-in card contains a 2048-byte
			send and receive buffer, and supports data rates to
			230.4Kbit/sec. Made by Hayes.</para>
		      
		    </listitem>
		  </varlistentry>
		</variablelist>
	      
	      
	      <para>In addition to these <quote>dumb</quote> UARTs, many vendors produce
		intelligent serial communication boards. This type of design
		usually provides a microprocessor that interfaces with several
		UARTs, processes and buffers the data, and then alerts the
		main PC processor when necessary. Because the UARTs are not
		directly accessed by the PC processor in this type of
		communication system, it is not necessary for the vendor to
		use UARTs that are compatible with the 8250, 16450, or the
		16550 UART. This leaves the designer free to components that
		may have better performance characteristics.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="sio">
	    <title>Configuring the <devicename>sio</devicename>
	      driver</title>
	    
	    <para>The <devicename>sio</devicename> driver provides
	      support for NS8250-, NS16450-, NS16550 and NS16550A-based EIA
	      RS-232C (CCITT V.24) communications interfaces. Several
	      multiport cards are supported as well. See the <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page for detailed technical
	      documentation.</para>
	    
	    
	    <sect4>
	      <title>Digi International (DigiBoard) PC/8</title>
	      
	      <para><emphasis>Contributed by &a.awebster;.<!-- <br> -->26
		  August 1995.</emphasis></para>
	      
	      <para>Here is a config snippet from a machine with a Digi
		International PC/8 with 16550. It has 8 modems connected to
		these 8 lines, and they work just great. Do not forget to add
		<literal>options COM_MULTIPORT</literal> or it will
		not work very well!</para>
	      
	      <programlisting>
device          sio4    at isa? port 0x100 tty flags 0xb05
device          sio5    at isa? port 0x108 tty flags 0xb05
device          sio6    at isa? port 0x110 tty flags 0xb05
device          sio7    at isa? port 0x118 tty flags 0xb05
device          sio8    at isa? port 0x120 tty flags 0xb05
device          sio9    at isa? port 0x128 tty flags 0xb05
device          sio10   at isa? port 0x130 tty flags 0xb05
device          sio11   at isa? port 0x138 tty flags 0xb05 irq 9 vector siointr
	      </programlisting>
	      
	      <para>The trick in setting this up is that the MSB of the flags
		represent the last SIO port, in this case 11 so flags are
		0xb05.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Boca 16</title>
	      
	      <para><emphasis>Contributed by &a.whiteside;.<!-- <br> -->26
		  August 1995.</emphasis></para>
	      
	      <para>The procedures to make a Boca 16 pord board with FreeBSD
		are pretty straightforward, but you will need a couple things
		to make it work:</para>
	      
	      
		<orderedlist>
		  
		  <listitem>
		    <para>You either need the kernel sources installed so you
		      can recompile the necessary options or you will need
		      someone else to compile it for you. The 2.0.5 default
		      kernel does <emphasis>not</emphasis> come with
		      multiport support enabled and you will need to add a
		      device entry for each port anyways.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Two, you will need to know the interrupt and IO
		      setting for your Boca Board so you can set these options
		      properly in the kernel.</para>
		  </listitem>
		  
		</orderedlist>
	      
	      
	      <para>One important note &mdash; the actual UART chips for the Boca 16
		are in the connector box, not on the internal board itself. So
		if you have it unplugged, probes of those ports will fail. I
		have never tested booting with the box unplugged and plugging
		it back in, and I suggest you do not either.</para>
	      
	      <para>If you do not already have a custom kernel configuration
		file set up, refer to <xref
		  linkend="kernelconfig" remap="Kernel Configuration"> for
		general procedures. The following are the specifics for the
		Boca 16 board and assume you are using the kernel name
		MYKERNEL and editing with vi.</para>
	      
	      <procedure>
		<step>
		  <para>Add the line 

		    <programlisting>
options COM_MULTIPORT
		    </programlisting>

		    to the config file.</para>
		</step>
		
		<step>
		  <para>Where the current <literal>device
		      sio<replaceable>n</replaceable></literal> lines are,
		      you will need to add 16 more devices. Only
			the last device includes the interrupt vector for the
			board. (See the <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page for detail as
		      to why.)  The following example is for a Boca Board with
		      an interrupt of 3, and a base IO address 100h. The IO
		      address for Each port is +8 hexadecimal from the
		      previous port, thus the 100h, 108h, 110h... addresses.</para>
		      
		      <programlisting>
device sio1 at isa? port 0x100 tty flags 0x1005
device sio2 at isa? port 0x108 tty flags 0x1005
device sio3 at isa? port 0x110 tty flags 0x1005
device sio4 at isa? port 0x118 tty flags 0x1005
&hellip;
device sio15 at isa? port 0x170 tty flags 0x1005
device sio16 at isa? port 0x178 tty flags 0x1005 irq 3 vector siointr
		      </programlisting>

		  <para>The flags entry
		    <emphasis>must</emphasis> be changed from this example
		    unless you are using the exact same sio assignments.
		    Flags are set according to 0x<replaceable>M</replaceable><replaceable>YY</replaceable>
		    where <replaceable>M</replaceable> indicates the minor number
		    of the master port (the last port on a Boca 16) and
		    <replaceable>YY</replaceable> indicates if FIFO is enabled or
		    disabled(enabled), IRQ sharing is used(yes) and if there
		    is an AST/4 compatible IRQ control register(no). In this
		    example,
		    
		    <programlisting>
flags 0x1005
		    </programlisting> indicates that the master port is
		    sio16. If I added another board and assigned sio17
		    through sio28, the flags for all 16 ports on
		    <emphasis>that</emphasis> board would be 0x1C05, where
		    1C indicates the minor number of the master port. Do not
		    change the 05 setting.</para>
		</step>
		  
		<step>
		  <para>Save and complete the kernel configuration,
		    recompile, install and reboot. Presuming you have
		    successfully installed the recompiled kernel and have it
		    set to the correct address and IRQ, your boot message
		    should indicate the successful probe of the Boca ports
		    as follows: (obviously the sio numbers, IO and IRQ could
		    be different)</para>
		    
		    <informalexample>
		      <screen>sio1 at 0x100-0x107 flags 0x1005 on isa
sio1: type 16550A (multiport)
sio2 at 0x108-0x10f flags 0x1005 on isa
sio2: type 16550A (multiport)
sio3 at 0x110-0x117 flags 0x1005 on isa
sio3: type 16550A (multiport)
sio4 at 0x118-0x11f flags 0x1005 on isa
sio4: type 16550A (multiport)
sio5 at 0x120-0x127 flags 0x1005 on isa
sio5: type 16550A (multiport)
sio6 at 0x128-0x12f flags 0x1005 on isa
sio6: type 16550A (multiport)
sio7 at 0x130-0x137 flags 0x1005 on isa
sio7: type 16550A (multiport)
sio8 at 0x138-0x13f flags 0x1005 on isa
sio8: type 16550A (multiport)
sio9 at 0x140-0x147 flags 0x1005 on isa
sio9: type 16550A (multiport)
sio10 at 0x148-0x14f flags 0x1005 on isa
sio10: type 16550A (multiport)
sio11 at 0x150-0x157 flags 0x1005 on isa
sio11: type 16550A (multiport)
sio12 at 0x158-0x15f flags 0x1005 on isa
sio12: type 16550A (multiport)
sio13 at 0x160-0x167 flags 0x1005 on isa
sio13: type 16550A (multiport)
sio14 at 0x168-0x16f flags 0x1005 on isa
sio14: type 16550A (multiport)
sio15 at 0x170-0x177 flags 0x1005 on isa
sio15: type 16550A (multiport)
sio16 at 0x178-0x17f irq 3 flags 0x1005 on isa
sio16: type 16550A (multiport master)</screen>
		      </informalexample>

		  <para>If the messages go by too fast to
		      see,

		    <informalexample>
		      <screen>&prompt.root; <userinput>dmesg | more</userinput></screen>
		    </informalexample> will
		      show you the boot messages.</para>
		  </step>
		  
		  <step>
		    <para>Next, appropriate entries in
		      <filename>/dev</filename> for the devices must be made
		      using the <filename>/dev/MAKEDEV</filename> script.
		      After becoming root:</para>
		    
		      <informalexample>
		      <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>./MAKEDEV tty1</userinput>
&prompt.root; <userinput>./MAKEDEV cua1</userinput>
<emphasis>(everything in between)</emphasis>
&prompt.root; <userinput>./MAKEDEV ttyg</userinput>
&prompt.root; <userinput>./MAKEDEV cuag</userinput></screen>
		      </informalexample>

		  <para>If you do not want or need callout
		      devices for some reason, you can dispense with making
		      the <filename>cua*</filename> devices.</para>
		  </step>
		  
		  <step>
		    <para>If you want a quick and sloppy way to make sure the
		      devices are working, you can simply plug a modem into
		      each port and (as root)

		    <informalexample>
		      <screen>&prompt.root; <userinput>echo at &gt; ttyd*</userinput></screen>
		    </informalexample> for each device you have made. You
		      <emphasis>should</emphasis> see the RX lights flash for
		      each working port.</para>
		  </step>
	      </procedure>
	    </sect4>
	  </sect3>
	  
	  <sect3 id="cy">
	    <title>Configuring the <devicename>cy</devicename>
	      driver</title>
	    
	    <para><emphasis>Contributed by &a.alex;.<!-- <br> -->6 June
		1996.</emphasis></para>
	    
	    <para>The Cyclades multiport cards are based on the
	      <devicename>cy</devicename> driver instead of the usual
	      <devicename>sio</devicename> driver used by other multiport
	      cards. Configuration is a simple matter of:</para>
	    
	    <procedure>
	      <step>
		<para>Add the <devicename>cy</devicename> device to
		  your <xref linkend="kernelconfig-config"
		    remap="kernel configuration"> (note that your irq and
		  iomem settings may differ).</para>
		    
		    <programlisting>
device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000 vector cyintr
		    </programlisting>
		</step>
		
	      <step>
		<para><xref linkend="kernelconfig-building" remap="Rebuild
		    and install">  the new kernel.</para>
	      </step>
	      
	      <step>
		<para>Make the <xref linkend="kernelconfig-nodes"
		    remap="device nodes"> by typing (the following example
		  assumes an 8-port board):</para>
		  
		  <informalexample>
		    <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>for i in 0 1 2 3 4 5 6 7;do ./MAKEDEV cuac$i ttyc$i;done</userinput></screen>
		  </informalexample>
	      </step>
	      
	      <step>
		<para>If appropriate, add <xref linkend="dialup"
		    remap="dialup"> entries to <xref linkend="dialup-ttys"
		    remap="/etc/ttys">
		  by  duplicating serial device (<literal>ttyd</literal>) entries and  using <literal>ttyc</literal> in place of <literal>ttyd</literal>. For example:</para>
		    
		    <programlisting>
ttyc0   "/usr/libexec/getty std.38400"  unknown on insecure
ttyc1   "/usr/libexec/getty std.38400"  unknown on insecure
ttyc2   "/usr/libexec/getty std.38400"  unknown on insecure
&hellip;
ttyc7   "/usr/libexec/getty std.38400"  unknown on insecure
		    </programlisting>
		</step>
		
		<step>
		  <para>Reboot with the new kernel.</para>
		</step>
	    </procedure>
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>* Parallel ports</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Modems</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Network cards</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Keyboards</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Mice</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Other</title>

	  <para></para>
	</sect2>
      </sect1>
      
      <sect1 id="hw-storage">
	<title>Storage Devices</title>
	
	
	<sect2 id="esdi">
	  <title>Using ESDI hard disks</title>
	  
	  <para><emphasis>Copyright &copy; 1995, &a.wilko;.<!-- <br> -->24
	      September 1995.</emphasis></para>
	  
	  <para>ESDI is an acronym that means Enhanced Small Device Interface.
	    It is loosely based on the good old ST506/412 interface originally
	    devised by Seagate Technology, the makers of the first affordable
	    5.25" winchester disk.</para>
	  
	  <para>The acronym says Enhanced, and rightly so. In the first place
	    the speed of the interface is higher, 10 or 15 Mbits/second
	    instead of the 5 Mbits/second of ST412 interfaced drives. Secondly
	    some higher level commands are added, making the ESDI interface
	    somewhat 'smarter' to the operating system driver writers. It is
	    by no means as smart as SCSI by the way. ESDI is standardized by
	    ANSI.</para>
	  
	  <para>Capacities of the drives are boosted by putting more sectors
	    on each track. Typical is 35 sectors per track, high capacity
	    drives I have seen were up to 54 sectors/track.</para>
	  
	  <para>Although ESDI has been largely obsoleted by IDE and SCSI
	    interfaces, the availability of free or cheap surplus drives makes
	    them  ideal for low (or now) budget systems.</para>
	  
	  
	  <sect3>
	    <title>Concepts of ESDI</title>
	    
	    
	    <sect4>
	      <title>Physical connections</title>
	      
	      <para>The ESDI interface uses two cables connected to each
		drive. One cable is a 34 pin flat cable edge connector that
		carries the command and status signals from the controller to
		the drive and vice-versa. The command cable is daisy chained
		between all the drives. So, it forms a bus onto which all
		drives are connected.</para>
	      
	      <para>The second cable is a 20 pin flat cable edge connector
		that carries the data to and from the drive. This cable is
		radially connected, so each drive has its own direct
		connection to the controller.</para>
	      
	      <para>To the best of my knowledge PC ESDI controllers are
		limited to using a maximum of 2 drives per controller. This is
		compatibility feature(?) left over from the WD1003 standard
		that reserves only a single bit for device addressing.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Device addressing</title>
	      
	      <para>On each command cable a maximum of 7 devices and 1
		controller can be present. To enable the controller to
		uniquely  identify which drive it addresses, each ESDI device
		is equipped with jumpers or switches to select the devices
		address.</para>
	      
	      <para>On PC type controllers the first drive is set to address
		0, the second disk to address 1. <emphasis>Always
		  make sure</emphasis> you set each disk to an unique address!
		So, on a PC with its two drives/controller maximum the first
		drive is drive 0, the second is drive 1.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Termination</title>
	      
	      <para>The daisy chained command cable (the 34 pin cable
		remember?) needs to be terminated at the last drive on the
		chain. For this purpose ESDI drives come with a termination
		resistor network that can be removed or disabled by a jumper
		when it is not used.</para>
	      
	      <para>So, one and <emphasis>only</emphasis> one drive,
		the one at  the farthest end of the command cable has its
		terminator installed/enabled. The controller automatically
		terminates the other end of the cable. Please note that this
		implies that the controller must be  at one end of the cable
		and <emphasis>not</emphasis> in the middle.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Using ESDI disks with FreeBSD</title>
	    
	    <para>Why is ESDI such a pain to get working in the first
	      place?</para>
	    
	    <para>People who tried ESDI disks with FreeBSD are known to have
	      developed a profound sense of frustration. A combination of
	      factors works against you to produce effects that are hard to
	      understand when you have never seen them before.</para>
	    
	    <para>This has also led to the popular legend ESDI and FreeBSD is
	      a plain NO-GO. The following sections try to list all the
	      pitfalls and  solutions.</para>
	    
	    
	    <sect4>
	      <title>ESDI speed variants</title>
	      
	      <para>As briefly mentioned before, ESDI comes in two speed
		flavors. The older drives and controllers use a 10
		Mbits/second data transfer rate. Newer stuff uses 15
		Mbits/second.</para>
	      
	      <para>It is not hard to imagine that 15 Mbits/second drive cause
		problems on controllers laid out for 10 Mbits/second. As
		always, consult your controller <emphasis>and</emphasis> drive  documentation to see if
		things match.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Stay on track</title>
	      
	      <para>Mainstream ESDI drives use 34 to 36 sectors per track.
		Most (older) controllers cannot handle more than this  number
		of sectors. Newer, higher capacity, drives use higher numbers
		of sectors per track. For instance, I own a 670 Mb drive that
		has 54 sectors per track.</para>
	      
	      <para>In my case, the controller could not handle this number of
		sectors. It proved to work well except that it only used 35
		sectors on each track. This meant losing a lot of disk
		space.</para>
	      
	      <para>Once again, check the documentation of your hardware for
		more info. Going out-of-spec like in the example might or
		might not work. Give it a try or get another more capable
		controller.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Hard or soft sectoring</title>
	      
	      <para>Most ESDI drives allow hard or soft sectoring to be
		selected using a jumper. Hard sectoring means that the drive
		will produce a sector pulse on the start of each new sector.
		The controller uses this pulse to tell when it should start to
		write or read.</para>
	      
	      <para>Hard sectoring allows a selection of sector size (normally
		256, 512 or 1024 bytes per formatted sector). FreeBSD uses
		512 byte sectors. The number of sectors per track also varies
		while still using the same number of bytes per formatted
		sector. The number of <emphasis>unformatted</emphasis> bytes
		per sector varies, dependent on your controller it needs more
		or less overhead  bytes to work correctly. Pushing more
		sectors on a track  of course gives you more usable space, but
		might give  problems if your controller needs more bytes than
		the  drive offers.</para>
	      
	      <para>In case of soft sectoring, the controller itself
		determines where to start/stop reading or writing. For ESDI
		hard sectoring is the default (at least on everything I came
		across). I never felt the urge to try soft sectoring.</para>
	      
	      <para>In general, experiment with sector settings before you
		install FreeBSD because you need to re-run the low-level
		format after each change.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Low level formatting</title>
	      
	      <para>ESDI drives need to be low level formatted before they are
		usable. A reformat is needed whenever you figgle with the
		number of sectors/track jumpers or the physical orientation of
		the drive (horizontal, vertical). So, first think, then
		format. The format time must not be underestimated, for big
		disks it can take hours.</para>
	      
	      <para>After a low level format, a surface scan is done to find
		and flag bad sectors. Most disks have a manufacturer bad block
		list listed on a piece of paper or adhesive sticker. In
		addition, on most disks the list is also written onto the
		disk. Please use the manufacturer's list. It is much easier to
		remap a defect now than after FreeBSD is installed.</para>
	      
	      <para>Stay away from low-level formatters that mark all sectors
		of a track as bad as soon as they find one bad sector. Not
		only does this waste space, it also and more importantly
		causes you grief with bad144 (see the section on
		bad144).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Translations</title>
	      
	      <para>Translations, although not exclusively a ESDI-only
		problem, might give you real trouble. Translations come in
		multiple flavors. Most of them  have in common that they
		attempt to work around the limitations posed upon disk
		geometries by the original IBM PC/AT design (thanks
		IBM!).</para>
	      
	      <para>First of all there is the (in)famous 1024 cylinder limit.
		For a system to be able to boot, the stuff (whatever
		operating system) must be in the first 1024 cylinders of a
		disk. Only 10 bits are available to encode the cylinder
		number. For the number of sectors the limit is 64 (0-63). When
		you combine the 1024 cylinder limit with the 16 head limit
		(also a design feature) you max out at fairly limited  disk
		sizes.</para>
	      
	      <para>To work around this problem, the manufacturers of ESDI PC
		controllers added a BIOS prom extension on their boards. This
		BIOS extension handles disk I/O for booting (and for some
		operating systems <emphasis>all</emphasis> disk I/O)
		by using  translation. For instance, a big drive might be
		presented to the system as having 32 heads and 64
		sectors/track. The result is that the number of cylinders is
		reduced to something below 1024 and is therefore usable by the
		system without problems. It is noteworthy to know that FreeBSD
		does not use the BIOS after its kernel has started. More on
		this later.</para>
	      
	      <para>A second reason for translations is the fact that most
		older system BIOSes could only handle drives with 17 sectors
		per track (the old ST412 standard). Newer system BIOSes
		usually have a user-defined drive type (in most cases this is
		drive type 47).</para>

	      <warning>
		<para>Whatever you do to translations after reading
		  this document, keep in mind that if you have multiple
		  operating systems on the same disk, all must use the same
		  translation</para>
	      </warning>
	      
	      <para>While on the subject of translations, I have seen one
		controller type (but there are probably more like this) offer
		the option to logically split a drive in multiple partitions
		as a BIOS option. I had select 1 drive == 1 partition because
		this controller wrote this info onto the disk. On power-up it
		read the info and presented itself to the system based on the
		info from the disk.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Spare sectoring</title>
	      
	      <para>Most ESDI controllers offer the possibility to remap bad
		sectors. During/after the low-level format of the disk bad
		sectors are marked as such, and a replacement sector is put in
		place (logically of course) of the bad one.</para>
	      
	      <para>In most cases the remapping is done by using N-1 sectors
		on each track for actual data storage, and sector N itself is
		the spare sector. N is the total number of sectors physically
		available on the track. The idea behind this is that the
		operating system sees a 'perfect' disk without bad sectors. In
		the case of FreeBSD this concept is not usable.</para>
	      
	      <para>The problem is that the translation from <emphasis>bad</emphasis> to <emphasis>good</emphasis> is performed by the BIOS of the
		ESDI controller. FreeBSD, being a true 32 bit operating
		system, does not use the BIOS after it has been booted.
		Instead, it has device drivers that talk directly to the
		hardware.</para>
	      
	      <para><emphasis>So: don't use spare sectoring, bad block
		  remapping or whatever it may be called by the controller
		  manufacturer when you want to use the disk for
		  FreeBSD.</emphasis></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Bad block handling</title>
	      
	      <para>The preceding section leaves us with a problem. The
		controller's bad block handling is not usable and still
		FreeBSD's filesystems assume perfect media without any flaws.
		To solve this problem, FreeBSD use the <command>bad144</command> tool. Bad144 (named after a
		Digital Equipment standard for bad block handling) scans a
		FreeBSD slice for bad blocks. Having found these bad blocks,
		it writes a table with the offending block numbers to the end
		of the FreeBSD slice.</para>
	      
	      <para>When the disk is in operation, the disk accesses are
		checked  against the table read from the disk. Whenever a
		block number is requested that is in the <command>bad144</command> list, a
		replacement block (also from the end of the FreeBSD slice) is
		used. In this way, the <command>bad144</command> replacement scheme presents
		'perfect' media to the FreeBSD filesystems.</para>
	      
	      <para>There are a number of potential pitfalls associated with
		the use of <command>bad144</command>. First of all, the slice cannot have more
		than 126 bad sectors. If your drive has a high number of bad
		sectors, you might need to divide it into multiple FreeBSD
		slices each containing less than 126 bad sectors. Stay away
		from low-level format programs that mark
		<emphasis>every</emphasis> sector of a track as bad when  they
		find a flaw on the track. As you can imagine, the  126 limit
		is quickly reached when the low-level format is done this
		way.</para>
	      
	      <para>Second, if the slice contains the root filesystem, the
		slice should be within the 1024 cylinder BIOS limit. During
		the boot process the bad144 list is read using the BIOS and
		this only succeeds when the list is within the 1024 cylinder
		limit.</para>

	      <note>
		<para>The restriction is not that only the root
		  <emphasis>filesystem</emphasis> must be within the 1024
		  cylinder limit, but rather the entire
		  <emphasis>slice</emphasis> that contains the root
		  filesystem.</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title>Kernel configuration</title>
	      
	      <para>ESDI disks are handled by the same <literal>wd</literal>driver as IDE and ST412 MFM disks. The
		<literal>wd</literal> driver should work for all
		WD1003 compatible interfaces.</para>
	      
	      <para>Most hardware is jumperable for one of two different I/O
		address ranges and IRQ lines. This allows you to have  two wd
		type controllers in one system.</para>
	      
	      <para>When your hardware allows non-standard strappings, you can
		use these with FreeBSD as long as you enter the  correct info
		into the kernel config file. An example from the kernel config
		file (they live in <filename>/sys/i386/conf</filename>
		BTW).</para>
	      
	      <programlisting>
# First WD compatible controller
controller      wdc0    at isa? port "IO_WD1" bio irq 14 vector wdintr
disk            wd0     at wdc0 drive 0
disk            wd1     at wdc0 drive 1
# Second WD compatible controller
controller      wdc1    at isa? port "IO_WD2" bio irq 15 vector wdintr
disk            wd2     at wdc1 drive 0
disk            wd3     at wdc1 drive 1
	      </programlisting>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Particulars on ESDI hardware</title>
	    
	    
	    <sect4>
	      <title>Adaptec 2320 controllers</title>
	      
	      <para>I successfully installed FreeBSD onto a ESDI disk
		controlled by a ACB-2320. No other operating system was
		present on the disk.</para>
	      
	      <para>To do so I low level formatted the disk using <command>NEFMT.EXE</command>
		(<command>ftp</command>able from
		<hostid role="fqdn">www.adaptec.com</hostid>) and answered NO to the
		question whether the disk should be formatted with a spare
		sector on each track. The BIOS on the ACD-2320 was disabled. I
		used the <literal>free configurable</literal> option in the system BIOS to
		allow the BIOS to boot it.</para>
	      
	      <para>Before using <command>NEFMT.EXE</command> I tried to format the disk using
		the ACB-2320 BIOS builtin formatter. This proved to be a show
		stopper, because it did not give me an option to disable spare
		sectoring. With spare sectoring enabled the FreeBSD
		installation process broke down on the <command>bad144</command> run.</para>
	      
	      <para>Please check carefully which ACB-232<replaceable>xy</replaceable> variant you have.
		The <replaceable>x</replaceable> is either <literal>0</literal> or <literal>2</literal>, indicating a controller without or
		with a floppy controller on board.</para>
	      
	      <para>The <literal>y</literal> is more interesting. It can either be a blank, a
		<literal>A-8</literal> or a <literal>D</literal>. A blank indicates a plain 10 Mbits/second
		controller. An <literal>A-8</literal> indicates a 15 Mbits/second controller
		capable of handling 52 sectors/track. A <literal>D</literal> means a 15
		Mbits/second controller that can also handle drives with &gt;
		36 sectors/track (also 52 ?).</para>
	      
	      <para>All variations should be capable of using 1:1
		interleaving. Use 1:1, FreeBSD is fast enough to handle
		it.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Western Digital WD1007 controllers</title>
	      
	      <para>I successfully installed FreeBSD onto a ESDI disk
		controlled by a WD1007 controller. To be precise, it was a
		WD1007-WA2. Other variations of the WD1007 do exist.</para>
	      
	      <para>To get it to work, I had to disable the sector translation
		and the WD1007's onboard BIOS. This implied I could not use
		the low-level formatter built into this BIOS. Instead, I
		grabbed <command>WDFMT.EXE</command> from <hostid role="fqdn">www.wdc.com</hostid> Running this formatted my
		drive just fine.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Ultrastor U14F controllers</title>
	      
	      <para>According to multiple reports from the net, Ultrastor ESDI
		boards work OK with FreeBSD. I lack any further info on
		particular settings.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="esdi-further-reading">
	    <title>Further reading</title>
	    
	    <para>If you intend to do some serious ESDI hacking, you might
	      want to have the official standard at hand:</para>
	    
	    <para>The latest ANSI X3T10 committee document is:
	      <itemizedlist>
		
		<listitem>
		  <para>Enhanced Small Device Interface (ESDI)
		    [X3.170-1990/X3.170a-1991]    [X3T10/792D Rev 11]</para>
		</listitem>
		
	      </itemizedlist> On Usenet the newsgroup <ulink
		URL="news:comp.periphs">comp.periphs</ulink> is a noteworthy
	      place to look  for more info.</para>
	    
	    <para>The World Wide Web (WWW) also proves to be a very handy info
	      source: For info on Adaptec ESDI controllers see <ulink
		URL="http://www.adaptec.com/">http://www.adaptec.com/</ulink>.
	      For info on Western Digital controllers see <ulink
		URL="http://www.wdc.com/">http://www.wdc.com/</ulink>.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Thanks to...</title>
	    
	    <para>Andrew Gordon for sending me an Adaptec 2320 controller and
	      ESDI disk  for testing.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="scsi">
	  <title>What is SCSI?</title>
	  
	  <para><emphasis>Copyright &copy; 1995, &a.wilko;.<!-- <br> -->July
	      6, 1996.</emphasis></para>
	  
	  <para>SCSI is an acronym for Small Computer Systems Interface. It
	    is an ANSI standard that has become one of the leading I/O buses
	    in the computer industry. The foundation of the SCSI standard was
	    laid by Shugart Associates (the same guys that gave the world the
	    first mini floppy disks) when they introduced the SASI bus
	    (Shugart Associates Standard Interface).</para>
	  
	  <para>After some time an industry effort was started to come to a
	    more strict standard allowing devices from different vendors to
	    work together. This effort was recognized in the ANSI SCSI-1
	    standard. The SCSI-1 standard (approx 1985) is rapidly becoming
	    obsolete. The current standard is SCSI-2 (see <xref
	      linkend="scsi-further-reading"
	      remap="Further         reading">), with SCSI-3 on the drawing
	    boards.</para>
	  
	  <para>In addition to a physical interconnection standard, SCSI
	    defines a logical (command set) standard to which disk devices
	    must adhere. This standard is called the Common Command Set (CCS)
	    and was developed more or less in parallel with ANSI SCSI-1.
	    SCSI-2 includes the (revised) CCS as part of the standard itself.
	    The commands are dependent on the type of device at hand. It does
	    not make much sense of course to define a Write command for a
	    scanner.</para>
	  
	  <para>The SCSI bus is a parallel bus, which comes in a number of
	    variants. The oldest and most used is an 8 bit wide bus, with
	    single-ended signals, carried on 50 wires. (If you do not know
	    what single-ended means, do not worry, that is what this document
	    is all about.)  Modern designs also use 16 bit wide buses, with
	    differential signals. This allows transfer speeds of
	    20Mbytes/second, on cables lengths of up to 25 meters. SCSI-2
	    allows a maximum bus width of 32 bits, using an additional cable.
	    Quickly emerging are Ultra SCSI (also called Fast-20) and Ultra2
	    (also called Fast-40). Fast-20 is 20 million transfers per second
	    (20 Mbytes/sec on a 8 bit bus), Fast-40 is 40 million transfers
	    per second (40 Mbytes/sec on a 8 bit bus). Most hard drives sold
	    today are single-ended Ultra SCSI (8 or 16 bits).</para>
	  
	  <para>Of course the SCSI bus not only has data lines, but also a
	    number of control signals. A very elaborate protocol is part of
	    the standard to allow multiple devices to share the bus in an
	    efficient manner. In SCSI-2, the data is always checked using a
	    separate parity line. In pre-SCSI-2 designs parity was
	    optional.</para>
	  
	  <para>In SCSI-3 even faster bus types are introduced, along with a
	    serial SCSI busses that reduces the cabling overhead and allows a
	    higher maximum bus length. You might see names like SSA and
	    Fiberchannel in this context. None of the serial buses are
	    currently in widespread use (especially not in the typical FreeBSD
	    environment). For this reason the serial bus types are not
	    discussed any further.</para>
	  
	  <para>As you could have guessed from the description above, SCSI
	    devices are intelligent. They have to be to adhere to the SCSI
	    standard (which is over 2 inches thick BTW). So, for a hard disk
	    drive for instance you do not specify a head/cylinder/sector to
	    address a particular block, but simply the number of the block you
	    want. Elaborate caching schemes, automatic bad block replacement
	    etc are all made possible by this 'intelligent device'
	    approach.</para>
	  
	  <para>On a SCSI bus, each possible pair of devices can communicate.
	    Whether their function allows this is another matter, but the
	    standard does not restrict it. To avoid signal contention, the 2
	    devices have to arbitrate for the bus before using it.</para>
	  
	  <para>The philosophy of SCSI is to have a standard that allows
	    older-standard devices to work with newer-standard ones. So, an
	    old SCSI-1 device should normally work on a SCSI-2 bus. I say
	    Normally, because it is not absolutely sure that the
	    implementation of an old device follows the (old) standard closely
	    enough to be acceptable on a new bus. Modern devices are usually
	    more well-behaved, because the standardization has become more
	    strict and is better adhered to by the device manufacturers.</para>
	  
	  <para>Generally speaking, the chances of getting a working set of
	    devices on a single bus is better when all the devices are SCSI-2
	    or newer. This implies that you do not have to dump all your old
	    stuff when you get that shiny 2GB disk: I own a system on which a
	    pre-SCSI-1 disk, a SCSI-2 QIC tape unit, a SCSI-1 helical scan
	    tape unit and 2 SCSI-1 disks work together quite happily. From a
	    performance standpoint you might want to separate your older and
	    newer (=faster) devices however.</para>
	  
	  
	  <sect3>
	    <title>Components of SCSI</title>
	    
	    <para>As said before, SCSI devices are smart. The idea is to put
	      the knowledge about intimate hardware details onto the SCSI
	      device itself. In this way, the host system does not have to
	      worry about things like how many heads are hard disks has, or
	      how many tracks there are on a specific tape device. If you are
	      curious, the standard specifies commands with which you can
	      query your devices on their hardware particulars. FreeBSD uses
	      this capability during boot to check out what devices are
	      connected and whether they need any special treatment.</para>
	    
	    <para>The advantage of intelligent devices is obvious: the device
	      drivers on the host can be made in a much more generic fashion,
	      there is no longer a need to change (and qualify!) drivers for
	      every odd new device that is introduced.</para>
	    
	    <para>For cabling and connectors there is a golden rule: get good
	      stuff. With bus speeds going up all the time you will save
	      yourself a lot of grief by using good material.</para>
	    
	    <para>So, gold plated connectors, shielded cabling, sturdy
	      connector hoods with strain reliefs etc are the way to go.
	      Second golden rule: do no use cables longer than necessary. I
	      once spent 3 days hunting down a problem with a flaky machine
	      only to discover that shortening the SCSI bus by 1 meter solved
	      the problem. And the original bus length was well within the
	      SCSI specification.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>SCSI bus types</title>
	    
	    <para>From an electrical point of view, there are two incompatible
	      bus types: single-ended and differential. This means that there
	      are two different main groups of SCSI devices and controllers,
	      which cannot be mixed on the same bus. It is possible however
	      to use special converter hardware to transform a single-ended
	      bus into a differential one (and vice versa). The differences
	      between the bus types are explained in the next sections.</para>
	    
	    <para>In lots of SCSI related documentation there is a sort of
	      jargon in use to abbreviate the different bus types. A small
	      list:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>FWD:	Fast Wide Differential</para>
		</listitem>
		
		<listitem>
		  <para>FND:	Fast Narrow Differential</para>
		</listitem>
		
		<listitem>
		  <para>SE:	Single Ended</para>
		</listitem>
		
		<listitem>
		  <para>FN:	Fast Narrow</para>
		</listitem>
		
		<listitem>
		  <para>etc.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>With a minor amount of imagination one can usually imagine
	      what is meant.</para>
	    
	    <para>Wide is a bit ambiguous, it can indicate 16 or 32 bit buses.
	      As far as I know, the 32 bit variant is not (yet) in use, so
	      wide normally means 16 bit.</para>
	    
	    <para>Fast means that the timing on the bus is somewhat different,
	      so that on a narrow (8 bit) bus 10 Mbytes/sec are possible
	      instead of 5 Mbytes/sec for 'slow' SCSI. As discussed before,
	      bus speeds of 20 and 40 million transfers/second are also
	      emerging  (Fast-20 == Ultra SCSI and Fast-40 == Ultra2 SCSI).</para>

	    <note>
	      <para>The data lines &gt; 8 are only used for data transfers and
		device addressing. The transfers of commands and status
		messages etc are only performed on the lowest 8 data lines.
		The standard allows narrow devices to operate on a wide bus.
		The usable bus width is negotiated between the devices. You
		have to watch your device addressing closely when mixing wide
		and narrow.</para>
	    </note>
	    
	    <sect4>
	      <title>Single ended buses</title>
	      
	      <para>A single-ended SCSI bus uses signals that are either 5
		Volts or 0 Volts (indeed, TTL levels) and are relative to a
		COMMON ground reference. A singled ended 8 bit SCSI bus has
		approximately 25 ground lines, who are all tied to a single
		`rail' on all devices. A standard single ended bus has a
		maximum length of 6 meters. If the same bus is used with
		fast-SCSI devices, the maximum length allowed drops to 3
		meters. Fast-SCSI means that instead of 5Mbytes/sec the bus
		allows 10Mbytes/sec transfers.</para>
	      
	      <para>Fast-20 (Ultra SCSI) and Fast-40 allow for 20 and 40
		million transfers/second respectively. So, F20 is 20
		Mbytes/second on a 8 bit bus, 40 Mbytes/second on a 16 bit bus
		etc. For F20 the max bus length is 1.5 meters, for F40 it
		becomes 0.75 meters. Be aware that F20 is pushing  the limits
		quite a bit, so you will quickly find out if your SCSI bus is
		electrically sound.</para>

	      <note>
		<para>If some devices on your bus use 'fast' to communicate
		  your bus must adhere to the length restrictions for fast
		  buses!</para>
	      </note>
	      
	      <para>It is obvious that with the newer fast-SCSI devices the
		bus length can become a real bottleneck. This is why the
		differential SCSI bus was introduced in the SCSI-2
		standard.</para>
	      
	      <para>For connector pinning and connector types please refer to
		the SCSI-2 standard (see <xref linkend="scsi-further-reading"
		  remap="Further             reading">) itself, connectors etc
		are listed there in painstaking detail.</para>
	      
	      <para>Beware of devices using non-standard cabling. For instance
		Apple uses a 25pin D-type connecter (like the one on serial
		ports and parallel printers). Considering that the official
		SCSI bus needs 50 pins you can imagine the use of this
		connector needs some 'creative cabling'. The reduction of the
		number of ground wires they used is a bad idea, you better
		stick to 50 pins cabling  in accordance with the SCSI
		standard. For Fast-20 and 40 do not even think about buses
		like this.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Differential buses</title>
	      
	      <para>A differential SCSI bus has a maximum length of 25 meters.
		Quite a difference from the 3 meters for a single-ended
		fast-SCSI bus. The idea behind differential signals is that
		each bus signal has its own return wire. So, each signal is
		carried on a (preferably twisted) pair of wires. The voltage
		difference between these two wires determines whether the
		signal is asserted or de-asserted. To a certain extent the
		voltage difference between ground and the signal wire pair is
		not relevant (do not try 10 kVolts though).</para>
	      
	      <para>It is beyond the scope of this document to explain why
		this differential idea is so much better. Just accept that
		electrically seen the use of differential signals gives a much
		better noise margin. You will normally find differential buses
		in use for inter-cabinet connections. Because of the lower
		cost single ended is mostly used for shorter buses like inside
		cabinets.</para>
	      
	      <para>There is nothing that stops you from using differential
		stuff with FreeBSD, as long as you use a controller that has
		device driver support in FreeBSD. As an example, Adaptec
		marketed the AHA1740 as a single ended board, whereas the
		AHA1744 was differential. The software interface to the host
		is identical for both.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Terminators</title>
	      
	      <para>Terminators in SCSI terminology are resistor networks that
		are used to get a correct impedance matching. Impedance
		matching is important to get clean signals on the bus, without
		reflections or ringing. If you once made a long distance
		telephone call on a bad line you probably know what
		reflections are. With 20Mbytes/sec traveling over your SCSI
		bus, you do not want signals echoing back.</para>
	      
	      <para>Terminators come in various incarnations, with more or
		less sophisticated designs. Of course, there are internal and
		external variants. Many SCSI devices come with a number of
		sockets in which a number of resistor networks can (must be!)
		installed. If you remove terminators from a device, carefully
		store them. You will need them when you ever decide to
		reconfigure your SCSI bus. There is enough variation in even
		these simple tiny things to make finding the exact replacement
		a frustrating business. There are also SCSI devices that have
		a single jumper to enable or disable a built-in terminator.
		There are special terminators you can stick onto a flat cable
		bus. Others look like external connectors, or a connector
		hood without a cable. So, lots of choice as you can
		see.</para>
	      
	      <para>There is much debate going on if and when you should
		switch from simple resistor (passive) terminators to active
		terminators. Active terminators contain slightly more
		elaborate circuit to give cleaner bus signals. The general
		consensus seems to be that the usefulness of active
		termination increases when you have long buses and/or fast
		devices. If you ever have problems with your SCSI buses you
		might consider trying an active terminator. Try to borrow one
		first, they reputedly are quite expensive.</para>
	      
	      <para>Please keep in mind that terminators for differential and
		single-ended buses are not identical. You should <emphasis>not mix</emphasis> the two variants.</para>
	      
	      <para>OK, and now where should you install your terminators?
		This is by far the most misunderstood part of SCSI. And it is
		by far the simplest. The rule is: <emphasis>every
		  single line on the SCSI bus has 2 (two) terminators, one at
		  each end of the bus.</emphasis> So, two and not one or three
		or whatever. Do yourself a favor and stick to this rule. It
		will save you endless grief, because wrong termination has the
		potential to introduce highly mysterious bugs. (Note the
		<quote>potential</quote> here; the nastiest part is that it may or may not
		work.)</para>
	      
	      <para>A common pitfall is to have an internal (flat) cable in a
		machine and also an external cable attached to the controller.
		It seems almost everybody forgets to remove the terminators
		from the controller. The terminator must now be on the last
		external device, and not on the controller! In general, every
		reconfiguration of a SCSI bus must pay attention to
		this.</para>

	      <note>
		<para>Termination is to be done on a per-line basis. This
		  means if you have both narrow and wide buses connected to
		  the same host adapter, you need to enable termination on the
		  higher 8 bits of the bus on the adapter (as well as the last
		  devices on each bus, of course).</para>
	      </note>
	      
	      <para>What I did myself is remove all terminators from my SCSI
		devices and controllers. I own a couple of external
		terminators, for both the Centronics-type external cabling and
		for the internal flat cable connectors. This makes
		reconfiguration much easier.</para>
	      
	      <para>On modern devices, sometimes integrated terminators are
		used. These things are special purpose integrated circuits
		that can be dis/en-abled with a control pin. It is not
		necessary to physically remove them from a device. You may
		find them on newer host adapters, sometimes they are software
		configurable, using some sort of setup tool. Some will even
		auto-detect the cables attached to the connectors and
		automatically set up the termination as necessary. At any
		rate, consult your documentation!</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Terminator power</title>
	      
	      <para>The terminators discussed in the previous chapter need
		power to operate properly. On the SCSI bus, a line is
		dedicated to this purpose. So, simple huh?</para>
	      
	      <para>Not so. Each device can provide its own terminator power
		to the terminator sockets it has on-device. But if you have
		external terminators, or when the device supplying the
		terminator power to the SCSI bus line is switched off you are
		in trouble.</para>
	      
	      <para>The idea is that initiators (these are devices that
		initiate actions on the bus, a discussion follows) must supply
		terminator power. All SCSI devices are allowed (but not
		required) to supply terminator power.</para>
	      
	      <para>To allow for un-powered devices on a bus, the terminator
		power must be supplied to the bus via a diode. This prevents
		the backflow of current to un-powered devices.</para>
	      
	      <para>To prevent all kinds of nastiness, the terminator power is
		usually fused. As you can imagine, fuses might blow. This
		can, but does not have to, lead to a non functional bus. If
		multiple devices supply terminator power, a single blown fuse
		will not put you out of business. A single supplier with a
		blown fuse certainly will. Clever external terminators
		sometimes have a  LED indication that shows whether terminator
		power is present.</para>
	      
	      <para>In newer designs auto-restoring fuses that 'reset'
		themselves after some time are sometimes used.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Device addressing</title>
	      
	      <para>Because the SCSI bus is, ehh, a bus there must be a way to
		distinguish or address the different devices connected to
		it.</para>
	      
	      <para>This is done by means of the SCSI or target ID. Each
		device has a unique target ID. You can select the ID to which
		a device must respond using a set of jumpers, or a dip switch,
		or something similar. Some SCSI host adapters let you change
		the target ID from the boot menu. (Yet some others will not
		let you change the ID from 7.)  Consult the documentation of
		your device for more information.</para>
	      
	      <para>Beware of multiple devices configured to use the same ID.
		Chaos normally reigns in this case. A pitfall is that one of
		the devices sharing the same ID sometimes even manages to
		answer to I/O requests!</para>
	      
	      <para>For an 8 bit bus, a maximum of 8 targets is possible. The
		maximum is 8 because the selection is done bitwise using the 8
		data lines on the bus. For wide buses this increases to the
		number of data lines (usually 16).</para>

	      <note>
		<para>A narrow SCSI device can not communicate with a SCSI
		  device with a target ID larger than 7. This means it is
		  generally not a good idea to move your SCSI host adapter's
		  target ID to something higher than 7 (or your CD-ROM will
		  stop working).</para>
	      </note>
	      
	      <para>The higher the SCSI target ID, the higher the priority the
		devices has. When it comes to arbitration between devices
		that want to use the bus at the same time, the device that has
		the highest SCSI ID will win. This also means that the SCSI
		host adapter usually uses target ID 7. Note however that the
		lower 8 IDs have higher priorities than the higher 8 IDs on a
		wide-SCSI bus. Thus, the order of target IDs is: [7 6 .. 1 0 15 14 .. 9 8] on a wide-SCSI
		system. (If you you are wondering why the lower 8 have higher
		priority, read the previous paragraph for a hint.)</para>
	      
	      <para>For a further subdivision, the standard allows for Logical
		Units or LUNs for short. A single target ID may have multiple
		LUNs. For example, a tape device including a tape changer may
		have LUN 0 for the tape device itself, and LUN 1 for the tape
		changer. In this way, the host system can address each of the
		functional units of the tape changer as desired.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Bus layout</title>
	      
	      <para>SCSI buses are linear. So, not shaped like Y-junctions,
		star topologies, rings, cobwebs or whatever else people might
		want to invent. One of the most common mistakes is for people
		with wide-SCSI host adapters to connect devices on all three
		connecters (external connector, internal wide connector,
		internal narrow connector). Don't do that. It may appear to
		work if you are really lucky, but I can almost guarantee that
		your system will stop functioning at the most unfortunate
		moment (this is also known as <quote>Murphy's law</quote>).</para>
	      
	      <para>You might notice that the terminator issue discussed
		earlier becomes rather hairy if your bus is not linear. Also,
		if you have more connectors than devices on your internal SCSI
		cable, make sure you attach devices on connectors on both ends
		instead of using the connectors in the middle and let one or
		both ends dangle. This will screw up the termination of the
		bus.</para>
	      
	      <para>The electrical characteristics, its noise margins and
		ultimately the reliability of it all are tightly related to
		linear bus rule.</para>
	      
	      <para><emphasis>Stick to the linear bus
		  rule!</emphasis></para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Using SCSI with FreeBSD</title>
	    
	    
	    <sect4>
	      <title>About translations, BIOSes and magic...</title>
	      
	      <para>As stated before, you should first make sure that you have
		a electrically sound bus.</para>
	      
	      <para>When you want to use a SCSI disk on your PC as boot disk,
		you must aware of some quirks related to PC BIOSes. The PC
		BIOS in its first incarnation used a low level physical
		interface to the hard disk. So, you had to tell the BIOS
		(using a setup tool or a BIOS built-in setup) how your disk
		physically looked like. This involved stating number of heads,
		number of cylinders, number of sectors per track, obscure
		things like precompensation and reduced write current cylinder
		etc.</para>
	      
	      <para>One might be inclined to think that since SCSI disks are
		smart you can forget about this. Alas, the arcane setup issue
		is still present today. The system BIOS needs to know how to
		access your SCSI disk with the head/cyl/sector method in order
		to load the FreeBSD kernel during boot.</para>
	      
	      <para>The SCSI host adapter or SCSI controller you have put in
		your AT/EISA/PCI/whatever bus to connect your disk therefore
		has its own on-board BIOS. During system startup, the SCSI
		BIOS takes over the hard disk interface routines from the
		system BIOS. To fool the system BIOS, the system setup is
		normally set to No hard disk present. Obvious, isn't
		it?</para>
	      
	      <para>The SCSI BIOS itself presents to the system a so called
		<emphasis>translated</emphasis> drive. This means
		that a fake drive table is constructed that allows the PC to
		boot the drive. This translation is often (but not always)
		done using a pseudo drive with 64 heads and 32 sectors per
		track. By varying the number of cylinders, the SCSI BIOS
		adapts to the actual drive size. It is useful to note that 32
		* 64 / 2 = the size of your drive in megabytes. The division
		by 2 is to get from disk blocks that are normally 512 bytes in
		size to Kbytes.</para>
	      
	      <para>Right. All is well now?! No, it is not. The system BIOS
		has another quirk you might run into. The number of cylinders
		of a bootable hard disk cannot be greater than 1024. Using the
		translation above, this is a show-stopper for disks greater
		than 1 GB. With disk capacities going up all the time this is
		causing problems.</para>
	      
	      <para>Fortunately, the solution is simple: just use another
		translation, e.g. with 128 heads instead of 32. In most cases
		new SCSI BIOS versions are available to upgrade older SCSI
		host adapters. Some newer adapters have an option, in the form
		of a jumper or software setup selection, to switch the
		translation the SCSI BIOS uses.</para>
	      
	      <para>It is very important that <emphasis>all</emphasis> operating systems on the disk use
		the <emphasis>same translation</emphasis> to get the
		right idea about where to find the relevant partitions. So,
		when installing FreeBSD you must answer any questions about
		heads/cylinders etc using the translated values your host
		adapter uses.</para>
	      
	      <para>Failing to observe the translation issue might lead to
		un-bootable systems or operating systems overwriting each
		others partitions. Using fdisk you should be able to see all
		partitions.</para>
	      
	      <para>You might have heard some talk of <quote>lying</quote> devices? Older
		FreeBSD kernels used to report the geometry of SCSI disks when
		booting. An example from one of my systems:</para>
	      
	      <informalexample>
		<screen>aha0 targ 0 lun 0: &lt;MICROP 1588-15MB1057404HSP4&gt;
sd0: 636MB (1303250 total sec), 1632 cyl, 15 head, 53 sec, bytes/sec 512</screen>
	      </informalexample>
	      
	      <para>Newer kernels usually do not report this information. e.g.</para>

		<informalexample>
		  <screen>(bt0:0:0): "SEAGATE ST41651 7574" type 0 fixed SCSI 2
sd0(bt0:0:0): Direct-Access 1350MB (2766300 512 byte sectors)</screen>
		</informalexample>
	      
	      <para>Why has this changed?</para>
	      
	      <para>This info is retrieved from the SCSI disk itself. Newer
		disks often use a technique called zone bit recording. The
		idea is that on the outer cylinders of the drive there is more
		space so more sectors per track can be put on them. This
		results in disks that have more tracks on outer cylinders than
		on the inner cylinders and, last but not least, have more
		capacity. You can imagine that the value reported by the drive
		when inquiring about the geometry now becomes suspect at best,
		and nearly always misleading. When asked for a geometry , it
		is nearly always better to supply the geometry used by the
		BIOS, or <emphasis>if the BIOS is never going to know about
		  this disk</emphasis>, (e.g. it is not a booting disk) to
		supply a fictitious geometry that is convenient.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>SCSI subsystem design</title>
	      
	      <para>FreeBSD uses a layered SCSI subsystem. For each different
		controller card a device driver is written. This driver knows
		all the intimate details about the hardware it controls. The
		driver has a interface to the upper layers of the SCSI
		subsystem through which it receives its commands and reports
		back any status.</para>
	      
	      <para>On top of the card drivers there are a number of more
		generic drivers for a class of devices. More specific: a
		driver for tape devices (abbreviation: st), magnetic disks
		(sd), CD-ROMs (cd) etc. In case you are wondering where you
		can find this stuff, it all lives in
		<filename>/sys/scsi</filename>. See the man pages in section 4
		for more details.</para>
	      
	      <para>The multi level design allows a decoupling of low-level
		bit banging and more high level stuff. Adding support for
		another piece of hardware is a much more manageable
		problem.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Kernel configuration</title>
	      
	      <para>Dependent on your hardware, the kernel configuration file
		must contain one or more lines describing your host
		adapter(s). This includes I/O addresses, interrupts etc.
		Consult the man page for your adapter driver to get more info.
		Apart from that, check out
		<filename>/sys/i386/conf/LINT</filename> for an overview of a
		kernel config file. <filename>LINT</filename> contains every
		possible option you can dream of. It does
		<emphasis>not</emphasis> imply <filename>LINT</filename> will
		actually get you to a working kernel at all.</para>
	      
	      <para>Although it is probably stating the obvious: the kernel
		config file should reflect your actual hardware setup. So,
		interrupts, I/O addresses etc must match the kernel config
		file. During system boot messages will be displayed to
		indicate whether the configured hardware was actually
		found.</para>

	      <note>
		<para>Note that most of the EISA/PCI drivers (namely
		  <devicename>ahb</devicename>, <devicename>ahc</devicename>,
		  <devicename>ncr</devicename> and
		  <devicename>amd</devicename> will automatically obtain the
		  correct parameters from the host adapters themselves at boot
		  time; thus, you just need to write, for instance,
		  <literal>controller ahc0</literal>.</para>
	      </note>
	      
	      <para>An example loosely based on the FreeBSD 2.2.5-Release
		kernel config  file <filename>LINT</filename> with some added comments (between
		[]):</para>
	      
	      <programlisting>
# SCSI host adapters: `aha', `ahb', `aic', `bt', `nca'
#
# aha: Adaptec 154x
# ahb: Adaptec 174x
# ahc: Adaptec 274x/284x/294x
# aic: Adaptec 152x and sound cards using the Adaptec AIC-6360 (slow!)
# amd: AMD 53c974 based SCSI cards (e.g., Tekram DC-390 and 390T)
# bt: Most Buslogic controllers
# nca: ProAudioSpectrum cards using the NCR 5380 or Trantor T130
# ncr: NCR/Symbios 53c810/815/825/875 etc based SCSI cards
# uha: UltraStore 14F and 34F
# sea: Seagate ST01/02 8 bit controller (slow!)
# wds: Western Digital WD7000 controller (no scatter/gather!).
#

[For an Adaptec AHA274x/284x/294x/394x etc controller]
controller	ahc0

[For an NCR/Symbios 53c875 based controller]
controller	ncr0

[For an Ultrastor adapter]
controller	uha0	at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr

# Map SCSI buses to specific SCSI adapters
controller	scbus0	at ahc0
controller	scbus2 at ncr0
controller	scbus1  at uha0

# The actual SCSI devices
disk sd0 at scbus0 target 0 unit 0	[SCSI disk 0 is at scbus 0, LUN 0]
disk sd1 at scbus0 target 1             [implicit LUN 0 if omitted]
disk sd2 at scbus1 target 3             [SCSI disk on the uha0]
disk sd3 at scbus2 target 4             [SCSI disk on the ncr0]
tape st1 at scbus0 target 6             [SCSI tape at target 6]
device cd0 at scbus?                    [the first ever CD-ROM found, no wiring]
	      </programlisting>
	      
	      <para>The example above tells the kernel to look for a ahc
		(Adaptec 274x) controller, then for an NCR/Symbios board, and
		so on. The lines following the controller specifications  tell
		the kernel to configure specific devices but
		<emphasis>only</emphasis> attach them when they match the
		target ID and LUN specified on the corresponding bus.</para>
	      
	      <para>Wired down devices get <quote>first shot</quote> at the unit numbers so
		the first non <quote>wired down</quote> device, is allocated the unit
		number  one greater than the highest <quote>wired down</quote> unit number
		for that kind of device. So, if you had a SCSI tape at target
		ID 2 it would be configured as st2, as the tape at target ID 6
		is wired down to unit number 1.</para>

	      <note>
		<para>Wired down devices need not be found to get their unit
		  number. The unit number for a wired down device is reserved
		  for that device, even if it is turned off at boot time. This
		  allows the device to be turned on and brought on-line at a
		  later time, without rebooting. Notice that a device's unit
		  number has <emphasis>no</emphasis> relationship with its
		  target ID on  the SCSI bus.</para>
	      </note>
	      
	      <para>Below is another example of a kernel config file as used
		by FreeBSD version &lt; 2.0.5. The difference with the first
		example is that devices are not <quote>wired down</quote>. <quote>Wired down</quote>
		means that you specify which SCSI target belongs to which
		device.</para>
	      
	      <para>A kernel built to the config file below will attach  the
		first SCSI disk it finds to sd0, the second disk to sd1 etc.
		If you ever removed or added a disk, all other devices of the
		same type (disk in this case) would 'move around'. This
		implies you have to change <filename>/etc/fstab</filename>
		each time.</para>
	      
	      <para>Although the old style still works, you  are
		<emphasis>strongly</emphasis> recommended to use this new
		feature. It will save you a lot of grief whenever you shift
		your hardware around on the SCSI buses. So, when you re-use
		your old trusty config file after upgrading from a
		pre-FreeBSD2.0.5.R system check this out.</para>
	      
	      <programlisting>
[driver for Adaptec 174x]
controller      ahb0 at isa? bio irq 11 vector ahbintr

[for Adaptec 154x]
controller      aha0    at isa? port "IO_AHA0" bio irq 11 drq 5 vector ahaintr

[for Seagate ST01/02]
controller      sea0    at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr

controller      scbus0

device          sd0     [support for 4 SCSI harddisks, sd0 up sd3]
device          st0	[support for 2 SCSI tapes]

[for the CD-ROM]
device          cd0     #Only need one of these, the code dynamically grows
	      </programlisting>
	      
	      <para>Both examples support SCSI disks. If during boot more
		devices of a specific type (e.g. sd disks) are found than are
		configured in the booting kernel, the system will simply
		allocate more devices, incrementing the unit number starting
		at the last number <quote>wired down</quote>. If there are no <quote>wired down</quote>
		devices then counting starts at unit 0.</para>
	      
	      <para>Use <command>man 4 scsi</command> to check for
		the latest info on the SCSI subsystem. For more detailed info
		on host adapter drivers use eg <command>man 4
		  ahc</command> for info on the Adaptec 294x driver.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Tuning your SCSI kernel setup</title>
	      
	      <para>Experience has shown that some devices are slow to respond
		to INQUIRY  commands after a SCSI bus reset (which happens at
		boot time). An INQUIRY command is sent by the kernel on boot
		to see what kind of device (disk, tape, CD-ROM etc) is
		connected to a specific target ID. This process is called
		device probing by the way.</para>
	      
	      <para>To work around the 'slow response' problem, FreeBSD allows
		a  tunable delay time before the SCSI devices are probed
		following a SCSI bus reset. You can set this delay time in
		your kernel configuration file using a line like:</para>
	      
	      <programlisting>
options         SCSI_DELAY=15         #Be pessimistic about Joe SCSI device
	      </programlisting>

	      <para>This line sets the delay time to 15 seconds. On my own
		system I had to use 3 seconds minimum to get my trusty old
		CD-ROM drive to be recognized. Start with a high value (say 30
		seconds or so) when you have problems  with device
		recognition. If this helps, tune it back until it just stays
		working.</para>
	      
	    </sect4>
	    
	    <sect4 id="scsi-rogue-devices">
	      <title>Rogue SCSI devices</title>
	      
	      <para>Although the SCSI standard tries to be complete and
		concise, it is a complex standard and implementing things
		correctly is no easy task. Some vendors do a better job then
		others.</para>
	      
	      <para>This is exactly where the <quote>rogue</quote> devices come into view.
		Rogues are devices that are recognized by the FreeBSD kernel
		as behaving slightly (...) non-standard. Rogue devices are
		reported by the kernel when booting. An example for two of my
		cartridge tape units:</para>
	      
	      <informalexample>
		<screen>Feb 25 21:03:34 yedi /kernel: ahb0 targ 5 lun 0: &lt;TANDBERG TDC 3600       -06:&gt;
Feb 25 21:03:34 yedi /kernel: st0: Tandberg tdc3600 is a known rogue

Mar 29 21:16:37 yedi /kernel: aha0 targ 5 lun 0: &lt;ARCHIVE VIPER 150  21247-005&gt;
Mar 29 21:16:37 yedi /kernel: st1: Archive  Viper 150 is a known rogue </screen>
	      </informalexample>
	      
	      <para>For instance, there are devices that respond to  all LUNs
		on a certain target ID, even if they are actually only one
		device. It is easy to see that the kernel might be fooled into
		believing that there are 8 LUNs at that particular target ID.
		The confusion this causes is left as an exercise to the
		reader.</para>
	      
	      <para>The SCSI subsystem of FreeBSD recognizes devices with bad
		habits by looking at the INQUIRY response they send when
		probed. Because the INQUIRY response also includes the version
		number of the device  firmware, it is even possible that for
		different firmware versions different workarounds are used.
		See e.g. <filename>/sys/scsi/st.c</filename> and
		<filename>/sys/scsi/scsiconf.c</filename> for more info on how
		this is done.</para>
	      
	      <para>This scheme works fine, but keep in mind that it of course
		only works for devices that are known to be weird. If you are
		the first to connect your bogus Mumbletech SCSI CD-ROM you
		might be the one that has to define which workaround is
		needed.</para>
	      
	      <para>After you got your Mumbletech working, please send the
		required workaround to the FreeBSD development team for
		inclusion in the next release of FreeBSD. Other Mumbletech
		owners will be grateful  to you.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Multiple LUN devices</title>
	      
	      <para>In some cases you come across devices that use multiple
		logical units (LUNs) on a single SCSI ID. In most cases
		FreeBSD only probes devices for LUN 0. An example are so
		called bridge boards that connect 2 non-SCSI harddisks to a
		SCSI bus (e.g. an Emulex MD21 found in old Sun
		systems).</para>
	      
	      <para>This means that any devices with LUNs != 0 are not
		normally found during device probe on system boot. To work
		around this problem you must add an appropriate entry in
		/sys/scsi/scsiconf.c and rebuild your kernel.</para>
	      
	      <para>Look for a struct that is initialized like below:</para>

		<programlisting>
{
        T_DIRECT, T_FIXED, "MAXTOR", "XT-4170S", "B5A",
        "mx1", SC_ONE_LU
}
		</programlisting>
	      
	      <para>For you Mumbletech BRIDGE2000 that has more than one LUN,
		acts as a SCSI disk and has firmware revision 123 you would
		add something like:</para>
	      
	      <programlisting>
{
        T_DIRECT, T_FIXED, "MUMBLETECH", "BRIDGE2000", "123",
        "sd", SC_MORE_LUS
}
	      </programlisting>
	      
	      <para>The kernel on boot scans the inquiry data it receives
		against the table and acts accordingly. See the source for
		more info.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Tagged command queueing</title>
	      
	      <para>Modern SCSI devices, particularly magnetic disks,
		support what is called tagged command queuing (TCQ).</para>
	      
	      <para>In a nutshell, TCQ allows the device to have multiple I/O
		requests outstanding at the same time. Because the device is
		intelligent, it can optimise its operations (like head
		positioning) based on its own request queue. On  SCSI devices
		like RAID (Redundant Array of Independent Disks) arrays the
		TCQ function is indispensable to take advantage of the
		device's inherent parallelism.</para>
	      
	      <para>Each I/O request is uniquely identified by a <quote>tag</quote> (hence
		the name tagged command queuing) and this tag is used by
		FreeBSD to see which I/O in the device drivers queue is
		reported as complete by the device.</para>
	      
	      <para>It should be noted however that TCQ requires device driver
		support and that some devices implemented it <quote>not quite right</quote>
		in their firmware. This problem bit me once, and it leads to
		highly mysterious problems. In such cases, try to disable
		TCQ.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Busmaster host adapters</title>
	      
	      <para>Most, but not all, SCSI host adapters are bus mastering
		controllers. This means that they can do I/O on their own
		without putting load onto the host CPU for data
		movement.</para>
	      
	      <para>This is of course an advantage for a multitasking
		operating system like FreeBSD. It must be noted however that
		there might be some rough edges.</para>
	      
	      <para>For instance an Adaptec 1542 controller can be set to use
		different transfer speeds on the host bus (ISA or AT in this
		case). The controller is settable to different rates because
		not all motherboards can handle the higher speeds. Problems
		like hangups, bad data etc might be the result of using a
		higher data transfer rate then your motherboard can
		stomach.</para>
	      
	      <para>The solution is of course obvious: switch to a lower data
		transfer rate and try if that works better.</para>
	      
	      <para>In the case of a Adaptec 1542, there is an option that can
		be put into the kernel config file to allow dynamic
		determination of the right, read: fastest feasible, transfer
		rate. This option is  disabled by default:</para>
	      
	      <programlisting>
options        "TUNE_1542"             #dynamic tune of bus DMA speed
	      </programlisting>
	      
	      <para>Check the man pages for the host adapter that you use. Or
		better still, use the ultimate documentation (read: driver
		source).</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Tracking down problems</title>
	    
	    <para>The following list is an attempt to give a guideline for the
	      most common SCSI problems and their solutions. It is by no means
	      complete.</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>Check for loose connectors and cables.</para>
		</listitem>
		
		<listitem>
		  <para>Check and double check the location and number of your
		    terminators.</para>
		</listitem>
		
		<listitem>
		  <para>Check if your bus has at least one supplier of
		    terminator power (especially with external
		    terminators.</para>
		</listitem>
		
		<listitem>
		  <para>Check if no double target IDs are used.</para>
		</listitem>
		
		<listitem>
		  <para>Check if all devices to be used are powered up.</para>
		</listitem>
		
		<listitem>
		  <para>Make a minimal bus config with as little devices as
		    possible.</para>
		</listitem>
		
		<listitem>
		  <para>If possible, configure your host adapter to use slow
		    bus speeds.</para>
		</listitem>
		
		<listitem>
		  <para>Disable tagged command queuing to make things as
		    simple as possible (for a NCR hostadapter based system see
		    man ncrcontrol)</para>
		</listitem>
		
		<listitem>
		  <para>If you can compile a kernel, make one with the
		  <literal>SCSIDEBUG</literal> option, and try accessing the device with
		    debugging turned on for that device. If your device does
		    not even probe at startup, you may have to define the
		    address of the device that is failing, and the desired
		    debug level in <filename>/sys/scsi/scsidebug.h</filename>.
		    If it probes but just does not work, you can use the
		    <citerefentry><refentrytitle>scsi</refentrytitle><manvolnum>8</manvolnum></citerefentry> command to dynamically set a
		  debug level to it in a running kernel (if <literal>SCSIDEBUG</literal> is
		  defined). This will give you <emphasis>copious</emphasis> debugging output with
		    which to confuse the gurus. see <command>man 4
		      scsi</command> for more exact information. Also look at
		    <command>man 8 scsi</command>.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	  </sect3>
	  
	  <sect3 id="scsi-further-reading">
	    <title>Further reading</title>
	    
	    <para>If you intend to do some serious SCSI hacking, you might
	      want to have the official standard at hand:</para>
	    
	    <para>Approved American National Standards can be purchased from
	      ANSI at

	      <address>
		<otheraddr>13th Floor</otheraddr>
		<street>11 West 42nd Street</street>
		<city>New York</city>
		<state>NY</state> <postcode>10036</postcode>
		Sales Dept: <phone>(212) 642-4900</phone>
	      </address>
	    </para>

	    <para>You can also buy many ANSI
	      standards and most committee draft documents from Global
	      Engineering Documents,

	      <address>
		<street>15 Inverness Way East</street>
		<city>Englewood</city>
		<state>CO</state>, <postcode>80112-5704</postcode>
		Phone: <phone>(800) 854-7179</phone>
		Outside USA and Canada: <phone>(303) 792-2181</phone>
		Fax: <fax>(303) 792- 2192</fax>
	      </address>
	    </para>
	    
	    <para>Many X3T10 draft documents are available electronically on
	      the SCSI BBS (719-574-0424) and on the <hostid role="fqdn">ncrinfo.ncr.com</hostid> anonymous
	      ftp site.</para>
	    
	    <para>Latest X3T10 committee documents are:</para>
	    
	      <itemizedlist>
		
		<listitem>
		  <para>AT Attachment (ATA or IDE) [X3.221-1994]
		    (<emphasis>Approved</emphasis>)</para>
		</listitem>
		
		<listitem>
		  <para>ATA Extensions (ATA-2) [X3T10/948D Rev 2i]</para>
		</listitem>
		
		<listitem>
		  <para>Enhanced Small Device Interface (ESDI)
		    [X3.170-1990/X3.170a-1991]
		    (<emphasis>Approved</emphasis>)</para>
		</listitem>
		
		<listitem>
		  <para>Small Computer System Interface &mdash; 2 (SCSI-2)
		    [X3.131-1994] (<emphasis>Approved</emphasis>)</para>
		</listitem>
		
		<listitem>
		  <para>SCSI-2 Common Access Method Transport and SCSI
		    Interface Module (CAM)  [X3T10/792D Rev 11]</para>
		</listitem>
		
	      </itemizedlist>

	    <para>Other publications that might provide you with
	      additional information are:</para>
	  
	      <itemizedlist>
		
		<listitem>
		  <para><quote>SCSI: Understanding the Small Computer System
		    Interface</quote>, written by NCR  Corporation. Available from:
		    Prentice Hall, Englewood Cliffs, NJ, 07632 Phone: (201)
		    767-5937 ISBN 0-13-796855-8</para>
		</listitem>
		
		<listitem>
		  <para><quote>Basics of SCSI</quote>, a SCSI tutorial written by Ancot
		    Corporation Contact Ancot for availability information at:
		    Phone: (415) 322-5322  Fax: (415) 322-0455</para>
		</listitem>
		
		<listitem>
		  <para><quote>SCSI Interconnection Guide Book</quote>, an AMP publication
		    (dated 4/93, Catalog  65237) that lists the various SCSI
		    connectors and suggests cabling schemes. Available from
		    AMP at (800) 522-6752 or (717) 564-0100</para>
		</listitem>
		
		<listitem>
		  <para><quote>Fast Track to SCSI</quote>, A Product Guide written by
		    Fujitsu. Available from: Prentice Hall, Englewood Cliffs,
		    NJ, 07632 Phone: (201) 767-5937 ISBN 0-13-307000-X</para>
		</listitem>
		
		<listitem>
		  <para><quote>The SCSI Bench Reference</quote>, <quote>The SCSI Encyclopedia</quote>,
		    and the <quote>SCSI Tutor</quote>, ENDL Publications, 14426 Black
		    Walnut Court, Saratoga CA, 95070 Phone: (408) 867-6642</para>
		</listitem>
		
		<listitem>
		  <para><quote>Zadian SCSI Navigator</quote> (quick ref. book) and
		    <quote>Discover the Power of SCSI</quote>  (First book along with a
		    one-hour video and tutorial book), Zadian Software, Suite
		    214, 1210 S. Bascom Ave., San Jose, CA 92128, (408)
		    293-0800</para>
		</listitem>
		
	      </itemizedlist>
	    
	    <para>On Usenet the newsgroups <ulink
		URL="news:comp.periphs.scsi">comp.periphs.scsi</ulink> and
	      <ulink URL="news:comp.periphs">comp.periphs</ulink> are
	      noteworthy places to look for more info. You can also find the
	      SCSI-Faq there, which is posted periodically.</para>
	    
	    <para>Most major SCSI device and host adapter suppliers operate
	      ftp sites and/or BBS systems. They may be valuable sources of
	      information about the devices you own.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="hw-storage-controllers">
	  <title>* Disk/tape controllers</title>
	  
	  
	  <sect3>
	    <title>* SCSI</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>* IDE</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>* Floppy</title>

	    <para></para>
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Hard drives</title>
	  
	  
	  <sect3>
	    <title>SCSI hard drives</title>
	    
	    <para><emphasis>Contributed by &a.asami;.<!-- <br> -->17 February
		1998.</emphasis></para>
	    
	    <para>As mentioned in the <xref linkend="scsi" remap="SCSI">
	      section, virtually all SCSI hard drives sold today are SCSI-2
	      compliant and thus will work fine as long as you connect them to
	      a supported SCSI host adapter. Most problems people encounter
	      are either due to badly designed cabling (cable too long, star
	      topology, etc.), insufficient termination, or defective parts.
	      Please refer to the <xref linkend="scsi" remap="SCSI">
	      section first if your SCSI hard drive is not working. However,
	      there are a couple of things you may want to take into account
	      before you purchase SCSI hard drives for your system.</para>
	    
	    
	    <sect4>
	      <title>Rotational speed</title>
	      
	      <para>Rotational speeds of SCSI drives sold today range from
		around 4,500RPM to 10,000RPM. Most of them are either 5,400RPM
		or 7,200RPM. Even though the 7,200RPM drives can generally
		transfer data faster, they run considerably hotter than their
		5,400RPM counterparts. A large fraction of today's disk drive
		malfunctions are heat-related. If you do not have very good
		cooling in your PC case, you may want to stick with 5,400RPM
		or slower drives.</para>
	      
	      <para>Note that newer drives, with higher areal recording
		densities, can deliver much more bits per rotation than older
		ones. Today's top-of-line 5,400RPM drives can sustain a
		throughput comparable to 7,200RPM drives of one or two model
		generations ago. The number to find on the spec sheet for
		bandwidth is <quote>internal data (or transfer) rate</quote>. It is
		usually in megabits/sec so divide it by 8 and you'll get the
		rough approximation of how much megabytes/sec you can get out
		of the drive.</para>
	      
	      <para>(If you are a speed maniac and want a 10,000RPM drive for
		your cute little peecee, be my guest; however, those drives
		become extremely hot. Don't even think about it if you don't
		have a fan blowing air <emphasis>directly at</emphasis> the
		drive or a properly ventilated disk enclosure.)</para>
	      
	      <para>Obviously, the latest 10,000RPM drives and 7,200RPM drives
		can deliver more data than the latest 5,400RPM drives, so if
		absolute bandwidth is the necessity for your applications, you
		have little choice but to get the faster drives. Also, if you
		need low latency, faster drives are better; not only do they
		usually have lower average seek times, but also the rotational
		delay is one place where slow-spinning drives can never beat a
		faster one. (The average rotational latency is half the time
		it takes to rotate the drive once; thus, it's 3 milliseconds
		for 10,000RPM drives, 4.2ms for 7,200RPM drives and 5.6ms for
		5,400RPM drives.)  Latency is seek time plus rotational delay.
		Make sure you understand whether you need low latency or more
		accesses per second, though; in the latter case (e.g., news
		servers), it may not be optimal to purchase one big fast
		drive. You can achieve similar or even better results by
		using the ccd (concatenated disk) driver to create a striped
		disk array out of multiple slower drives for comparable
		overall cost.</para>
	      
	      <para>Make sure you have adequate air flow around the drive,
		especially if you are going to use a fast-spinning drive. You
		generally need at least 1/2" (1.25cm) of spacing above and
		below a drive. Understand how the air flows through your PC
		case. Most cases have the power supply suck the air out of
		the back. See where the air flows in, and put the drive where
		it will have the largest volume of cool air flowing around it.
		You may need to seal some unwanted holes or add a new fan for
		effective cooling.</para>
	      
	      <para>Another consideration is noise. Many 7,200 or faster
		drives generate a high-pitched whine which is quite unpleasant
		to most people. That, plus the extra fans often required for
		cooling, may make 7,200 or faster drives unsuitable for some
		office and home environments.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Form factor</title>
	      
	      <para>Most SCSI drives sold today are of 3.5" form factor. They
		come in two different heights; 1.6" (<quote>half-height</quote>) or 1"
		(<quote>low-profile</quote>). The half-height drive is the same height as a
		CD-ROM drive. However, don't forget the spacing rule
		mentioned in the previous section. If you have three standard
		3.5" drive bays, you will not be able to put three half-height
		drives in there (without frying them, that is).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Interface</title>
	      
	      <para>The majority of SCSI hard drives sold today are Ultra or
		Ultra-wide SCSI. The maximum bandwidth of Ultra SCSI is
		20MB/sec, and Ultra-wide SCSI is 40MB/sec. There is no
		difference in max cable length between Ultra and Ultra-wide;
		however, the more devices you have on the same bus, the sooner
		you will start having bus integrity problems. Unless you have
		a well-designed disk enclosure, it is not easy to make more
		than 5 or 6 Ultra SCSI drives work on a single bus.</para>
	      
	      <para>On the other hand, if you need to connect many drives,
		going for Fast-wide SCSI may not be a bad idea. That will
		have the same max bandwidth as Ultra (narrow) SCSI, while
		electronically it's much easier to get it <quote>right</quote>. My advice
		would be: if you want to connect many disks, get wide SCSI
		drives; they usually cost a little more but it may save you
		down the road. (Besides, if you can't afford the cost
		difference, you shouldn't be building a disk array.)</para>
	      
	      <para>There are two variant of wide SCSI drives; 68-pin and
		80-pin SCA (Single Connector Attach). The SCA drives don't
		have a separate 4-pin power connector, and also read the SCSI
		ID settings through the 80-pin connector. If you are really
		serious about building a large storage system, get SCA drives
		and a good SCA enclosure (dual power supply with at least one
		extra fan). They are more electronically sound than 68-pin
		counterparts because there is no <quote>stub</quote> of the SCSI bus inside
		the disk canister as in arrays built from 68-pin drives. They
		are easier to install too (you just need to screw the drive in
		the canister, instead of trying to squeeze in your fingers in
		a tight place to hook up all the little cables (like the SCSI
		ID and disk activity LED lines).</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>* IDE hard drives</title>

	    <para></para>
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Tape drives</title>
	  
	  <para><emphasis>Contributed by &a.jmb;.<!-- <br> -->2 July
	      1996.</emphasis></para>
	  
	  
	  <sect3>
	    <title>General tape access commands</title>
	    
	    <para><citerefentry><refentrytitle>mt</refentrytitle><manvolnum>1</manvolnum></citerefentry> provides generic access to the tape
	      drives. Some of the more common commands are
	      <command>rewind</command>, <command>erase</command>, and
	      <command>status</command>. See the <citerefentry><refentrytitle>mt</refentrytitle><manvolnum>1</manvolnum></citerefentry>
	      manual page for a detailed description.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Controller Interfaces</title>
	    
	    <para>There are several different interfaces that support tape
	      drives. The interfaces are SCSI, IDE, Floppy and Parallel Port.
	      A wide variety of tape drives are available for these
	      interfaces. Controllers are discussed in
	      <xref linkend="hw-storage-controllers" remap="Disk/tape
		controllers"></para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>SCSI drives</title>
	    
	    <para>The <citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry> driver provides
	      support for 8mm (Exabyte), 4mm (DAT: Digital Audio Tape), QIC
	      (Quarter-Inch Cartridge), DLT (Digital Linear Tape), QIC
	      Minicartridge and 9-track (remember the big reels that you see
	      spinning in Hollywood computer rooms) tape drives. See the
	      <citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page for a detailed
	      description.</para>
	    
	    <para>The drives listed below are currently being used by members
	      of the FreeBSD community. They are not the only drives that
	      will work with FreeBSD. They just happen to be the ones that we
	      use.</para>
	    
	    
	    <sect4>
	      <title>4mm (DAT: Digital Audio Tape)</title>
	      
	      <para><xref linkend="hw-storage-python" remap="Archive
		  Python"></para>
	      
	      <para><xref linkend="hw-storage-hp1533a" remap="HP
		  C1533A"></para>
	      
	      <para><xref linkend="hw-storage-hp1534a" remap="HP
		  C1534A"></para>
	      
	      <para><xref linkend="hw-storage-hp35450a" remap="HP
		  35450A"></para>
	      
	      <para><xref linkend="hw-storage-hp35470a" remap="HP
		  35470A"></para>
	      
	      <para><xref linkend="hw-storage-hp35480a" remap="HP
		  35480A"></para>
	      
	      <para><xref linkend="hw-storage-sdt5000"
		  remap="SDT-5000"></para>
	      
	      <para><xref linkend="hw-storage-wangtek6200" remap="Wangtek
		  6200"></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>8mm (Exabyte)</title>
	      
	      <para><xref linkend="hw-storage-exb8200"
		  remap="EXB-8200"></para>
	      
	      <para><xref linkend="hw-storage-exb8500"
		  remap="EXB-8500"></para>
	      
	      <para><xref linkend="hw-storage-exb8505"
		  remap="EXB-8505"></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>QIC (Quarter-Inch Cartridge)</title>
	      
	      <para><xref linkend="hw-storage-anaconda" remap="Archive
		  Ananconda 2750"></para>
	      
	      <para><xref linkend="hw-storage-viper60" remap="Archive Viper
		  60"></para>
	      
	      <para><xref linkend="hw-storage-viper150" remap="Archive Viper
		  150"></para>
	      
	      <para><xref linkend="hw-storage-viper2525" remap="Archive Viper
		  2525"></para>
	      
	      <para><xref linkend="hw-storage-tandberg3600" remap="Tandberg
		  TDC 3600"></para>
	      
	      <para><xref linkend="hw-storage-tandberg3620" remap="Tandberg
		  TDC 3620"></para>
	      
	      <para><xref linkend="hw-storage-tandberg4222" remap="Tandberg
		  TDC 4222"></para>
	      
	      <para><xref linkend="hw-storage-wangtek5525es" remap="Wangtek
		  5525ES"></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>DLT (Digital Linear Tape)</title>
	      
	      <para><xref linkend="hw-storage-dectz87" remap="Digital
		  TZ87"></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Mini-Cartridge</title>
	      
	      <para><xref linkend="hw-storage-ctms3200" remap="Conner CTMS
		  3200"></para>
	      
	      <para><xref linkend="hw-storage-exb2501" remap="Exabyte
		  2501"></para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Autoloaders/Changers</title>
	      
	      <para><xref linkend="hw-storage-hp1553a" remap="Hewlett-Packard
		  HP C1553A Autoloading DDS2"></para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>* IDE drives</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>Floppy drives</title>
	    
	    <para><xref linkend="hw-storage-conner420r" remap="Conner
		420R"></para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>* Parallel port drives</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>Detailed Information</title>
	    
	    
	    <sect4 id="hw-storage-anaconda">
	      <title>Archive Anaconda 2750</title>
	      
	      <para>The boot message identifier for this drive is
		<literal>ARCHIVE ANCDA 2750 28077 -003 type 1 removable SCSI
		  2</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 1.35GB when using QIC-1350 tapes. This
		drive will read and write QIC-150 (DC6150), QIC-250 (DC6250),
		and QIC-525 (DC6525) tapes as well.</para>
	      
	      <para>Data transfer rate is 350kB/s using
		<citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Rates of 530kB/s have been
		reported when using <xref
		  linkend="hw-storage-amanda" remap="Amanda"></para>
	      
	      <para>Production of this drive has been discontinued.</para>
	      
	      <para>The SCSI bus connector on this tape drive is reversed from
		that on most other SCSI devices. Make sure that you have
		enough SCSI cable to twist the cable one-half turn before and
		after the Archive Anaconda tape drive, or turn your other SCSI
		devices upside-down.</para>
	      
	      <para>Two kernel code changes are required to use this drive.
		This drive will not work as delivered.</para>
	      
	      <para>If you have a SCSI-2 controller, short jumper 6.
		Otherwise, the drive behaves are a SCSI-1 device. When
		operating as a SCSI-1 device, this drive, <quote>locks</quote> the SCSI bus
		during some tape operations, including: fsf, rewind, and
		rewoffl.</para>
	      
	      <para>If you are using the NCR SCSI controllers, patch the file
		<filename>/usr/src/sys/pci/ncr.c</filename> (as shown below).
		Build and install a new kernel.</para>
	      
	      <programlisting>
*** 4831,4835 ****
                };
        
!               if (np-&gt;latetime&gt;4) {
                        /*
                        **      Although we tried to wake it up,
--- 4831,4836 ----
                };
 
!               if (np-&gt;latetime&gt;1200) {
                        /*
                        **      Although we tried to wake it up,
	      </programlisting>
	      
	      <para>Reported by: &a.jmb;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-python">
	      <title>Archive Python</title>
	      
	      <para>The boot message identifier for this drive is
		<literal>ARCHIVE Python 28454-XXX4ASB</literal> <literal>type
		  1 removable SCSI 2</literal> <literal>density code 0x8c,
		  512-byte blocks</literal></para>
	      
	      <para>This is a DDS-1 tape drive.</para>
	      
	      <para>Native capacity is 2.5GB on 90m tapes.</para>
	      
	      <para>Data transfer rate is XXX.</para>
	      
	      <para>This drive was repackaged by Sun Microsystems as model
		411.</para>
	      
	      <para>Reported by: Bob Bishop <email>rb@gid.co.uk</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-viper60">
	      <title>Archive Viper 60</title>
	      
	      <para>The boot message identifier for this drive is
		<literal>ARCHIVE VIPER 60 21116 -007</literal> <literal>type 1
		  removable SCSI 1</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 60MB.</para>
	      
	      <para>Data transfer rate is XXX.</para>
	      
	      <para>Production of this drive has been discontinued.</para>
	      
	      <para>Reported by: Philippe Regnauld <email>regnauld@hsc.fr</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-viper150">
	      <title>Archive Viper 150</title>
	      
	      <para>The boot message identifier for this drive is <literal>ARCHIVE
		VIPER 150 21531 -004</literal> <literal>Archive Viper 150 is a known rogue</literal>
		<literal>type 1 removable SCSI 1</literal>. A multitude of firmware revisions
		exist for this drive. Your drive may report different numbers
		(e.g <literal>21247 -005</literal>.</para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 150/250MB. Both 150MB (DC6150) and
		250MB (DC6250) tapes have the recording format. The 250MB
		tapes are approximately 67% longer than the 150MB tapes. This
		drive can read 120MB tapes as well. It can not write 120MB
		tapes.</para>
	      
	      <para>Data transfer rate is 100kB/s</para>
	      
	      <para>This drive reads and writes DC6150 (150MB) and DC6250
		(250MB) tapes.</para>
	      
	      <para>This drives quirks are known and pre-compiled into the
		scsi tape device driver (<citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry>).</para>
	      
	      <para>Under FreeBSD 2.2-current, use <command>mt
		  blocksize 512</command> to set the blocksize. (The
		particular drive had firmware revision 21247 -005. Other
		firmware revisions may behave differently) Previous versions
		of FreeBSD did not have this problem.</para>
	      
	      <para>Production of this drive has been discontinued.</para>
	      
	      <para>Reported by: Pedro A M Vazquez
		<email>vazquez@IQM.Unicamp.BR</email></para>
	      
	      <para>Mike Smith
		<email>msmith@atrad.adelaide.edu.au</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-viper2525">
	      <title>Archive Viper 2525</title>
	      
	      <para>The boot message identifier for this drive is <literal>ARCHIVE
		VIPER 2525 25462 -011</literal> <literal>type 1 removable SCSI 1</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 525MB.</para>
	      
	      <para>Data transfer rate is 180kB/s at 90 inches/sec.</para>
	      
	      <para>The drive reads QIC-525, QIC-150, QIC-120 and QIC-24
		tapes. Writes QIC-525, QIC-150, and QIC-120.</para>
	      
	      <para>Firmware revisions prior to <literal>25462 -011</literal> are bug ridden
		and will not function properly.</para>
	      
	      <para>Production of this drive has been discontinued.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-conner420r">
	      <title>Conner 420R</title>
	      
	      <para>The boot message identifier for this drive is <literal>Conner
		tape</literal>.</para>
	      
	      <para>This is a floppy controller, minicartridge tape
		drive.</para>
	      
	      <para>Native capacity is XXXX</para>
	      
	      <para>Data transfer rate is XXX</para>
	      
	      <para>The drive uses QIC-80 tape cartridges.</para>
	      
	      <para>Reported by: Mark Hannon <email>mark@seeware.DIALix.oz.au</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-ctms3200">
	      <title>Conner CTMS 3200</title>
	      
	      <para>The boot message identifier for this drive is <literal>CONNER CTMS
		3200 7.00</literal> <literal>type 1 removable SCSI 2</literal>.</para>
	      
	      <para>This is a minicartridge tape drive.</para>
	      
	      <para>Native capacity is XXXX</para>
	      
	      <para>Data transfer rate is XXX</para>
	      
	      <para>The drive uses QIC-3080 tape cartridges.</para>
	      
	      <para>Reported by: Thomas S. Traylor <email>tst@titan.cs.mci.com</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-dectz87">
	      <title><ulink
		  URL="http://www.digital.com/info/Customer-Update/931206004.txt.html">DEC TZ87</ulink></title>
	      
	      <para>The boot message identifier for this drive is <literal>DEC TZ87
		(C) DEC 9206</literal> <literal>type 1 removable SCSI 2</literal> <literal>density code
		0x19</literal></para>
	      
	      <para>This is a DLT tape drive.</para>
	      
	      <para>Native capacity is 10GB.</para>
	      
	      <para>This drive supports hardware data compression.</para>
	      
	      <para>Data transfer rate is 1.2MB/s.</para>
	      
	      <para>This drive is identical to the Quantum DLT2000. The drive
		firmware can be set to emulate several well-known drives,
		including an Exabyte 8mm drive.</para>
	      
	      <para>Reported by: &a.wilko;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-exb2501">
	      <title><ulink
		  URL="http://www.Exabyte.COM:80/Products/Minicartridge/2501/Rfeatures.html">Exabyte EXB-2501</ulink></title>
	      
	      <para>The boot message identifier for this drive is <literal>EXABYTE
		EXB-2501</literal></para>
	      
	      <para>This is a mini-cartridge tape drive.</para>
	      
	      <para>Native capacity is 1GB when using MC3000XL
		minicartridges.</para>
	      
	      <para>Data transfer rate is XXX</para>
	      
	      <para>This drive can read and write DC2300 (550MB), DC2750
		(750MB), MC3000 (750MB), and MC3000XL (1GB)
		minicartridges.</para>
	      
	      <para>WARNING: This drive does not meet the SCSI-2
		specifications. The drive locks up completely in response to
		a SCSI MODE_SELECT command unless there is a formatted tape in
		the drive. Before using this drive, set the tape blocksize
		with</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>mt -f /dev/st0ctl.0 blocksize 1024</userinput></screen>
	      </informalexample>
	      
	      <para>Before using a minicartridge for the first time, the
		minicartridge must be formated. FreeBSD 2.1.0-RELEASE and
		earlier:</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>/sbin/scsi -f /dev/rst0.ctl -s 600 -c "4 0 0 0 0 0"</userinput></screen>
	      </informalexample>
	      
	      <para>(Alternatively, fetch a copy of the <command>scsiformat</command> shell script from FreeBSD
		2.1.5/2.2.) FreeBSD 2.1.5 and later:</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>/sbin/scsiformat -q -w /dev/rst0.ctl</userinput></screen>
	      </informalexample>
	      
	      <para>Right now, this drive cannot really be recommended for
		FreeBSD.</para>
	      
	      <para>Reported by: Bob Beaulieu <email>ez@eztravel.com</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-exb8200">
	      <title>Exabyte EXB-8200</title>
	      
	      <para>The boot message identifier for this drive is <literal>EXABYTE
		EXB-8200 252X</literal> <literal>type 1 removable SCSI 1</literal></para>
	      
	      <para>This is an 8mm tape drive.</para>
	      
	      <para>Native capacity is 2.3GB.</para>
	      
	      <para>Data transfer rate is 270kB/s.</para>
	      
	      <para>This drive is fairly slow in responding to the SCSI bus
		during boot. A custom kernel may be required (set SCSI_DELAY
		to 10 seconds).</para>
	      
	      <para>There are a large number of firmware configurations for
		this drive, some have been customized to a particular vendor's
		hardware. The firmware can be changed via EPROM
		replacement.</para>
	      
	      <para>Production of this drive has been discontinued.</para>
	      
	      <para>Reported by: Mike Smith
		<email>msmith@atrad.adelaide.edu.au</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-exb8500">
	      <title>Exabyte EXB-8500</title>
	      
	      <para>The boot message identifier for this drive is <literal>EXABYTE
		EXB-8500-85Qanx0 0415</literal> <literal>type 1 removable SCSI 2</literal></para>
	      
	      <para>This is an 8mm tape drive.</para>
	      
	      <para>Native capacity is 5GB.</para>
	      
	      <para>Data transfer rate is 300kB/s.</para>
	      
	      <para>Reported by: Greg Lehey <email>grog@lemis.de</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-exb8505">
	      <title><ulink
		  URL="http://www.Exabyte.COM:80/Products/8mm/8505XL/Rfeatures.html">Exabyte EXB-8505</ulink></title>
	      
	      <para>The boot message identifier for this drive is <literal>EXABYTE
		EXB-85058SQANXR1 05B0</literal> <literal>type 1 removable SCSI 2</literal></para>
	      
	      <para>This is an 8mm tape drive which supports compression, and
		is upward compatible with the EXB-5200 and EXB-8500.</para>
	      
	      <para>Native capacity is 5GB.</para>
	      
	      <para>The drive supports hardware data compression.</para>
	      
	      <para>Data transfer rate is 300kB/s.</para>
	      
	      <para>Reported by: Glen Foster <email>gfoster@gfoster.com</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp1533a">
	      <title>Hewlett-Packard HP C1533A</title>
	      
	      <para>The boot message identifier for this drive is <literal>HP C1533A
		9503</literal> <literal>type 1 removable SCSI 2</literal>.</para>
	      
	      <para>This is a DDS-2 tape drive. DDS-2 means hardware data
		compression and narrower tracks for increased data
		capacity.</para>
	      
	      <para>Native capacity is 4GB when using 120m tapes. This drive
		supports hardware data compression.</para>
	      
	      <para>Data transfer rate is 510kB/s.</para>
	      
	      <para>This drive is used in Hewlett-Packard's SureStore 6000eU
		and 6000i tape drives and C1533A DDS-2 DAT drive.</para>
	      
	      <para>The drive has a block of 8 dip switches. The proper
		settings for FreeBSD are: 1 ON; 2 ON; 3 OFF; 4 ON; 5 ON; 6 ON;
		7 ON; 8 ON.</para>

		<informaltable frame="none">
		  <tgroup cols="3">
		    <thead>
		      <row>
			<entry>switch 1</entry>
			<entry>switch 2</entry>
			<entry>Result</entry>
		      </row>
		    </thead>
		    
		    <tbody>
		      <row>
			<entry>On</entry>
			<entry>On</entry>
			<entry>Compression enabled at power-on, with host
			  control</entry>
		      </row>

		      <row>
			<entry>On</entry>
			<entry>Off</entry>
			<entry>Compression enabled at power-on, no host
			  control</entry>
		      </row>

		      <row>
			<entry>Off</entry>
			<entry>On</entry>
			<entry>Compression disabled at power-on, with host
			  control</entry>
		      </row>

		      <row>
			<entry>Off</entry>
			<entry>Off</entry>
			<entry>Compression disabled at power-on, no host
			  control</entry>
		      </row>
		    </tbody>
		  </tgroup>
		</informaltable>
	      
	      <para>Switch 3 controls MRS (Media Recognition System). MRS
		tapes have stripes on the transparent leader. These identify
		the tape as DDS (Digital Data Storage) grade media. Tapes
		that do not have the stripes will be treated as
		write-protected. Switch 3 OFF enables MRS. Switch 3 ON
		disables MRS.</para>
	      
	      <para>See <ulink URL="http://www.hp.com/tape/c_intro.html">HP
		  SureStore Tape Products</ulink> and <ulink
		  URL="http://www.impediment.com/hp/hp_technical.html">Hewlett-Packard Disk and Tape Technical Information</ulink> for more information on configuring this drive.</para>
	      
	      <para><emphasis>Warning:</emphasis> Quality control on these
		drives varies greatly. One FreeBSD core-team member has
		returned 2 of these drives. Neither lasted more than 5
		months.</para>
	      
	      <para>Reported by: &a.se;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp1534a">
	      <title>Hewlett-Packard HP 1534A</title>
	      
	      <para>The boot message identifier for this drive is <literal>HP HP35470A
		T503</literal> <literal>type 1 removable SCSI 2</literal> <literal>Sequential-Access density code
		0x13, variable blocks</literal>.</para>
	      
	      <para>This is a DDS-1 tape drive. DDS-1 is the original DAT
		tape format.</para>
	      
	      <para>Native capacity is 2GB when using 90m tapes.</para>
	      
	      <para>Data transfer rate is 183kB/s.</para>
	      
	      <para>The same mechanism is used in Hewlett-Packard's SureStore
		<ulink
		  URL="http://www.dmo.hp.com/tape/sst2000.htm">2000i</ulink>
		tape drive, C35470A DDS format DAT drive, C1534A DDS format
		DAT drive and HP C1536A DDS format DAT drive.</para>
	      
	      <para>The HP C1534A DDS format DAT drive has two indicator
		lights, one green and one amber. The green one indicates tape
		action: slow flash during load, steady when loaded, fast flash
		during read/write operations. The amber one indicates
		warnings: slow flash when cleaning is required or tape is
		nearing the end of its useful life, steady indicates an hard
		fault. (factory service required?)</para>
	      
	      <para>Reported by Gary Crutcher <email>gcrutchr@nightflight.com</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp1553a">
	      <title>Hewlett-Packard HP C1553A Autoloading DDS2</title>
	      
	      <para>The boot message identifier for this drive is "".</para>
	      
	      <para>This is a DDS-2 tape drive with a tape changer. DDS-2
		means hardware data compression and narrower tracks for
		increased data capacity.</para>
	      
	      <para>Native capacity is 24GB when using 120m tapes. This drive
		supports hardware data compression.</para>
	      
	      <para>Data transfer rate is 510kB/s (native).</para>
	      
	      <para>This drive is used in Hewlett-Packard's SureStore <ulink
		  URL="http://www.dmo.hp.com/tape/sst12000.htm">12000e</ulink>
		tape drive.</para>
	      
	      <para>The drive has two selectors on the rear panel. The
		selector closer to the fan is SCSI id. The other selector
		should be set to 7.</para>
	      
	      <para>There are four internal switches. These should be set: 1
		ON; 2 ON; 3 ON; 4 OFF.</para>
	      
	      <para>At present the kernel drivers do not automatically change
		tapes at the end of a volume. This shell script can be used
		to change tapes:</para>
	      
	      <programlisting>
#!/bin/sh
PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH

usage()
{
        echo "Usage: dds_changer [123456ne] raw-device-name
        echo "1..6 = Select cartridge"
        echo "next cartridge"
        echo "eject magazine"
        exit 2
}

if [ $# -ne 2 ] ; then
        usage
fi

cdb3=0
cdb4=0
cdb5=0

case $1 in
        [123456])
                cdb3=$1
                cdb4=1
                ;;
        n)
                ;;
        e)
                cdb5=0x80
                ;;
        ?)
                usage
                ;;
esac

scsi -f $2 -s 100 -c "1b 0 0 $cdb3 $cdb4 $cdb5"
	      </programlisting>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp35450a">
	      <title>Hewlett-Packard HP 35450A</title>
	      
	      <para>The boot message identifier for this drive is <literal>HP HP35450A
		-A C620</literal> <literal>type 1 removable SCSI 2</literal> <literal>Sequential-Access density
		code 0x13</literal></para>
	      
	      <para>This is a DDS-1 tape drive. DDS-1 is the original DAT
		tape format.</para>
	      
	      <para>Native capacity is 1.2GB.</para>
	      
	      <para>Data transfer rate is 160kB/s.</para>
	      
	      <para>Reported by: mark thompson
		<email>mark.a.thompson@pobox.com</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp35470a">
	      <title>Hewlett-Packard HP 35470A</title>
	      
	      <para>The boot message identifier for this drive is <literal>HP HP35470A
		9 09</literal> <literal>type 1 removable SCSI 2</literal></para>
	      
	      <para>This is a DDS-1 tape drive. DDS-1 is the original DAT
		tape format.</para>
	      
	      <para>Native capacity is 2GB when using 90m tapes.</para>
	      
	      <para>Data transfer rate is 183kB/s.</para>
	      
	      <para>The same mechanism is used in Hewlett-Packard's SureStore
		<ulink
		  URL="http://www.dmo.hp.com/tape/sst2000.htm">2000i</ulink>
		tape drive, C35470A DDS format DAT drive, C1534A DDS format
		DAT drive, and HP C1536A DDS format DAT drive.</para>
	      
	      <para><emphasis>Warning:</emphasis> Quality control on these
		drives varies greatly. One FreeBSD core-team member has
		returned 5 of these drives. None lasted more than 9
		months.</para>
	      
	      <para>Reported by: David Dawes <email>dawes@rf900.physics.usyd.edu.au</email>
		(9 09)</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-hp35480a">
	      <title>Hewlett-Packard HP 35480A</title>
	      
	      <para>The boot message identifier for this drive is <literal>HP HP35480A
		1009</literal> <literal>type 1 removable SCSI 2</literal> <literal>Sequential-Access density
		code 0x13</literal>.</para>
	      
	      <para>This is a DDS-DC tape drive. DDS-DC is DDS-1 with
		hardware data compression. DDS-1 is the original DAT tape
		format.</para>
	      
	      <para>Native capacity is 2GB when using 90m tapes. It cannot
		handle 120m tapes. This drive supports hardware data
		compression. Please refer to the section on <xref
		  linkend="hw-storage-hp1533a" remap="HP
		  C1533A"> for the proper switch settings.</para>
	      
	      <para>Data transfer rate is 183kB/s.</para>
	      
	      <para>This drive is used in Hewlett-Packard's SureStore <ulink
		  URL="http://www.dmo.hp.com/tape/sst5000.htm">5000eU</ulink>
		and <ulink
		  URL="http://www.dmo.hp.com/tape/sst5000.htm">5000i</ulink>
		tape drives and C35480A DDS format DAT drive..</para>
	      
	      <para>This drive will occasionally hang during a tape eject
		operation (<command>mt offline</command>).
		Pressing the front panel button will eject the tape and bring
		the tape drive back to life.</para>
	      
	      <para>WARNING: HP 35480-03110 only. On at least two occasions
		this tape drive when used with FreeBSD 2.1.0, an IBM Server
		320 and an 2940W SCSI controller resulted in all SCSI disk
		partitions being lost. The problem has not be analyzed or
		resolved at this time.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-sdt5000">
	      <title><ulink
		  URL="http://www.sel.sony.com/SEL/ccpg/storage/tape/t5000.html">Sony SDT-5000</ulink></title>
	      
	      <para>There are at least two significantly different models: one
		is a DDS-1 and the other DDS-2. The DDS-1 version is
		<literal>SDT-5000 3.02</literal>. The DDS-2 version is <literal>SONY SDT-5000 327M</literal>.
		The DDS-2 version has a 1MB cache. This cache is able to keep
		the tape streaming in almost any circumstances.</para>
	      
	      <para>The boot message identifier for this drive is <literal>SONY
		SDT-5000 3.02</literal> <literal>type 1 removable SCSI 2</literal> <literal>Sequential-Access
		density code 0x13</literal></para>
	      
	      <para>Native capacity is 4GB when using 120m tapes. This drive
		supports hardware data compression.</para>
	      
	      <para>Data transfer rate is depends upon the model or the drive.
		The rate is 630kB/s for the <literal>SONY SDT-5000 327M</literal> while
		compressing the data. For the <literal>SONY SDT-5000 3.02</literal>, the data
		transfer rate is 225kB/s.</para>
	      
	      <para>In order to get this drive to stream, set the blocksize to
		512 bytes (<command>mt blocksize 512</command>)
		reported by Kenneth Merry
		ken@ulc199.residence.gatech.edu</para>
	      
	      <para><literal>SONY SDT-5000 327M</literal> information reported by Charles
		Henrich henrich@msu.edu</para>
	      
	      <para>Reported by: &a.jmz;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tandberg3600">
	      <title>Tandberg TDC 3600</title>
	      
	      <para>The boot message identifier for this drive is <literal>TANDBERG
		TDC 3600 =08:</literal> <literal>type 1 removable SCSI 2</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 150/250MB.</para>
	      
	      <para>This drive has quirks which are known and work around code
		is present in the scsi tape device driver (<citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry>). Upgrading the firmware to XXX
		version will fix the quirks and provide SCSI 2
		capabilities.</para>
	      
	      <para>Data transfer rate is 80kB/s.</para>
	      
	      <para>IBM and Emerald units will not work. Replacing the
		firmware EPROM of these units will solve the problem.</para>
	      
	      <para>Reported by: Michael Smith
		<email>msmith@atrad.adelaide.edu.au</email></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tandberg3620">
	      <title>Tandberg TDC 3620</title>
	      
	      <para>This is very similar to the <xref
		  linkend="hw-storage-tandberg3600" remap="Tandberg TDC 3600">
		drive.</para>
	      
	      <para>Reported by: &a.joerg;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tandberg4222">
	      <title>Tandberg TDC 4222</title>
	      
	      <para>The boot message identifier for this drive is <literal>TANDBERG
		TDC 4222 =07</literal> <literal>type 1 removable SCSI 2</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 2.5GB. The drive will read all
		cartridges from the 60 MB (DC600A) upwards, and write 150 MB
		(DC6150) upwards. Hardware compression is optionally
		supported for the 2.5 GB cartridges.</para>
	      
	      <para>This drives quirks are known and pre-compiled into the
		scsi tape device driver (<citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry>)
		beginning with FreeBSD 2.2-current. For previous versions of
		FreeBSD, use <command>mt</command> to read one
		block from the tape, rewind the tape, and then execute the
		backup program (<command>mt fsr 1; mt rewind; dump
		  ...</command>)</para>
	      
	      <para>Data transfer rate is 600kB/s (vendor claim with
		compression), 350 KB/s can even be reached in start/stop mode.
		The rate decreases for smaller cartridges.</para>
	      
	      <para>Reported by: &a.joerg;</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-wangtek5525es">
	      <title>Wangtek 5525ES</title>
	      
	      <para>The boot message identifier for this drive is <literal>WANGTEK
		5525ES SCSI REV7 3R1</literal> <literal>type 1 removable SCSI 1</literal> <literal>density code
		0x11, 1024-byte blocks</literal></para>
	      
	      <para>This is a QIC tape drive.</para>
	      
	      <para>Native capacity is 525MB.</para>
	      
	      <para>Data transfer rate is 180kB/s.</para>
	      
	      <para>The drive reads 60, 120, 150, and 525MB tapes. The drive
		will not write 60MB (DC600 cartridge) tapes. In order to
		overwrite 120 and 150 tapes reliably, first erase (<command>mt erase</command>) the tape. 120 and 150 tapes
		used a wider track (fewer tracks per tape) than 525MB tapes.
		The <quote>extra</quote> width of the previous tracks is not overwritten,
		as a result the new data lies in a band surrounded on both
		sides by the previous data unless the tape have been
		erased.</para>
	      
	      <para>This drives quirks are known and pre-compiled into the
		scsi tape device driver (<citerefentry><refentrytitle>st</refentrytitle><manvolnum>4</manvolnum></citerefentry>).</para>
	      
	      <para>Other firmware revisions that are known to work are:
		M75D</para>
	      
	      <para>Reported by: Marc van Kempen <email>marc@bowtie.nl</email>  <literal>REV73R1</literal>
		Andrew Gordon <email>Andrew.Gordon@net-tel.co.uk</email> <literal>M75D</literal></para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-wangtek6200">
	      <title>Wangtek 6200</title>
	      
	      <para>The boot message identifier for this drive is <literal>WANGTEK
		6200-HS 4B18</literal> <literal>type 1 removable SCSI 2</literal> <literal>Sequential-Access
		density code 0x13</literal></para>
	      
	      <para>This is a DDS-1 tape drive.</para>
	      
	      <para>Native capacity is 2GB using 90m tapes.</para>
	      
	      <para>Data transfer rate is 150kB/s.</para>
	      
	      <para>Reported by: Tony Kimball <email>alk@Think.COM</email></para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>* Problem drives</title>

	    <para></para>
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>CD-ROM drives</title>
	  
	  <para><emphasis>Contributed by &a.obrien;.<!-- <br> -->23 November
	      1997.</emphasis></para>
	  
	  <para>As mentioned in
	    <xref linkend="hw-jordans-picks-cdrom" remap="Jordan's Picks">
	    Generally speaking those in <emphasis>The FreeBSD
	      Project</emphasis> prefer SCSI CDROM drives over IDE CDROM
	    drives. However not all SCSI CDROM drives are equal. Some feel
	    the quality of some SCSI CDROM drives have been deteriorating to
	    that of IDE CDROM drives. Toshiba used to be the favored
	    stand-by, but many on the SCSI mailing list have found displeasure
	    with the 12x speed XM-5701TA as its volume (when playing audio
	    CDROMs) is not controllable by the various audio player
	    software.</para>
	  
	  <para>Another area where SCSI CDROM manufacturers are cutting
	    corners is adhearance to the 
	    <xref linkend="scsi-further-reading" remap="SCSI specification">.
	    Many SCSI CDROMs will respond to
	    <xref linkend="scsi-rogue-devices" remap="multiple LUNs"> for its
	    target address. Known violators include the 6x Teac CD-56S
	    1.0D.</para>
	  
	</sect2>
	
	<sect2>
	  <title>* Other</title>

	  <para></para>
	</sect2>
	
	<sect2>
	  <title>* Adding and reconfiguring disks</title>

	  <para></para>
	</sect2>
	
	<sect2 id="hw-storage-tapebackups">
	  <title>Tapes and backups</title>
	  
	  
	  <sect3>
	    <title>* What about backups to floppies?</title>

	    <para></para>
	  </sect3>
	  
	  <sect3>
	    <title>Tape Media</title>
	    
	    
	    <sect4 id="hw-storage-tapebackups-4mm">
	      <title>4mm (DDS: Digital Data Storage)</title>
	      
	      <para>4mm tapes are replacing QIC as the workstation backup
		media of choice. This trend accelerated greatly when Conner
		purchased Archive, a leading manufacturer of QIC drives, and
		then stopped production of QIC drives. 4mm drives are small
		and quiet but do not have the reputation for reliability that
		is enjoyed by 8mm drives. The cartridges are less expensive
		and smaller (3 x 2 x 0.5 inches, 76 x 51 x 12 mm) than 8mm
		cartridges. 4mm, like 8mm, has comparatively short head life
		for the same reason, both use helical scan.</para>
	      
	      <para>Data thruput on these drives starts ~150kB/s, peaking at
		~500kB/s. Data capacity starts at 1.3 GB and ends at 2.0 GB.
		Hardware compression, available with most of these drives,
		approximately doubles the capacity. Multi-drive tape library
		units can have 6 drives in a single cabinet with automatic
		tape changing. Library capacities reach 240 GB.</para>
	      
	      <para>4mm drives, like 8mm drives, use helical-scan. All the
		benefits and drawbacks of helical-scan apply to both 4mm and
		8mm drives.</para>
	      
	      <para>Tapes should be retired from use after 2,000 passes or 100
		full backups.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tapebackups-8mm">
	      <title>8mm (Exabyte)</title>
	      
	      <para>8mm tapes are the most common SCSI tape drives; they are
		the best choice of exchanging tapes. Nearly every site has an
		exabyte 2 GB 8mm tape drive. 8mm drives are reliable,
		convenient and quiet. Cartridges are inexpensive and small
		(4.8 x 3.3 x 0.6 inches; 122 x 84 x 15 mm). One downside of
		8mm tape is relatively short head and tape life due to the
		high rate of relative motion of the tape across the
		heads.</para>
	      
	      <para>Data thruput ranges from ~250kB/s to ~500kB/s. Data sizes
		start at 300 MB and go up to 7 GB. Hardware compression,
		available with most of these drives, approximately doubles the
		capacity. These drives are available as single units or
		multi-drive tape libraries with 6 drives and 120 tapes in a
		single cabinet. Tapes are changed automatically by the unit.
		Library capacities reach 840+ GB.</para>
	      
	      <para>Data is recorded onto the tape using helical-scan, the
		heads are positioned at an angle to the media (approximately 6
		degrees). The tape wraps around 270 degrees of the spool that
		holds the heads. The spool spins while the tape slides over
		the spool. The result is a high density of data and closely
		packed tracks that angle across the tape from one edge to the
		other.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tapebackups-qic">
	      <title>QIC</title>
	      
	      <para>QIC-150 tapes and drives are, perhaps, the most common
		tape drive and media around. QIC tape drives are the least
		expensive <quote>serious</quote> backup drives. The downside is the cost
		of media. QIC tapes are expensive compared to 8mm or 4mm
		tapes, up to 5 times the price per GB data storage. But, if
		your needs can be satisfied with a half-dozen tapes, QIC may
		be the correct choice. QIC is the <emphasis>most</emphasis>
		common tape drive. Every site has a QIC drive of some density
		or another. Therein lies the rub, QIC has a large number of
		densities on physically similar (sometimes identical) tapes.
		QIC drives are not quiet. These drives audibly seek before
		they begin to record data and are clearly audible whenever
		reading, writing or seeking. QIC tapes measure (6 x 4 x 0.7
		inches; 15.2 x 10.2 x 1.7 mm). <xref
		  linkend="hw-storage-tapebackups-mini"
		  remap="Mini-cartridges">, which also use 1/4" wide tape are
		discussed separately. Tape libraries and changers are not
		available.</para>
	      
	      <para>Data thruput ranges from ~150kB/s to ~500kB/s. Data
		capacity ranges from 40 MB to 15 GB. Hardware compression is
		available on many of the newer QIC drives. QIC drives are
		less frequently installed; they are being supplanted by DAT
		drives.</para>
	      
	      <para>Data is recorded onto the tape in tracks. The tracks run
		along the long axis of the tape media from one end to the
		other. The number of tracks, and therefore the width of a
		track, varies with the tape's capacity. Most if not all newer
		drives provide backward-compatibility at least for reading
		(but often also for writing). QIC has a good reputation
		regarding the safety of the data (the mechanics are simpler
		and more robust than for helical scan drives).</para>
	      
	      <para>Tapes should be retired from use after 5,000
		backups.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-tapebackups-mini">
	      <title>* Mini-Cartridge</title>

	      <para></para>
	    </sect4>
	    
	    <sect4 id="hw-storage-tapebackups-dlt">
	      <title>DLT</title>
	      
	      <para>DLT has the fastest data transfer rate of all the drive
		types listed here. The 1/2" (12.5mm) tape is contained in a
		single spool cartridge (4 x 4 x 1 inches; 100 x 100 x 25 mm).
		The cartridge has a swinging gate along one entire side of the
		cartridge. The drive mechanism opens this gate to extract the
		tape leader. The tape leader has an oval hole in it which the
		drive uses to <quote>hook</quote> the tape. The take-up spool is located
		inside the tape drive. All the other tape cartridges listed
		here (9 track tapes are the only exception) have both the
		supply and take-up spools located inside the tape cartridge
		itself.</para>
	      
	      <para>Data thruput is approximately 1.5MB/s, three times the
		thruput of 4mm, 8mm, or QIC tape drives. Data capacities
		range from 10GB to 20GB for a single drive. Drives are
		available in both multi-tape changers and multi-tape,
		multi-drive tape libraries containing from 5 to 900 tapes over
		1 to 20 drives, providing from 50GB to 9TB of storage.</para>
	      
	      <para>Data is recorded onto the tape in tracks parallel to the
		direction of travel (just like QIC tapes). Two tracks are
		written at once. Read/write head lifetimes are relatively
		long; once the tape stops moving, there is no relative motion
		between the heads and the tape.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Using a new tape for the first time</title>
	    
	    <para>The first time that you try to read or write a new,
	      completely blank tape, the operation will fail. The console
	      messages should be similar to:</para>
	    
	      <informalexample>
		<screen>st0(ncr1:4:0): NOT READY asc:4,1
st0(ncr1:4:0):  Logical unit is in process of becoming ready</screen>
	      </informalexample>
	    
	    <para>The tape does not contain an Identifier Block (block number
	      0). All QIC tape drives since the adoption of QIC-525 standard
	      write an Identifier Block to the tape. There are two solutions:</para>
	    
	    <para><command>mt fsf 1</command> causes the tape drive
	      to write an Identifier Block to the tape.</para>
	    
	    <para>Use the front panel button to eject the tape.</para>
	    
	    <para>Re-insert the tape and <citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> data to
	      the tape.</para>
	    
	    <para><citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> will report <errorname>DUMP: End of tape detected</errorname> and the console
	      will show: <errorname>HARDWARE FAILURE info:280
		asc:80,96</errorname></para>
	    
	    <para>rewind the tape using: <command>mt
		rewind</command></para>
	    
	    <para>Subsequent tape operations are successful.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Backup Programs</title>
	    
	    <para>The three major programs are <citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
	      <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>, and
	      <citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
	    
	    
	    <sect4>
	      <title>Dump and Restore</title>
	      
	      <para><citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> and
		<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry> are the traditional Unix backup
		programs. They operate on the drive as a collection of disk
		blocks, below the abstractions of files, links and directories
		that are created by the filesystems.
		<citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> backs up devices, entire
		filesystems, not parts of a filesystem and not directory trees
		that span more than one filesystem, using either soft links
		<citerefentry><refentrytitle>ln</refentrytitle><manvolnum>1</manvolnum></citerefentry> or mounting one filesystem onto
		another. <citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> does not write files and
		directories to tape, but rather writes the data blocks that
		are the building blocks of files and directories.
		<citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> has quirks that remain from its
		early days in Version 6 of ATT Unix (circa 1975). The default
		parameters are suitable for 9-track tapes (6250 bpi), not the
		high-density media available today (up to 62,182 ftpi). These
		defaults must be overridden on the command line to utilize the
		capacity of current tape drives.</para>
	      
	      <para><citerefentry><refentrytitle>rdump</refentrytitle><manvolnum>8</manvolnum></citerefentry> and
		<citerefentry><refentrytitle>rrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry> backup data across the network
		to a tape drive attached to another computer. Both programs
		rely upon <citerefentry><refentrytitle>rcmd</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
		<citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> to access the remote tape
		drive. Therefore, the user performing the backup must have
		<filename>rhosts</filename> access to the remote
		computer. The arguments to <citerefentry><refentrytitle>rdump</refentrytitle><manvolnum>8</manvolnum></citerefentry> and
		<citerefentry><refentrytitle>rrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry> must suitable to use on the
		remote computer. (e.g. When <command>rdump</command>'ing from a FreeBSD computer to an
		Exabyte tape drive connected to a Sun called komodo, use:

		<informalexample>
		  <screen>&prompt.root; <userinput>/sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nrst8 /dev/rsd0a 2&gt;&amp;1</userinput></screen>
		</informalexample>) Beware:
		there are security implications to allowing <filename>rhosts</filename> commands. Evaluate your
		situation carefully.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Tar</title>
	      
	      <para><citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> also dates back to Version 6 of
		ATT Unix (circa 1975). <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> operates in
		cooperation with the filesystem; <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>
		writes files and directories to tape.
		<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> does not support the full range of
		options that are available from <citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
		but <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> does not require the unusual
		command pipeline that <citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> uses.</para>
	      
	      <para>Most versions of <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> do not support
		backups across the network. The GNU version of
		<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>, which FreeBSD utilizes, supports
		remote devices using the same syntax as <command>rdump</command>. To <citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> to
		an Exabyte tape drive connected to a Sun called komodo, use:
		<command>/usr/bin/tar cf komodo:/dev/nrst8 .
		  2&gt;&amp;1</command>. For versions without remote device
		support, you can use a pipeline and <citerefentry><refentrytitle>rsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>
		to send the data to a remote tape drive. (XXX add an example
		command)</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Cpio</title>
	      
	      <para><citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> is the original Unix file
		interchange tape program for magnetic media.
		<citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> has options (among many others) to
		perform byte-swapping, write a number of different archives
		format, and pipe the data to other programs. This last feature
		makes <citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> and excellent choice for
		installation media. <citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> does not know
		how to walk the directory tree and a list of files must be
		provided thru <acronym>STDIN</acronym>.</para>
	      
	      <para><citerefentry><refentrytitle>cpio</refentrytitle><manvolnum>1</manvolnum></citerefentry> does not support backups across
		the network. You can use a pipeline and
		<citerefentry><refentrytitle>rsh</refentrytitle><manvolnum>1</manvolnum></citerefentry> to send the data to a remote tape
		drive. (XXX add an example command)</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Pax</title>
	      
	      <para><citerefentry><refentrytitle>pax</refentrytitle><manvolnum>1</manvolnum></citerefentry> is IEEE/POSIX's answer to
		<command>tar</command> and <command>cpio</command>. Over the years the various
		versions of <command>tar</command> and <command>cpio</command> have gotten slightly incompatible.
		So rather than fight it out to fully standardize them, POSIX
		created a new archive utility. <command>pax</command> attempts to read and write many of
		the various cpio and tar formats, plus new formats of its own.
		Its command set more resembles <command>cpio</command> than <command>tar</command>.</para>
	      
	    </sect4>
	    
	    <sect4 id="hw-storage-amanda">
	      <title><ulink
		  URL="http://www.freebsd.org/ports/misc.html#amanda-2.2.6.5">Amanda</ulink></title>
	      
	      <para>Amanda (Advanced Maryland Network Disk Archiver) is a
		client/server backup system, rather than a single program. An
		Amanda server will backup to a single tape drive any number of
		computers that have Amanda clients and network communications
		with the Amanda server. A common problem at locations with a
		number of large disks is the length of time required to backup
		to data directly to tape exceeds the amount of time available
		for the task. Amanda solves this problem. Amanda can use a
		<quote>holding disk</quote> to backup several filesystems at the same time.
		Amanda creates <quote>archive sets</quote>: a group of tapes used over a
		period of time to create full backups of all the filesystems
		listed in Amanda's configuration file. The <quote>archive set</quote> also
		contains nightly incremental (or differential) backups of all
		the filesystems. Restoring a damaged filesystem requires the
		most recent full backup and the incremental backups.</para>
	      
	      <para>The configuration file provides fine control backups and
		the network traffic that Amanda generates. Amanda will use
		any of the above backup programs to write the data to tape.
		Amanda is available as either a port or a package, it is not
		installed by default.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Do nothing</title>
	      
	      <para><quote>Do nothing</quote> is not a computer program, but it is the most
		widely used backup strategy. There are no initial costs.
		There is no backup schedule to follow. Just say no. If
		something happens to your data, grin and bear it!</para>
	      
	      <para>If your time and your data is worth little to nothing,
		then <quote>Do nothing</quote> is the most suitable backup program for your
		computer. But beware, Unix is a useful tool, you may find
		that within six months you have a collection of files that are
		valuable to you.</para>
	      
	      <para><quote>Do nothing</quote> is the correct backup method for
		<filename>/usr/obj</filename> and other directory trees that
		can be exactly recreated by your computer. An example is the
		files that comprise these handbook pages-they have been
		generated from <acronym>SGML</acronym> input files. Creating
		backups of these <acronym>HTML</acronym> files is not
		necessary. The <acronym>SGML</acronym> source files are
		backed up regularly.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Which Backup Program is Best?</title>
	      
	      <para><citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> <emphasis>Period.</emphasis>
		Elizabeth D. Zwicky torture tested all the backup programs
		discussed here. The clear choice for preserving all your data
		and all the peculiarities of Unix filesystems is
		<citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Elizabeth created filesystems
		containing a large variety of unusual conditions (and some not
		so unusual ones) and tested each program by do a backup and
		restore of that filesystems. The peculiarities included:
		files with holes, files with holes and a block of nulls, files
		with funny characters in their names, unreadable and
		unwritable files, devices, files that change size during the
		backup, files that are created/deleted during the backup and
		more. She presented the results at LISA V in Oct.
		1991.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Emergency Restore Procedure</title>
	    
	    
	    <sect4>
	      <title>Before the Disaster</title>
	      
	      <para>There are only four steps that you need to perform in
		preparation for any disaster that may occur.</para>

	      <procedure>
		<step>
	      <para>Print the disklabel from each of your disks
		(e.g., <command>disklabel sd0 | lpr</command>), your
		filesystem table (<filename>/etc/fstab</filename>) and all
		boot messages, two copies of each.</para>
		</step>

		<step>
	      <para>Determine the boot and fixit floppies (<filename>boot.flp</filename>
		and <filename>fixit.flp</filename>) have all your devices. The easiest way to
		check is to reboot your machine with the boot floppy in the
		floppy drive and check the boot messages. If all your devices
		are listed and functional, skip on to step three.</para>
	      
	      <para>Otherwise, you have to create two custom bootable floppies
		which has a kernel that can mount your all of your disks and
		access your tape drive. These floppies must contain:
		<citerefentry><refentrytitle>fdisk</refentrytitle><manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>disklabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
		<citerefentry><refentrytitle>newfs</refentrytitle><manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and
		whichever backup program you use. These programs must be
		statically linked. If you use <citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry>, the
		floppy must contain <citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
		</step>

		<step>
	      <para>Create backup tapes regularly. Any changes that you
		make after your last backup may be irretrievably lost.
		Write-protect the backup tapes.</para>
		</step>

		<step>
		  <para>Test the floppies (either <filename>boot.flp</filename> and <filename>fixit.flp</filename>
		or the two custom bootable floppies you made in step two.)
		and backup tapes. Make notes of the procedure. Store these
		notes with the bootable floppy, the printouts and the backup
		tapes. You will be so distraught when restoring that the
		notes may prevent you from destroying your backup tapes (How?
		In place of <command>tar xvf /dev/rst0</command>, you might
		accidently type <command> tar cvf /dev/rst0</command> and
		over-write your backup tape).</para>
	      
	      <para>For an added measure of security, make bootable floppies
		and two backup tapes each time. Store one of each at a remote
		location. A remote location is NOT the basement of the same
		office building. A number of firms in the World Trade Center
		learned this lesson the hard way. A remote location should be
		physically separated from your computers and disk drives by a
		significant distance.</para>
	      
	      <para>An example script for creating a bootable floppy:</para>
		  
		<programlisting>
#!/bin/sh
#
# create a restore floppy
#
# format the floppy
#
PATH=/bin:/sbin:/usr/sbin:/usr/bin
       
fdformat -q fd0
if [ $? -ne 0 ]
then
        echo "Bad floppy, please use a new one"
        exit 1
fi
       
# place boot blocks on the floppy
#
disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440
       
#
# newfs the one and only partition
#
newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 5 -o space /dev/rfd0

#		  
# mount the new floppy
#
mount /dev/fd0a /mnt
       
#
# create required directories 
#
mkdir /mnt/dev
mkdir /mnt/bin
mkdir /mnt/sbin
mkdir /mnt/etc
mkdir /mnt/root
mkdir /mnt/mnt                 # for the root partition
mkdir /mnt/tmp
mkdir /mnt/var
       
#
# populate the directories
#
if [ ! -x /sys/compile/MINI/kernel ] 
then
        cat &lt;&lt; EOM
The MINI kernel does not exist, please create one.
Here is an example config file:
#
# MINI -- A kernel to get FreeBSD on onto a disk.
#
machine                "i386"
cpu            "I486_CPU"
ident          MINI
maxusers       5
       
options                INET                    # needed for _tcp _icmpstat _ipstat
                                               #            _udpstat _tcpstat _udb
options                FFS                     #Berkeley Fast File System
options                FAT_CURSOR              #block cursor in syscons or pccons
options                SCSI_DELAY=15           #Be pessimistic about Joe SCSI device
options                NCONS=2         #1 virtual consoles
options                USERCONFIG              #Allow user configuration with -c XXX
       
config         kernel  root on sd0 swap on sd0 and sd1 dumps on sd0
       
controller     isa0
controller     pci0
       
controller     fdc0    at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk           fd0     at fdc0 drive 0
       
controller     ncr0
       
controller     scbus0
       
device         sc0     at isa? port "IO_KBD" tty irq 1 vector scintr
device         npx0    at isa? port "IO_NPX" irq 13 vector npxintr
       
device         sd0
device         sd1
device         sd2
       
device         st0
       
pseudo-device  loop            # required by INET
pseudo-device  gzip            # Exec gzipped a.out's
EOM
        exit 1
fi
       
cp -f /sys/compile/MINI/kernel /mnt
       
gzip -c -best /sbin/init &gt; /mnt/sbin/init
gzip -c -best /sbin/fsck &gt; /mnt/sbin/fsck
gzip -c -best /sbin/mount &gt; /mnt/sbin/mount
gzip -c -best /sbin/halt &gt; /mnt/sbin/halt
gzip -c -best /sbin/restore &gt; /mnt/sbin/restore
       
gzip -c -best /bin/sh &gt; /mnt/bin/sh
gzip -c -best /bin/sync &gt; /mnt/bin/sync
       
cp /root/.profile /mnt/root
       
cp -f /dev/MAKEDEV /mnt/dev
chmod 755 /mnt/dev/MAKEDEV
       
chmod 500 /mnt/sbin/init
chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt
chmod 555 /mnt/bin/sh /mnt/bin/sync
chmod 6555 /mnt/sbin/restore
       
#
# create the devices nodes 
#
cd /mnt/dev
./MAKEDEV std
./MAKEDEV sd0
./MAKEDEV sd1
./MAKEDEV sd2
./MAKEDEV st0
./MAKEDEV pty0
cd /
       
#
# create minimum filesystem table
#
cat &gt; /mnt/etc/fstab &lt;&lt;EOM
/dev/fd0a      /       ufs     rw 1 1
EOM
       
#
# create minimum passwd file
#
cat &gt; /mnt/etc/passwd &lt;&lt;EOM
root:*:0:0:Charlie &amp;:/root:/bin/sh
EOM
       
cat &gt; /mnt/etc/master.passwd &lt;&lt;EOM
root::0:0::0:0:Charlie &amp;:/root:/bin/sh
EOM
       
chmod 600 /mnt/etc/master.passwd
chmod 644 /mnt/etc/passwd
/usr/sbin/pwd_mkdb -d/mnt/etc /mnt/etc/master.passwd
       
#
# umount the floppy and inform the user
#
/sbin/umount /mnt
		</programlisting>
		</step>
	      </procedure>
	    </sect4>
	    
	    <sect4>
	      <title>After the Disaster</title>
	      
	      <para>The key question is: did your hardware survive? You have
		been doing regular backups so there is no need to worry about
		the software.</para>
	      
	      <para>If the hardware has been damaged. First, replace those
		parts that have been damaged.</para>
	      
	      <para>If your hardware is okay, check your floppies. If you are
		using a custom boot floppy, boot single-user (type <option>-s</option> at the
		<prompt>boot:</prompt> prompt). Skip the following paragraph.</para>
	      
	      <para>If you are using the boot.flp and fixit.flp floppies, keep
		reading. Insert the boot.flp floppy in the first floppy drive
		and boot the computer. The original install menu will be
		displayed on the screen. Select the "Fixit--Repair mode with
		CDROM or floppy." option. Insert the <filename>fixit.flp</filename> when prompted.
		<command>restore</command> and the other programs
		that you need are located in
		<filename>/mnt2/stand</filename>.</para>
	      
	      <para>Recover each filesystem separately.</para>
	      
	      <para>Try to <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> (e.g. <command>mount /dev/sd0a /mnt</command>) the root partition of your first disk. If
		the disklabel was damaged, use <citerefentry><refentrytitle>disklabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
		to re-partition and label the disk to match the label that
		your printed and saved. Use <citerefentry><refentrytitle>newfs</refentrytitle><manvolnum>8</manvolnum></citerefentry> to
		re-create the filesystems. Re-mount the root partition of the
		floppy read-write (<command>mount -u -o rw /mnt</command>).
		Use your backup program and backup tapes to recover the data
		for this filesystem (e.g. <command>restore vrf
		  /dev/st0</command>). Unmount the filesystem (e.g.
		<filename>umount /mnt</filename>) Repeat for each filesystem
		that was damaged.</para>
	      
	      <para>Once your system is running, backup your data onto new
		tapes. Whatever caused the crash or data loss may strike
		again. An another hour spent now, may save you from further
		distress later.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>* I did not prepare for the Disaster, What Now?</title>

	      <para></para>
	    </sect4>
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="hw-other">
	<title>* Other</title>
	
	
	<sect2>
	  <title>* PCMCIA</title>

	  <para></para>
	</sect2>
      </sect1>
    </chapter>
    
    <chapter id="l10n">
      <title>Localization</title>
      
      
      <sect1 id="russian">
	<title>Russian Language (KOI8-R encoding)</title>
	
	<para><emphasis>Contributed by &a.ache;<!-- <br> --> 1 May
	    1997</emphasis>.</para>
	
	<para>See more info about KOI8-R encoding at <ulink
	    URL="http://www.nagual.pp.ru/~ache/koi8.html">KOI8-R References
	    (Russian Net Character Set)</ulink>.</para>
	
	
	<sect2 id="russian-console">
	  <title>Console Setup</title>
	  
	  
	    <procedure>
	      
	      <step>
		<para>Add following line to your kernel configuration file:
		  
		  <programlisting>
options         "SC_MOUSE_CHAR=0x03"
		  </programlisting> to move character
		  codes used for mouse cursor off KOI8-R pseudographics
		  range.</para>
	      </step>
	      
	      <step>
		<para>Russian console entry in
		  <filename>/etc/rc.conf</filename> should looks like:</para>
		  
		  <programlisting>
keymap=ru.koi8-r
keychange="61 ^[[K"
scrnmap=koi8-r2cp866
font8x16=cp866b-8x16
font8x14=cp866-8x14
font8x8=cp866-8x8
		  </programlisting>

		<note>
		  <para>^[ means that real ESC character must be entered into
		    <filename>/etc/rc.conf</filename>, not just ^[
		    string.</para>
		</note>
		
		<para>This tuning means KOI8-R keyboard with Alternative
		  screen font mapped to KOI8-R encoding to preserve
		  pseudographics, <literal>Gray Delete</literal>
		  key remapped to match Russian <citerefentry><refentrytitle>termcap</refentrytitle><manvolnum>5</manvolnum></citerefentry> entry for FreeBSD
		  console.</para>
		
		<para>RUS/LAT switch will be <literal>CapsLock</literal>. Old CapsLock function still
		  available via <literal>Shift+CapsLock</literal>.
		  CapsLock LED will indicate RUS mode, not CapsLock
		  mode.</para>
	      </step>
	      
	      <step>
		<para>For each <literal>ttyv?</literal> entry in
		  <filename>/etc/ttys</filename> change terminal type from
		  <literal>cons25</literal> to <literal>cons25r</literal>, i.e. each entry should looks
		  like:</para>

		  <programlisting>
ttyv0	"/usr/libexec/getty Pc"        cons25r	on  secure
		  </programlisting>
	      </step>
	      
	    </procedure>
	  
	  
	</sect2>
	
	<sect2 id="russian-locale">
	  <title>Locale Setup</title>
	  
	  <para><anchor id="russian-env"> There is two environment variables
	    for locale setup:</para>
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><envar>LANG</envar> for POSIX
		  <citerefentry><refentrytitle>setlocale</refentrytitle><manvolnum>3</manvolnum></citerefentry> family functions;</para>
	      </listitem>
	      
	      <listitem>
		<para><envar>MM_CHARSET</envar> for applications MIME
		  chararter set.</para>
	      </listitem>
	      
	    </itemizedlist>
	  	  
	  <para>The best way is using <filename>/etc/login.conf</filename>
	    <literal>russian</literal> user's login class in
	    <citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum></citerefentry> entry login class
	    position. See <citerefentry><refentrytitle>login.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
	    details.</para>
	  
	  
	  <sect3 id="russian-class">
	    <title>Login Class Method</title>
	    
	    <para>First of all check your <filename>/etc/login.conf</filename>
	      have <literal>russian</literal> login class, this
	      entry may looks like:</para>

	      <programlisting>
russian:Russian Users Accounts:\
        :charset=KOI8-R:\
        :lang=ru_RU.KOI8-R:\
        :tc=default:
	      </programlisting>
	    
	    
	    <sect4>
	      <title>How to do it with <citerefentry><refentrytitle>vipw</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
	      
	      <para>If you use <citerefentry><refentrytitle>vipw</refentrytitle><manvolnum>8</manvolnum></citerefentry> for adding new
		users, <filename>/etc/master.passwd</filename> entry should
		looks like:</para>

		<programlisting>
user:password:1111:11:russian:0:0:User Name:/home/user:/bin/csh
		</programlisting>
	      
	    </sect4>
	    
	    <sect4>
	      <title>How to do it with <citerefentry><refentrytitle>adduser</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
	      
	      <para>If you use <citerefentry><refentrytitle>adduser</refentrytitle><manvolnum>8</manvolnum></citerefentry> for adding new
		users:
		<itemizedlist>
		  
		  <listitem>
		    <para>Set

		      <programlisting>
defaultclass = russian
		      </programlisting> in
		      <filename>/etc/adduser.conf</filename> (you must enter
		      <literal>default</literal> class for all
		      non-Russian users in this case);</para>
		  </listitem>
		  
		  <listitem>
		    <para>Alternative variant will be answering <literal>russian</literal> each time when you see

		      <informalexample>
			<screen><prompt>Enter login class:</prompt> default []:</screen>
		      </informalexample> prompt from
		      <citerefentry><refentrytitle>adduser</refentrytitle><manvolnum>8</manvolnum></citerefentry>;</para>
		  </listitem>
		  
		  <listitem>
		    <para>Another variant: call

		      <informalexample>
			<screen>&prompt.root; <userinput>adduser -class russian</userinput></screen>
			</informalexample> for each Russian user
		      you want to add.</para>
		  </listitem>
		  
		</itemizedlist>
	      </para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>How to do it with <citerefentry><refentrytitle>pw</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
	      
	      <para>If you use <citerefentry><refentrytitle>pw</refentrytitle><manvolnum>8</manvolnum></citerefentry> for adding new users,
		call it in this form:</para>

		<informalexample>
		  <screen>&prompt.root; <userinput>pw useradd user_name -L russian</userinput></screen>
		</informalexample>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Shell Startup Files Method</title>
	    
	    <para>If you don't want to use
	      <xref linkend="russian-class" remap="login class method"> for
	      some reasons, just set this
	      <xref linkend="russian-env" remap="two environment variables">
	      in the following shell startup files:</para>
	    
	      <itemizedlist>
		
		<listitem>
		  <para><filename>/etc/profile</filename>:</para>
		    
		    <programlisting>
LANG=ru_RU.KOI8-R; export LANG
MM_CHARSET=KOI8-R; export MM_CHARSET
		    </programlisting>
		</listitem>
		
		<listitem>
		  <para><filename>/etc/csh.login</filename>:</para>

		    <programlisting>
setenv LANG ru_RU.KOI8-R
setenv MM_CHARSET KOI8-R
		    </programlisting>
		</listitem>
		
	      </itemizedlist>

	    
	    <para>Alternatively you can add this instructions to
	      <itemizedlist>
		
		<listitem>
		  <para><filename>/usr/share/skel/dot.profile</filename>:</para>
		  
		  <para>(similar to <filename>/etc/profile</filename>
		    above);</para>
		</listitem>
		
		<listitem>
		  <para><filename>/usr/share/skel/dot.login</filename>:</para>
		  
		  <para>(similar to <filename>/etc/csh.login</filename>
		    above).</para>
		</listitem>
		
	      </itemizedlist>
	    </para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="russian-printer">
	  <title>Printer Setup</title>
	  
	  <para>Since most printers with Russian characters comes with
	    hardware code page CP866, special output filter needed for KOI8-R
	    -&gt; CP866 conversion. Such filter installed by default as
	    <filename>/usr/libexec/lpr/ru/koi2alt</filename>. So, Russian
	    printer <filename>/etc/printcap</filename> entry should looks
	    like:</para>

	    <programlisting>
lp|Russian local line printer:\
        :sh:of=/usr/libexec/lpr/ru/koi2alt:\
        :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
	    </programlisting>

	  <para>See <citerefentry><refentrytitle>printcap</refentrytitle><manvolnum>5</manvolnum></citerefentry> for detailed description.</para>
	  
	</sect2>
	
	<sect2 id="russian-msdosfs">
	  <title>MSDOS FS and Russian file names</title>
	  
	  <para>Look at following example <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry> entry to enable support for Russian
	    file names in MSDOS FS:</para>

	    <programlisting>
/dev/sd0s1        /dos/c    msdos   rw,-W=koi2dos,-L=ru_RU.KOI8-R 0 0
	    </programlisting>

	<para>See
	    <citerefentry><refentrytitle>mount_msdos</refentrytitle><manvolnum>8</manvolnum></citerefentry>for detailed description of
	    <option>-W</option> and <option>-L</option> options.</para>
	  
	</sect2>
	
	<sect2 id="russian-xwindow">
	  <title>X Window Setup</title>
	  
	  <para>Step by step instructions:</para>
	  
	    <procedure>
	      
	      <step>
		<para>Do
		  <xref linkend="russian-locale" remap="non-X locale setup">
		  first as described.</para>

		<note>
		  <para><anchor id="russian-note">Russian KOI8-R locale may
		    not work with old XFree86 releases (lower than 3.3).
		    XFree86 port from
		    <filename>/usr/ports/x11/XFree86</filename> already have
		    most recent XFree86 version, so it will work, if you
		    install XFree86 from this port. XFree86 version shipped
		    with the latest FreeBSD distribution should work too
		    (check XFree86 version number not less than 3.3
		    first).</para>
		</note>
	      </step>
	      
	      <step>
		<para>Go to <filename>/usr/ports/russian/X.language</filename>
		  directory and say

		  <informalexample>
		    <screen>&prompt.root; <userinput>make all install</userinput></screen>
		  </informalexample> there. This port install latest
		  version of KOI8-R fonts. XFree86 3.3 already have some
		  KOI8-R fonts, but this ones scaled better.</para>
		
		<para>Check find <literal>"Files"</literal> section
		  in your <filename>/etc/XF86Config</filename>, following
		  lines must be before any other <literal>FontPath</literal>
		  entries:</para>

		  <programlisting>
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/misc"
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi"
FontPath   "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"
		  </programlisting>
		
		<para>If you use high resolution video mode, swap 75 dpi and
		  100 dpi lines.</para>
	      </step>
	      
	      <step>
		<para>To activate Russian keyboard add

		  <programlisting>
XkbKeymap   "xfree86(ru)"
		  </programlisting> line into
		  <literal>"Keyboard"</literal> section in your
		  <filename>/etc/XF86Config</filename>, also make sure that
		  <literal>XkbDisable</literal> is turned off
		  (commented out) there.</para>
		
		<para>RUS/LAT switch will be <literal>CapsLock</literal>. Old CapsLock function still
		  available via <literal>Shift+CapsLock</literal>
		  (in LAT mode only).</para>

		<note>
		  <para>Russian XKB keyboard may not work with old XFree86
		    versions, see <xref
		    linkend="russian-note" remap="locale note"> for more info.
		    Russian XKB keyboard may not work with non-localized
		    applications too, minimally localized application should
		    call <literal>XtSetLanguageProc
		    (NULL, NULL, NULL);</literal> function early in the program.</para>
		</note>
	      </step>
	      
	    </procedure>
	    
	</sect2>
      </sect1>
      
      <sect1 id="german">
	<title>German Language (ISO 8859-1)</title>
	
	<para>Slaven Rezic <email>eserte@cs.tu-berlin.de</email> wrote a tutorial how to use umlauts on a FreeBSD machine. The tutorial  is written in German and available at <ulink URL="http://www.de.freebsd.org/de/umlaute/">http://www.de.freebsd.org/de/umlaute/</ulink>.</para>
	
      </sect1>
    </chapter>
  </part>
  
  <part>
    <title>Network Communications</title>
    
    
    <chapter>
      <title>Serial Communications</title>
      
      
      <sect1 id="serial">
	<title>Serial Basics</title>
	
	<para><emphasis>Assembled from FAQ.</emphasis></para>
	
	<para>This section should give you some general information about
	  serial ports. If you do not find what you want here, check into the
	  Terminal and Dialup sections of the handbook.</para>
	
	<para>The <filename>ttyd<replaceable>X</replaceable></filename> (or <filename>cuaa<replaceable>X</replaceable></filename>)
	  device is the regular device you will want to open for your
	  applications. When a process opens the device, it will have a
	  default set of terminal I/O settings. You can see these settings
	  with the command</para>

	  <informalexample>
            <screen>&prompt.root; <userinput>stty -a -f /dev/ttyd1</userinput></screen>
	  </informalexample>
	
	<para>When you change the settings to this device, the settings are in
	  effect until the device is closed. When it is reopened, it goes
	  back to the default set. To make changes to the default set, you
	  can open and adjust the settings of the <quote>initial state</quote> device.
	  For example, to turn on <acronym>CLOCAL</acronym> mode, 8 bits, and
	  <emphasis>XON/XOFF</emphasis> flow control by default for ttyd5, do:</para>

	  <informalexample>
            <screen>&prompt.root; <userinput>stty -f /dev/ttyid5 clocal cs8 ixon ixoff</userinput></screen>
	  </informalexample>
	
	<para>A good place to do this is in
	  <filename>/etc/rc.serial</filename>. Now, an application will have
	  these settings by default when it opens <filename>ttyd5</filename>.
	  It can still change these settings to its liking, though.</para>
	
	<para>You can also prevent certain settings from being changed by an
	  application by making adjustments to the <quote>lock state</quote> device. For
	  example, to lock the speed of <filename>ttyd5</filename> to 57600
	  bps, do</para>

	  <informalexample>
            <screen>&prompt.root; <userinput>stty -f /dev/ttyld5 57600</userinput></screen>
	  </informalexample>
	
	<para>Now, an application that opens <filename>ttyd5</filename> and
	  tries to change the speed of the port will be stuck with 57600
	  bps.</para>
	
	<para>Naturally, you should make the initial state and lock state
	  devices writable only by <username>root</username>. The
	  <filename>MAKEDEV</filename> script does <emphasis>not</emphasis> do
	  this when it creates the device entries.</para>
	
      </sect1>
      
      <sect1 id="term">
	<title>Terminals</title>
	
	<para><emphasis>Contributed by &a.kelly;<!-- <br> -->28 July
	    1996</emphasis></para>
	
	<para>Terminals provide a convenient and low-cost way to access the
	  power of your FreeBSD system when you are not at the computer's
	  console or on a connected network. This section describes how to
	  use terminals with FreeBSD.</para>
	
	
	<sect2 id="term-uses">
	  <title>Uses and Types of Terminals</title>
	  
	  <para>The original Unix systems did not have consoles. Instead,
	    people logged in and ran programs through terminals that were
	    connected to the computer's serial ports. It is quite similar to
	    using a modem and some terminal software to dial into a remote
	    system to do text-only work.</para>
	  
	  <para>Today's PCs have consoles capable of high quality graphics,
	    but the ability to establish a login session on a serial port
	    still exists in nearly every Unix-style operating system today;
	    FreeBSD is no exception. By using a terminal attached to a unused
	    serial port, you can log in and run any text program that you
	    would normally run on the console or in an <command>xterm</command> window in the X Window System.</para>
	  
	  <para>For the business user, you can attach many terminals to a
	    FreeBSD system and place them on your employees' desktops. For a
	    home user, a spare computer such as an older IBM PC or a Macintosh
	    can be a terminal wired into a more powerful computer running
	    FreeBSD. You can turn what might otherwise be a single-user
	    computer into a powerful multiple user system.</para>
	  
	  <para>For FreeBSD, there are three kinds of terminals:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><xref linkend="term-dumb" remap="Dumb terminals"></para>
	      </listitem>
	      
	      <listitem>
		<para><xref linkend="term-pcs" remap="PCs acting as
		    terminals"></para>
	      </listitem>
	      
	      <listitem>
		<para><xref linkend="term-x" remap="X terminals"></para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>The remaining subsections describe each kind.</para>
	  
	  
	  <sect3 id="term-dumb">
	    <title>Dumb Terminals</title>
	    
	    <para>Dumb terminals are specialized pieces of hardware that let
	      you connect to computers over serial lines. They are called
	      <quote>dumb</quote> because they have only enough computational power to
	      display, send, and receive text. You cannot run any programs on
	      them. It is the computer to which you connect them that has all
	      the power to run text editors, compilers, email, games, and so
	      forth.</para>
	    
	    <para>There are hundreds of kinds of dumb terminals made by many
	      manufacturers, including Digital Equipment Corporation's VT-100
	      and Wyse's WY-75. Just about any kind will work with FreeBSD.
	      Some high-end terminals can even display graphics, but only
	      certain software packages can take advantage of these advanced
	      features.</para>
	    
	    <para>Dumb terminals are popular in work environments where
	      workers do not need access to graphic applications such as those
	      provided by the X Window System.</para>
	    
	  </sect3>
	  
	  <sect3 id="term-pcs">
	    <title>PCs Acting As Terminals</title>
	    
	    <para>If a <xref linkend="term-dumb" remap="dumb terminal"> has
	      just enough ability to display, send, and receive text, then
	      certainly any spare personal computer can be a dumb terminal.
	      All you need is the proper cable and some <emphasis>terminal
		emulation</emphasis> software to run on the computer.</para>
	    
	    <para>Such a configuration is popular in homes. For example, if
	      your spouse is busy working on your FreeBSD system's console,
	      you can do some text-only work at the same time from a less
	      powerful personal computer hooked up as a terminal to the
	      FreeBSD system.</para>
	    
	  </sect3>
	  
	  <sect3 id="term-x">
	    <title>X Terminals</title>
	    
	    <para>X terminals are the most sophisticated kind of terminal
	      available. Instead of connecting to a serial port, they usually
	      connect to a network like Ethernet. Instead of being relegated
	      to text-only applications, they can display any X
	      application.</para>
	    
	    <para>We introduce X terminals just for the sake of completeness.
	      However, this chapter does <emphasis>not</emphasis> cover setup,
	      configuration, or use of X terminals.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="term-cables-ports">
	  <title>Cables and Ports</title>
	  
	  <para>To connect a terminal to your FreeBSD system, you need the
	    right kind of cable and a serial port to which to connect it. This
	    section tells you what to do. If you are already familiar with
	    your terminal and the cable it requires, skip to
	    <xref linkend="term-config" remap="Configuration">.</para>
	  
	  
	  <sect3 id="term-cables">
	    <title>Cables</title>
	    
	    <para>Because terminals use serial ports, you need to use
	      serial&mdash;also known as RS-232C&mdash;cables to connect the terminal
	      to the FreeBSD system.</para>
	    
	    <para>There are a couple of kinds of serial cables. Which one
	      you'll use depends on the terminal you want to connect:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>If you are connecting a personal computer to act as a
		    terminal, use a <xref linkend="term-null"
		      remap="null-modem"> cable. A null-modem cable connects
		    two computers or terminals together.</para>
		</listitem>
		
		<listitem>
		  <para>If you have an actual terminal, your best source of
		    information on what cable to use is the documentation that
		    accompanied the terminal. If you do not have the
		    documentation, then try a <xref linkend="term-null"
		      remap="null-modem"> cable. If that does not work, then
		    try a <xref linkend="term-std" remap="standard">
		    cable.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>Also, the serial port on <emphasis>both</emphasis> the
	      terminal and your FreeBSD system must have connectors that will
	      fit the cable you are using.</para>
	    
	    
	    <sect4 id="term-null">
	      <title>Null-modem cables</title>
	      
	      <para>A null-modem cable passes some signals straight through,
		like <quote>signal ground,</quote> but switches other signals. For
		example, the <quote>send data</quote> pin on one end goes to the
		<quote>receive data</quote> pin on the other end.</para>
	      
	      <para>If you like making your own cables, here is a table
		showing a recommended way to construct a null-modem cable for
		use with terminals. This table shows the RS-232C signal names
		and the pin numbers on a DB-25 connector.</para>

		<informaltable frame="none">
		  <tgroup cols="5">
		    <thead>
		      <row>
			<entry>Signal</entry>
			<entry>Pin #</entry>
			<entry></entry>
			<entry>Pin #</entry>
			<entry>Signal</entry>
		      </row>
		    </thead>
		    
		    <tbody>

		      <row>
			<entry>TxD</entry>
			<entry>2</entry>
			<entry>connects to</entry>
			<entry>3</entry>
			<entry>RxD</entry>
		      </row>

		      <row>
			<entry>RxD</entry>
			<entry>3</entry>
			<entry>connects to</entry>
			<entry>2</entry>
			<entry>TxD</entry>
		      </row>
		      
		      <row>
			<entry>DTR</entry>
			<entry>20</entry>
			<entry>connects to</entry>
			<entry>6</entry>
			<entry>DSR</entry>
		      </row>
		      
		      <row>
			<entry>DSR</entry>
			<entry>6</entry>
			<entry>connects to</entry>
			<entry>20</entry>
			<entry>DTR</entry>
		      </row>
		      
		      <row>
			<entry>SG</entry>
			<entry>7</entry>
			<entry>connects to</entry>
			<entry>7</entry>
			<entry>SG</entry>
		      </row>
		      
		      <row>
			<entry>DCD</entry>
			<entry>8</entry>
			<entry>connects to</entry>
			<entry>4</entry>
			<entry>RTS<footnote>
			    <para>Connect pins 4 to 5 internally in the
			      connector hood, and then to pin 8 in the remote hood.</para></footnote></entry>
		      </row>
		      
		      <row>
			<entry>RTS</entry>
			<entry>4</entry>
			<entry></entry>
			<entry>5</entry>
			<entry>CTS</entry>
		      </row>
		      
		      <row>
			<entry>CTS</entry>
			<entry>5</entry>
			<entry>connects to</entry>
			<entry>8</entry>
			<entry>DCD</entry>
		      </row>
		    </tbody>
		  </tgroup>
		</informaltable>
	      
	    </sect4>
	    
	    <sect4 id="term-std">
	      <title>Standard RS-232C Cables</title>
	      
	      <para>A standard serial cable passes all the RS-232C signals
		straight-through. That is, the <quote>send data</quote> pin on one end
		of the cable goes to the <quote>send data</quote> pin on the other end.
		This is the type of cable to connect a modem to your FreeBSD
		system, and the type of cable needed for some
		terminals.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="term-ports">
	    <title>Ports</title>
	    
	    <para>Serial ports are the devices through which data is
	      transferred between the FreeBSD host computer and the terminal.
	      This section describes the kinds of ports that exist and how
	      they are addressed in FreeBSD.</para>
	    
	    
	    <sect4 id="term-portkinds">
	      <title>Kinds of Ports</title>
	      
	      <para>Several kinds of serial ports exist. Before you purchase
		or construct a cable, you need to make sure it will fit the
		ports on your terminal and on the FreeBSD system.</para>
	      
	      <para>Most terminals will have DB25 ports. Personal computers,
		including PCs running FreeBSD, will have DB25 or DB9 ports.
		If you have a multiport serial card for your PC, you may have
		RJ-12 or RJ-45 ports.</para>
	      
	      <para>See the documentation that accompanied the hardware for
		specifications on the kind of port in use. A visual
		inspection of the port often works, too.</para>
	      
	    </sect4>
	    
	    <sect4 id="term-portnames">
	      <title>Port Names</title>
	      
	      <para>In FreeBSD, you access each serial port through an entry
		in the <filename>/dev</filename> directory. There are two
		different kinds of entries:</para>
	      
		<itemizedlist>
		  
		  <listitem>
		    <para>Callin ports are named
		      <filename>/dev/ttyd<replaceable>X</replaceable></filename> where <replaceable>X</replaceable> is the port number, starting from zero. Generally, you use the callin port for terminals. Callin ports require that the serial line assert the data carrier detect (DCD) signal to work.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Callout ports are named
		      <filename>/dev/cuaa<replaceable>X</replaceable></filename>. You usually do not use the callout port for terminals, just for modems. You may use the callout port if the serial cable or the terminal does not support the carrier detect signal.</para>
		  </listitem>
		  
		</itemizedlist>
	      
	      <para>See the <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page for more information.</para>
	      
	      <para>If you have connected a terminal to the first serial port
		(<devicename>COM1</devicename> in DOS parlance), then you want to use
		<filename>/dev/ttyd0</filename> to refer to the terminal. If
		it is on the second serial port (also known as <devicename>COM2</devicename>), it is
		<filename>/dev/ttyd1</filename>, and so forth.</para>
	      
	      <para>Note that you may have to configure your kernel to support
		each serial port, especially if you have a multiport serial
		card. See <xref linkend="kernelconfig"
		  remap="Configuring the FreeBSD      Kernel"> for more
		information.</para>
	      
	    </sect4>
	  </sect3>
	</sect2>
	
	<sect2 id="term-config">
	  <title>Configuration</title>
	  
	  <para>This section describes what you need to configure on your
	    FreeBSD system to enable a login session on a terminal. It
	    assumes you have already configured your kernel to support the
	    serial port to which the terminal is connected&mdash;and that you have
	    connected it.</para>
	  
	  <para>In a nutshell, you need to tell the <command>init</command> process, which is responsible for
	    process control and initialization, to start a <command>getty</command> process, which is responsible for
	    reading a login name and starting the <command>login</command> program.</para>
	  
	  <para>To do so, you have to edit the <filename>/etc/ttys</filename>
	    file. First, use the <command>su</command> command to
	    become root. Then, make the following changes to
	    <filename>/etc/ttys</filename>:</para>

	    <procedure>
	      <step>
		<para>Add an line to <filename>/etc/ttys</filename> for the
		  entry in the <filename>/dev</filename> directory for the
		  serial port if it is not already there.</para>
	      </step>
	      
	      <step>
		<para>Specify that <filename>/usr/libexec/getty</filename> be
		  run on the port, and specify the appropriate <replaceable>getty</replaceable> type from the
		  <filename>/etc/gettytab</filename> file.</para>
	      </step>
	      
	      <step>
		<para>Specify the default terminal type.</para>
	      </step>
	      
	      <step>
		<para>Set the port to <quote>on.</quote></para>
	      </step>
	      
	      <step>
		<para>Specify whether the port should be <quote>secure.</quote></para>
	      </step>
	      
	      <step>
		<para>Force <command>init</command> to reread the
		  <filename>/etc/ttys</filename> file.</para>
	      </step>
	    </procedure>
	  
	  <para>As an optional step, you may wish to create a custom
	    <replaceable>getty</replaceable> type for use in step 2 by making an
	    entry in <filename>/etc/gettytab</filename>. This document does
	    not explain how to do so; you are encouraged to see the
	    <citerefentry><refentrytitle>gettytab</refentrytitle><manvolnum>5</manvolnum></citerefentry> and the <citerefentry><refentrytitle>getty</refentrytitle><manvolnum>8</manvolnum></citerefentry> manual pages for more
	    information.</para>
	  
	  <para>The remaining sections detail how to do these steps. We will
	    use a running example throughout these sections to illustrate what
	    we need to do. In our example, we will connect two terminals to
	    the system: a Wyse-50 and a old 286 IBM PC running Procomm
	    terminal software emulating a VT-100 terminal. We connect the Wyse
	    to the second serial port and the 286 to the sixth serial port (a
	    port on a multiport serial card).</para>
	  
	  <para>For more information on the <filename>/etc/ttys</filename>
	    file, see the <citerefentry><refentrytitle>ttys</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page.</para>
	  
	  
	  <sect3 id="term-etcttys">
	    <title>Adding an Entry to <filename>/etc/ttys</filename></title>
	    
	    <para>First, you need to add an entry to the
	      <filename>/etc/ttys</filename> file, unless one is already
	      there.</para>
	    
	    <para>The <filename>/etc/ttys</filename> file lists all of the
	      ports on your FreeBSD system where you want to allow logins. For
	      example, the first virtual console <filename>ttyv0</filename>
	      has an entry in this file. You can log in on the console using
	      this entry. This file contains entries for the other virtual
	      consoles, serial ports, and pseudo-ttys. For a hardwired
	      terminal, just list the serial port's <filename>/dev</filename>
	      entry without the <filename>/dev</filename> part.</para>
	    
	    <para>When you installed your FreeBSD system, the
	      <filename>/etc/ttys</filename> file included entries for the
	      first four serial ports: <filename>ttyd0</filename> through
	      <filename>ttyd3</filename>. If you are attaching a terminal on
	      one of those ports, you do not need to add an entry.</para>
	    
	    <para>In our example, we attached a Wyse-50 to the second serial
	      port, <filename>ttyd1</filename>, which is already in
	      the file. We need to add an entry for the 286 PC connected to
	      the sixth serial port. Here is an excerpt of the
	      <filename>/etc/ttys</filename> file after we add the new entry:</para>

	      <programlisting>
ttyd1   "/usr/libexec/getty std.9600"   unknown off secure
ttyd5
	      </programlisting>
	    
	  </sect3>
	  
	  <sect3 id="term-getty">
	    <title>Specifying the <replaceable>getty</replaceable>
	      Type</title>
	    
	    <para>Next, we need to specify what program will be run to handle
	      the logins on a terminal. For FreeBSD, the standard program to
	      do that is <filename>/usr/libexec/getty</filename>. It is what
	      provides the <prompt>login:</prompt> prompt.</para>
	    
	    <para>The program <command>getty</command> takes one
	      (optional) parameter on its command line, the
	      <replaceable>getty</replaceable> type.
	      A <replaceable>getty</replaceable> type tells about
	      characteristics on the terminal line, like bps rate and parity.
	      The <command>getty</command> program reads these
	      characteristics from the file
	      <filename>/etc/gettytab</filename>.</para>
	    
	    <para>The file <filename>/etc/gettytab</filename> contains lots of
	      entries for terminal lines both old and new. In almost all
	      cases, the entries that start with the text <literal>std</literal> will work for hardwired terminals.
	      These entries ignore parity. There is a <literal>std</literal> entry for each bps rate from 110 to
	      115200. Of course, you can add your own entries to this file.
	      The manual page <citerefentry><refentrytitle>gettytab</refentrytitle><manvolnum>5</manvolnum></citerefentry> provides more information.</para>
	    
	    <para>When setting the <replaceable>getty</replaceable> type in
	      the <filename>/etc/ttys</filename> file, make sure that the
	      communications settings on the terminal match.</para>
	    
	    <para>For our example, the Wyse-50 uses no parity and connects at
	      38400 bps. The 286 PC uses no parity and connects at 19200 bps.
	      Here is the <filename>/etc/ttys</filename> file so far (showing
	      just the two terminals in which we are interested):</para>

	      <programlisting>
ttyd1   "/usr/libexec/getty std.38400"   unknown off secure
ttyd5   "/usr/libexec/getty std.19200"
	      </programlisting>

	    <para>Note that the second field&mdash;where we specify
	      what program to run&mdash;appears in quotes. This is important,
	      otherwise the type argument to <command>getty</command> might be interpreted as the next
	      field.</para>
	    
	  </sect3>
	  
	  <sect3 id="term-deftermtype">
	    <title>Specifying the Default Terminal Type</title>
	    
	    <para>The third field in the <filename>/etc/ttys</filename> file
	      lists the default terminal type for the port. For dialup ports,
	      you typically put <literal>unknown</literal> or
	      <literal>dialup</literal> in this field because users
	      may dial up with practically any kind of terminal or software.
	      For hardwired terminals, the terminal type does not change, so
	      you can put a real terminal type in this field.</para>
	    
	    <para>Users will usually use the <command>tset</command> program in  their
	      <filename>.login</filename> or <filename>.profile</filename>
	      files to check the terminal type and prompt for one if
	      necessary. By setting a terminal type in the
	      <filename>/etc/ttys</filename> file, users can forego such
	      prompting.</para>
	    
	    <para>To find out what terminal types FreeBSD supports, see the
	      file <filename>/usr/share/misc/termcap</filename>. It lists
	      about 600 terminal types. You can add more if you wish. See
	      the <citerefentry><refentrytitle>termcap</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page for information.</para>
	    
	    <para>In our example, the Wyse-50 is a Wyse-50 type of terminal
	      (although it can emulate others, we will leave it in Wyse-50
	      mode). The 286 PC is running Procomm which will be set to
	      emulate a VT-100. Here are the pertinent yet unfinished entries
	      from the <filename>/etc/ttys</filename> file:</para>

	      <programlisting>
ttyd1   "/usr/libexec/getty std.38400"   wy50  off secure
ttyd5   "/usr/libexec/getty std.19200"   vt100
	      </programlisting>
	    
	  </sect3>
	  
	  <sect3 id="term-enable">
	    <title>Enabling the Port</title>
	    
	    <para>The next field in <filename>/etc/ttys</filename>, the fourth
	      field, tells whether to enable the port. Putting <literal>on</literal> here will have the <command>init</command> process start the program in the
	      second field, <command>getty</command>, which will
	      prompt for a login. If you put <literal>off</literal> in the fourth field, there will be no
	      <command>getty</command>, and hence no logins on the
	      port.</para>
	    
	    <para>So, naturally, you want an <literal>on</literal>
	      in this field. Here again is the <filename>/etc/ttys</filename>
	      file. We have turned each port <literal>on</literal>.</para>

	      <programlisting>
ttyd1   "/usr/libexec/getty std.38400"   wy50  on secure
ttyd5   "/usr/libexec/getty std.19200"	 vt100 on
	      </programlisting>
	    
	  </sect3>
	  
	  <sect3 id="term-secure">
	    <title>Specifying Secure Ports</title>
	    
	    <para>We have arrived at the last field (well, almost: there is an
	      optional <literal>window</literal> specifier, but we
	      will ignore that). The last field tells whether the port is
	      secure.</para>
	    
	    <para>What does <quote>secure</quote> mean?</para>
	    
	    <para>It means that the root account (or any account with a user
	      ID of 0) may login on the port. Insecure ports do not allow
	      root to login.</para>
	    
	    <para>How do you use secure and insecure ports?</para>
	    
	    <para>By marking a port as insecure, the terminal to which it is
	      connected will not allow root to login. People who know the
	      root password to your FreeBSD system will first have to login
	      using a regular user account. To gain superuser privileges,
	      they will then have to use the <command>su</command>
	      command.</para>
	    
	    <para>Because of this, you will have two records to help track
	      down possible compromises of root privileges: both the <command>login</command> and
	      the <command>su</command> command make records in the
	      system log (and logins are also recorded in the <filename>wtmp</filename> file).</para>
	    
	    <para>By marking a port as secure, the terminal will allow root
	      in. People who know the root password will just login as root.
	      You will not have the potentially useful login and <command>su</command> command records.</para>
	    
	    <para>Which should you use?</para>
	    
	    <para>Just use <quote>insecure.</quote>  Use <quote>insecure</quote>
	      <emphasis>even</emphasis> for terminals <emphasis>not</emphasis>
	      in public user areas or behind locked doors. It is quite easy
	      to login and use <command>su</command> if you need
	      superuser privileges.</para>
	    
	    <para>Here finally are the completed entries in the
	      <filename>/etc/ttys</filename> file, with comments added to
	      describe where the terminals are:</para>

	      <programlisting>
ttyd1   "/usr/libexec/getty std.38400"   wy50  on insecure # Kitchen
ttyd5   "/usr/libexec/getty std.19200"   vt100 on insecure # Guest bathroom
	      </programlisting>
	    
	  </sect3>
	  
	  <sect3 id="term-hup">
	    <title>Force <command>init</command> to Reread
	      <filename>/etc/ttys</filename></title>
	    
	    <para>When you boot FreeBSD, the first process, <command>init</command>, will read the
	      <filename>/etc/ttys</filename> file and start the programs
	      listed for each enabled port to prompt for logins.</para>
	    
	    <para>After you edit <filename>/etc/ttys</filename>, you do not
	      want to have to reboot your system to get <command>init</command> to see the changes. So, <command>init</command> will reread
	      <filename>/etc/ttys</filename> if it receives a SIGHUP (hangup)
	      signal.</para>
	    
	    <para>So, after you have saved your changes to
	      <filename>/etc/ttys</filename>, send <literal>SIGHUP</literal> to <command>init</command> by typing:
	      <informalexample>
		<screen>&prompt.root; <userinput>kill -HUP 1</userinput></screen>
	      </informalexample> (The <command>init</command>
	      process <emphasis>always</emphasis> has process ID 1.)</para>
	    
	    <para>If everything is set up correctly, all cables are in place,
	      and the terminals are powered up, you should see login prompts.
	      Your terminals are ready for their first logins!</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="term-debug">
	  <title>Debugging your connection</title>
	  
	  <para>Even with the most meticulous attention to detail, something
	    could still go wrong while setting up a terminal. Here is a list
	    of symptoms and some suggested fixes.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>No login prompt appears</term>
		<listitem>
		  <para>Make sure the terminal is plugged in and powered up.
		    If it is a personal computer acting as a terminal, make
		    sure it is running terminal emulation software on the
		    correct serial port.</para>
		  
		  <para>Make sure the cable is connected firmly to both the
		    terminal and the FreeBSD computer. Make sure it is the
		    right kind of cable.</para>
		  
		  <para>Make sure the terminal and FreeBSD agree on the bps
		    rate and parity settings. If you have a video display
		    terminal, make sure the contrast and brightness controls
		    are turned up. If it is a printing terminal, make sure
		    paper and ink are in good supply.</para>
		  
		  <para>Make sure that a <command>getty</command>
		    process is running and serving the terminal. Type
		  
		    <informalexample>
		      <screen>&prompt.root; <userinput>ps -axww|grep getty</userinput></screen>
		    </informalexample> to get a list of running <command>getty</command> processes. You should see an
		    entry for the terminal. For example, the display
		  
		    <informalexample>
		      <screen>22189  d1  Is+    0:00.03 /usr/libexec/getty std.38400 ttyd1</screen>
		    </informalexample> shows that a <command>getty</command> is running on the second
		    serial port <literal>ttyd1</literal> and is
		    using the <literal>std.38400</literal> entry in
		    <filename>/etc/gettytab</filename>.</para>
		  
		  <para>If no <command>getty</command> process is
		    running, make sure you have enabled the port in
		    <filename>/etc/ttys</filename>. Make sure you have run
		    <command>kill -HUP 1</command>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Garbage appears instead of a login
		  prompt</term>
		
		<listitem>
		  <para>Make sure the terminal and FreeBSD agree on the bps
		    rate and parity settings. Check the getty processes to
		    make sure the correct <replaceable>getty</replaceable>
		    type is in use. If not, edit
		    <filename>/etc/ttys</filename> and run <command>kill -HUP
		      1</command>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Characters appear doubled; the password
		  appears when typed</term>
		
		<listitem>
		  <para>Switch the terminal (or the terminal emulation
		    software) from <quote>half duplex</quote> or <quote>local echo</quote> to <quote>full
		    duplex.</quote></para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="dialup">
	<title>Dialin Service</title>
	
	<para><emphasis>Contributed by &a.ghelmer;.</emphasis></para>
	
	<para>This document provides suggestions for configuring a FreeBSD
	  system to handle dialup modems. This document is written based on
	  the author's experience with FreeBSD versions 1.0, 1.1, and 1.1.5.1
	  (and experience with dialup modems on other UNIX-like operating
	  systems); however, this document may not answer all of your
	  questions or provide examples specific enough to your environment.
	  The author cannot be responsible if you damage your system or lose
	  data due to attempting to follow the suggestions here.</para>
	
	
	<sect2 id="dialup-prereqs">
	  <title>Prerequisites</title>
	  
	  <para>To begin with, the author assumes you have some basic
	    knowledge of FreeBSD. You need to have FreeBSD installed, know
	    how to edit files in a UNIX-like environment, and how to look up
	    manual pages on the system. As discussed below, you will need
	    certain versions of FreeBSD, and knowledge of some terminology
	    &amp; modem and cabling.</para>
	  
	  
	  <sect3>
	    <title>FreeBSD Version</title>
	    
	    <para>First, it is assumed that you are using FreeBSD version 1.1
	      or higher (including versions 2.x). FreeBSD version 1.0
	      included two different serial drivers, which complicates the
	      situation. Also, the serial device driver (<devicename>sio</devicename>) has improved in every release of
	      FreeBSD, so more recent versions of FreeBSD are assumed to have
	      better and more efficient drivers than earlier versions.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Terminology</title>
	    
	    <para>A quick rundown of terminology:</para>
	    
	    
	      <variablelist>
		<varlistentry><term>bps</term>
		  <listitem>
		    <para>Bits per Second &mdash; the rate at which data is
		      transmitted</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>DTE</term>
		  
		  <listitem>
		    <para>Data Terminal Equipment &mdash; for example, your
		      computer</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>DCE</term>
		  
		  <listitem>
		    <para>Data Communications Equipment &mdash;  your modem</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>RS-232</term>
		  
		  <listitem>
		    <para>EIA standard for serial communications via
		      hardware</para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>If you need more information about these terms and data
	      communications in general, the author remembers reading that
	      <emphasis>The RS-232 Bible</emphasis> (anybody have an ISBN?) is
	      a good reference.</para>
	    
	    <para>When talking about communications data rates, the author
	      does not use the term <quote>baud</quote>. Baud
	      refers to the number of electrical state transitions that may be
	      made in a period of time, while <quote>bps</quote> (bits per second) is the <quote>correct</quote>
	      term to use (at least it does not seem to bother the curmudgeons
	      quite a much).</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>External vs. Internal Modems</title>
	    
	    <para>External modems seem to be more convenient for dialup,
	      because external modems often can be semi-permanently configured
	      via parameters stored in non-volatile RAM and they usually
	      provide lighted indicators that display the state of important
	      RS-232 signals. Blinking lights impress visitors, but lights are
	      also very useful to see whether a modem is operating
	      properly.</para>
	    
	    <para>Internal modems usually lack non-volatile RAM, so their
	      configuration may be limited only to setting DIP switches. If
	      your internal modem has any signal indicator lights, it is
	      probably difficult to view the lights when the system's cover is
	      in place.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Modems and Cables</title>
	    
	    <para>A background knowledge of these items is assumed</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>You know how to connect your modem to your computer
		    so that the two can communicate (unless you have an
		    internal modem, which does not need such a cable)</para>
		</listitem>
		
		<listitem>
		  <para>You are familiar with your modem's command set, or
		    know where to look up needed commands</para>
		</listitem>
		
		<listitem>
		  <para>You know how to configure your modem (probably via a
		    terminal communications program) so you can set the
		    non-volatile RAM parameters</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>The first, connecting your modem, is usually simple &mdash; most
	      straight-through serial cables work without any problems. You
	      need to have a cable with appropriate connectors (DB-25 or DB-9,
	      male or female) on each end, and the cable must be a DCE-to-DTE
	      cable with these signals wired:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>Transmitted Data (<acronym>SD</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Received Data (<acronym>RD</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Request to Send (<acronym>RTS</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Clear to Send (<acronym>CTS</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Data Set Ready (<acronym>DSR</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Data Terminal Ready (<acronym>DTR</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Carrier Detect (<acronym>CD</acronym>)</para>
		</listitem>
		
		<listitem>
		  <para>Signal Ground (<acronym>SG</acronym>)</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>FreeBSD needs the <acronym>RTS</acronym> and
	      <acronym>CTS</acronym> signals for flow-control at speeds above
	      2400bps, the <acronym>CD</acronym> signal to detect when a call
	      has been answered or the line has been hung up, and the
	      <acronym>DTR</acronym> signal to reset the modem after a session
	      is complete. Some cables are wired without all of the needed
	      signals, so if you have problems, such as a login session not
	      going away when the line hangs up, you may have a problem with
	      your cable.</para>
	    
	    <para>The second prerequisite depends on the modem(s) you use. If
	      you do not know your modem's command set by heart, you will need
	      to have the modem's reference book or user's guide handy.
	      Sample commands for USR Sportster 14,400 external modems will be
	      given, which you may be able to use as a reference for your own
	      modem's commands.</para>
	    
	    <para>Lastly, you will need to know how to setup your modem so
	      that it will work well with FreeBSD. Like other UNIX-like
	      operating systems, FreeBSD uses the hardware signals to find out
	      when a call has been answered or a line has been hung up and to
	      hangup and reset the modem after a call. FreeBSD avoids sending
	      commands to the modem or watching for status reports from the
	      modem. If you are familiar with connecting modems to PC-based
	      bulletin board systems, this may seem awkward.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Serial Interface Considerations</title>
	    
	    <para>FreeBSD supports NS8250-, NS16450-, NS16550-, and
	      NS16550A-based EIA RS-232C (CCITT V.24) communications
	      interfaces. The 8250 and 16450 devices have single-character
	      buffers. The 16550 device provides a 16-character buffer, which
	      allows for better system performance. (Bugs in plain 16550's
	      prevent the use of the 16-character buffer, so use 16550A's if
	      possible). Because single-character-buffer devices require more
	      work by the operating system than the 16-character-buffer
	      devices, 16550A-based serial interface cards are much prefered.
	      If the system has many active serial ports or will have a heavy
	      load, 16550A-based cards are better for low-error-rate
	      communications.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Quick Overview</title>
	  
	  <para>Here is the process that FreeBSD follows to accept dialup
	    logins. A <command>getty</command> process, spawned by
	    <command>init</command>, patiently waits to open the
	    assigned serial port (<filename>/dev/ttyd0</filename>, for our
	    example). The command <command>ps ax</command> might
	    show this:</para>
	  
	  
	    <informalexample>
	      <screen> 4850 ??  I      0:00.09 /usr/libexec/getty V19200 ttyd0</screen>
	    </informalexample>
	  
	  <para>When a user dials the modem's line and the modems connect, the
	    <acronym>CD</acronym> line is asserted by the modem. The kernel
	    notices that carrier has been detected and completes
	    <command>getty</command>'s open of the
	    port. <command>getty</command> sends a <prompt>login:</prompt> prompt at the specified initial line
	    speed. <command>getty</command> watches to see if
	    legitimate characters are received, and, in a typical
	    configuration, if it finds junk (probably due to the modem's
	    connection speed being different than <command>getty</command>'s speed), <command>getty</command> tries adjusting the line speeds until
	    it receives reasonable characters.</para>
	  
	  <para>We hope <command>getty</command> finds the correct
	    speed and the user sees a <prompt>login:</prompt>
	    prompt. After the user enters his/her login name, <command>getty</command> executes
	    <filename>/usr/bin/login</filename>, which completes the login by
	    asking for the user's password and then starting the user's
	    shell.</para>
	  
	  <para>Let's dive into the configuration...</para>
	  
	</sect2>
	
	<sect2>
	  <title>Kernel Configuration</title>
	  
	  <para>FreeBSD kernels typically come prepared to search for four
	    serial ports, known in the PC-DOS world as
	    <devicename>COM1:</devicename>, <devicename>COM2:</devicename>,
	    <devicename>COM3:</devicename>, and <devicename>COM4:</devicename>. FreeBSD can presently also handle
	    <quote>dumb</quote> multiport serial interface cards, such as the Boca Board
	    1008 and 2016 (please see the manual page <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> for kernel configuration information
	    if you have a multiport serial card). The default kernel only
	    looks for the standard COM ports, though.</para>
	  
	  <para>To see if your kernel recognizes any of your serial ports,
	    watch for messages while the kernel is booting, or use the
	    <command>/sbin/dmesg</command> command to replay the
	    kernel's boot messages. In particular, look for messages that
	    start with the characters <literal>sio</literal>. Hint:
	    to view just the messages that have the word <literal>sio</literal>, use the command:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>/sbin/dmesg | grep 'sio'</userinput></screen>
	    </informalexample>
	  
	  <para>For example, on a system with four serial ports, these are the
	    serial-port specific kernel boot messages:</para>
	  
	  
	    <informalexample>
	      <screen>sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
sio2 at 0x3e8-0x3ef irq 5 on isa
sio2: type 16550A
sio3 at 0x2e8-0x2ef irq 9 on isa
sio3: type 16550A</screen>
	    </informalexample>
	  
	  <para>If your kernel does not recognize all of your serial ports,
	    you will probably need to configure a custom FreeBSD kernel for
	    your system.</para>
	  
	  <para>Please see the BSD System Manager's Manual chapter on
	    <quote>Building Berkeley Kernels with Config</quote> [the source for which is
	    in <filename>/usr/src/share/doc/smm</filename>] and <quote>FreeBSD
	    Configuration Options</quote> [in <filename>/sys/conf/options</filename>
	    and in
	    <filename>/sys/<replaceable>arch</replaceable>/conf/options.<replaceable>arch</replaceable></filename>, with <emphasis>arch</emphasis> for example being <filename>i386</filename>] for more information on configuring and building kernels. You may have to unpack the kernel source distribution if have not installed the system sources already (<filename>srcdist/srcsys.??</filename> in FreeBSD 1.1, <filename>srcdist/sys.??</filename> in FreeBSD 1.1.5.1, or the entire source distribution in FreeBSD 2.0) to be able to configure and build kernels.</para>
	  
	  <para>Create a kernel configuration file for your system (if you
	    have not already) by <command>cd</command>ing to
	    <filename>/sys/i386/conf</filename>. Then, if you are creating a
	    new custom configuration file, copy the file
	    <filename>GENERICAH</filename> (or <filename>GENERICBT</filename>,
	    if you have a BusTek SCSI controller on FreeBSD 1.x) to
	    <filename>YOURSYS</filename>, where <filename>YOURSYS</filename>
	    is the name of your system, but in upper-case letters. Edit the
	    file, and change the device lines:</para>
	  
	  <programlisting>
device		sio0	at isa? port "IO_COM1" tty irq 4 vector siointr
device		sio1	at isa? port "IO_COM2" tty irq 3 vector siointr
device		sio2	at isa? port "IO_COM3" tty irq 5 vector siointr
device		sio3    at isa? port "IO_COM4" tty irq 9 vector siointr
	  </programlisting>
	  
	  <para>You can comment-out or completely remove lines for devices you
	    do not have. If you have a multiport serial board, such as the
	    Boca Board BB2016, please see the <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> man page for complete information on
	    how to write configuration lines for multiport boards. Be careful
	    if you are using a configuration file that was previously used for
	    a different version of FreeBSD because the device flags have
	    changed between versions.</para>

	  <note>
	    <para><literal>port "IO_COM1"</literal> is a
	      substitution for <literal>port 0x3f8</literal>,
	      <symbol>IO_COM2</symbol> is <literal>0x2f8</literal>,
	      <symbol>IO_COM3</symbol> is <literal>0x3e8</literal>, and
	      <symbol>IO_COM4</symbol> is <literal>0x2e8</literal>, which are
	      fairly common port addresses for their respective serial ports;
	      interrupts 4, 3, 5, and 9 are fairly common interrupt request
	      lines. Also note that regular serial ports <emphasis>cannot</emphasis> share interrupts on ISA-bus PCs
	      (multiport boards have on-board electronics that allow all the
	      16550A's on the board to share one or two interrupt request
	      lines).</para>
	  </note>
	  
	  <para>When you are finished adjusting the kernel configuration file,
	    use the program <command>config</command> as documented
	    in <quote>Building Berkeley Kernels with Config</quote> and the
	    <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> manual page to prepare a kernel
	    building directory, then build, install, and test the new
	    kernel.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Device Special Files</title>
	  
	  <para>Most devices in the kernel are accessed through <quote>device
	    special files</quote>, which are located in the
	    <filename>/dev</filename> directory. The <devicename>sio</devicename> devices are accessed through the
	    <filename>/dev/ttyd<replaceable>?</replaceable></filename> (dial-in) and
	    <filename>/dev/cua0<replaceable>?</replaceable></filename> (call-out) devices. On FreeBSD
	    version 1.1.5 and higher, there are also initialization devices
	    (<filename>/dev/ttyid<replaceable>?</replaceable></filename> and
	    <filename>/dev/cuai0<replaceable>?</replaceable></filename>) and locking devices
	    (<filename>/dev/ttyld<replaceable>?</replaceable></filename> and
	    <filename>/dev/cual0<replaceable>?</replaceable></filename>). The initialization devices are
	    used to initialize communications port parameters each time a port
	    is opened, such as <literal>crtscts</literal> for
	    modems which use <literal>CTS/RTS</literal> signaling for flow
	    control. The locking devices are used to lock flags on ports to
	    prevent users or programs changing certain parameters; see the
	    manual pages <citerefentry><refentrytitle>termios</refentrytitle><manvolnum>4</manvolnum></citerefentry>, <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry>, and <citerefentry><refentrytitle>stty</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
	    information on the terminal settings, locking &amp; initializing
	    devices, and setting terminal options, respectively.</para>
	  
	  
	  <sect3>
	    <title>Making Device Special Files</title>
	    
	    <para>A shell script called <command>MAKEDEV</command> in the
	      <filename>/dev</filename> directory manages the device special
	      files. (The manual page for <citerefentry><refentrytitle>MAKEDEV</refentrytitle><manvolnum>8</manvolnum></citerefentry> on
	      FreeBSD 1.1.5 is fairly bogus in its discussion of
	      <acronym>COM</acronym> ports, so ignore it.)  To use
	      <command>MAKEDEV</command> to make dialup device special files
	      for <devicename>COM1:</devicename> (port 0), <command>cd</command> to <filename>/dev</filename> and issue
	      the command <command>MAKEDEV ttyd0</command>.
	      Likewise, to make dialup device special files for
	      <devicename>COM2:</devicename> (port 1), use <command>MAKEDEV ttyd1</command>.</para>
	    
	    <para><command>MAKEDEV</command> not only creates the
	      <filename>/dev/ttyd<replaceable>?</replaceable></filename> device special files, but also
	      creates the <filename>/dev/cua0<replaceable>?</replaceable></filename> (and all of the
	      initializing and locking special files under FreeBSD 1.1.5 and
	      up) and removes the hardwired terminal special file
	      <filename>/dev/tty0<replaceable>?</replaceable></filename>, if it exists.</para>
	    
	    <para>After making new device special files, be sure to check the
	      permissions on the files (especially the
	      <filename>/dev/cua*</filename> files) to make sure that only
	      users who should have access to those device special files can
	      read &amp; write on them &mdash; you probably do not want to allow
	      your average user to use your modems to dialout. The default
	      permissions on the <filename>/dev/cua*</filename> files should
	      be sufficient:</para>
	    
	    <informalexample>
	      <screen>crw-rw----    1 uucp     dialer    28, 129 Feb 15 14:38 /dev/cua01
crw-rw----    1 uucp     dialer    28, 161 Feb 15 14:38 /dev/cuai01
crw-rw----    1 uucp     dialer    28, 193 Feb 15 14:38 /dev/cual01</screen>
	    </informalexample>
	    
	    <para>These permissions allow the user <username>uucp</username>
	      and users in the group <username>dialer</username> to use the call-out devices.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Configuration Files</title>
	  
	  <para>There are three system configuration files in the
	    <filename>/etc</filename> directory that you will probably need to
	    edit to allow dialup access to your FreeBSD system. The first,
	    <filename>/etc/gettytab</filename>, contains configuration
	    information for the <filename>/usr/libexec/getty</filename>
	    daemon. Second, <filename>/etc/ttys</filename> holds information
	    that tells <filename>/sbin/init</filename> what
	    <filename>tty</filename> devices should have <command>getty</command> processes running on them. Lastly,
	    you can place port initialization commands in the
	    <filename>/etc/rc.serial</filename> script if you have FreeBSD
	    1.1.5.1 or higher; otherwise, you can initialize ports in the
	    <filename>/etc/rc.local</filename> script.</para>
	  
	  <para>There are two schools of thought regarding dialup modems on
	    UNIX. One group likes to configure their modems and system so
	    that no matter at what speed a remote user dials in, the local
	    computer-to-modem RS-232 interface runs at a locked speed. The
	    benefit of this configuration is that the remote user always sees
	    a system login prompt immediately. The downside is that the system
	    does not know what a user's true data rate is, so full-screen
	    programs like Emacs will not adjust their screen-painting methods
	    to make their response better for slower connections.</para>
	  
	  <para>The other school configures their modems' RS-232 interface to
	    vary its speed based on the remote user's connection speed. For
	    example, V.32bis (14.4 Kbps) connections to the modem might make
	    the modem run its RS-232 interface at 19.2 Kbps, while 2400 bps
	    connections make the modem's RS-232 interface run at 2400 bps.
	    Because <command>getty</command> does not understand
	    any particular modem's connection speed reporting,
	    <command>getty</command> gives a <prompt>login:</prompt> message at an initial speed and
	    watches the characters that come back in response. If the user
	    sees junk, it is assumed that they know they should press the
	    <literal>&lt;Enter&gt;</literal> key until they see a
	    recognizable prompt. If the data rates do not match, <command>getty</command> sees anything the user types as
	    <quote>junk</quote>, tries going to the next speed and gives the
	    <prompt>login:</prompt> prompt again. This procedure can
	    continue ad nauseum, but normally only takes a keystroke or two
	    before the user sees a good prompt. Obviously, this login sequence
	    does not look as clean as the former <quote>locked-speed</quote> method, but
	    a user on a low-speed connection should receive better interactive
	    response from full-screen programs.</para>
	  
	  <para>The author will try to give balanced configuration
	    information, but is biased towards having the modem's data rate
	    follow the connection rate.</para>
	  
	  
	  <sect3>
	    <title><filename>/etc/gettytab</filename></title>
	    
	    <para><filename>/etc/gettytab</filename> is a <citerefentry><refentrytitle>termcap</refentrytitle><manvolnum>5</manvolnum></citerefentry>-style file of configuration
	      information for <citerefentry><refentrytitle>getty</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Please see the
	      <citerefentry><refentrytitle>gettytab</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page for
	      complete information on the format of the file and the list of
	      capabilities.</para>
	    
	    
	    <sect4>
	      <title>Locked-Speed Config</title>
	      
	      <para>If you are locking your modem's data communications rate
		at a particular speed, you probably will not need to make any
		changes to <filename>/etc/gettytab</filename>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Matching-Speed Config</title>
	      
	      <para>You will need to setup an entry in
		<filename>/etc/gettytab</filename> to give <command>getty</command> information about the speeds you
		wish to use for your modem. If you have a 2400 bps modem, you
		can probably use the existing <literal>D2400</literal> entry. This entry already exists
		in the FreeBSD 1.1.5.1 <filename>gettytab</filename>
		file, so you do not need to add it unless it is missing under
		your version of FreeBSD:</para>
	      
	      <programlisting>
#
# Fast dialup terminals, 2400/1200/300 rotary (can start either way)
#
D2400|d2400|Fast-Dial-2400:\
        :nx=D1200:tc=2400-baud:
3|D1200|Fast-Dial-1200:\
        :nx=D300:tc=1200-baud:
5|D300|Fast-Dial-300:\
        :nx=D2400:tc=300-baud:
	      </programlisting>
	      
	      <para>If you have a higher speed modem, you will probably need
		to add an entry in <filename>/etc/gettytab</filename>; here is
		an entry you could use for a 14.4 Kbps modem with a top
		interface speed of 19.2 Kbps:</para>
	      
	      <programlisting>
#
# Additions for a V.32bis Modem
#
um|V300|High Speed Modem at 300,8-bit:\
        :nx=V19200:tc=std.300:
un|V1200|High Speed Modem at 1200,8-bit:\
        :nx=V300:tc=std.1200:
uo|V2400|High Speed Modem at 2400,8-bit:\
        :nx=V1200:tc=std.2400:
up|V9600|High Speed Modem at 9600,8-bit:\
        :nx=V2400:tc=std.9600:
uq|V19200|High Speed Modem at 19200,8-bit:\
        :nx=V9600:tc=std.19200:
	      </programlisting>
	      
	      <para>On FreeBSD 1.1.5 and later, this will result in 8-bit, no
		parity connections. Under FreeBSD 1.1, add
		<literal>:np:</literal> parameters to the <literal>std.<replaceable>xxx</replaceable></literal>
		entries at the top of the file for 8 bits, no parity;
		otherwise, the default is 7 bits, even parity.</para>
	      
	      <para>The example above starts the communications rate at 19.2
		Kbps (for a V.32bis connection), then cycles through 9600 bps
		(for V.32), 2400 bps, 1200 bps, 300 bps, and back to 19.2
		Kbps. Communications rate cycling is implemented with the
		<literal>nx=</literal> (<quote>next
		  table</quote>) capability. Each of the lines uses a
		<literal>tc=</literal> (<quote>table
		  continuation</quote>) entry to pick up the rest of the
		<quote>standard</quote> settings for a particular data rate.</para>
	      
	      <para>If you have a 28.8 Kbps modem and/or you want to take
		advantage of compression on a 14.4 Kbps modem, you need to use
		a higher communications rate than 19.2 Kbps. Here is an
		example of a <filename>gettytab</filename> entry
		starting a 57.6 Kbps:</para>
	      
	      <programlisting>
#
# Additions for a V.32bis or V.34 Modem
# Starting at 57.6 Kbps
#
vm|VH300|Very High Speed Modem at 300,8-bit:\
        :nx=VH57600:tc=std.300:
vn|VH1200|Very High Speed Modem at 1200,8-bit:\
        :nx=VH300:tc=std.1200:
vo|VH2400|Very High Speed Modem at 2400,8-bit:\
        :nx=VH1200:tc=std.2400:
vp|VH9600|Very High Speed Modem at 9600,8-bit:\
        :nx=VH2400:tc=std.9600:
vq|VH57600|Very High Speed Modem at 57600,8-bit:\
        :nx=VH9600:tc=std.57600:
	      </programlisting>
	      
	      <para>If you have a slow CPU or a heavily loaded system and you
		do not have 16550A-based serial ports, you may receive sio
		<quote>silo</quote> errors at 57.6 Kbps.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="dialup-ttys">
	    <title><filename>/etc/ttys</filename></title>
	    
	    <para><filename>/etc/ttys</filename> is the list of <filename>ttys</filename> for <command>init</command> to monitor.
	      <filename>/etc/ttys</filename> also provides security
	      information to <command>login</command> (user
	      <username>root</username> may only login on ttys marked
	      <literal>secure</literal>). See the manual page for
	      <citerefentry><refentrytitle>ttys</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more
	      information.</para>
	    
	    <para>You will need to either modify existing lines in
	      <filename>/etc/ttys</filename> or add new lines to make
	      <command>init</command> run <command>getty</command> processes automatically on your new
	      dialup ports. The general format of the line will be the same,
	      whether you are using a locked-speed or matching-speed
	      configuration:</para>
	    
		<programlisting>
ttyd0   "/usr/libexec/getty xxx"   dialup on
	      </programlisting>
	    
	    <para>The first item in the above line is the device special file
	      for this entry &mdash; <literal>ttyd0</literal> means
	      <filename>/dev/ttyd0</filename> is the file that this <command>getty</command> will be watching. The second item,
	      <literal>"/usr/libexec/getty
		<replaceable>xxx</replaceable>"</literal>
	      (<replaceable>xxx</replaceable> will be replaced by the initial
	      <filename>gettytab</filename> capability) is the
	      process <command>init</command> will run on the
	      device. The third item, <literal>dialup</literal>,
	      is the default terminal type. The fourth parameter,
	      <literal>on</literal>, indicates to <command>init</command> that the line is operational. There
	      can be a fifth parameter, <literal>secure</literal>,
	      but it should only be used for terminals which are physically
	      secure (such as the system console).</para>
	    
	    <para>The default terminal type (<literal>dialup</literal> in the example above) may depend on
	      local preferences. <literal>dialup</literal> is the
	      traditional default terminal type on dialup lines so that users
	      may customize their login scripts to notice when the terminal is
	      <literal>dialup</literal> and automatically adjust
	      their terminal type. However, the author finds it easier at his
	      site to specify <literal>vt102</literal> as the
	      default terminal type, since the users just use VT102 emulation
	      on their remote systems.</para>
	    
	    <para>After you have made changes to
	      <filename>/etc/ttys</filename>, you may send the <command>init</command> process a <acronym>HUP</acronym>
	      signal to re-read the file. You can use the command
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>kill -1 1</userinput></screen>
	    </informalexample>
	    
	    to send the signal. If this is your first time setting up
	      the system, though, you may want to wait until your modem(s) are
	      properly configured and connected before signaling <command>init</command>.</para>
	    
	    
	    <sect4>
	      <title>Locked-Speed Config</title>
	      
	      <para>For a locked-speed configuration, your <filename>ttys</filename> entry needs to have a fixed-speed
		entry provided to <command>getty</command>. For a
		modem whose port speed is locked at 19.2 Kbps, the <filename>ttys</filename> entry might look like this:</para>
	      
	      <programlisting>
ttyd0   "/usr/libexec/getty std.19200"   dialup on
	      </programlisting>
	      
	      <para>If your modem is locked at a different data rate,
		substitute the appropriate name for the <literal>std.<replaceable>speed</replaceable></literal>
		entry for <literal>std.19200</literal> from
		<filename>/etc/gettytab</filename> for your modem's data
		rate.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Matching-Speed Config</title>
	      
	      <para>In a matching-speed configuration, your <filename>ttys</filename> entry needs to reference the
		appropriate beginning <quote>auto-baud</quote> (sic) entry in
		<filename>/etc/gettytab</filename>. For example, if you added
		the above suggested entry for a matching-speed modem that
		starts at 19.2 Kbps (the <filename>gettytab</filename> entry
		containing the <literal>V19200</literal> starting point), your
		<filename>ttys</filename> entry might look like this:</para>
	      
	      <programlisting>
ttyd0   "/usr/libexec/getty V19200"   dialup on
	      </programlisting>
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title><filename>/etc/rc.serial</filename> or
	      <filename>/etc/rc.local</filename></title>
	    
	    <para>High-speed modems, like V.32, V.32bis, and V.34 modems, need
	      to use hardware (<filename>RTS/CTS</filename>) flow control.
	      You can add <command>stty</command> commands to
	      <filename>/etc/rc.serial</filename> on FreeBSD 1.1.5.1 and up,
	      or <filename>/etc/rc.local</filename> on FreeBSD 1.1, to set the
	      hardware flow control flag in the FreeBSD kernel for the modem
	      ports.</para>
	    
	    <para>For example, on a sample FreeBSD 1.1.5.1 system,
	      <filename>/etc/rc.serial</filename> reads:</para>
	    
	    <programlisting>
#!/bin/sh
#
# Serial port initial configuration

stty -f /dev/ttyid1 crtscts
stty -f /dev/cuai01 crtscts
	    </programlisting>
	    	    
	    <para>This sets the <literal>termios</literal> flag
	      <literal>crtscts</literal> on serial port #1's
	      (<devicename>COM2:</devicename>) dialin and dialout
	      initialization devices.</para>
	    
	    <para>On an old FreeBSD 1.1 system, these entries were added to
	      <filename>/etc/rc.local</filename> to set the <literal>crtscts</literal> flag on the devices:</para>
	    
	    <programlisting>
# Set serial ports to use RTS/CTS flow control
stty -f /dev/ttyd0 crtscts
stty -f /dev/ttyd1 crtscts
stty -f /dev/ttyd2 crtscts
stty -f /dev/ttyd3 crtscts
	    </programlisting>
	    
	    <para>Since there is no initialization device special file on
	      FreeBSD 1.1, one has to just set the flags on the sole device
	      special file and hope the flags are not cleared by a
	      miscreant.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Modem Settings</title>
	  
	  <para>If you have a modem whose parameters may be permanently set in
	    non-volatile RAM, you will need to use a terminal program (such as
	    Telix under PC-DOS or <command>tip</command> under
	    FreeBSD) to set the parameters. Connect to the modem using the
	    same communications speed as the initial speed <command>getty</command> will use and configure the modem's
	    non-volatile RAM to match these requirements:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><acronym>CD</acronym> asserted when connected</para>
	      </listitem>
	      
	      <listitem>
		<para><acronym>DTR</acronym> asserted for operation; dropping
		  DTR hangs up line &amp; resets modem</para>
	      </listitem>
	      
	      <listitem>
		<para><acronym>CTS</acronym> transmitted data flow control</para>
	      </listitem>
	      
	      <listitem>
		<para>Disable <acronym>XON/XOFF</acronym> flow control</para>
	      </listitem>
	      
	      <listitem>
		<para><acronym>RTS</acronym> received data flow control</para>
	      </listitem>
	      
	      <listitem>
		<para>Quiet mode (no result codes)</para>
	      </listitem>
	      
	      <listitem>
		<para>No command echo</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>Please read the documentation for your modem to find out what
	    commands and/or DIP switch settings you need to give it.</para>
	  
	  <para>For example, to set the above parameters on a USRobotics
	    Sportster 14,400 external modem, one could give these commands to
	    the modem:</para>
	  

	  <programlisting>
ATZ
AT&amp;C1&amp;D2&amp;H1&amp;I0&amp;R2&amp;W
	  </programlisting>
	  
	  <para>You might also want to take this opportunity to adjust other
	    settings in the modem, such as whether it will use V.42bis and/or
	    MNP5 compression.</para>
	  
	  <para>The USR Sportster 14,400 external modem also has some DIP
	    switches that need to be set; for other modems, perhaps you can
	    use these settings as an example:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Switch 1: UP &mdash; DTR Normal</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 2: Do not care (Verbal Result Codes/Numeric
		  Result Codes)</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 3: UP &mdash; Suppress Result Codes</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 4: DOWN &mdash; No echo, offline commands</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 5: UP &mdash; Auto Answer</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 6: UP &mdash; Carrier Detect Normal</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 7: UP &mdash; Load NVRAM Defaults</para>
	      </listitem>
	      
	      <listitem>
		<para>Switch 8: Do not care (Smart Mode/Dumb Mode)</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>Result codes should be disabled/suppressed for dialup modems
	    to avoid problems that can occur if <command>getty</command>
	    mistakenly gives a <prompt>login:</prompt> prompt to a modem that is in command
	    mode and the modem echoes the command or returns a result code. I
	    have heard this sequence can result in a extended, silly
	    conversation between <command>getty</command> and the
	    modem.</para>
	  
	  
	  <sect3>
	    <title>Locked-speed Config</title>
	    
	    <para>For a locked-speed configuration, you will need to configure
	      the modem to maintain a constant modem-to-computer data rate
	      independent of the communications rate. On a USR Sportster
	      14,400 external modem, these commands will lock the
	      modem-to-computer data rate at the speed used to issue the
	      commands:</para>
	    
	    <programlisting>
ATZ
AT&amp;B1&amp;W
	    </programlisting>
	  </sect3>
	  
	  <sect3>
	    <title>Matching-speed Config</title>
	    
	    <para>For a variable-speed configuration, you will need to
	      configure your modem to adjust its serial port data rate to
	      match the incoming call rate. On a USR Sportster 14,400
	      external modem, these commands will lock the modem's
	      error-corrected data rate to the speed used to issue the
	      commands, but allow the serial port rate to vary for
	      non-error-corrected connections:</para>
	    
	    <programlisting>
ATZ
AT&amp;B2&amp;W
	    </programlisting>
	  </sect3>
	  
	  <sect3>
	    <title>Checking the Modem's Configuration</title>
	    
	    <para>Most high-speed modems provide commands to view the modem's
	      current operating parameters in a somewhat human-readable
	      fashion. On the USR Sportster 14,400 external modems, the
	      command <command>ATI5</command> displays the settings
	      that are stored in the non-volatile RAM. To see the true
	      operating parameters of the modem (as influenced by the USR's
	      DIP switch settings), use the commands <command>ATZ</command>
	      and then <command>ATI4</command>.</para>
	    
	    <para>If you have a different brand of modem, check your modem's
	      manual to see how to double-check your modem's configuration
	      parameters.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Troubleshooting</title>
	  
	  <para>Here are a few steps you can follow to check out the dialup
	    modem on your system.</para>
	  
	  
	  <sect3>
	    <title>Checking out the FreeBSD system</title>
	    
	    <para>Hook up your modem to your FreeBSD system, boot the system,
	      and, if your modem has status indication lights, watch to see
	      whether the modem's <acronym>DTR</acronym> indicator lights when
	      the <prompt>login:</prompt> prompt appears on the
	      system's console &mdash; if it lights up, that should mean that
	      FreeBSD has started a <command>getty</command>
	      process on the appropriate communications port and is waiting
	      for the modem to accept a call.</para>
	    
	    <para>If the <acronym>DTR</acronym> indicator doesn't light, login
	      to the FreeBSD system through the console and issue a <command>ps ax</command> to see if FreeBSD is trying to run a
	      <command>getty</command> process on the correct port.
	      You should see a lines like this among the processes
	      displayed:</para>
	    
	    <informalexample>
	      <screen>  114 ??  I      0:00.10 /usr/libexec/getty V19200 ttyd0
  115 ??  I      0:00.10 /usr/libexec/getty V19200 ttyd1</screen>
	    </informalexample>
	    
	    <para>If you see something different, like this:
	    
	    <informalexample>
	      <screen>  114 d0  I      0:00.10 /usr/libexec/getty V19200 ttyd0</screen>
	    </informalexample>
	    
	    and the modem has not accepted a call yet, this means that
	      <command>getty</command> has completed its open on
	      the communications port. This could indicate a problem with the
	      cabling or a mis-configured modem, because <command>getty</command> should not be able to open the
	      communications port until <acronym>CD</acronym> (carrier detect)
	      has been asserted by the modem.</para>
	    
	    <para>If you do not see any <command>getty</command>
	      processes waiting to open the desired <filename>ttyd<replaceable>?</replaceable></filename>
	      port, double-check your entries in
	      <filename>/etc/ttys</filename> to see if there are any mistakes
	      there. Also, check the log file
	      <filename>/var/log/messages</filename> to see if there are any
	      log messages from <command>init</command> or
	      <command>getty</command> regarding any problems. If
	      there are any messages, triple-check the configuration files
	      <filename>/etc/ttys</filename> and
	      <filename>/etc/gettytab</filename>, as well as the appropriate
	      device special files <filename>/dev/ttyd?</filename>, for any
	      mistakes, missing entries, or missing device special
	      files.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Try Dialing In</title>
	    
	    <para>Try dialing into the system; be sure to use 8 bits, no
	      parity, 1 stop bit on the remote system. If you do not get a
	      prompt right away, or get garbage, try pressing <literal>&lt;Enter&gt;</literal> about once per second. If
	      you still do not see a <prompt>login:</prompt>
	      prompt after a while, try sending a <command>BREAK</command>.
	      If you are using a high-speed modem to do the dialing, try
	      dialing again after locking the dialing modem's interface speed
	      (via <command>AT&amp;B1</command> on a USR Sportster,
	      for example).</para>
	    
	    <para>If you still cannot get a <prompt>login:</prompt> prompt, check
	      <filename>/etc/gettytab</filename> again and double-check
	      that</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>The initial capability name specified in
		    <filename>/etc/ttys</filename> for the line matches a name
		    of a capability in <filename>/etc/gettytab</filename></para>
		</listitem>
		
		<listitem>
		  <para>Each <literal>nx=</literal> entry matches another
		    <filename>gettytab</filename> capability name</para>
		</listitem>
		
		<listitem>
		  <para>Each <literal>tc=</literal> entry matches another
		    <filename>gettytab</filename> capability name</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>If you dial but the modem on the FreeBSD system will not
	      answer, make sure that the modem is configured to answer the
	      phone when <acronym>DTR</acronym> is asserted. If the modem
	      seems to be configured correctly, verify that the
	      <acronym>DTR</acronym> line is asserted by checking the modem's
	      indicator lights (if it has any).</para>
	    
	    <para>If you have gone over everything several times and it still
	      does not work, take a break and come back to it later. If it
	      still does not work, perhaps you can send an electronic mail
	      message to the &a.questions;describing your modem and your
	      problem, and the good folks on the list will try to help.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Acknowledgments</title>
	  
	  <para>Thanks to these people for comments and advice:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>&a.kelly;</term>
		<listitem>
		  <para>for a number of good suggestions</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="dialout">
	<title>Dialout Service</title>
	
	<para><emphasis>Information integrated from FAQ.</emphasis></para>
	
	<para>The following are tips to getting your host to be able to
	  connect over the modem to another computer. This is appropriate for
	  establishing a terminal session with a remote host.</para>
	
	<para>This is useful to log onto a BBS.</para>
	
	<para>This kind of connection can be extremely helpful to get a file
	  on the Internet if you have problems with PPP. If you need to ftp
	  something and PPP is broken, use the terminal session to ftp it.
	  Then use zmodem to transfer it to your machine.</para>
	
	
	<sect2>
	  <title>Why cannot I run <command>tip</command> or
	    <command>cu</command>?</title>
	  
	  <para>On your system, the programs <command>tip</command>
	    and <command>cu</command> are probably executable only
	    by <username>uucp</username> and group
	    <username>dialer</username>. You can use the group <username>dialer</username> to control who has access to your
	    modem or remote systems. Just add yourself to group
	    dialer.</para>
	  
	  <para>Alternatively, you can let everyone on your system run
	    <command>tip</command> and <command>cu</command> by typing:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>chmod 4511 /usr/bin/tip</userinput></screen>
	    </informalexample>

	  <para>You do not have to run
	    this command for <command>cu</command>, since <command>cu</command> is just a hard link to <command>tip</command>.</para>
	  
	</sect2>
	
	<sect2>
	  <title>My stock Hayes modem is not supported, what can I do?</title>
	  
	  <para>Actually, the man page for <command>tip</command>
	    is out of date. There is a generic Hayes dialer already built in.
	    Just use <literal>at=hayes</literal> in your
	    <filename>/etc/remote</filename> file.</para>
	  
	  <para>The Hayes driver is not smart enough to recognize some of the
	    advanced features of newer modems&mdash;messages like
	    <literal>BUSY</literal>, <literal>NO
	      DIALTONE</literal>, or <literal>CONNECT
	      115200</literal> will just confuse it. You should turn those
	    messages off when you use <command>tip</command> (using
	    <command>ATX0&amp;W</command>).</para>
	  
	  <para>Also, the dial timeout for <command>tip</command>
	    is 60 seconds. Your modem should use something less, or else tip
	    will think there is a communication problem. Try
	    <command>ATS7=45&amp;W</command>.</para>
	  
	  <para>Actually, as shipped <command>tip</command> does
	    not yet support it fully. The solution is to edit the file
	    <filename>tipconf.h</filename> in the directory
	    <filename>/usr/src/usr.bin/tip/tip</filename> Obviously you need
	    the source distribution to do this.</para>
	  
	  <para>Edit the line <literal>#define HAYES
	      0</literal> to <literal>#define HAYES
	      1</literal>. Then <command>make</command> and
	    <command>make install</command>. Everything works
	    nicely after that.</para>
	  
	</sect2>
	
	<sect2 id="direct-at">
	  <title>How am I expected to enter these AT commands?</title>
	  
	  <para>Make what is called a <quote>direct</quote>
	    entry in your <filename>/etc/remote</filename> file. For example,
	    if your modem is hooked up to the first serial port,
	    <filename>/dev/cuaa0</filename>, then put in the following line:</para>

	    <programlisting>
cuaa0:dv=/dev/cuaa0:br#19200:pa=none
	    </programlisting>

	  <para>Use the highest bps rate your modem supports in
	    the br capability. Then, type <command>tip
	      cuaa0</command> and you will be connected to your
	    modem.</para>
	  
	  <para>If there is no <filename>/dev/cuaa0</filename> on your system,
	    do this:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>MAKEDEV cuaa0</userinput></screen>
	    </informalexample>
	  
	  <para>Or use cu as root with the following command:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cu -l<replaceable>line</replaceable> -s<replaceable>speed</replaceable></userinput></screen>
	    </informalexample>

	  <para><replaceable>line</replaceable> is the
	    serial port (e.g.<filename>/dev/cuaa0</filename>) and <replaceable>speed</replaceable> is
	    the speed (e.g.<literal>57600</literal>). When you are
	    done entering the AT commands hit <command>~.</command>
	    to exit.</para>
	  
	</sect2>
	
	<sect2>
	  <title>The <literal>@</literal> sign for the pn capability does not
	    work!</title>
	  
	  <para>The <literal>@</literal> sign in the phone number capability tells
	    tip to look in <filename>/etc/phones</filename> for a phone
	    number. But the <literal>@</literal> sign is also a special character
	    in capability files like <filename>/etc/remote</filename>. Escape
	    it with a backslash:</para>

	    <programlisting>
pn=\@
	    </programlisting>
	  
	</sect2>
	
	<sect2>
	  <title>How can I dial a phone number on the command line?</title>
	  
	  <para>Put what is called a <quote>generic</quote>
	    entry in your <filename>/etc/remote</filename> file. For example:</para>

	    <programlisting>
tip115200|Dial any phone number at 115200 bps:\
        :dv=/dev/cuaa0:br#115200:at=hayes:pa=none:du:
tip57600|Dial any phone number at 57600 bps:\
        :dv=/dev/cuaa0:br#57600:at=hayes:pa=none:du:
	    </programlisting>
	  
	  <para>Then you can things like:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>tip -115200 5551234</userinput></screen>
	    </informalexample>

	  <para>If you prefer <command>cu</command> over <command>tip</command>,
	    use a generic cu entry:

	    <programlisting>
cu115200|Use cu to dial any number at 115200bps:\
        :dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du:
	    </programlisting>
	    and type:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cu 5551234 -s 115200</userinput></screen>
	    </informalexample>
	</sect2>
	
	<sect2>
	  <title>Do I have to type in the bps rate every time I do
	    that?</title>
	  
	  <para>Put in an entry for <literal>tip1200</literal> or
	    <literal>cu1200</literal>, but go ahead and use
	    whatever bps rate is appropriate with the br capability. <command>tip</command> thinks a good default is 1200 bps which
	    is why it looks for a <literal>tip1200</literal>
	    entry. You do not have to use 1200 bps, though.</para>
	  
	</sect2>
	
	<sect2>
	  <title>I access a number of hosts through a terminal server.</title>
	  
	  <para>Rather than waiting until you are connected and typing
	    <command>CONNECT &lt;host&gt;</command> each time,
	    use tip's <literal>cm</literal> capability. For
	    example, these entries in <filename>/etc/remote</filename>:

	    <programlisting>
pain|pain.deep13.com|Forrester's machine:\
        :cm=CONNECT pain\n:tc=deep13:
muffin|muffin.deep13.com|Frank's machine:\
        :cm=CONNECT muffin\n:tc=deep13:
deep13:Gizmonics Institute terminal server:\
        :dv=/dev/cua02:br#38400:at=hayes:du:pa=none:pn=5551234:
	    </programlisting>
	  
	  will let you type <command>tip pain</command>
	    or <command>tip muffin</command> to connect to the
	    hosts pain or muffin; and <command>tip
	      deep13</command> to get to the terminal server.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Can tip try more than one line for each site?</title>
	  
	  <para>This is often a problem where a university has several modem
	    lines and several thousand students trying to use them...</para>
	  
	  <para>Make an entry for your university in
	    <filename>/etc/remote</filename> and use <literal>@</literal> for the
	    <literal>pn</literal> capability:</para>

	    <programlisting>
big-university:\
        :pn=\@:tc=dialout
dialout:\
        :dv=/dev/cuaa3:br#9600:at=courier:du:pa=none:
	    </programlisting>
	  
	  <para>Then, list the phone numbers for the university in
	    <filename>/etc/phones</filename>:</para>

	    <programlisting>
big-university 5551111
big-university 5551112
big-university 5551113
big-university 5551114
	    </programlisting>
	  
	  <para><command>tip</command> will try each one in the
	    listed order, then give up. If you want to keep retrying, run
	    <command>tip</command> in a while loop.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Why do I have to hit CTRL+P twice to send CTRL+P
	    once?</title>
	  
	  <para>CTRL+P is the default <quote>force</quote> character, used to tell
	    <command>tip</command> that the next character is
	    literal data. You can set the force character to any other
	    character with the <command>~s</command> escape, which
	    means <quote>set a variable.</quote></para>
	  
	  <para>Type <command>~sforce=<replaceable>single-char</replaceable></command>
	    followed by a newline. <replaceable>single-char</replaceable> is any single character.
	    If you leave out <replaceable>single-char</replaceable>, then the force
	    character is the nul character, which you can get by typing CTRL+2
	    or CTRL+SPACE. A pretty good value for <replaceable>single-char</replaceable> is SHIFT+CTRL+6, which I
	    have seen only used on some terminal servers.</para>
	  
	  <para>You can have the force character be whatever you want by
	    specifying the following in your
	    <filename>&#36;HOME/.tiprc</filename> file:</para>

	    <programlisting>
force=&lt;single-char&gt;
	    </programlisting>
	  
	</sect2>
	
	<sect2>
	  <title>Suddenly everything I type is in UPPER CASE??</title>
	  
	  <para>You must have pressed CTRL+A, <command>tip</command>'s <quote>raise character,</quote> specially
	    designed for people with broken caps-lock keys. Use <command>~s</command> as above and set the variable
	    <literal>raisechar</literal> to something reasonable. In fact, you can set it to
	    the same as the force character, if you never expect to use either
	    of these features.</para>
	  
	  <para>Here is a sample .tiprc file perfect for Emacs users who need
	    to type CTRL+2 and CTRL+A a lot:</para>

	    <programlisting>
force=^^
raisechar=^^
	    </programlisting>

	    <para>The ^^ is SHIFT+CTRL+6.</para>
	  
	</sect2>
	
	<sect2>
	  <title>How can I do file transfers with <command>tip</command>?</title>
	  
	  <para>If you are talking to another UNIX system, you can send and
	    receive files with <command>~p</command> (put) and
	    <command>~t</command> (take). These commands run
	    <command>cat</command> and <command>echo</command> on the remote system to accept and
	    send files. The syntax is:</para>

	    <cmdsynopsis>
	      <command>~p</command>
	      <arg choice="plain">local-file</arg>
	      <arg choice="opt">remote-file</arg>
	    </cmdsynopsis>

	    <cmdsynopsis>
	      <command>~t</command>
	      <arg choice="plain">remote-file</arg>
	      <arg choice="opt">local-file</arg>
	    </cmdsynopsis>
	  
	  <para>There is no error checking, so you probably should use another
	    protocol, like zmodem.</para>
	  
	</sect2>
	
	<sect2>
	  <title>How can I run zmodem with <command>tip</command>?</title>
	  
	  <para>To receive files, start the sending program on the remote end.
	    Then, type <command>~C rz</command> to begin
	    receiving them locally.</para>
	  
	  <para>To send files, start the receiving program on the remote end.
	    Then, type <command>~C sz <replaceable>files</replaceable></command>
	    to send them to the remote system.</para>
	  
	</sect2>
      </sect1>
    </chapter>
    
    <chapter>
      <title>PPP and SLIP</title>
      
      <para>If your connection to the Internet is through a modem, or you wish
	to provide other people with dialup connections to the Internet using
	FreeBSD, you have the option of using PPP or SLIP. Furthermore, two
	varieties of PPP are provided: <emphasis>user</emphasis> (sometimes
	referred to as <emphasis>iijppp</emphasis>) and <emphasis>kernel</emphasis>. The
	procedures for configuring both types of PPP, and for setting up SLIP
	are described in this chapter.</para>
      
      
      <sect1 id="userppp">
	<title>Setting up User PPP</title>
	
	<para>User PPP was introduced to FreeBSD in release 2.0.5 as an
	  addition to the existing kernel implementation of PPP. So, what is
	  different about this new PPP that warrants its addition? To quote
	  from the manual page:</para>
	
	
	  <blockquote>
	    <para>This is a user process PPP software package. Normally, PPP
	    is implemented as a part of the kernel (e.g. as managed by <command>pppd</command>)
	      and it is thus somewhat hard to debug and/or modify its
	      behavior. However, in this implementation PPP is done as a user
	      process with the help of the tunnel device driver (tun).</para>
	  </blockquote>
	
	
	<para>In essence, this means that rather than running a PPP daemon,
	  the ppp program can be run as and when desired. No PPP interface
	  needs to be compiled into the kernel, as the program can use the
	  generic tunnel device to get data into and out of the kernel.</para>
	
	<para>From here on out, user ppp will be referred to simply as ppp
	  unless a distinction needs to be made between it and any other PPP
	  client/server software such as <command>pppd</command>. Unless otherwise stated, all
	  commands in this section should be executed as root.</para>
	
	
	<sect2>
	  <title>Before you start</title>
	  
	  <para>This document assumes you are in roughly this position:</para>
	  
	  <para>You have an account with an Internet Service Provider (ISP)
	    which lets you use PPP. Further, you have a modem (or other
	    device) connected and configured correctly which allows you to
	    connect to your ISP.</para>
	  
	  <para>You are going to need the following information to
	    hand:</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Your ISPs phone number(s).</para>
	      </listitem>
	      
	      <listitem>
		<para>Your login name and password. This can be either a
		  regular unix style login/password pair, or a PPP PAP or CHAP
		  login/password pair.</para>
	      </listitem>
	      
	      <listitem>
		<para>The IP address of your ISP's gateway. The gateway is
		  the machine to which you will connect and will be set up as
		  your <quote>default route</quote>. If your
		  ISP hasn't given you this number, don't worry. We can make
		  one up and your ISP's PPP server will tell us when we
		  connect.</para>
		
		<para>This number is known from now on as
		  <literal>HISADDR</literal>.</para>
	      </listitem>
	      
	      <listitem>
		<para>Your ISP's netmask setting. Again, if your ISP hasn't
		  given you this information, you can safely use a netmask of
		<hostid role="netmask">255.255.255.0</hostid>.</para>
	      </listitem>
	      
	      <listitem>
		<para>The IP addresses of one or more nameservers. Normally,
		  you will be given two IP numbers. You
		  <emphasis>must</emphasis> have this information unless you run
		  your own nameserver.</para>
	      </listitem>
	      
	      <listitem>
		<para>If your ISP allocates you a static IP address and
		  hostname then you will need this information too. If not,
		  you will need to know from what range of IP addresses your
		  allocated IP address will belong. If you haven't been given
		  this range, don't worry. You can configure <command>ppp</command> to accept any
		  IP number (as explained later).</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>If you do not have any of the required information, contact
	    your ISP and make sure they provide it to you.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Building a ppp ready kernel</title>
	  
	  <para>As the description states, <command>ppp</command> uses the kernel <devicename>tun</devicename>
	    device. It is necessary to make sure that your kernel has support
	    for this device compiled in.</para>
	  
	  <para>To check this, go to your kernel compile directory
	    (<filename>/sys/i386/conf</filename> or
	    <filename>/sys/pc98/conf</filename>) and examine your kernel
	    configuration file. It needs to have the line
	  
	  <programlisting>
pseudo-device tun 1
	  </programlisting>
	  
	  in it somewhere. The stock <filename>GENERIC</filename> kernel
	    has this as standard, so if you have not installed a custom kernel
	    or you do not have a <filename>/sys</filename> directory, you do not have to change
	    anything.</para>
	  
	  <para>If your kernel configuration file does not have this line in
	    it, or you need to configure more than one tun device (for
	    example, if you are setting up a server and could have 16 dialup
	    ppp connections at any one time then you will need to use <literal>16</literal>
	    instead of <literal>1</literal>), then you should add the line, re-compile,
	    re-install and boot the new kernel. Please refer to the 
	    <xref linkend="kernelconfig" remap="Configuring the FreeBSD
	      Kernel"> section for more information on kernel
	    configuration.</para>
	  
	  <para>You can check how many tunnel devices your current kernel has
	    by typing the following:</para>
	  
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ifconfig -a</userinput>
tun0: flags=8051&lt;UP,POINTOPOINT,RUNNING,MULTICAST&gt; mtu 1500
        inet 200.10.100.1 --&gt; 203.10.100.24 netmask 0xffffffff
tun1: flags=8050&lt;POINTOPOINT,RUNNING,MULTICAST&gt; mtu 576
tun2: flags=8051&lt;UP,POINTOPOINT,RUNNING,MULTICAST&gt; mtu 1500
        inet 203.10.100.1 --&gt; 203.10.100.20 netmask 0xffffffff
tun3: flags=8050&lt;POINTOPOINT,RUNNING,MULTICAST&gt; mtu 1500</screen>
	    </informalexample>
	  
	  <para>This case shows four tunnel devices, two of which are
	    currently configured and being used.</para>
	  
	  <para>If you have a kernel without the tun device, and you can not
	    rebuild it for some reason, all is not lost. You should be able
	    to dynamically load the code. Refer to the appropriate <citerefentry><refentrytitle>modload</refentrytitle><manvolnum>8</manvolnum></citerefentry>
	    and <citerefentry><refentrytitle>lkm</refentrytitle><manvolnum>4</manvolnum></citerefentry> pages for further details.</para>
	  
	  <para>You may also wish to take this opportunity to configure a
	    firewall. Details can be found in the <xref linkend="firewalls"
	      remap="Firewalls"> section.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Check the tun device</title>
	  
	  <para>Most users will only require one <devicename>tun</devicename> device (<filename>/dev/tun0</filename>). If you
	    have used more (i.e., a number other than <literal>1</literal> in the <literal>pseudo-device</literal>
	    line in the kernel configuration file) then alter all references
	    to <devicename>tun0</devicename> below to reflect whichever device number you are
	    using.</para>
	  
	  <para>The easiest way to make sure that the <devicename>tun0</devicename> device is
	    configured correctly is to re-make it. To do this, execute the
	    following commands:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>./MAKEDEV tun0</userinput></screen>
	    </informalexample>
	  
	  <para>If you require 16 tunnel devices in your kernel, you will need
	    to create more than just tun0:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>./MAKEDEV tun15</userinput></screen>
	    </informalexample>
	  
	  <para>Also, to confirm that the kernel is configured correctly, the
	    following command should give the indicated output:</para>
	  
	  
	    <informalexample>
	      <screen>&prompt.root; <userinput>ifconfig tun0</userinput>
tun0: flags=8050&lt;POINTOPOINT,RUNNING,MULTICAST&gt; mtu 1500</screen>
	    </informalexample>
	  
	</sect2>
	
	<sect2>
	  <title>Name Resolution Configuration</title>
	  
	  <para>The resolver is the part of the system that turns IP addresses
	    into hostnames and vice versa. It can be configured to look for
	    maps that describe IP to hostname mappings in one of two places.
	    The first is a file called <filename>/etc/hosts</filename>
	    (<command>man 5 hosts</command>). The second is the
	    Internet Domain Name Service (DNS), a distributed data base, the
	    discussion of which is beyond the scope of this document.</para>
	  
	  <para>This section describes briefly how to configure your
	    resolver.</para>
	  
	  <para>The resolver is a set of system calls that do the name
	    mappings, but you have to tell them where to find their
	    information. You do this by first editing the file
	    <filename>/etc/host.conf</filename>. Do <emphasis>not</emphasis> call this file
	    <filename>/etc/hosts.conf</filename> (note the extra <literal>s</literal>) as the
	    results can be confusing.</para>
	  
	  
	  <sect3>
	    <title>Edit the <filename>/etc/host.conf</filename> file</title>
	    
	    <para>This file should contain the following two lines:</para>
	    
	    <programlisting>
hosts
bind
	    </programlisting>
	    
	    <para>These instructs the resolver to first look in
	      the file <filename>/etc/hosts</filename>, and then to consult
	      the DNS if the name was not found.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Edit the <filename>/etc/hosts</filename>(5) file</title>
	    
	    <para>This file should contain the IP addresses and names of
	      machines on your network. At a bare minimum it should contain
	      entries for the machine which will be running ppp. Assuming that
	      your machine is called <hostid role="fqdn">foo.bar.com</hostid>
	      with the IP address <hostid role="ipaddr">10.0.0.1</hostid>,
	      <filename>/etc/hosts</filename> should contain:</para>
	    
	    <programlisting>
127.0.0.1    localhost
10.0.0.1     foo.bar.com		  foo
	    </programlisting>
	    
	    <para>The first line defines the alias <hostid>localhost</hostid> as a synonym
	      for the current machine. Regardless of your own IP address, the
	      IP address for this line should always be <hostid role="ipaddr">127.0.0.1</hostid>. The second
	      line maps the name <hostid role="fqdn">foo.bar.com</hostid> (and the shorthand <hostid>foo</hostid>)
	      to the IP address <hostid role="ipaddr">10.0.0.1</hostid>.</para>
	    
	    <para>If your provider allocates you a static IP address and name,
	      then use these in place of the <hostid role="ipaddr">10.0.0.1</hostid> entry.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Edit the <filename>/etc/resolv.conf</filename> file</title>
	    
	    <para><filename>/etc/resolv.conf</filename> tells the resolver how
	      to behave. If you are running your own DNS, you may leave this
	      file empty. Normally, you will need to enter the following
	      line(s):</para>
	    
	    <programlisting>
nameserver <replaceable>x.x.x.x</replaceable>
nameserver <replaceable>y.y.y.y</replaceable>
domain <replaceable>bar.com</replaceable>
	    </programlisting>
	    
	    <para>The <hostid
		role="ipaddr"><replaceable>x.x.x.x</replaceable></hostid> and
	      <hostid role="ipaddr"><replaceable>y.y.y.y</replaceable></hostid> addresses are those given to you
	      by your ISP. Add as many <literal>nameserver</literal> lines as your ISP
	      provides. The <literal>domain</literal> line defaults to your hostname's
	      domain, and is probably unnecessary. Refer to the <filename>resolv.conf</filename>
	      manual page for details of other possible entries in this
	      file.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title><command>ppp</command> Configuration</title>
	  
	  <para>Both user ppp and <command>pppd</command> (the kernel level implementation of
	    PPP) use configuration files located in the
	    <filename>/etc/ppp</filename> directory. The sample configuration
	    files provided are a good reference for user ppp, so don't delete
	    them.</para>
	  
	  <para>Configuring <command>ppp</command> requires that you edit a number of files,
	    depending on your requirements. What you put in them depends to
	    some extent on whether your ISP allocates IP addresses statically
	    (i.e., you get given one IP address, and always use that one) or
	    dynamically (i.e., your IP address can be different for each PPP
	    session).</para>
	  
	  
	  <sect3 id="userppp-staticIP">
	    <title>PPP and Static IP addresses</title>
	    
	    <para>You will need to create a configuration file called
	      <filename>/etc/ppp/ppp.conf</filename>. It should look similar
	      to the example below.</para>

	    <note>
	      <para>Lines that end in a <literal>:</literal> start in the first column, all
		other lines should be indented as shown using spaces or
		tabs.</para>
	    </note>
	    
	    
	      <programlisting>
1     default:
2       set device /dev/cuaa0
3       set speed 115200
4       set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-AT-OK \\dATDT\\TTIMEOUT 40 CONNECT"
5     provider:
6       set phone "(0123) 456 7890"
7       set login "TIMEOUT 10 gin:-BREAK-gin: foo word: bar col: ppp"
8       set timeout 300
9       deny lqr
10      set ifaddr <replaceable>x.x.x.x</replaceable> <replaceable>y.y.y.y</replaceable>
11      delete ALL
12      add 0 0 HISADDR
	      </programlisting>

	    <para>Do not include the line numbers, they are
	      just for reference in this discussion.</para>
	    
	    
	      <variablelist>
		<varlistentry><term>Line 1:</term>
		  <listitem>
		    <para>Identifies the default entry. Commands in this
		      entry are executed automatically when ppp is run.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 2:</term>
		  
		  <listitem>
		    <para>Identifies the device to which the modem is
		      connected. <devicename>COM1:</devicename> is <filename>/dev/cuaa0</filename> and
		      <devicename>COM2:</devicename> is <filename>/dev/cuaa1</filename>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 3:</term>
		  
		  <listitem>
		    <para>Sets the speed you want to connect at. If 115200
		      doesn't work (it should with any reasonably new modem),
		      try 38400 instead.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 4:</term>
		  
		  <listitem>
		    <para>The dial string. User PPP uses an expect-send
		      syntax similar to the <citerefentry><refentrytitle>chat</refentrytitle><manvolnum>8</manvolnum></citerefentry>
		      program. Refer to the manual page for information on
		      the features of this language.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 5:</term>
		  
		  <listitem>
		    <para>Identifies an entry for a provider called
		      <quote>provider</quote>.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 6:</term>
		  
		  <listitem>
		    <para>Sets the phone number for this provider. Multiple
		      phone numbers may be specified using the
		      <literal>:</literal> or <literal>|</literal>
		      character as a separator. The difference between these
		      spearators is described in the ppp manual page. To
		      summarize, if you want to rotate through the numbers,
		      use the <literal>:</literal>. If you want to always attempt to dial
		      the first number first and only use the other numbers if
		      the first number fails, use the <literal>|</literal>. Always quote the
		      entire set of phone numbers as shown.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 7:</term>
		  
		  <listitem>
		    <para>The login string is of the same chat-like syntax as
		      the dial string. In this example, the string works for
		      a service whose login session looks like this:</para>
		    
		    
		    <informalexample>
		      <screen>J. Random Provider
login: <replaceable>foo</replaceable>
password: <replaceable>bar</replaceable>
protocol: ppp</screen>
		    </informalexample>
		    
		    <para>You will need to alter this script to suit your own
		      needs. If you're using PAP or CHAP, there will be no
		      login at this point, so your login string can be left
		      blank. See
		      <xref linkend="userppp-PAPnCHAP" remap="PAP and CHAP
			authentication"> for further details.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 8:</term>
		  
		  <listitem>
		    <para>Sets the default timeout (in seconds) for the
		      connection. Here, the connection will be closed
		      automatically after 300 seconds of inactivity. If you
		      never want to timeout, set this value to zero.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 9:</term>
		  
		  <listitem>
		    <para><command>ppp</command> can be configured to exchange Link Quality
		      Report (LQR) packets. These packets describe how good
		      the physical link is. <command>ppp</command>'s LQR strategy is to close
		      the connection when a number of these packets are
		      missed. This is useful when you have a direct serial
		      link to another machine and the DSR modem signal is not
		      available to indicate that the line is up. When data
		      saturates the line, LQR packets are sometimes
		      <quote>missed</quote>, causing <command>ppp</command> to close the connection
		      prematurely. Refusing to negotiate lqr is sometimes
		      prudent (if you are going through a modem) as it avoids
		      this whole mess. By default, <command>ppp</command> will not attempt to
		      negotiate LQR, but will accept LQR negotiation from the
		      peer.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 10:</term>
		  
		  <listitem>
		    <para>Sets the interface addresses. The string <replaceable>x.x.x.x</replaceable>
		      should be replaced by the IP address that your provider
		      has allocated to you. The string <replaceable>y.y.y.y</replaceable> should be
		      replaced by the IP address that your ISP indicated for
		      their gateway (the machine to which you connect). If
		      your ISP hasn't given you a gateway address, use
		      <hostid role="netmask">10.0.0.2/0</hostid>. If you need
		      to use a <quote>guessed</quote> address, make sure that you create
		      an entry in <filename>/etc/ppp/ppp.linkup</filename> as
		      per the instructions for
		      <xref linkend="userppp-dynamicIP" remap="PPP and Dynamic
			IP addresses">. If this line is omitted, <command>ppp</command> cannot
		      run in <option>-auto</option> or
		      <option>-dynamic</option> mode.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 11:</term>
		  
		  <listitem>
		    <para>Deletes all existing routing table entries for the
		      acquired tun device. This should not normally be
		      necessary, but will make sure that <command>ppp</command> is starting with
		      a clean bill of health.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 12:</term>
		  
		  <listitem>
		    <para>Adds a default route to your ISPs gateway. The
		      special word <literal>HISADDR</literal> is replaced with
		      the gateway address specified on line 9. It is
		      important that this line appears after line 9, otherwise
		      <literal>HISADDR</literal> will not yet be
		      initialized.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    <para>It is not necessary to add an entry to
	      <filename>ppp.linkup</filename> when you have a static IP
	      address as your routing table entries are already correct before
	      you connect. You may however wish to create an entry to invoke
	      programs after connection. This is explained later with the
	      sendmail example.</para>
	    
	    <para>Example configuration files can be found in the
	      <filename>/etc/ppp</filename> directory.</para>
	    
	  </sect3>
	  
	  <sect3 id="userppp-dynamicIP">
	    <title>PPP and Dynamic IP addresses</title>
	    
	    <para>If your service provider does not assign static IP numbers,
	      <command>ppp</command> can be configured to negotiate
	      the local and remote addresses. This is done by <quote>guessing</quote> an
	      IP number and allowing <command>ppp</command> to set it up correctly using the IP
	      Configuration Protocol (IPCP) after connecting. The
	      <filename>ppp.conf</filename> configuration is the same as <xref
		linkend="userppp-staticIP" remap="PPP and
		Static IP addresses">, with the following change:</para>
	    
	    <programlisting>
10      set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0
	    </programlisting>
	    
	    <para>Again, do not include the line numbers, they are just for
	      reference in this discussion. Indentation of at least one space
	      is required.</para>
	    
	    
	      <variablelist>
		<varlistentry><term>Line 10:</term>
		  <listitem>
		    <para>The number after the <literal>/</literal> character is the number
		      of bits of the address that ppp will insist on. You may
		      wish to use IP numbers more appropriate to your
		      circumstances, but the above example will almost always
		      work. If it fails, you may be able to defeat some
		      broken ppp implementations by supplying an additional
		      <literal>0.0.0.0</literal> argument:</para>
		    
		    <programlisting>
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
		    </programlisting>
		    
		    <para>This tells ppp to negotiate using address <hostid
			role="ipaddr">0.0.0.0</hostid> rather than <hostid
			role="ipaddr">10.0.0.1</hostid>. Do not use <hostid
			role="netmask">0.0.0.0/0</hostid> as the first argument
		      to <command>set ifaddr</command> as it
		      prevents <command>ppp</command> from setting up an initial route in
		      <option>-auto</option> and <option>-ddial</option>
		      mode.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>You will also need to create an entry in
	      <filename>/etc/ppp/ppp.linkup</filename>.
	      <filename>ppp.linkup</filename> is used after a connection has
	      been established. At this point, <command>ppp</command> will know what IP
	      addresses should <emphasis>really</emphasis> be used.
	      The following entry will delete the existing bogus routes, and
	      create correct ones:</para>
	    
	    <programlisting>
1     provider:
2       delete ALL
3       add 0 0 HISADDR
	    </programlisting>
	    
	    
	      <variablelist>
		<varlistentry><term>Line 1:</term>
		  <listitem>
		    <para>On establishing a connection, <command>ppp</command> will look for an
		      entry in <filename>ppp.linkup</filename> according to
		      the following rules: First, try to match the same label
		      as we used in <filename>ppp.conf</filename>. If that
		      fails, look for an entry for the IP number of our
		      gateway. This entry is a four-octet IP style label. If
		      we still haven't found an entry, look for the
		      <literal>MYADDR</literal> entry.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 2:</term>
		  
		  <listitem>
		    <para>This line tells <command>ppp</command> to delete all existing routes
		      for the acquired tun interface (except the direct route
		      entry).</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 3:</term>
		  
		  <listitem>
		    <para>This line tells <command>ppp</command> to add a default route that
		      points to <literal>HISADDR</literal>.
		      <literal>HISADDR</literal> will be replaced with the IP
		      number of the gateway as negotiated in the IPCP.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	    <para>See the pmdemand entry in the files
	      <filename>/etc/ppp/ppp.conf.sample</filename> and
	      <filename>/etc/ppp/ppp.linkup.sample</filename> for a detailed
	      example.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Receiving incoming calls with <command>ppp</command></title>
	    
	    <para>This section describes setting up <command>ppp</command> in a server
	      role.</para>
	    
	    <para>When you configure <command>ppp</command> to
	      receive incoming calls, you must decide whether you wish to
	      forward packets for just PPP
	      connections, for all interfaces, or not at all. To forward for
	      just PPP connections, include the line
	    
	    <programlisting>
enable proxy
	    </programlisting>
	    
	    in your <filename>ppp.conf</filename> file. If you wish to
	      forward packets on all interfaces, use the
	    
	    <programlisting>
gateway=YES
	    </programlisting>
	    
	    option in <filename>/etc/rc.conf</filename> (this file used
	      to be called <filename>/etc/sysconfig</filename>).</para>
	    
	    
	    <sect4>
	      <title>Which getty?</title>
	      
	      <para><xref linkend="dialup" remap="Configuring FreeBSD for
		  Dialup Services"> provides a good description on enabling
		dialup services using getty.</para>
	      
	      <para>An alternative to <command>getty</command> is <ulink
		  URL="http://www.leo.org/~doering/mgetty/index.html">mgetty</ulink>, a smarter version of <command>getty</command> designed with dialup lines in mind.</para>
	      
	      <para>The advantages of using <command>mgetty</command> is that it actively
		<emphasis>talks</emphasis> to modems, meaning if port is
		turned off in <filename>/etc/ttys</filename> then your modem
		won't answer the phone.</para>
	      
	      <para>Later versions of <command>mgetty</command> (from 0.99beta onwards) also
		support the automatic detection of PPP streams, allowing your
		clients script-less access to your server.</para>
	      
	      <para>Refer to <xref linkend="userppp-mgetty" remap="Mgetty and
		  AutoPPP"> for more information on <command>mgetty</command>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>PPP permissions</title>
	      
	      <para><command>ppp</command> must normally be run as user id 0. If however you
		wish to allow <command>ppp</command> to run in server mode as a normal user by
		executing <command>ppp</command> as described below, that user must be given
		permission to run <command>ppp</command> by adding them to the
		<username>network</username> group in
		<filename>/etc/group</filename>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Setting up a PPP shell for dynamic-IP users</title>
	      
	      <para>Create a file called
		<filename>/etc/ppp/ppp-shell</filename> containing the
		following:</para>
	      
	      <programlisting>
#!/bin/sh
IDENT=`echo $0 | sed -e 's/^.*-\(.*\)$/\1/'`
CALLEDAS="$IDENT"
TTY=`tty`

if [ x$IDENT = xdialup ]; then
        IDENT=`basename $TTY`
fi

echo "PPP for $CALLEDAS on $TTY"
echo "Starting PPP for $IDENT"

exec /usr/sbin/ppp -direct $IDENT
	      </programlisting>
	      
	      <para>This script should be executable. Now make a symbolic
		link called <filename>ppp-dialup</filename> to this script
		using the following commands:</para>
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-dialup</userinput></screen>
	      </informalexample>
	      
	      <para>You should use this script as the
		<emphasis>shell</emphasis> for all your dialup ppp users.
		This is an example from <filename>/etc/password</filename> for
		a dialup PPP user with username <username>pchilds</username>. (remember don't
		directly edit the password file, use <command>vipw</command>)</para>
	      
	      <programlisting>
pchilds:*:1011:300:Peter Childs PPP:/home/ppp:/etc/ppp/ppp-dialup
	      </programlisting>
	      
	      <para>Create a <filename>/home/ppp</filename> directory that is
		world readable containing the following 0 byte files
	      
	      
	      <informalexample>
		<screen>-r--r--r--   1 root     wheel           0 May 27 02:23 .hushlogin
-r--r--r--   1 root     wheel           0 May 27 02:22 .rhosts</screen>
	      </informalexample>
	      
	      which prevents <filename>/etc/motd</filename> from being
		displayed.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Setting up a PPP shell for static-IP users</title>
	      
	      <para>Create the <filename>ppp-shell</filename> file as above
		and for each account with statically assigned IPs create a
		symbolic link to <filename>ppp-shell</filename>.</para>
	      
	      <para>For example, if you have three dialup customers <username>fred</username>, <username>sam</username>,
		and <username>mary</username>, that you route class C networks for, you would type
		the following:</para>
	      
	      
	      <informalexample>
		<screen>&prompt.root; <userinput>ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-fred</userinput>
&prompt.root; <userinput>ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-sam</userinput>
&prompt.root; <userinput>ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-mary</userinput></screen>
		</informalexample>
	      
	      <para>Each of these users dialup accounts should have their
		shell set to the symbolic link created above. (ie. <username>mary</username>'s
		shell should be
		<filename>/etc/ppp/ppp-mary</filename>).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Setting up ppp.conf for dynamic-IP users</title>
	      
	      <para>The <filename>/etc/ppp/ppp.conf</filename> file should
		contain something along the lines of</para>
	      
	      <programlisting>
default:
  set debug phase lcp chat
  set timeout 0

ttyd0:
  set ifaddr 203.14.100.1 203.14.100.20 255.255.255.255
  enable proxy

ttyd1:
  set ifaddr 203.14.100.1 203.14.100.21 255.255.255.255
  enable proxy
	      </programlisting>

	      <note>
		<para>The indenting is important.</para>
	      </note>
	      
	      <para>The <literal>default:</literal> section is
		loaded for each session. For each dialup line enabled in
		<filename>/etc/ttys</filename> create an entry similar to the
		one for <literal>ttyd0:</literal> above. Each line
		should get a unique IP address from your pool of IP addresses for
		dynamic users.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Setting up <filename>ppp.conf</filename> for static-IP users</title>
	      
	      <para>Along with the contents of the sample
		<filename>/etc/ppp/ppp.conf</filename> above you should add a
		section for each of the statically assigned dialup users. We
		will continue with our <username>fred</username>, <username>sam</username>, and <username>mary</username> example.</para>
	      
	      <programlisting>
fred:
  set ifaddr 203.14.100.1 203.14.101.1 255.255.255.255

sam:
  set ifaddr 203.14.100.1 203.14.102.1 255.255.255.255

mary:
  set ifaddr 203.14.100.1 203.14.103.1 255.255.255.255
	      </programlisting>
	      
	      <para>The file <filename>/etc/ppp/ppp.linkup</filename> should
		also contain routing information for each static IP user if
		required. The line below  would add a route for the <hostid
		  role="ipaddr">203.14.101.0</hostid> class C via  the client's
		ppp link.</para>
	      
	      <programlisting>
fred:
  add 203.14.101.0 netmask 255.255.255.0 HISADDR

sam:
  add 203.14.102.0 netmask 255.255.255.0 HISADDR

mary:
  add 203.14.103.0 netmask 255.255.255.0 HISADDR
	      </programlisting>
	      
	    </sect4>
	    
	    <sect4>
	      <title>More on <command>mgetty</command>, AutoPPP, and MS extensions</title>
	      
	      
	      <sect5 id="userppp-mgetty">
		<title><command>mgetty</command> and AutoPPP</title>
		
		<para>Configuring and compiling <command>mgetty</command> with the <literal>AUTO_PPP</literal>
		  option enabled allows <command>mgetty</command> to detect the LCP phase of PPP
		  connections and automatically spawn off a ppp shell.
		  However, since the default login/password sequence does not
		  occur it is necessary to authenticate users using either PAP
		  or CHAP.</para>
		
		<para>This section assumes the user has successfully
		  configured, compiled, and installed a version of <command>mgetty</command> with
		  the <literal>AUTO_PPP</literal> option (v0.99beta or later)</para>
		
		<para>Make sure your
		  <filename>/usr/local/etc/mgetty+sendfax/login.config</filename> file has the following in it:</para>
		
		<programlisting>
/AutoPPP/ -     -		      /etc/ppp/ppp-pap-dialup
		</programlisting>
		
		<para>This will tell <command>mgetty</command> to run the
		  <filename>ppp-pap-dialup</filename> script for detected PPP
		  connections.</para>
		
		<para>Create a file called
		  <filename>/etc/ppp/ppp-pap-dialup</filename> containing the
		  following (the file should be executable):</para>
		
		<programlisting>
#!/bin/sh
TTY=`tty`
IDENT=`basename $TTY`

exec /usr/sbin/ppp -direct pap$IDENT
		</programlisting>
		
		<para>For each dialup line enabled in
		  <filename>/etc/ttys</filename> create a corresponding entry
		  in <filename>/etc/ppp/ppp.conf</filename>. This will
		  happily co-exist with the definitions we created
		  above.</para>
		
		<programlisting>
papttyd0:
  enable pap
  set ifaddr 203.14.100.1 203.14.100.20 255.255.255.255
  enable proxy

papttyd1:
  enable pap
  set ifaddr 203.14.100.1 203.14.100.21 255.255.255.255
  enable proxy
		</programlisting>
		
		<para>Each user logging in with this method will need to have
		  a username/password in
		  <filename>/etc/ppp/ppp.secret</filename> file, or
		  alternatively add the</para>
		
		<programlisting>
enable passwdauth
		</programlisting>
		
		<para>option to authenticate users via pap from the
		  <filename>/etc/password</filename>d file<footnote><para>(*) Note this option only available in 2.2-961014-SNAP
		  or later, or by getting the updated ppp code for 2.1.x. (see
		  MS extensions below for details)</para>
		  </footnote>.</para>
		
	      </sect5>
	      
	      <sect5>
		<title>MS extentions</title>
		
		<para>From 2.2-961014-SNAP onwards it is possible to allow the
		  automatic negotiation of DNS and NetBIOS name servers with
		  clients supporting this feature (namely Win95/NT clients).
		  See RFC1877 for more details on the protocol.</para>
		
		<para>An example of enabling these extensions in your
		  <filename>/etc/ppp/ppp.conf</filename> file is illustrated
		  below.</para>
		
		<programlisting>
default:
  set debug phase lcp chat
  set timeout 0
  enable msext
  set ns 203.14.100.1 203.14.100.2
  set nbns 203.14.100.5
		</programlisting>
		
		<para>This will tell the clients the primary and secondary
		  name server addresses, and a netbios nameserver host.</para>
		
	      </sect5>
	    </sect4>
	  </sect3>
	  
	  <sect3 id="userppp-PAPnCHAP">
	    <title>PAP and CHAP authentication</title>
	    
	    <para>Some ISPs set their system up so that the authentication
	      part of your connection is done using either of the PAP or CHAP
	      authentication mechanisms. If this is the case, your ISP will
	      not give a <prompt>login:</prompt> prompt when you
	      connect, but will start talking PPP immediately.</para>
	    
	    <para>PAP is less secure than CHAP, but security is not normally
	      an issue here as passwords, although being sent as plain text
	      with PAP, are being transmitted down a serial line only.
	      There's not much room for hackers to <quote>eavesdrop</quote>.</para>
	    
	    <para>Referring back to the <xref linkend="userppp-staticIP"
		remap="PPP and Static IP addresses"> or <xref
		linkend="userppp-dynamicIP" remap="PPP and Dynamic IP
		addresses"> sections, the following alterations must be
	      made:</para>
	    
	    <programlisting>
7       set login
&hellip;
13      set authname <replaceable>MyUserName</replaceable>
14      set authkey <replaceable>MyPassword</replaceable>
	    </programlisting>
	    
	    <para>As always, do not include the line numbers, they are just
	      for reference in this discussion. Indentation of at least one
	      space is required.</para>
	    
	    
	      <variablelist>
		<varlistentry><term>Line 7:</term>
		  <listitem>
		    <para>Your ISP will not normally require that you log into
		      the server if you're using PAP or CHAP. You must
		      therefore disable your "set login" string.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 13:</term>
		  
		  <listitem>
		    <para>This line specifies your PAP/CHAP user name. You
		      will need to insert the correct value for <replaceable>MyUserName</replaceable>.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Line 14:</term>
		  
		  <listitem>
		    <para>This line specifies your PAP/CHAP password. You
		      will need to insert the correct value for <replaceable>MyPassword</replaceable>. You may want to add an
		      additional line
		    
		      <programlisting>
15      accept PAP
		      </programlisting> or
		    
		      <programlisting>
15      accept CHAP
		      </programlisting> to make it obvious that this is the
		      intention, but PAP and CHAP are accepted by
		      default.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    

	    <note>
	      <para>Your <literal>authkey</literal> will be logged
		if you have command logging turned on (<command>set log
		  +command</command>). Care should be taken when deciding the
		ppp log file permissions.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title>Changing your <command>ppp</command> configuration on the fly</title>
	    
	    <para>It is possible to talk to the <command>ppp</command> program while it is
	      running in the background, but only if a suitable password has
	      been set up.</para>
	    
	    <para>By default, ppp will listen to a TCP port of 3000 +
	      <replaceable>tunno</replaceable>, where <replaceable>tunno</replaceable> is the number of the tun device
	      acquired, however, if a password for the local machine is not
	      set up in <filename>/etc/ppp/ppp.secret</filename>, no server
	      connection will be created. To set your password, put the
	      following line in
	      <filename>/etc/ppp/ppp.secret</filename>:</para>
	    
	    <programlisting>
<replaceable>foo</replaceable> <replaceable>MyPassword</replaceable>
	    </programlisting>
	    
	    <para><replaceable>foo</replaceable> is your local
	      hostname (run <command>hostname -s</command> to determine the
	      correct name), and <replaceable>MyPassword</replaceable> is
	      the unencrypted password that you wish to use.
	      <filename>/etc/ppp/ppp.secret</filename> should
	      <emphasis>not</emphasis> be accessable by anyone without user id
	      <username>0</username>. This means that <filename>/</filename>,
	      <filename>/etc</filename> and <filename>/etc/ppp</filename>
	      should not be writable, and <filename>ppp.secret</filename>
	      should be owned by user id <username>0</username> and have permissions 0600.</para>
	    
	    <para>It is also possible to select a specific port number or to
	      have ppp listen to a local unix domain socket rather than to a
	      TCP socket. Refer to the <command>set
		socket</command> command in manual page for further
	      details.</para>
	    
	    <para>Once a socket has been set up, the
	      <citerefentry><refentrytitle>pppctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> program may be used in scripts that
	      wish to manipulate the running program.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2 id="userppp-final">
	  <title>Final system configuration</title>
	  
	  <para>You now have <command>ppp</command> configured, but there are a few more things
	    to do before it is ready to work. They all involve editing the
	    <filename>/etc/rc.conf</filename> file (was
	    <filename>/etc/sysconfig</filename>).</para>
	  
	  <para>Working from the top down in this file, make sure the
	    <literal>hostname=</literal> line is set, e.g.:</para>
	  
	  <programlisting>
hostname=foo.bar.com
	  </programlisting>
	  
	  <para>If your ISP has supplied you with a static IP address and
	    name, it's probably best that you use this name as your host
	    name.</para>
	  
	  <para>Look for the <literal>network_interfaces</literal> variable. If you want to
	    configure your system to dial your ISP on demand, make sure the
	    <devicename>tun0</devicename> device is added to the list, otherwise remove it.</para>
	  
	  <programlisting>
network_interfaces="lo0 tun0" ifconfig_tun0=
	  </programlisting>

	  <note>
	    <para>The <literal>ifconfig_tun0</literal> variable should be empty,
	      and a file called <filename>/etc/start_if.tun0</filename> should
	      be created. This file should contain the line</para>

	    <programlisting>
ppp -auto mysystem
	    </programlisting>
	    
	    <para>This script is executed at network configuration time,
	      starting your ppp daemon in automatic mode. If you have a LAN
	      for which this machine is a gateway, you may also wish to use
	      the <option>-alias</option> switch. Refer to the manual page
	      for further details.</para>
	  </note>
	  
	  <para>Set the router program to <literal>NO</literal> with the line</para>
	  
	  <programlisting>
router_enable=NO            (/etc/rc.conf)
router=NO                   (/etc/sysconfig)
	  </programlisting>
	  
	  <para>It is important that the <command>routed</command>
	    daemon is not started (it's started by default) as <command>routed</command> tends to delete the default routing
	    table entries created by <command>ppp</command>.</para>
	  
	  <para>It is probably worth your while ensuring that the
	    <literal>sendmail_flags</literal> line does not include the <option>-q</option> option,
	    otherwise <command>sendmail</command> will attempt to do a network lookup every now
	    and then, possibly causing your machine to dial out. You may
	    try:</para>
	  
	  <programlisting>
sendmail_flags="-bd"
	  </programlisting>
	  
	  <para>The upshot of this is that you must force <command>sendmail</command> to
	    re-examine the mail queue whenever the ppp link is up by
	    typing:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>/usr/sbin/sendmail -q</userinput></screen>
	  </informalexample>
	  
	  <para>You may wish to use the <command>!bg</command>
	    command in <filename>ppp.linkup</filename> to do this
	    automatically:</para>
	  
	  <programlisting>
1     provider:
2       delete ALL
3       add 0 0 HISADDR
4       !bg sendmail -bd -q30m
	  </programlisting>
	  
	  <para>If you don't like this, it is possible to set up a <quote>dfilter</quote>
	    to block SMTP traffic. Refer to the sample files for further
	    details.</para>
	  
	  <para>All that is left is to reboot the machine.</para>
	  
	  <para>After rebooting, you can now either type</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ppp</userinput></screen>
	  </informalexample>
	  
	  <para>and then <command>dial provider</command> to start the PPP session, or, if
	    you want <command>ppp</command> to establish sessions automatically when there is
	    outbound traffic (and you haven't created the <filename>start_if.tun0</filename>
	    script), type</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>ppp -auto provider</userinput></screen>
	  </informalexample>
	  
	</sect2>
	
	<sect2>
	  <title>Summary</title>
	  
	  <para>To recap, the following steps are necessary when setting up
	    ppp for the first time:</para>
	  
	  <para>Client side:</para>
	  
	  
	    <procedure>
	      
	      <step>
	      <para>Ensure that the <devicename>tun</devicename> device is built into your
		  kernel.</para>
	      </step>
	      
	      <step>
	      <para>Ensure that the <filename>tun<replaceable>X</replaceable></filename> device file is
		  available in the <filename>/dev</filename> directory.</para>
	      </step>
	      
	      <step>
		<para>Create an entry in
		  <filename>/etc/ppp/ppp.conf</filename>. The <filename>pmdemand</filename> example should suffice for
		  most ISPs.</para>
	      </step>
	      
	      <step>
		<para>If you have a dynamic IP address, create an entry in
		  <filename>/etc/ppp/ppp.linkup</filename>.</para>
	      </step>
	      
	      <step>
		<para>Update your <filename>/etc/rc.conf</filename> (or
		  <filename>sysconfig</filename>) file.</para>
	      </step>
	      
	      <step>
		<para>Create a <filename>start_if.tun0</filename> script if you require demand
		  dialing.</para>
	      </step>
	      
	    </procedure>
	  
	  
	  <para>Server side:</para>
	  
	    <procedure>
	      
	      <step>
	      <para>Ensure that the <devicename>tun</devicename> device is built into your
		  kernel.</para>
	      </step>
	      
	      <step>
	      <para>Ensure that the <filename>tun<replaceable>X</replaceable></filename> device file is
		  available in the <filename>/dev</filename> directory.</para>
	      </step>
	      
	      <step>
		<para>Create an entry in <filename>/etc/passwd</filename>
		  (using the <citerefentry><refentrytitle>vipw</refentrytitle><manvolnum>8</manvolnum></citerefentry> program).</para>
	      </step>
	      
	      <step>
		<para>Create a profile in this users home directory that runs
		  <command>ppp -direct direct-server</command> or similar.</para>
	      </step>
	      
	      <step>
		<para>Create an entry in
		  <filename>/etc/ppp/ppp.conf</filename>. The <filename>direct-server</filename> example should
		  suffice.</para>
	      </step>
	      
	      <step>
		<para>Create an entry in
		  <filename>/etc/ppp/ppp.linkup</filename>.</para>
	      </step>
	      
	      <step>
		<para>Update your <filename>/etc/rc.conf</filename> (or
		  <filename>sysconfig</filename>) file.</para>
	      </step>
	      
	    </procedure>
	  
	</sect2>
	
	<sect2>
	  <title>Acknowledgments</title>
	  
	  <para>This section of the handbook was last updated on Sun Sep 7,
	    1997 by &a.brian;</para>
	  
	  <para>Thanks to the following for their input, comments &amp;
	    suggestions:</para>
	  
	  <para>&a.nik;</para>
	  
	  <para>&a.dirkvangulik;</para>
	  
	  <para>&a.pjc;</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="ppp">
	<title>Setting up Kernel PPP</title>
	
	<para><emphasis>Contributed by &a.gena;.</emphasis></para>
	
	<para>Before you start setting up PPP on your machine make sure that
	  <command>pppd</command> is located in <filename>/usr/sbin</filename> and directory
	  <filename>/etc/ppp</filename> exists.</para>
	
	<para><command>pppd</command> can work in two modes:</para>
	
	  <orderedlist>
	    
	    <listitem>
	      <para>as a <quote>client</quote>, i.e. you want to connect your machine to
		outside world via PPP serial connection or modem line.</para>
	    </listitem>
	    
	    <listitem>
	      <para>as a <quote>server</quote>, i.e. your machine is located on the
		network and used to connect other computers using PPP.</para>
	    </listitem>
	    
	  </orderedlist>

	<para>In both cases you will need to set up an options file
	  (<filename>/etc/ppp/options</filename> or
	  <filename>~/.ppprc</filename> if you have more then one user on your
	  machine that uses PPP).</para>
	
	<para>You also will need some modem/serial software (preferably
	  kermit) so you can dial and establish connection with remote
	  host.</para>
	
	
	<sect2>
	  <title>Working as a PPP client</title>
	  
	  <para>I used the following <filename>/etc/ppp/options</filename> to
	    connect to CISCO terminal server PPP line.</para>

	    <programlisting>
crtscts         # enable hardware flow control
modem           # modem control line
noipdefault     # remote PPP server must supply your IP address.
                # if the remote host doesn't send your IP during IPCP
                # negotiation , remove this option
passive         # wait for LCP packets
domain ppp.foo.com      # put your domain name here

:&lt;remote_ip&gt;    # put the IP of remote PPP host here
                # it will be used to route packets via PPP link
                # if you didn't specified the noipdefault option
                # change this line to &lt;local_ip&gt;:&lt;remote_ip&gt;

defaultroute    # put this if you want that PPP server will be your
                # default router
	    </programlisting>
	  
	  <para>To connect:</para>
	  
	    <procedure>
	      
	      <step>
		<para>Dial to the remote host using kermit (or other modem
		  program) enter your user name and password (or whatever is
		  needed to enable PPP on the remote host)</para>
	      </step>
	      
	      <step>
		<para>Exit kermit (without hanging up the line).</para>
	      </step>
	      
	      <step>
		<para>enter:</para>

		  <informalexample>
		<screen>&prompt.root; <userinput>/usr/src/usr.sbin/pppd.new/pppd <replaceable>/dev/tty01</replaceable> <replaceable>19200</replaceable></userinput></screen>
		  </informalexample>

	      <para>Use the appropriate speed and device name.</para>
	      </step>
	      
	    </procedure>
	  
	  <para>Now your computer is connected with PPP. If the connection
	    fails for some reasons you can add the <option>debug</option> option to the
	    <filename>/etc/ppp/options</filename> file and check messages on
	    the console to track the problem</para>
	  
	  <para>Following <filename>/etc/ppp/pppup</filename> script will make
	    all 3 stages automatically:</para>

	    <programlisting>
#!/bin/sh
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing pppd, PID=' ${pid}
        kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing kermit, PID=' ${pid}
        kill -9 ${pid}
fi

ifconfig ppp0 down
ifconfig ppp0 delete

kermit -y /etc/ppp/kermit.dial
pppd /dev/tty01 19200
	    </programlisting>
	  
	  <para><filename>/etc/ppp/kermit.dial</filename> is kermit script
	    that dials and makes all necessary authorization on the remote
	    host. (Example of such script is attached to the end of this
	    document)</para>
	  
	  <para>Use the following <filename>/etc/ppp/pppdown</filename> script
	    to disconnect the PPP line:</para>

	    <programlisting>
#!/bin/sh
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ X${pid} != "X" ] ; then
        echo 'killing pppd, PID=' ${pid}
        kill -TERM ${pid}
fi

ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing kermit, PID=' ${pid}
        kill -9 ${pid}
fi

/sbin/ifconfig ppp0 down
/sbin/ifconfig ppp0 delete
kermit -y /etc/ppp/kermit.hup
/etc/ppp/ppptest
	    </programlisting>
	  
	  <para>Check if PPP is still running
	    (<filename>/usr/etc/ppp/ppptest</filename>):</para>

	    <programlisting>
#!/bin/sh
pid=`ps ax| grep pppd |grep -v grep|awk '{print $1;}'`
if [ X${pid} != "X" ] ; then
        echo 'pppd running: PID=' ${pid-NONE}
else
        echo 'No pppd running.'
fi
set -x
netstat -n -I ppp0
ifconfig ppp0
	    </programlisting>
	  
	  <para>Hangs up modem line
	    (<filename>/etc/ppp/kermit.hup</filename>):</para>

	    <programlisting>
set line /dev/tty01	; put your modem device here
set speed 19200
set file type binary
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none

pau 1
out +++
inp 5 OK
out ATH0\13
echo \13
exit
	    </programlisting>
	  
	  <para>Here is an alternate method using <command>chat</command> instead of <command>kermit</command>.</para>
	  
	  <para><emphasis>Contributed by &a.rhuff;.</emphasis></para>
	  
	  <para>The following two files are sufficient to accomplish a pppd
	    connection.</para>
	  
	  <para><filename>/etc/ppp/options</filename>:</para>

	    <programlisting>
/dev/cuaa1 115200

crtscts		# enable hardware flow control
modem		# modem control line
connect "/usr/bin/chat -f /etc/ppp/login.chat.script"
noipdefault	# remote PPP serve must supply your IP address.
	        # if the remote host doesn't send your IP during
                # IPCP negotiation, remove this option
passive         # wait for LCP packets
domain &lt;your.domain&gt;	# put your domain name here

:		# put the IP of remote PPP host here
	        # it will be used to route packets via PPP link
                # if you didn't specified the noipdefault option
                # change this line to &lt;local_ip&gt;:&lt;remote_ip&gt;

defaultroute	# put this if you want that PPP server will be
	        # your default router
	    </programlisting>
	  
	  <para><filename>/etc/ppp/login.chat.script</filename>:</para>
	  
	  <para>(This should actually go into a single line.)</para>
	  
	  <programlisting>
ABORT BUSY ABORT 'NO CARRIER' "" AT OK ATDT&lt;phone.number&gt;
  CONNECT "" TIMEOUT 10 ogin:-\\r-ogin: &lt;login-id&gt;
  TIMEOUT 5 sword: &lt;password&gt;
	  </programlisting>
	  
	  <para>Once these are installed and modified correctly, all you need
	    to do is</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>pppd</userinput></screen>
	  </informalexample>
	  
	  <para>This sample based primarily on information provided
	      by: Trev Roydhouse
	      &lt;Trev.Roydhouse@f401.n711.z3.fidonet.org&gt; and used by
	      permission.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Working as a PPP server</title>
	  
	  <para><filename>/etc/ppp/options</filename>:</para>

	    <programlisting>
crtscts                         # Hardware flow control
netmask 255.255.255.0           # netmask ( not required )
192.114.208.20:192.114.208.165  # ip's of local and remote hosts
                                # local ip must be different from one
                                # you assigned to the ethernet ( or other )
                                # interface on your machine.
                                # remote IP is ip address that will be 
                                # assigned to the remote machine
domain ppp.foo.com              # your domain
passive                         # wait for LCP
modem                           # modem line
	    </programlisting>
	  
	  <para>Following <filename>/etc/ppp/pppserv</filename> script will
	    enable ppp server on your machine:</para>

	    <programlisting>
#!/bin/sh 
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing pppd, PID=' ${pid}
        kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing kermit, PID=' ${pid}
        kill -9 ${pid}
fi

# reset ppp interface
ifconfig ppp0 down
ifconfig ppp0 delete

# enable autoanswer mode
kermit -y /etc/ppp/kermit.ans

# run ppp
pppd /dev/tty01 19200
	    </programlisting>
	  
	  <para>Use this <filename>/etc/ppp/pppservdown</filename> script to
	    stop ppp server:</para>

	    <programlisting>
#!/bin/sh 
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing pppd, PID=' ${pid}
        kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
        echo 'killing kermit, PID=' ${pid}
        kill -9 ${pid}
fi
ifconfig ppp0 down
ifconfig ppp0 delete

kermit -y /etc/ppp/kermit.noans
	    </programlisting>
	  
	  <para>Following kermit script will enable/disable autoanswer mode
	    on your modem (<filename>/etc/ppp/kermit.ans</filename>):</para>

	    <programlisting>
set line /dev/tty01
set speed 19200
set file type binary
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none

pau 1
out +++
inp 5 OK
out ATH0\13
inp 5 OK
echo \13
out ATS0=1\13   ; change this to out ATS0=0\13 if you want to disable
                ; autoanswer mod
inp 5 OK
echo \13
exit
	    </programlisting>
	  
	  <para>This <filename>/etc/ppp/kermit.dial</filename> script is used
	    for dialing and authorizing on remote host. You will need to
	    customize it for your needs. Put your login and password in this
	    script, also you will need to change input statement depending on
	    responses from your modem and remote host.</para>

	    <programlisting>
;
; put the com line attached to the modem here:
;
set line /dev/tty01
;
; put the modem speed here:
;
set speed 19200
set file type binary            ; full 8 bit file xfer
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none
set modem hayes
set dial hangup off
set carrier auto                ; Then SET CARRIER if necessary,
set dial display on             ; Then SET DIAL if necessary,
set input echo on
set input timeout proceed
set input case ignore
def \%x 0                       ; login prompt counter
goto slhup

:slcmd                          ; put the modem in command mode
echo Put the modem in command mode.
clear                           ; Clear unread characters from input buffer
pause 1
output +++                      ; hayes escape sequence
input 1 OK\13\10                ; wait for OK
if success goto slhup
output \13
pause 1
output at\13
input 1 OK\13\10
if fail goto slcmd              ; if modem doesn't answer OK, try again

:slhup                          ; hang up the phone
clear                           ; Clear unread characters from input buffer
pause 1
echo Hanging up the phone.
output ath0\13                  ; hayes command for on hook
input 2 OK\13\10
if fail goto slcmd              ; if no OK answer, put modem in command mode

:sldial                         ; dial the number
pause 1
echo Dialing.
output atdt9,550311\13\10               ; put phone number here
assign \%x 0                    ; zero the time counter

:look
clear                           ; Clear unread characters from input buffer
increment \%x                   ; Count the seconds
input 1 {CONNECT }
if success goto sllogin
reinput 1 {NO CARRIER\13\10}
if success goto sldial
reinput 1 {NO DIALTONE\13\10}
if success goto slnodial
reinput 1 {\255}
if success goto slhup
reinput 1 {\127}
if success goto slhup
if < \%x 60 goto look
else goto slhup

:sllogin                        ; login
assign \%x 0                    ; zero the time counter
pause 1
echo Looking for login prompt.

:slloop
increment \%x                   ; Count the seconds
clear                           ; Clear unread characters from input buffer
output \13
;
; put your expected login prompt here:
;
input 1 {Username: }
if success goto sluid
reinput 1 {\255}
if success goto slhup
reinput 1 {\127}
if success goto slhup
if < \%x 10 goto slloop         ; try 10 times to get a login prompt
else goto slhup                 ; hang up and start again if 10 failures

:sluid
;
; put your userid here:
;
output ppp-login\13
input 1 {Password: }
;
; put your password here:
;
output ppp-password\13
input 1 {Entering SLIP mode.}
echo
quit

:slnodial
echo \7No dialtone.  Check the telephone line!\7
exit 1

; local variables:
; mode: csh
; comment-start: "; "
; comment-start-skip: "; "
; end:	      
	    </programlisting>
	  
	</sect2>
      </sect1>
      
      <sect1 id="slipc">
	<title>Setting up a SLIP Client</title>
	
	<para><emphasis>Contributed by &a.asami;<!-- <br> -->8 Aug
	    1995.</emphasis></para>
	
	<para>The following is one way to set up a FreeBSD machine for SLIP on
	  a static host network. For dynamic hostname assignments (i.e., your
	  address changes each time you dial up), you probably need to do
	  something much fancier.</para>
	
	<para>First, determine which serial port your modem is connected to. I
	  have a symbolic link to <filename>/dev/modem</filename> from 
	    <filename>/dev/cuaa1</filename>, and only use the modem name in my configuration
	  files. It can become quite cumbersome when you need to fix a bunch
	  of files in <filename>/etc</filename> and
	  <filename>.kermrc</filename>'s all over the system!</para>

	<note>
	  <para><filename>/dev/cuaa0</filename> is <devicename>COM1</devicename>,
	    <filename>cuaa1</filename> is <devicename>COM2</devicename>, etc.</para>
	</note>
	
	<para>Make sure you have

	  <programlisting>
pseudo-device   sl      1
	  </programlisting> in your kernel's config file. It is included in
	  the <filename>GENERIC</filename> kernel, so this will not be a
	  problem unless you deleted it.</para>
	
	
	<sect2>
	  <title>Things you have to do only once</title>
	  
	  
	    <procedure>
	      
	      <step>
		<para>Add your home machine, the gateway and nameservers to
		  your <filename>/etc/hosts</filename> file. Mine looks like
		  this:</para>

		  <programlisting>
127.0.0.1               localhost loghost
136.152.64.181          silvia.HIP.Berkeley.EDU silvia.HIP silvia
136.152.64.1            inr-3.Berkeley.EDU inr-3 slip-gateway
128.32.136.9            ns1.Berkeley.edu ns1
128.32.136.12           ns2.Berkeley.edu ns2
		  </programlisting>

	      <para>By the way, silvia is
		  the name of the car that I had when I was back in Japan (it
		  is called 2?0SX here in U.S.).</para>
	      </step>
	      
	      <step>
		<para>Make sure you have <option>hosts</option> before <option>bind</option> in your
		  <filename>/etc/host.conf</filename>. Otherwise, funny things
		  may happen.</para>
	      </step>
	      
	      <step>
		<para>Edit the file <filename>/etc/rc.conf</filename>. Note
		  that you should edit the file
		  <filename>/etc/sysconfig</filename> instead if you are
		  running FreeBSD previous to version 2.2.2.
		  <orderedlist>
		    
		    <listitem>
		      <para>Set your hostname by editing the line that says:
			<programlisting>
hostname=myname.my.domain
			</programlisting> You should give it your full Internet hostname.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Add sl0 to the list of network interfaces by
			changing the line that says:
		      
			<programlisting>
network_interfaces="lo0"
			</programlisting>

		    to:
		    
			<programlisting>
network_interfaces="lo0 sl0"
			</programlisting></para>
		    </listitem>
		    
		    <listitem>
		      <para>Set the startup flags of sl0 by adding a line:</para>

			<programlisting>
ifconfig_sl0="inet ${hostname} slip-gateway netmask 0xffffff00 up"
			</programlisting>
		    </listitem>
		    
		    <listitem>
		      <para>Designate the default router by changing the line:
			<programlisting>
defaultrouter=NO
			</programlisting> to:
			<programlisting>
defaultrouter=slip-gateway
			</programlisting></para>
		    </listitem>
		    
		  </orderedlist>
		  
		</para>
	      </step>
	      
	      <step>
		<para>Make a file <filename>/etc/resolv.conf</filename> which
		  contains:

		  <programlisting>
domain HIP.Berkeley.EDU
nameserver 128.32.136.9
nameserver 128.32.136.12
		  </programlisting> As
		  you can see, these set up the nameserver hosts. Of course,
		  the actual domain names and addresses depend on your
		  environment.</para>
	      </step>
	      
	      <step>
		<para>Set the password for root and toor (and any other
		  accounts that does not have a password). Use passwd, do not
		  edit the <filename>/etc/passwd</filename> or
		  <filename>/etc/master.passwd</filename> files!</para>
	      </step>
	      
	      <step>
		<para>Reboot your machine and make sure it comes up with the
		  correct hostname.</para>
	      </step>
	      
	    </procedure>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Making a SLIP connection</title>
	  
	  
	    <procedure>
	      
	      <step>
		<para>Dial up, type <command>slip</command> at the prompt, enter your machine
		  name and password. The things you need to enter depends on
		  your environment. I use kermit, with a script like this:

		  <programlisting>
# kermit setup
set modem hayes
set line /dev/modem
set speed 115200
set parity none
set flow rts/cts
set terminal bytesize 8
set file type binary
# The next macro will dial up and login
define slip dial 643-9600, input 10 =>, if failure stop, -
output slip\x0d, input 10 Username:, if failure stop, -
output silvia\x0d, input 10 Password:, if failure stop, -
output ***\x0d, echo \x0aCONNECTED\x0a
		  </programlisting>
		  (of
		  course, you have to change the hostname and password to fit
		  yours). Then you can just type <command>slip</command> from the kermit
		  prompt to get connected.</para>

		<note>
		  <para>Leaving your password in plain text anywhere in the
		    filesystem is generally a BAD idea. Do it at your own
		    risk. I am just too lazy.</para>
		</note>
	      </step>
	      
	      <step>
		<para>Leave the kermit there (you can suspend it by <command>z</command>) and
		  as root, type:</para>

		  <informalexample>
		    <screen>&prompt.root; <userinput>slattach -h -c -s 115200 /dev/modem</userinput></screen>
		  </informalexample>

	      <para>If you are able to <command>ping</command> hosts
		  on the other side of the router, you are connected! If it
		  does not work, you might want to try <option>-a</option> instead of <option>-c</option> as
		  an argument to slattach.</para>
	      </step>
	      
	    </procedure>
	  
	  
	</sect2>
	
	<sect2>
	  <title>How to shutdown the connection</title>
	  
	  <para>Type

	    <informalexample>
	      <screen>&prompt.root; <userinput>kill -INT `cat /var/run/slattach.modem.pid`</userinput></screen>
	    </informalexample>(as root)
	    to kill slattach. Then go back to kermit (<command>fg</command> if you suspended
	    it) and exit from it (<command>q</command>).</para>
	  
	  <para>The slattach man page says you have to use <command>ifconfig sl0 down</command>
	    to mark the interface down, but this does not seem to make any
	    difference for me. (<command>ifconfig sl0</command> reports the same
	    thing.)</para>
	  
	  <para>Some times, your modem might refuse to drop the carrier (mine
	    often does). In that case, simply start kermit and quit it again.
	    It usually goes out on the second try.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Troubleshooting</title>
	  
	  <para>If it does not work, feel free to ask me. The things that
	    people tripped over so far:</para>
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Not using <option>-c</option> or <option>-a</option> in slattach (I have no idea why
		  this can be fatal, but adding this flag solved the problem
		  for at least one person)</para>
	      </listitem>
	      
	      <listitem>
		<para>Using <option>s10</option> instead of <option>sl0</option> (might be hard to see the
		  difference on some fonts).</para>
	      </listitem>
	      
	      <listitem>
		<para>Try <command>ifconfig sl0</command> to see your
		interface status. I get:</para>
	      
		  <informalexample>
		    <screen>&prompt.root; <userinput>ifconfig sl0</userinput>
sl0: flags=10&lt;POINTOPOINT&gt;
        inet 136.152.64.181 --&gt; 136.152.64.1 netmask ffffff00</screen>
		  </informalexample>
	      </listitem>
	      
	      <listitem>
		<para>Also, <command>netstat -r</command> will give the
		  routing table, in case you get the "no route to host"
		  messages from ping. Mine looks like:

		  <informalexample>
		    <screen>&prompt.root; <userinput>netstat -r</userinput>
Routing tables
Destination      Gateway            Flags     Refs     Use  IfaceMTU    Rtt    Netmasks:

(root node)
(root node)

Route Tree for Protocol Family inet:
(root node) =&gt;
default          inr-3.Berkeley.EDU UG          8   224515  sl0 -      -
localhost.Berkel localhost.Berkeley UH          5    42127  lo0 -       0.438
inr-3.Berkeley.E silvia.HIP.Berkele UH          1        0  sl0 -      -
silvia.HIP.Berke localhost.Berkeley UGH        34 47641234  lo0 -       0.438
(root node)</screen>
		  </informalexample> (this is after transferring a bunch
		  of files, your numbers should be smaller).</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	</sect2>
      </sect1>
      
      <sect1 id="slips">
	<title>Setting up a SLIP Server</title>
	
	<para><emphasis>Contributed by &a.ghelmer;.<!-- <br> --> v1.0, 15 May
	    1995.</emphasis></para>
	
	<para>This document provides suggestions for setting up SLIP Server
	  services on a FreeBSD system, which typically means configuring your
	  system to automatically startup connections upon login for remote
	  SLIP clients. The author has written this document based on his
	  experience; however, as your system and needs may be different, this
	  document may not answer all of your questions, and the author cannot
	  be responsible if you damage your system or lose data due to
	  attempting to follow the suggestions here.</para>
	
	<para>This guide was originally written for SLIP Server services on a
	  FreeBSD 1.x system. It has been modified to reflect changes in the
	  pathnames and the removal of the SLIP interface compression flags in
	  early versions of FreeBSD 2.X, which appear to be the only major
	  changes between FreeBSD versions. If you do encounter mistakes in
	  this document, please email the author with enough information to
	  help correct the problem.</para>
	
	
	<sect2 id="slips-prereqs">
	  <title>Prerequisites</title>
	  
	  <para>This document is very technical in nature, so background
	    knowledge is required. It is assumed that you are familiar with
	    the TCP/IP network protocol, and in particular, network and node
	    addressing, network address masks, subnetting, routing, and
	    routing protocols, such as RIP. Configuring SLIP services on a
	    dial-up server requires a knowledge of these concepts, and if you
	    are not familiar with them, please read a copy of either Craig
	    Hunt's <emphasis>TCP/IP Network Administration</emphasis>
	    published by O'Reilly &amp; Associates, Inc. (ISBN Number
	    0-937175-82-X), or Douglas Comer's books on the TCP/IP
	    protocol.</para>
	  
	  <para>It is further assumed that you have already setup your
	    modem(s) and configured the appropriate system files to allow
	    logins through your modems. If you have not prepared your system
	    for this yet, please see the tutorial for configuring dialup
	    services; if you have a World-Wide Web browser available, browse
	    the list of tutorials at <ulink
	      url="http://www.freebsd.org/">http://www.freebsd.org/</ulink>;
	    otherwise, check the place where you found this document for a
	    document named <filename>dialup.txt</filename> or something
	    similar. You may also want to check the manual pages for
	    <citerefentry><refentrytitle>sio</refentrytitle><manvolnum>4</manvolnum></citerefentry> for information on the serial
	    port device driver and <citerefentry><refentrytitle>ttys</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
	    <citerefentry><refentrytitle>gettytab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
	    <citerefentry><refentrytitle>getty</refentrytitle><manvolnum>8</manvolnum></citerefentry>, &amp; <citerefentry><refentrytitle>init</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
	    information relevant to configuring the system to accept logins on
	    modems, and perhaps <citerefentry><refentrytitle>stty</refentrytitle><manvolnum>1</manvolnum></citerefentry> for information on
	    setting serial port parameters (such as <literal>clocal</literal> for directly-connected serial
	    interfaces).</para>
	  
	</sect2>
	
	<sect2>
	  <title>Quick Overview</title>
	  
	  <para>In its typical configuration, using FreeBSD as a SLIP server
	    works as follows: a SLIP user dials up your FreeBSD SLIP Server
	    system and logs in with a special SLIP login ID that uses
	    <filename>/usr/sbin/sliplogin</filename> as the special user's
	    shell. The <command>sliplogin</command> program
	    browses the file <filename>/etc/sliphome/slip.hosts</filename> to
	    find a matching line for the special user, and if it finds a
	    match, connects the serial line to an available SLIP interface and
	    then runs the shell script
	    <filename>/etc/sliphome/slip.login</filename> to configure the
	    SLIP interface.</para>
	  
	  
	  <sect3>
	    <title>An Example of a SLIP Server Login</title>
	    
	    <para>For example, if a SLIP user ID were
	      <username>Shelmerg</username>, <username>Shelmerg</username>'s entry in
	      <filename>/etc/master.passwd</filename> would look something
	      like this (except it would be all on one line):</para>
	    
	    <programlisting>
Shelmerg:password:1964:89::0:0:Guy Helmer - SLIP:/usr/users/Shelmerg:/usr/sbin/sliplogin
	    </programlisting>
	    
	    <para>When <username>Shelmerg</username> logs in,
	      <command>sliplogin</command> will search
	      <filename>/etc/sliphome/slip.hosts</filename> for a line that
	      had a matching user ID; for example, there may be a line in
	      <filename>/etc/sliphome/slip.hosts</filename> that reads:</para>
	    
	    <programlisting>
Shelmerg        dc-slip sl-helmer       0xfffffc00		  autocomp
	    </programlisting>
	    
	    <para><command>sliplogin</command> will find that
	      matching line, hook the serial line into the next available SLIP
	      interface, and then execute
	      <filename>/etc/sliphome/slip.login</filename> like this:</para>
	    
	    <programlisting>
/etc/sliphome/slip.login 0 19200 Shelmerg dc-slip sl-helmer 0xfffffc00 autocomp
	      
	    </programlisting>
	    
	    <para>If all goes well,
	      <filename>/etc/sliphome/slip.login</filename> will issue an
	      <command>ifconfig</command> for the SLIP interface to
	      which <command>sliplogin</command> attached itself
	      (slip interface 0, in the above example, which was the first
	      parameter in the list given to <filename>slip.login</filename>)
	      to set the local IP address (<hostid>dc-slip</hostid>), remote
	      IP address (<hostid>sl-helmer</hostid>), network mask for the SLIP
	      interface (<hostid role="netmask">0xfffffc00</hostid>), and any additional
	      flags (<literal>autocomp</literal>). If something
	      goes wrong, <command>sliplogin</command> usually logs
	      good informational messages via the <literal>daemon</literal> syslog facility,
	      which usually goes into <filename>/var/log/messages</filename>
	      (see the manual pages for <citerefentry><refentrytitle>syslogd</refentrytitle><manvolnum>8</manvolnum></citerefentry> and
	      <citerefentry><refentrytitle>syslog.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, and perhaps check
	      <filename>/etc/syslog.conf</filename> to see to which files
	      <command>syslogd</command> is logging).</para>
	    
	    <para>OK, enough of the examples &mdash; let us dive into setting up
	      the system.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Kernel Configuration</title>
	  
	  <para>FreeBSD's default kernels usually come with two SLIP
	    interfaces defined (<devicename>sl0</devicename> and
	    <devicename>sl1</devicename>); you can use <command>netstat -i</command> to see whether these interfaces
	    are defined in your kernel.</para>
	  
	  <para>Sample output from <command>netstat -i</command>:</para>
	  
	  
	  <informalexample>
	    <screen>Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
ed0   1500  &lt;Link&gt;0.0.c0.2c.5f.4a         291311     0   174209     0   133
ed0   1500  138.247.224 ivory             291311     0   174209     0   133
lo0   65535 &lt;Link&gt;                            79     0       79     0     0
lo0   65535 loop        localhost             79     0       79     0     0
sl0*  296   &lt;Link&gt;                             0     0        0     0     0
sl1*  296   &lt;Link&gt;                             0     0        0     0     0</screen>
	    </informalexample>
	  
	  <para>The <devicename>sl0</devicename> and <devicename>sl1</devicename> interfaces shown in <command>netstat -i</command>'s output indicate that there are
	    two SLIP interfaces built into the kernel. (The asterisks after
	    the <literal>sl0</literal> and <literal>sl1</literal> indicate that the interfaces are
	    <quote>down</quote>.)</para>
	  
	  <para>However, FreeBSD's default kernels do not come configured to
	    forward packets (ie, your FreeBSD machine will not act as a
	    router) due to Internet RFC requirements for Internet hosts (see
	    RFC's 1009 [Requirements for Internet Gateways], 1122
	    [Requirements for Internet Hosts &mdash; Communication Layers], and
	    perhaps 1127 [A Perspective on the Host Requirements RFCs]), so if
	    you want your FreeBSD SLIP Server to act as a router, you will
	    have to edit the <filename>/etc/rc.conf</filename> file (called
	    <filename>/etc/sysconfig</filename> in FreeBSD releases prior to
	    2.2.2) and change the setting of the <literal>gateway</literal> variable to <option>YES</option>.
	    If you have an older system which predates even the
	    <filename>/etc/sysconfig</filename> file, then add the following
	    command:

	    <programlisting>
sysctl -w net.inet.ip.forwarding = 1
	    </programlisting> to your <filename>/etc/rc.local</filename>
	    file.</para>
	  
	  <para>You will then need to reboot for the new settings to take
	    effect.</para>
	  
	  <para>You will notice that near the end of the default kernel
	    configuration file (<filename>/sys/i386/conf/GENERIC</filename>)
	    is a line that reads:</para>
	  
	  <programlisting>
pseudo-device sl 2
	  </programlisting>
	  
	  <para>This is the line that defines the number of SLIP devices
	    available in the kernel; the number at the end of the line is the
	    maximum number of SLIP connections that may be operating
	    simultaneously.</para>
	  
	  <para>Please refer to <xref linkend="kernelconfig"
	      remap="Configuring the FreeBSD Kernel"> for help in
	    reconfiguring your kernel.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Sliplogin Configuration</title>
	  
	  <para>As mentioned earlier, there are three files in the
	    <filename>/etc/sliphome</filename> directory that are part of the
	    configuration for <filename>/usr/sbin/sliplogin</filename> (see
	    <citerefentry><refentrytitle>sliplogin</refentrytitle><manvolnum>8</manvolnum></citerefentry> for the actual manual page for
	    <command>sliplogin</command>):
	    <filename>slip.hosts</filename>, which defines the SLIP users
	    &amp; their associated IP addresses;
	    <filename>slip.login</filename>, which usually just configures the
	    SLIP interface; and (optionally) <filename>slip.logout</filename>,
	    which undoes <filename>slip.login</filename>'s effects when the
	    serial connection is terminated.</para>
	  
	  
	  <sect3>
	    <title><filename>slip.hosts</filename> Configuration</title>
	    
	    <para><filename>/etc/sliphome/slip.hosts</filename> contains lines
	      which have at least four items, separated by whitespace:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>SLIP user's login ID</para>
		</listitem>
		
		<listitem>
		  <para>Local address (local to the SLIP server) of the SLIP
		    link</para>
		</listitem>
		
		<listitem>
		  <para>Remote address of the SLIP link</para>
		</listitem>
		
		<listitem>
		  <para>Network mask</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>The local and remote addresses may be host names (resolved
	      to IP addresses by <filename>/etc/hosts</filename> or by the
	      domain name service, depending on your specifications in
	      <filename>/etc/host.conf</filename>), and I believe the network
	      mask may be a name that can be resolved by a lookup into
	      <filename>/etc/networks</filename>. On a sample system,
	      <filename>/etc/sliphome/slip.hosts</filename> looks like
	      this:</para>
	    
	    <programlisting>
#
# login local-addr      remote-addr     mask            opt1    opt2 
#                                               (normal,compress,noicmp)
#
Shelmerg  dc-slip       sl-helmerg      0xfffffc00      autocomp
	    </programlisting>
	    
	    <para>At the end of the line is one or more of the options.</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><option>normal</option> &mdash; no header
		    compression</para>
		</listitem>
		
		<listitem>
		  <para><option>compress</option> &mdash; compress
		    headers</para>
		</listitem>
		
		<listitem>
		  <para><option>autocomp</option> &mdash; compress
		    headers if the remote end allows it</para>
		</listitem>
		
		<listitem>
		  <para><option>noicmp</option> &mdash; disable ICMP
		    packets (so any <quote>ping</quote> packets will be dropped instead
		    of using up your bandwidth)</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>Note that <command>sliplogin</command> under
	      early releases of FreeBSD 2 ignored the options that FreeBSD 1.x
	      recognized, so the options <option>normal</option>,
	      <option>compress</option>, <option>autocomp</option>, and
	      <option>noicmp</option> had no effect until support was
	      added in FreeBSD 2.2 (unless your
	      <filename>slip.login</filename> script included code to make use
	      of the flags).</para>
	    
	    <para>Your choice of local and remote addresses for your SLIP
	      links depends on whether you are going to dedicate a TCP/IP
	      subnet or if you are going to use <quote>proxy ARP</quote> on your SLIP
	      server (it is not <quote>true</quote> proxy ARP, but that is the
	      terminology used in this document to describe it). If you are
	      not sure which method to select or how to assign IP addresses,
	      please refer to the TCP/IP books referenced in the <xref
		linkend="slips-prereqs" remap="slips-prereqs"> section
	      and/or consult your IP network manager.</para>
	    
	    <para>If you are going to use a separate subnet for your SLIP
	      clients, you will need to allocate the subnet number out of your
	      assigned IP network number and assign each of your SLIP client's
	      IP numbers out of that subnet. Then, you will probably either
	      need to configure a static route to the SLIP subnet via your
	      SLIP server on your nearest IP router, or install <command>gated</command> on your FreeBSD SLIP server and
	      configure it to talk the appropriate routing protocols to your
	      other routers to inform them about your SLIP server's route to
	      the SLIP subnet.</para>
	    
	    <para>Otherwise, if you will use the <quote>proxy ARP</quote> method, you
	      will need to assign your SLIP client's IP addresses out of your
	      SLIP server's Ethernet subnet, and you will also need to adjust
	      your <filename>/etc/sliphome/slip.login</filename> and
	      <filename>/etc/sliphome/slip.logout</filename> scripts to use
	      <citerefentry><refentrytitle>arp</refentrytitle><manvolnum>8</manvolnum></citerefentry> to manage the proxy-ARP entries in the
	      SLIP server's ARP table.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title><filename>slip.login</filename> Configuration</title>
	    
	    <para>The typical <filename>/etc/sliphome/slip.login</filename>
	      file looks like this:</para>
	    
	    <programlisting>
#!/bin/sh -
#
#       @(#)slip.login  5.1 (Berkeley) 7/1/90

#
# generic login file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 inet $4 $5 netmask $6	    
	    </programlisting>
	    
	    <para>This <filename>slip.login</filename> file merely <command>ifconfig</command>'s
	      the appropriate SLIP interface with the local and remote
	      addresses and network mask of the SLIP interface.</para>
	    
	    <para>If you have decided to use the <quote>proxy ARP</quote> method (instead
	      of using a separate subnet for your SLIP clients), your
	      <filename>/etc/sliphome/slip.login</filename> file will need to
	      look something like this:</para>
	    
	    <programlisting>
#!/bin/sh -
#
#       @(#)slip.login  5.1 (Berkeley) 7/1/90

#
# generic login file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 inet $4 $5 netmask $6 
# Answer ARP requests for the SLIP client with our Ethernet addr
/usr/sbin/arp -s $5 00:11:22:33:44:55 pub
	    </programlisting>
	    
	    <para>The additional line in this <filename>slip.login</filename>,
	      <command>arp -s &#36;5 00:11:22:33:44:55 pub</command>, creates
	      an ARP entry in the SLIP server's ARP table. This ARP entry
	      causes the SLIP server to respond with the SLIP server's
	      Ethernet MAC address whenever a another IP node on the Ethernet
	      asks to speak to the SLIP client's IP address.</para>
	    
	    <para>When using the example above, be sure to replace the
	      Ethernet MAC address (<hostid role="mac">00:11:22:33:44:55</hostid>) with the MAC address of
	      your system's Ethernet card, or your <quote>proxy ARP</quote> will
	      definitely not work! You can discover your SLIP server's
	      Ethernet MAC address by looking at the results of running
	      <command>netstat -i</command>; the second line of the output
	      should look something like:</para>
	    
	    <informalexample>
	      <screen>ed0   1500  &lt;Link&gt;0.2.c1.28.5f.4a         191923	0   129457     0   116
	      </screen>
	    </informalexample>
	    
	    <para>This indicates that this particular system's Ethernet MAC
	      address is <hostid role="mac">00:02:c1:28:5f:4a</hostid> &mdash;
	      the periods in the Ethernet MAC address given by
	      <command>netstat -i</command> must be changed to colons and
	      leading zeros should be added to each single-digit hexadecimal
	      number to convert the address into the form that
	      <citerefentry><refentrytitle>arp</refentrytitle><manvolnum>8</manvolnum></citerefentry> desires; see the manual page on
	      <citerefentry><refentrytitle>arp</refentrytitle><manvolnum>8</manvolnum></citerefentry> for complete information on
	      usage.</para>

	    <note>
	      <para>When you create
		<filename>/etc/sliphome/slip.login</filename> and
		<filename>/etc/sliphome/slip.logout</filename>, the
		<quote>execute</quote> bit (ie, <command>chmod 755
		  /etc/sliphome/slip.login
		  /etc/sliphome/slip.logout</command>) must be set, or
		<command>sliplogin</command> will be unable to execute
		it.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title><filename>slip.logout</filename> Configuration</title>
	    
	    <para><filename>/etc/sliphome/slip.logout</filename> is not
	      strictly needed (unless you are implementing <quote>proxy ARP</quote>), but
	      if you decide to create it, this is an example of a basic
	      <filename>slip.logout</filename> script:</para>
	    
	    <programlisting>
#!/bin/sh -
#
#       slip.logout

#
# logout file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 down
	    </programlisting>

	    <para>If you are using <quote>proxy ARP</quote>, you will want to have
	      <filename>/etc/sliphome/slip.logout</filename> remove the ARP
	      entry for the SLIP client:</para>
	    
	    <programlisting>
#!/bin/sh -
#
#       @(#)slip.logout

#
# logout file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 down
# Quit answering ARP requests for the SLIP client
/usr/sbin/arp -d $5	      
	    </programlisting>
	    
	    <para>The <command>arp -d &#36;5</command> removes the ARP entry
	      that the <quote>proxy ARP</quote> <filename>slip.login</filename> added
	      when the SLIP client logged in.</para>
	    
	    <para>It bears repeating: make sure
	      <filename>/etc/sliphome/slip.logout</filename> has the execute
	      bit set for after you create it (ie, <command>chmod
		755 /etc/sliphome/slip.logout</command>).</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Routing Considerations</title>
	  
	  <para>If you are not using the <quote>proxy ARP</quote> method for routing
	    packets between your SLIP clients and the rest of your network
	    (and perhaps the Internet), you will probably either have to add
	    static routes to your closest default router(s) to route your SLIP
	    client subnet via your SLIP server, or you will probably need to
	    install and configure <command>gated</command> on your
	    FreeBSD SLIP server so that it will tell your routers via
	    appropriate routing protocols about your SLIP subnet.</para>
	  
	  
	  <sect3>
	    <title>Static Routes</title>
	    
	    <para>Adding static routes to your nearest default routers can be
	      troublesome (or impossible, if you do not have authority to do
	      so...). If you have a multiple-router network in your
	      organization, some routers, such as Cisco and Proteon, may not
	      only need to be configured with the static route to the SLIP
	      subnet, but also need to be told which static routes to tell
	      other routers about, so some expertise and
	      troubleshooting/tweaking may be necessary to get
	      static-route-based routing to work.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Running <command>gated</command></title>
	    
	    <para>An alternative to the headaches of static routes is to
	      install <command>gated</command> on your FreeBSD SLIP
	      server and configure it to use the appropriate routing protocols
	      (RIP/OSPF/BGP/EGP) to tell other routers about your SLIP subnet.
	      You can use <command>gated</command> from the
	      <xref linkend="ports" remap="ports collection"> or retrieve and
	      build it yourself from <ulink
		URL="ftp://ftp.gated.merit.edu/research.and.development/gated/">the GateD anonymous ftp site</ulink>; I believe the current version as of this writing is <filename>gated-R3_5Alpha_8.tar.Z</filename>, which includes support for FreeBSD <quote>out-of-the-box</quote>. Complete information and documentation on <command>gated</command> is available on the Web starting at <ulink URL="http://www.gated.merit.edu/">the Merit GateD Consortium</ulink>. Compile and install it, and then write a <filename>/etc/gated.conf</filename> file to configure your gated; here is a sample, similar to what the author used on a FreeBSD SLIP server:</para>
	    
	    <programlisting>
#
# gated configuration file for dc.dsu.edu; for gated version 3.5alpha5
# Only broadcast RIP information for xxx.xxx.yy out the ed Ethernet interface
#
#
# tracing options
#
traceoptions "/var/tmp/gated.output" replace size 100k files 2 general ;

rip yes {
  interface sl noripout noripin ;
  interface ed ripin ripout version 1 ;
  traceoptions route ;
} ;

#
# Turn on a bunch of tracing info for the interface to the kernel:
kernel {
  traceoptions remnants request routes info interface ;
} ;

#
# Propagate the route to xxx.xxx.yy out the Ethernet interface via RIP
#

export proto rip interface ed {
  proto direct {
      <replaceable>xxx.xxx.yy</replaceable> mask 255.255.252.0 metric 1; # SLIP connections
  } ;
} ;

#
# Accept routes from RIP via ed Ethernet interfaces
	      
import proto rip interface ed {
  all ;
} ;
	    </programlisting>
	    
	    <para>The above sample <filename>gated.conf</filename> file
	      broadcasts routing information regarding the SLIP subnet
	      <replaceable>xxx.xxx.yy</replaceable> via RIP onto the
	      Ethernet; if you are using a different Ethernet driver than the
	      <devicename>ed</devicename> driver, you will need to change
	      the references to the <devicename>ed</devicename> interface
	      appropriately. This sample file also sets up tracing to
	      <filename>/var/tmp/gated.output</filename> for debugging
	      <command>gated</command>'s activity; you can
	      certainly turn off the tracing options if <command>gated</command> works OK for you. You will need to
	      change the <replaceable>xxx.xxx.yy</replaceable>'s into the
	      network address of your own SLIP subnet (be sure to change the
	      net mask in the <literal>proto direct</literal>
	      clause as well).</para>
	    
	    <para>When you get <command>gated</command> built and
	      installed and create a configuration file for it, you will need
	      to run <command>gated</command> in place of <command>routed</command> on your FreeBSD system; change the
	      <filename>routed/gated</filename> startup parameters in
	      <filename>/etc/netstart</filename> as appropriate for your
	      system. Please see the manual page for <command>gated</command> for information on <command>gated</command>'s command-line parameters.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Acknowledgments</title>
	  
	  <para>Thanks to these people for comments and advice regarding this
	    tutorial:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>&a.wilko;</term>
		<listitem>
		  <para></para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Piero Serini</term>
		
		<listitem>
		<para><email>Piero@Strider.Inet.IT</email></para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
      </sect1>
    </chapter>
    
    <chapter>
      <title>Advanced Networking</title>
      
      
      <sect1 id="routing">
	<title>Gateways and Routes</title>
	
	<para><emphasis>Contributed by &a.gryphon;.<!-- <br> -->6 October
	    1995.</emphasis></para>
	
	<para>For one machine to be able to find another, there must be a
	  mechanism in place to describe how to get from one to the other.
	  This is called Routing. A <quote>route</quote> is a defined pair of addresses:
	  a <quote>destination</quote> and a <quote>gateway</quote>. The pair indicates that if you are
	  trying to get to this <emphasis>destination</emphasis>, send along
	  through this <emphasis>gateway</emphasis>. There are three types of
	  destinations: individual hosts, subnets, and <quote>default</quote>. The
	  <quote>default route</quote> is used if none of the other routes apply. We will
	  talk a little bit more about default routes later on. There are
	  also three types of gateways: individual hosts, interfaces (also
	  called <quote>links</quote>), and ethernet hardware addresses.</para>
	
	
	<sect2>
	  <title>An example</title>
	  
	  <para>To illustrate different aspects of routing, we will use the
	    following example which is the output of the command
	    <command>netstat -r</command>:</para>
	  
	  <informalexample>
	    <screen>Destination      Gateway            Flags     Refs     Use     Netif Expire

default          outside-gw         UGSc       37      418      ppp0
localhost        localhost          UH          0      181       lo0
test0            0:e0:b5:36:cf:4f   UHLW        5    63288       ed0     77
10.20.30.255     link#1             UHLW        1     2421 
foobar.com       link#1             UC          0        0 
host1            0:e0:a8:37:8:1e    UHLW        3     4601       lo0
host2            0:e0:a8:37:8:1e    UHLW        0        5       lo0 =>
host2.foobar.com link#1             UC          0        0
224              link#1             UC          0        0</screen>
	  </informalexample>
	  
	  <para>The first two lines specify the default route (which we will
	    cover in the next section) and the <hostid>localhost</hostid> route.</para>
	  
	  <para>The interface (<literal>Netif</literal> column)
	    that it specifies to use for <literal>localhost</literal> is
	    <devicename>lo0</devicename>, also known as the loopback device. This
	    says to keep all traffic for this destination internal, rather
	    than sending it out over the LAN, since it will only end up back
	    where it started anyway.</para>
	  
	  <para>The next thing that stands out are the <hostid role="mac">0:e0:...</hostid> addresses. These are ethernet
	    hardware addresses. FreeBSD will automatically identify any hosts
	    (<hostid>test0</hostid> in the example) on the local
	    ethernet and add a route for that host, directly to it over the
	    ethernet interface, <devicename>ed0</devicename>. There is
	    also a timeout (<literal>Expire</literal> column)
	    associated with this type of route, which is used if we fail to
	    hear from the host in a specific amount of time. In this case the
	    route will be automatically deleted. These hosts are identified
	    using a mechanism known as RIP (Routing Information Protocol),
	    which figures out routes to local hosts based upon a shortest path
	    determination.</para>
	  
	  <para>FreeBSD will also add subnet routes for the local subnet
	    (<hostid role="ipaddr">10.20.30.255</hostid> is the broadcast
	    address for the subnet <hostid role="ipaddr">10.20.30</hostid>, and
	    <hostid role="domainname">foobar.com</hostid> is the domain name
	    associated with that subnet). The designation <literal>link#1</literal> refers to the first ethernet card in
	    the machine. You will notice no additional interface is specified
	    for those.</para>
	  
	  <para>Both of these groups (local network hosts and local subnets)
	    have their routes automatically configured by a daemon called
	    <command>routed</command>. If this is not run, then
	    only routes which are statically defined (ie. entered explicitly)
	    will exist.</para>
	  
	  <para>The <literal>host1</literal> line refers to our
	    host, which it knows by ethernet address. Since we are the
	    sending host, FreeBSD knows to use the loopback interface
	    (<devicename>lo0</devicename>) rather than sending it out
	    over the ethernet interface.</para>
	  
	  <para>The two <literal>host2</literal> lines are an
	    example of what happens when we use an ifconfig alias (see the
	    section of ethernet for reasons why we would do this). The
	    <literal>=&gt;</literal> symbol after the <devicename>lo0</devicename> interface says that not only are we
	    using the loopback (since this is address also refers to the local
	    host), but specifically it is an alias. Such routes only show up
	    on the host that supports the alias; all other hosts on the local
	    network will simply have a <literal>link#1</literal>
	    line for such.</para>
	  
	  <para>The final line (destination subnet <literal>224</literal>) deals with MultiCasting, which will be
	    covered in a another section.</para>
	  
	  <para>The other column that we should talk about are the <literal>Flags</literal>. Each route has different attributes
	    that are described in the column. Below is a short table of some
	    of these flags and their meanings:</para>
	  
	  
	  <informaltable frame="none">
	    <tgroup cols="2">
	      <tbody>
		<row>
		  <entry>U</entry>
		  <entry>Up: The route is active.</entry>
		</row>
		
		<row>
		  <entry>H</entry>
		  <entry>Host: The route destination is a single host.</entry>
		</row>
	      
		<row>
		  <entry>G</entry>
		  <entry>Gateway: Send anything
		    for this destination on to this remote system, which will
		    figure out from there where to send it.</entry>
		</row>
	      
		<row>
		  <entry>S</entry>
		  <entry>Static: This route was
		    configured manually, not automatically generated by the
		    system.</entry>
		</row>
	      
		<row>
		  <entry>C</entry>
		  <entry>Clone: Generates a new
		    route based upon this route for machines we connect to.
		    This type of route is normally used for local
		    networks.</entry>
		</row>
	      
		<row>
		  <entry>W</entry>
		  <entry>WasCloned: Indicated a
		    route that was auto-configured based upon a local area
		    network (Clone) route.</entry>
		</row>
	      
		<row>
		  <entry>L</entry>
		  <entry>Link: Route involves
		    references to ethernet hardware.</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Default routes</title>
	  
	  <para>When the local system needs to make a connection to remote
	    host, it checks the routing table to determine if a known path
	    exists. If the remote host falls into a subnet that we know how to
	    reach (Cloned routes), then the system checks to see if it can
	    connect along that interface.</para>
	  
	  <para>If all known paths fail, the system has one last option: the
	    <quote>default</quote> route. This route is a
	    special type of gateway route (usually the only one present in the
	    system), and is always marked with a <literal>c</literal> in the flags field. For hosts on a
	    local area network, this gateway is set to whatever machine has a
	    direct connection to the outside world (whether via PPP link, or
	    your hardware device attached to a dedicated data line).</para>
	  
	  <para>If you are configuring the default route for a machine which
	    itself is functioning as the gateway to the outside world, then
	    the default route will be the gateway machine at your Internet
	    Service Provider's (ISP) site.</para>
	  
	  <para>Let us look at an example of default routes. This is a common
	    configuration:</para>
	    
	    <literallayout>
[Local2]  &lt;--ether--&gt;  [Local1]  &lt;--PPP--&gt; [ISP-Serv]  &lt;--ether--&gt;  [T1-GW]
	    </literallayout>
	  
	  <para>The hosts <hostid>Local1</hostid> and <hostid>Local2</hostid> are at your site, with the formed
	    being your PPP connection to your ISP's Terminal Server. Your ISP
	    has a local network at their site, which has, among other things,
	    the server where you connect and a hardware device (T1-GW)
	    attached to the ISP's Internet feed.</para>
	  
	  <para>The default routes for each of your machines will be:</para>

	  <informaltable frame="none">
	    <tgroup cols="3">
	      <thead>
		<row>
		  <entry>host</entry>
		  <entry>default gateway</entry>
		  <entry>interface</entry>
		</row>
	      </thead>
	      
	      <tbody>
		<row>
		  <entry>Local2</entry>
		  <entry>Local1</entry>
		  <entry>ethernet</entry>
		</row>

		<row>
		  <entry>Local1</entry>
		  <entry>T1-GW</entry>
		  <entry>PPP</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	  
	  <para>A common question is <quote>Why (or how) would we set the T1-GW to
	    be the default gateway for Local1, rather than the ISP server it
	    is connected to?</quote>.</para>
	  
	  <para>Remember, since the PPP interface is using an address on the
	    ISP's local network for your side of the connection, routes for
	    any other machines on the ISP's local network will be
	    automatically generated. Hence, you will already know how to reach
	    the T1-GW machine, so there is no need for the intermediate step
	    of sending traffic to the ISP server.</para>
	  
	  <para>As a final note, it is common to use the address <hostid
	      role="ipaddr">...1</hostid> as the gateway address for your local
	    network. So (using the same example), if your local class-C
	    address space was <hostid role="ipaddr">10.20.30</hostid> and your
	    ISP was using <hostid role="ipaddr">10.9.9</hostid> then the
	    default routes would be:</para>
	  
	  <literallayout>
Local2 (10.20.30.2)             --&gt;  Local1 (10.20.30.1)
Local1 (10.20.30.1, 10.9.9.30)  --&gt;  T1-GW (10.9.9.1)
	  </literallayout>
	  
	</sect2>
	
	<sect2>
	  <title>Dual homed hosts</title>
	  
	  <para>There is one other type of configuration that we should cover,
	    and that is a host that sits on two different networks.
	    Technically, any machine functioning as a gateway (in the example
	    above, using a PPP connection) counts as a dual-homed host. But
	    the term is really only used to refer to a machine that sits on
	    two local-area networks.</para>
	  
	  <para>In one case, the machine as two ethernet cards, each having an
	    address on the separate subnets. Alternately, the machine may only
	    have one ethernet card, and be using ifconfig aliasing. The former
	    is used if two physically separate ethernet networks are in use,
	    the latter if there is one physical network segment, but two
	    logically separate subnets.</para>
	  
	  <para>Either way, routing tables are set up so that each subnet
	    knows that this machine is the defined gateway (inbound route) to
	    the other subnet. This configuration, with the machine acting as
	    a Bridge between the two subnets, is often used when we need to
	    implement packet filtering or firewall security in either or both
	    directions.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Routing propagation</title>
	  
	  <para>We have already talked about how we define our routes to the
	    outside world, but not about how the outside world finds
	    us.</para>
	  
	  <para>We already know that routing tables can be set up so that all
	    traffic for a particular address space (in our examples, a class-C
	    subnet) can be sent to a particular host on that network, which
	    will forward the packets inbound.</para>
	  
	  <para>When you get an address space assigned to your site, your
	    service provider will set up their routing tables so that all
	    traffic for your subnet will be sent down your PPP link to your
	    site. But how do sites across the country know to send to your
	    ISP?</para>
	  
	  <para>There is a system (much like the distributed DNS information)
	    that keeps track of all assigned address-spaces, and defines their
	    point of connection to the Internet Backbone. The <quote>Backbone</quote> are
	    the main trunk lines that carry Internet traffic across the
	    country, and around the world. Each backbone machine has a copy of
	    a master set of tables, which direct traffic for a particular
	    network to a specific backbone carrier, and from there down the
	    chain of service providers until it reaches your network.</para>
	  
	  <para>It is the task of your service provider to advertise to the
	    backbone sites that they are the point of connection (and thus the
	    path inward) for your site. This is known as route
	    propagation.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Troubleshooting</title>
	  
	  <para>Sometimes, there is a problem with routing propagation, and
	    some sites are unable to connect to you. Perhaps the most useful
	    command for trying to figure out where a routing is breaking down
	    is the <citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry> command. It is equally
	    useful if you cannot seem to make a connection to a remote machine
	    (ie. <citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry> fails).</para>
	  
	  <para>The <citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry> command is run with the
	    name of the remote host you are trying to connect to. It will show
	    the gateway hosts along the path of the attempt, eventually either
	    reaching the target host, or terminating because of a lack of
	    connection.</para>
	  
	  <para>For more information, see the manual page for
	    <citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="nfs">
	<title>NFS</title>
	
	<para><emphasis>Contributed by &a.jlind;.</emphasis></para>
	
	<para>Certain Ethernet adapters for ISA PC systems have limitations
	  which can lead to serious network problems, particularly with NFS.
	  This difficulty is not specific to FreeBSD, but FreeBSD systems are
	  affected by it.</para>
	
	<para>The problem nearly always occurs when (FreeBSD) PC systems are
	  networked with high-performance workstations, such as those made by
	  Silicon Graphics, Inc., and Sun Microsystems, Inc. The NFS mount
	  will work fine, and some operations may succeed, but suddenly the
	  server will seem to become unresponsive to the client, even though
	  requests to and from other systems continue to be processed. This
	  happens to the client system, whether the client is the FreeBSD
	  system or the workstation. On many systems, there is no way to shut
	  down the client gracefully once this problem has manifested itself.
	  The only solution is often to reset the client, because the NFS
	  situation cannot be resolved.</para>
	
	<para>Though the <quote>correct</quote> solution is to get a higher performance and
	  capacity Ethernet adapter for the FreeBSD system, there is a simple
	  workaround that will allow satisfactory operation. If the FreeBSD
	  system is the <emphasis>server</emphasis>, include the option <option>-w=1024</option> on the mount from
	  the client. If the FreeBSD system is the <emphasis>client</emphasis>, then mount the NFS
	  file system with the option <option>-r=1024</option>. These options may be
	  specified using the fourth field of the <filename>fstab</filename> entry on the client
	  for automatic mounts, or by using the <option>-o</option> parameter of the mount
	  command for manual mounts.</para>
	
	<para>It should be noted that there is a different problem, sometimes
	  mistaken for this one, when the NFS servers and clients are on
	  different networks. If that is the case, make <emphasis>certain</emphasis> that your
	  routers are routing the necessary UDP information, or you will not
	  get anywhere, no matter what else you are doing.</para>
	
	<para>In the following examples, <hostid>fastws</hostid> is the host (interface) name
	  of a high-performance workstation, and <hostid>freebox</hostid> is the host
	  (interface) name of a FreeBSD system with a lower-performance
	  Ethernet adapter. Also, <filename>/sharedfs</filename> will be the exported NFS
	  filesystem (see <command>man exports</command>), and <filename>/project</filename> will be the mount
	  point on the client for the exported file system. In all cases,
	  note that additional options, such as <option>hard</option> or <option>soft</option> and <option>bg</option> may
	  be desirable in your application.</para>
	
	<para>Examples for the FreeBSD system (<hostid>freebox</hostid>) as the client: in
	  <filename>/etc/fstab</filename> on freebox:

	  <programlisting>
fastws:/sharedfs /project nfs rw,-r=1024 0 0
	  </programlisting>

	  as a manual mount command on <hostid>freebox</hostid>:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>mount -t nfs -o -r=1024 fastws:/sharedfs /project</userinput></screen>
	  </informalexample>
	
	<para>Examples for the FreeBSD system as the server: in
	  <filename>/etc/fstab</filename> on <hostid>fastws</hostid>:

	  <programlisting>
freebox:/sharedfs /project nfs rw,-w=1024 0 0
	    </programlisting>

	  as a manual mount command on <hostid>fastws</hostid>:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>mount -t nfs -o -w=1024 freebox:/sharedfs /project</userinput></screen>
	  </informalexample>
	
	<para>Nearly any 16-bit Ethernet adapter will allow operation without
	  the above restrictions on the read or write size.</para>
	
	<para>For anyone who cares, here is what happens when the failure
	  occurs, which also explains why it is unrecoverable. NFS typically
	  works with a <quote>block</quote> size of 8k (though it may do fragments of
	  smaller sizes). Since the maximum Ethernet packet is around 1500
	  bytes, the NFS <quote>block</quote> gets split into multiple Ethernet packets,
	  even though it is still a single unit to the upper-level code, and
	  must be received, assembled, and <emphasis>acknowledged</emphasis> as a unit. The
	  high-performance workstations can pump out the packets which
	  comprise the NFS unit one right after the other, just as close
	  together as the standard allows. On the smaller, lower capacity
	  cards, the later packets overrun the earlier packets of the same
	  unit before they can be transferred to the host and the unit as a
	  whole cannot be reconstructed or acknowledged. As a result, the
	  workstation will time out and try again, but it will try again with
	  the entire 8K unit, and the process will be repeated, ad
	  infinitum.</para>
	
	<para>By keeping the unit size below the Ethernet packet size
	  limitation, we ensure that any complete Ethernet packet received can
	  be acknowledged individually, avoiding the deadlock
	  situation.</para>
	
	<para>Overruns may still occur when a high-performance workstations is
	  slamming data out to a PC system, but with the better cards, such
	  overruns are not guaranteed on NFS <quote>units</quote>. When an overrun occurs,
	  the units affected will be retransmitted, and there will be a fair
	  chance that they will be received, assembled, and acknowledged.</para>
	
      </sect1>
      
      <sect1 id="diskless">
	<title>Diskless Operation</title>
	
	<para><emphasis>Contributed by &a.martin;.</emphasis></para>
	
	<para><filename>netboot.com</filename>/<filename>netboot.rom</filename> allow you to boot
	  your FreeBSD machine over the network and run FreeBSD without having
	  a disk on your client. Under 2.0 it is now possible to have local
	  swap. Swapping over NFS is also still supported.</para>
	
	<para>Supported Ethernet cards include: Western Digital/SMC 8003,
	  8013, 8216 and compatibles; NE1000/NE2000 and compatibles (requires
	  recompile)</para>
	
	
	<sect2>
	  <title>Setup Instructions</title>
	  
	  
	    <procedure>
	      
	      <step>
		<para>Find a machine that will be your server. This machine
		  will require enough disk space to hold the FreeBSD 2.0
		  binaries and have bootp, tftp and NFS services available.
		  Tested machines:</para>
	      
		  <itemizedlist>
		    
		    <listitem>
		      <para>HP9000/8xx running HP-UX 9.04 or later (pre 9.04
			doesn't work)</para>
		    </listitem>
		    
		    <listitem>
		      <para>Sun/Solaris 2.3. (you may need to get
			bootp)</para>
		    </listitem>
		    
		  </itemizedlist>
		  
	      </step>
	      
	      <step>
		<para>Set up a bootp server to provide the client with IP,
		  gateway, netmask.</para>

		  <programlisting>
diskless:\
        :ht=ether:\
        :ha=0000c01f848a:\
        :sm=255.255.255.0:\
        :hn:\
        :ds=192.1.2.3:\
        :ip=192.1.2.4:\
        :gw=192.1.2.5:\
        :vm=rfc1048:
		  </programlisting>
	      </step>
	      
	      <step>
		<para>Set up a TFTP server (on same machine as bootp server)
		  to provide booting information to client. The name of this
		file is <filename>cfg.<replaceable>X.X.X.X</replaceable></filename> (or
		<filename>/tftpboot/cfg.<replaceable>X.X.X.X</replaceable></filename>, it will try
		  both) where <replaceable>X.X.X.X</replaceable> is the IP address
		  of the client. The contents of this file can be any valid
		  netboot commands. Under 2.0, netboot has the following
		  commands:</para>

	      <informaltable frame="none">
		<tgroup cols="2">
		  <tbody>
		    <row>
		      <entry>help</entry>
		      <entry>print help list</entry>
		    </row>

		    <row>
		      <entry>ip <option><replaceable>X.X.X.X</replaceable></option></entry>
		      <entry>print/set client's IP address</entry>
		    </row>

		    <row>
		      <entry>server <option><replaceable>X.X.X.X</replaceable></option></entry>
		      <entry>print/set bootp/tftp server address</entry>
		    </row>

		    <row>
		      <entry>netmask <option><replaceable>X.X.X.X</replaceable></option></entry>
		      <entry>print/set netmask</entry>
		    </row>

		    <row>
		      <entry>hostname <replaceable>name</replaceable></entry>
		      <entry>print/set hostname</entry>
		    </row>

		    <row>
		      <entry>kernel <option><replaceable>name</replaceable></option></entry>
		      <entry>print/set kernel name</entry>
		    </row>

		    <row>
		      <entry>rootfs <option><replaceable>ip:/fs</replaceable></option></entry>
		      <entry>print/set root filesystem</entry>
		    </row>

		    <row>
		      <entry>swapfs <option><replaceable>ip:/fs</replaceable></option></entry>
		      <entry>print/set swap filesystem</entry>
		    </row>

		    <row>
		      <entry>swapsize <option><replaceable>size</replaceable></option></entry>
		      <entry>set diskless swapsize in Kbytes</entry>
		    </row>

		    <row>
		      <entry>diskboot</entry>
		      <entry>boot from disk</entry>
		    </row>

		    <row>
		      <entry>autoboot</entry>
		      <entry>continue boot process</entry>
		    </row>

		    <row>
		      <entry>trans
			<option>on</option>|<option>off</option></entry>
		      <entry>turn transceiver on|off</entry>
		    </row>

		    <row>
		      <entry>flags
			<option>b</option><option>c</option><option>d</option><option>h</option><option>s</option><option>v</option></entry>
		      <entry>set boot flags</entry>
		    </row>
		  </tbody>
		</tgroup>
	      </informaltable>
	      
		  <para>A typical completely diskless cfg file
		  might contain:</para>

		  <programlisting>
rootfs 192.1.2.3:/rootfs/myclient
swapfs 192.1.2.3:/swapfs
swapsize 20000
hostname myclient.mydomain
		  </programlisting>

	      <para>A cfg file for a machine with local swap
		  might contain:</para>

		  <programlisting>
rootfs 192.1.2.3:/rootfs/myclient
hostname myclient.mydomain
		  </programlisting>
	      </step>
	      
	      <step>
		<para>Ensure that your NFS server has exported the root (and
		  swap if applicable) filesystems to your client, and that the
		  client has root access to these filesystems A typical
		  <filename>/etc/exports</filename> file on FreeBSD might look
		  like:</para>

		  <programlisting>
/rootfs/myclient -maproot=0:0 myclient.mydomain
/swapfs -maproot=0:0 myclient.mydomain
		  </programlisting>

	      <para>And on HP-UX:</para>

		  <programlisting>
/rootfs/myclient -root=myclient.mydomain
/swapfs -root=myclient.mydomain
		  </programlisting>
	      </step>
	      
	      <step>
		<para>If you are swapping over NFS (completely diskless
		  configuration) create a swap file for your client using
		  <command>dd</command>. If your <command>swapfs</command> command has the arguments
		  <filename>/swapfs</filename> and the size 20000 as in the
		  example above, the swapfile for myclient will be called
		<filename>/swapfs/swap.<replaceable>X.X.X.X</replaceable></filename> where
		  <replaceable>X.X.X.X</replaceable> is the client's IP addr, eg:</para>

		  <informalexample>
		    <screen>&prompt.root; <userinput>dd if=/dev/zero of=/swapfs/swap.192.1.2.4 bs=1k count=20000</userinput></screen>
		  </informalexample>

	      <para>Also, the client's swap space might
		  contain sensitive information once swapping starts, so make
		  sure to restrict read and write access to this file to
		  prevent unauthorized access:</para>
	      
		  <informalexample>
		    <screen>&prompt.root; <userinput>chmod 0600 /swapfs/swap.192.1.2.4</userinput></screen>
		  </informalexample>
	      </step>
	      
	      <step>
		<para>Unpack the root filesystem in the directory the client
		  will use for its root filesystem
		  (<filename>/rootfs/myclient</filename> in the example
		  above).
		  
		  <itemizedlist>
		    
		    <listitem>
		      <para>On HP-UX systems: The server should be running
			HP-UX 9.04 or later for HP9000/800 series machines.
			Prior versions do not allow the creation of device
			files over NFS.</para>
		    </listitem>
		    
		    <listitem>
		      <para>When extracting <filename>/dev</filename> in
			<filename>/rootfs/myclient</filename>, beware that
			some systems (HPUX) will not create device files that
			FreeBSD is happy with. You may have to go to single
			user mode on the first bootup (press control-c during
			the bootup phase), cd <filename>/dev</filename> and do
			a <command>sh ./MAKEDEV all</command>
			from the client to fix this.</para>
		    </listitem>
		    
		  </itemizedlist>
		  
		</para>
	      </step>
	      
	      <step>
		<para>Run <command>netboot.com</command> on the client or
		  make an EPROM from the <filename>netboot.rom</filename>
		  file</para>
	      </step>
	      
	    </procedure>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Using Shared <filename>/</filename> and
	    <filename>/usr</filename> filesystems</title>
	  
	  <para>At present there isn't an officially sanctioned way of doing
	    this, although I have been using a shared
	    <filename>/usr</filename> filesystem and individual
	    <filename>/</filename> filesystems for each client. If anyone has
	    any suggestions on how to do this cleanly, please let me and/or
	    the &a.core; know.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Compiling netboot for specific setups</title>
	  
	  <para>Netboot can be compiled to support NE1000/2000 cards by
	    changing the configuration in
	    <filename>/sys/i386/boot/netboot/Makefile</filename>. See the
	    comments at the top of this file.</para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="isdn">
	<title>ISDN</title>
	
	<para><emphasis>Last modified by &a.wlloyd;</emphasis>.</para>
	
	<para>A good resource for information on ISDN technology and hardware
	  is <ulink URL="http://alumni.caltech.edu/~dank/isdn/">Dan Kegel's
	    ISDN Page</ulink>.</para>
	
	<para>A quick simple roadmap to ISDN follows:</para>
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>If you live in Europe I suggest you investigate the ISDN
		card section.</para>
	    </listitem>
	    
	    <listitem>
	      <para>If you are planning to use ISDN primarily to connect to
		the Internet with an Internet Provider on a dialup
		non-dedicated basis, I suggest you look into Terminal
		Adapters. This will give you the most flexibility, with the
		fewest problems, if you change providers.</para>
	    </listitem>
	    
	    <listitem>
	      <para>If you are connecting two lans together, or connecting to
		the Internet with a dedicated ISDN connection, I suggest you
		consider the stand alone router/bridge option.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	<para>Cost is a significant factor in determining what solution you
	  will choose. The following options are listed from least expensive
	  to most expensive.</para>
	
	
	<sect2>
	  <title>ISDN Cards</title>
	  
	  <para><emphasis>Original Contribution by &a.hm;.</emphasis></para>
	  
	  <para>This section is really only relevant to European ISDN users.
	    The cards supported are not yet(?) available for North American
	    ISDN standards.</para>
	  
	  <para>You should be aware that this code is largely under
	    development. Specifically, drivers have only been written for two
	    manufacturers cards.</para>
	  
	  <para>PC ISDN cards support the full bandwidth of ISDN, 128Kbs.
	    These cards are often the least expensive type of ISDN equipment.</para>
	  
	  <para>Under FreeBSD 2.1.0 and 2.1.5, there is early unfinished ISDN
	    code under <filename>/usr/src/gnu/isdn</filename>. This code is
	    out of date and should not be used. If you want to go this route,
	    get the bisdn stuff. This code has been removed from the main
	    source tree starting with FreeBSD 2.2.</para>
	  
	  <para>There is the bisdn ISDN package available from  <ulink
	      URL="ftp://hub.freebsd.org/pub/bisdn">hub.freebsd.org</ulink>
	    supporting FreeBSD 2.1R, FreeBSD-current and NetBSD. The latest
	    source can be found on the above mentioned ftp server under
	    directory isdn as file bisdn-097.tar.gz.</para>
	  
	  <para>There are drivers for the following cards:</para>
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Currently all (passive) Teles cards and their clones are
		  supported for the EuroISDN (DSS1) and 1TR6 protocols.</para>
	      </listitem>
	      
	      <listitem>
		<para>Dr. Neuhaus &mdash; Niccy 1016</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  <para>There are several limitations with the bisdn stuff.
	    Specifically the following features usually associated with ISDN
	    are not supported.</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>No PPP support, only raw hdlc. This means you cannot
		  connect to most standalone routers.</para>
	      </listitem>
	      
	      <listitem>
		<para>Bridging Control Protocol not supported.</para>
	      </listitem>
	      
	      <listitem>
		<para>Multiple cards are not supported.</para>
	      </listitem>
	      
	      <listitem>
		<para>No bandwidth on demand.</para>
	      </listitem>
	      
	      <listitem>
		<para>No channel bundling.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>A majordomo maintained mailing list is available. To join the
	    list, send mail to &a.majordomo; and specify:

	    <programlisting>
subscribe freebsd-isdn
	    </programlisting>

	    in the body
	    of your message.</para>
	  
	</sect2>
	
	<sect2>
	  <title>ISDN Terminal Adapters</title>
	  
	  <para>Terminal adapters(TA), are to ISDN what modems are to regular
	    phone lines.</para>
	  
	  <para>Most TA's use the standard hayes modem AT command set, and can
	    be used as a drop in replacement for a modem.</para>
	  
	  <para>A TA will operate basically the same as a modem except
	    connection and throughput speeds will be much faster than your old
	    modem. You will need to configure <xref linkend="ppp"
	      remap="PPP"> exactly the
	    same as for a modem setup. Make sure you set your serial speed as
	    high as possible.</para>
	  
	  <para>The main advantage of using a TA to connect to an Internet
	    Provider is that you can do Dynamic PPP. As IP address space
	    becomes more and more scarce, most providers are not willing to
	    provide you with a static IP anymore. Most standalone routers are
	    not able to accommodate dynamic IP allocation.</para>
	  
	  <para>TA's completely rely on the PPP daemon that you are running
	    for their features and stability of connection. This allows you
	    to upgrade easily from using a modem to ISDN on a FreeBSD machine,
	    if you already have PPP setup. However, at the same time any
	    problems you experienced with the PPP program and are going to
	    persist.</para>
	  
	  <para>If you want maximum stability, use the kernel  <xref
	      linkend="ppp" remap="PPP"> option, not the user-land <xref
	      linkend="userppp" remap="iijPPP">.</para>
	  
	  <para>The following TA's are know to work with FreeBSD.</para>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>Motorola BitSurfer and Bitsurfer Pro</para>
	      </listitem>
	      
	      <listitem>
		<para>Adtran</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	  <para>Most other TA's will probably work as well, TA vendors try to
	    make sure their product can accept most of the standard modem AT
	    command set.</para>
	  
	  <para>The real problem with external TA's is like modems you need a
	    good serial card in your computer.</para>
	  
	  <para>You should read the <xref linkend="uart" remap="serial ports">
	    section in the handbook for a detailed understanding of serial
	    devices, and the differences between asynchronous and synchronous
	    serial ports.</para>
	  
	  <para>A TA running off a standard PC serial port (asynchronous)
	    limits you to 115.2Kbs, even though you have a 128Kbs connection.
	    To fully utilize the 128Kbs that ISDN is capable of, you must move
	    the TA to a synchronous serial card.</para>
	  
	  <para>Do not be fooled into buying an internal TA and thinking you
	    have avoided the synchronous/asynchronous issue. Internal TA's
	    simply have a standard PC serial port chip built into them. All
	    this will do, is save you having to buy another serial cable, and
	    find another empty electrical socket.</para>
	  
	  <para>A synchronous card with a TA is at least as fast as a
	    standalone router, and with a simple 386 FreeBSD box driving it,
	    probably more flexible.</para>
	  
	  <para>The choice of sync/TA vs standalone router is largely a
	    religious issue. There has been some discussion of this in the
	    mailing lists. I suggest you search the <ulink
	      URL="http://www.freebsd.org/search.html">archives</ulink> for
	    the complete discussion.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Standalone ISDN Bridges/Routers</title>
	  
	  <para>ISDN bridges or routers are not at all specific to FreeBSD or
	    any other operating system. For a more complete description of
	    routing and bridging technology, please refer to a Networking
	    reference book.</para>
	  
	  <para>In the context of this page, I will use router and bridge
	    interchangeably.</para>
	  
	  <para>As the cost of low end ISDN routers/bridges comes down, it
	    will likely become a more and more popular choice. An ISDN router
	    is a small box that plugs directly into your local Ethernet
	    network(or card), and manages its own connection to the other
	    bridge/router. It has all the software to do PPP and other
	    protocols built in.</para>
	  
	  <para>A router will allow you much faster throughput that a standard
	    TA, since it will be using a full synchronous ISDN
	    connection.</para>
	  
	  <para>The main problem with ISDN routers and bridges is that
	    interoperability between manufacturers can still be a problem. If
	    you are planning to connect to an Internet provider, I recommend
	    that you discuss your needs with them.</para>
	  
	  <para>If you are planning to connect two lan segments together, ie:
	    home lan to the office lan, this is the simplest lowest
	    maintenance solution. Since you are buying the equipment for both
	    sides of the connection you can be assured that the link will
	    work.</para>
	  
	  <para>For example to connect a home computer or branch office
	    network to a head office network the following setup could be
	    used.</para>
	  
	  <example>
	    <title>Branch office or Home network</title>
	  
	  <para>Network is 10 Base T Ethernet. Connect router to network
	    cable with AUI/10BT transceiver, if necessary.</para>

	  <!-- This should be a graphic -->
	  <programlisting>
---Sun workstation     
|
---FreeBSD box
|
---Windows 95 (Do not admit to owning it)
|
Standalone router
   |
ISDN BRI line
	  </programlisting>

	  <para>If your home/branch office is only
	    one computer you can use a twisted pair crossover cable to connect
	    to the standalone router directly.</para>
	  </example>
	  
	  <example>
	    <title>Head office or other lan</title>
	  
	  <para>Network is Twisted Pair Ethernet.</para>

	    <!-- This should be a graphic -->
	    <programlisting>
    -------Novell Server
    | H |
    |   ---Sun      
    |   |
    | U ---FreeBSD
    |   |
    |   ---Windows 95
    | B |
    |___---Standalone router
                |
        ISDN BRI line
	    </programlisting>
	  </example>
	  
	  <para>One large advantage of most routers/bridges is that they allow
	    you to have 2 <emphasis>separate independent</emphasis> PPP connections to 2 separate
	    sites at the <emphasis>same</emphasis> time. This is not supported on most TA's,
	    except for specific(expensive) models that have two serial ports.
	    Do not confuse this with channel bonding, MPP etc.</para>
	  
	  <para>This can be very useful feature, for example if you have an
	    dedicated internet ISDN connection at your office and would like
	    to tap into it, but don't want to get another ISDN line at work.
	    A router at the office location can manage a dedicated B channel
	    connection (64Kbs) to the internet, as well as a use the other B
	    channel for a separate data connection. The second B channel can
	    be used for dialin, dialout or dynamically bond(MPP etc.) with the
	    first B channel for more bandwidth.</para>
	  
	  <para>An Ethernet bridge will also allow you to transmit more than
	    just IP traffic, you can also send IPX/SPX or whatever other
	    protocols you use.</para>
	  
	</sect2>
      </sect1>
    </chapter>
    
    <chapter id="mail">
      <title>Electronic Mail</title>
      
      <para><emphasis>Contributed by &a.wlloyd;.</emphasis></para>
      
      <para>Electronic Mail configuration is the subject of many <xref
	  linkend="bibliography" remap="System Administration"> books. If you
	plan on doing anything beyond setting up one mailhost for your
	network, you need industrial strength help.</para>
      
      <para>Some parts of E-Mail configuration are controlled in the Domain
	Name System (DNS). If you are going to run your own own DNS server
	check out <filename>/etc/namedb</filename> and <command>man -k named</command> for more information.</para>
      
      
      <sect1>
	<title>Basic Information</title>
	
	<para>These are the major programs involved in an E-Mail exchange. A
	  <quote>mailhost</quote> is a server that is
	  responsible for delivering and receiving all email for your host,
	  and possibly your network.</para>
	
	
	<sect2>
	  <title>User program</title>
	  
	  <para>This is a program like <application >elm</application>, <application>pine</application>,
	      <application>mail</application>, or something more sophisticated like a WWW
	    browser. This program will simply pass off all e-mail
	    transactions to the local <quote>mailhost</quote> ,
	    either by calling <command>sendmail</command> or
	    delivering it over TCP.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Mailhost Server Daemon</title>
	  
	  <para>Usually this program is <command>sendmail</command> or
	      <command>smail</command> running in the background. Turn it off or
	    change the command line options in
	    <filename>/etc/rc.conf</filename> (or, prior to FreeBSD 2.2.2,
	    <filename>/etc/sysconfig</filename>). It is best to leave it on,
	    unless you have a specific reason to want it off. Example: You
	    are building a <xref
	      linkend="firewalls" remap="Firewall">.</para>
	  
	  <para>You should be aware that <command>sendmail</command> is a potential weak link in a
	    secure site. Some versions of <command>sendmail</command> have known security
	    problems.</para>
	  
	  <para><command>sendmail</command> does two jobs. It looks after delivering
	    and receiving mail.</para>
	  
	  <para>If <command>sendmail</command>
	     needs to deliver mail off your site it will look up in
	    the DNS to determine the actual host that will receive mail for
	    the destination.</para>
	  
	  <para>If it is acting as a delivery agent <command>sendmail</command> will take the message from the
	    local queue and deliver it across the Internet to another sendmail
	    on the receivers computer.</para>
	  
	</sect2>
	
	<sect2>
	  <title>DNS &mdash; Name Service</title>
	  
	  <para>The Domain Name System and its daemon <command>named</command>, contain the database mapping
	    hostname to IP address, and hostname to mailhost. The IP address
	    is specified in an A record. The MX record specifies the
	    mailhost that will receive mail for you. If you do not have a
	    MX record mail for your hostname, the mail will be delivered to
	    your host directly.</para>
	  
	  <para>Unless you are running your own DNS server, you will not be
	    able to change any information in the DNS yourself. If you are
	    using an Internet Provider, speak to them.</para>
	  
	</sect2>
	
	<sect2>
	  <title>POP Servers</title>
	  
	  <para>This program gets the mail from your mailbox and gives it to
	    your browser. If you want to run a POP server on your computer,
	    you will need to do 2 things.</para>
	  
	    <procedure>
	      
	      <step>
		<para>Get pop software from the <ulink
		    URL="../ports/mail.html">Ports collection</ulink>  that
		  can be found in <filename>/usr/ports</filename> or packages
		  collection. This handbook section has a complete reference
		  on the <xref linkend="ports"
		    remap="Ports"> system.</para>
	      </step>
	      
	      <step>
		<para>Modify <filename>/etc/inetd.conf</filename>
		  to load the POP server.</para>
	      </step>
	      
	    </procedure>
	  
	  <para>The pop program will have instructions with it. Read
	    them.</para>
	  
	</sect2>
      </sect1>
      
      <sect1>
	<title>Configuration</title>
	
	
	<sect2>
	  <title>Basic</title>
	  
	  <para>As your FreeBSD system comes <quote>out of the box</quote>[TM], you should
	    be able to send E-mail to external hosts as long as you have
	    <filename>/etc/resolv.conf</filename> setup or are running a name
	    server. If you want to have mail for your host delivered to your
	    specific host,there are two methods:</para>

	  <itemizedlist>
	    <listitem>
	  <para>Run a name server (<command>man -k named</command>) and have your own domain
	    <hostid role="domainname">smallminingco.com </hostid></para>
	    </listitem>

	    <listitem>
	  <para>Get mail delivered to the current DNS name for your host.
	    Ie: <hostid role="fqdn">dorm6.ahouse.school.edu </hostid></para>
	    </listitem>
	  </itemizedlist>
	  
	  <para>No matter what option you choose, to have mail delivered
	    directly to your host, you must be a full Internet host. You must
	    have a permanent IP address. IE: NO dynamic PPP. If you are
	    behind a firewall, the firewall must be passing on smtp traffic to
	    you. From <filename>/etc/services</filename>:</para>

	    <programlisting
>smtp	      25/tcp mail         #Simple Mail Transfer
	    </programlisting>

	  <para>If you
	    want to receive mail at your host itself, you must make sure that
	    the DNS MX entry points to your host address, or there is no MX
	    entry for your DNS name.</para>
	  
	  <para>Try this:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>hostname</userinput>
newbsdbox.freebsd.org
&prompt.root; <userinput>host newbsdbox.freebsd.org</userinput>
newbsdbox.freebsd.org has address 204.216.27.xx</screen>
	    </informalexample>
	  
	  <para>If that is all that comes out for your machine, mail directory
	    to <email>root@newbsdbox.freebsd.org</email>
	    will work no problems.</para>
	  
	  <para>If instead, you have this:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>host newbsdbox.freebsd.org</userinput>
newbsdbox.FreeBSD.org has address 204.216.27.xx
newbsdbox.FreeBSD.org mail is handled (pri=10) by freefall.FreeBSD.org</screen>
	    </informalexample>

	  <para>All mail sent to your host
	    directly will end up on <hostid>freefall</hostid>, under the same username.</para>
	  
	  <para>This information is setup in your domain name server. This
	    should be the same host that is listed as your primary nameserver
	    in <filename>/etc/resolv.conf</filename></para>
	  
	  <para>The DNS record that carries mail routing information is the
	    Mail eXchange entry. If no MX entry exists, mail will be
	    delivered directly to the host by way of the Address
	    record.</para>
	  
	  <para>The MX entry for <hostid role="fqdn">freefall.freebsd.org</hostid> at one time.</para>

	    <programlisting>
freefall                       MX    30   mail.crl.net
freefall                       MX    40   agora.rdrop.com
freefall                       HINFO Pentium     FreeBSD
freefall                       MX    10   freefall.FreeBSD.org
freefall                       MX    20   who.cdrom.com
freefall                       A     204.216.27.xx
freefall                       CNAME www.FreeBSD.org
	    </programlisting>
	  
	  <para><hostid>freefall</hostid> has many MX entries. The lowest MX number gets the
	    mail in the end. The others will queue mail temporarily, if
	    <hostid>freefall</hostid> is busy or down.</para>
	  
	  <para>Alternate MX sites should have separate connections to the
	    Internet, to be most useful. An Internet Provider or other
	    friendly site can provide this service.</para>
	  
	  <para><command>dig</command>, <command>nslookup</command>,
	      and <command>host</command> are your friends.</para>
	  
	</sect2>
	
	<sect2 id="mail-domain">
	  <title>Mail for your Domain (Network).</title>
	  
	  <para>To setup up a network mailhost, you need to direct the mail
	    from arriving at all the workstations. In other words, you want to
	    hijack all mail for <hostid role="domainname">*.smallminingco.com
	    </hostid> and divert it to one machine, your <quote>mailhost</quote>.</para>
	  
	  <para>The network users on their workstations will most likely pick
	    up their mail over POP or telnet.</para>
	  
	  <para>A user account with the <emphasis>same username</emphasis> should exist on both
	    machines. Please use <command>adduser</command> to do
	    this as required. If you set the <literal>shell</literal> to
	    <literal>/nonexistent</literal>
	    the user will not be allowed to login.</para>
	  
	  <para>The mailhost that you will be using must be designated the
	    Mail eXchange for each workstation. This must be arranged in DNS
	    (ie BIND, named). Please refer to a Networking book for in-depth
	    information.</para>
	  
	  <para>You basically need to add these lines in your DNS server.</para>

	    <programlisting>
pc24.smallminingco.com	A <replaceable>xxx.xxx.xxx.xxx</replaceable>		; Workstation ip
                       MX  10 smtp.smallminingco.com	; Your mailhost
	    </programlisting>
	  
	  <para>You cannot do this yourself unless you are running a DNS
	    server. If you do not want to run a DNS server, get somebody else
	    like your Internet Provider to do it.</para>
	  
	  <para>This will redirect mail for the workstation to the Mail
	    eXchange host. It does not matter what machine the A record
	    points to, the mail will be sent to the MX host.</para>
	  
	  <para>This feature is used to implement Virtual E-Mail Hosting.</para>
	  
	  <para>Example</para>
	  
	  <para>I have a customer with domain foo.bar and I want all mail for
	    foo.bar to be sent to my machine smtp.smalliap.com. You must make
	    an entry in your DNS server like:</para>

	    <programlisting>
foo.bar                  MX  10	smtp.smalliap.com	; your mailhost
	    </programlisting>

	  <para>The A record is not needed if you only
	    want E-Mail for the domain. IE: Don't expect <command>ping foo.bar</command>
	    to work unless an Address record for <filename>foo.bar</filename>
	    exists as well.</para>
	  
	  <para>On the mailhost that actually accepts mail for final delivery
	    to a mailbox, <command>sendmail</command> must be told what hosts it will be
	    accepting mail for.</para>
	  
	  <para>Add <literal>pc24.smallminingco.com</literal> to <filename>/etc/sendmail.cw</filename> (if you are
	    using <literal>FEATURE(use_cw_file)</literal>), or add a <literal>Cw myhost.smalliap.com</literal>
	    line to <filename>/etc/sendmail.cf</filename></para>
	  
	  <para>If you plan on doing anything serious with <command>sendmail</command> you should install the <command>sendmail</command>
	    source. The source has plenty of documentation with it. You will
	    find information on getting <command>sendmail</command>
	    source from <xref linkend="sendmailuucp" remap="the UUCP
	      information">.</para>
	  
	</sect2>
	
	<sect2 id="sendmailuucp">
	  <title>Setting up UUCP.</title>
	  
	  <para><emphasis>Stolen from the FAQ.</emphasis></para>
	  
	  <para>The sendmail configuration that ships with FreeBSD is suited
	    for sites that connect directly to the Internet. Sites that wish
	    to exchange their mail via UUCP must install another <command>sendmail</command>
	    configuration file.</para>
	  
	  <para>Tweaking <filename>/etc/sendmail.cf</filename> manually is
	    considered something for purists. Sendmail version 8 comes with a
	    new approach of generating config files via some <command>m4</command> preprocessing, where the actual
	    hand-crafted configuration is on a higher abstraction level. You
	    should use the configuration files under 
	    <filename>/usr/src/usr.sbin/sendmail/cf</filename>.</para>
	  
	  <para>If you did not install your system with full sources, the
	    <command>sendmail</command> config stuff has been broken out into a separate source
	    distribution tarball just for you. Assuming you have your CD-ROM
	    mounted, do:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/src</userinput>
&prompt.root; <userinput>tar -xvzf /cdrom/dists/src/ssmailcf.aa</userinput></screen>
	  </informalexample>
	  
	  <para>Do not panic, this is only a few hundred kilobytes in size.
	    The file <filename>README</filename> in the <filename>cf</filename> directory can serve as a basic
	    introduction to m4 configuration.</para>
	  
	  <para>For UUCP delivery, you are best advised to use the
	    <emphasis>mailertable</emphasis> feature. This constitutes a
	    database that <command>sendmail</command> can use to base its routing decision
	    upon.</para>
	  
	  <para>First, you have to create your <filename>.mc</filename> file.
	    The directory
	    <filename>/usr/src/usr.sbin/sendmail/cf/cf</filename> is the home
	    of these files. Look around, there are already a few examples.
	    Assuming you have named your file <filename>foo.mc</filename>, all
	    you need to do in order to convert it into a valid
	    <filename>sendmail.cf</filename> is:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/src/usr.sbin/sendmail/cf/cf</userinput>
&prompt.root; <userinput>make foo.cf</userinput></screen>
	  </informalexample>
	  
	  <para>If you don't have a <filename>/usr/obj</filename> hiearchy,
	    then:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cp foo.cf /etc/sendmail.cf</userinput></screen>
	  </informalexample>
	  
	  <para>Otherwise:</para>
	  
	  <informalexample>
	    <screen>&prompt.root; <userinput>cp /usr/obj/`pwd`/foo.cf /etc/sendmail.cf</userinput></screen>
	  </informalexample>
	  
	  <para>A typical <filename>.mc</filename> file might look
	    like:</para>
	  
	  <programlisting>
include(`../m4/cf.m4')
VERSIONID(`<replaceable>Your version number</replaceable>')
OSTYPE(bsd4.4)

FEATURE(nodns)
FEATURE(nocanonify)
FEATURE(mailertable)

define(`UUCP_RELAY', <replaceable>your.uucp.relay</replaceable>)
define(`UUCP_MAX_SIZE', 200000)

MAILER(local)
MAILER(smtp)
MAILER(uucp)

Cw    <replaceable>your.alias.host.name</replaceable>
Cw    <replaceable>youruucpnodename.UUCP</replaceable>
	  </programlisting>
	  
	  <para>The <literal>nodns</literal> and
	    <literal>nocanonify</literal> features will prevent any usage of
	    the DNS during mail delivery. The <literal>UUCP_RELAY</literal>
	    clause is needed for bizarre reasons, do not ask. Simply put an
	    Internet hostname there that is able to handle .UUCP pseudo-domain
	    addresses; most likely, you will enter the mail relay of your ISP
	    there.</para>
	  
	  <para>Once you have this, you need this file called
	    <filename>/etc/mailertable</filename>. A typical example of this
	    gender again:</para>
	  
	  <programlisting>
#
# makemap hash /etc/mailertable.db &lt; /etc/mailertable
#
horus.interface-business.de   uucp-dom:horus
.interface-business.de        uucp-dom:if-bus
interface-business.de         uucp-dom:if-bus
.heep.sax.de                  smtp8:%1 horus.UUCP
uucp-dom:horus                if-bus.UUCP
uucp-dom:if-bus .	      uucp-dom:sax
	  </programlisting>
	  
	  <para>As you can see, this is part of a real-life file. The first
	    three lines handle special cases where domain-addressed mail
	    should not be sent out to the default route, but instead to some
	    UUCP neighbor in order to <quote>shortcut</quote> the delivery path. The
	    next line handles mail to the local Ethernet domain that can be
	    delivered using SMTP. Finally, the UUCP neighbors are mentioned
	    in the .UUCP pseudo-domain notation, to allow for a
	    <literal>uucp-neighbor!recipient</literal> override of the default rules. The
	    last line is always a single dot, matching everything else, with
	    UUCP delivery to a UUCP neighbor that serves as your universal
	    mail gateway to the world. All of the node names behind the
	    <literal>uucp-dom:</literal> keyword must be valid UUCP
	    neighbors, as you can verify using the command <command>uuname</command>.</para>
	  
	  <para>As a reminder that this file needs to be converted into a DBM
	    database file before being usable, the command line to accomplish
	    this is best placed as a comment at the top of the <filename>mailertable</filename>.
	    You always have to execute this command each time you change your
	    <filename>mailertable</filename>.</para>
	  
	  <para>Final hint: if you are uncertain whether some particular mail
	    routing would work, remember the <option>-bt</option> option to
	    <command>sendmail</command>. It starts <command>sendmail</command>
	    in <quote>address test
	      mode</quote>; simply enter <literal>0</literal>, followed by the address
	    you wish to test for the mail routing. The last line tells you
	    the used internal mail agent, the destination host this agent will
	    be called with, and the (possibly translated) address. Leave this
	    mode by typing Control-D.</para>
	  
	  <informalexample>
	    <screen>&prompt.user; <userinput>sendmail -bt</userinput>
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter &lt;ruleset&gt; &lt;address&gt;
<prompt>&gt;</prompt> <userinput>0 foo@interface-business.de</userinput>
rewrite: ruleset  0   input: foo @ interface-business . de
&hellip;
rewrite: ruleset  0 returns: $# uucp-dom $@ if-bus $: foo &lt; @ interface-business . de</screen>
	  </informalexample>
	  
	</sect2>
      </sect1>
      
      <sect1 id="mailfaq">
	<title>FAQ</title>
	
	<para><emphasis>Migration from FAQ.</emphasis></para>
	
	
	<sect2>
	  <title>Why do I have to use the FQDN for hosts on my site?</title>
	  
	  <para>You will probably find that the host is actually in a
	    different domain; for example, if you are in <hostid role="fqdn">foo.bar.edu</hostid> and you
	    wish to reach a host called <hostid>mumble</hostid> in the <hostid
	      role="domainname">bar.edu</hostid> domain, you
	    will have to refer to it by the fully-qualified domain name,
	    <hostid role="fqdn">mumble.bar.edu</hostid>, instead of just <hostid>mumble</hostid>.</para>
	  
	  <para>Traditionally, this was allowed by BSD BIND resolvers. However
	    the current version of <application>BIND</application> that ships with
	    FreeBSD no longer provides default abbreviations for non-fully
	    qualified domain names other than the domain you are in. So an
	    unqualified host <hostid>mumble</hostid> must either
	    be found as <hostid role="fqdn">mumble.foo.bar.edu</hostid>, or
	    it will be searched for in the root domain.</para>
	  
	  <para>This is different from the previous behavior, where the search
	    continued across <hostid role="domainname">mumble.bar.edu</hostid>,
	    and <hostid role="domainname">mumble.edu</hostid>. Have a look at
	    RFC 1535 for why this was considered bad practice, or even a
	    security hole.</para>
	  
	  <para>As a good workaround, you can place the line
	  
	  <programlisting>
search foo.bar.edu bar.edu
	  </programlisting>
	  
	  instead of the previous
	  
	  <programlisting>
domain foo.bar.edu
	  </programlisting>
	  
	  into your <filename>/etc/resolv.conf</filename>. However,
	    make sure that the search order does not go beyond the <quote>boundary
	    between local and public administration</quote>, as RFC 1535 calls
	    it.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Sendmail says <errorname>mail loops back to myself</errorname></title>
	  
	  <para>This is answered in the sendmail FAQ as follows:</para>
	  
	    <programlisting>
* I am getting "Local configuration error" messages, such as:

553 relay.domain.net config error: mail loops back to myself
554 &lt;user@domain.net&gt;... Local configuration error

How can I solve this problem?

You have asked mail to the domain (e.g., domain.net) to be
forwarded to a specific host (in this case, relay.domain.net)
by using an MX record, but the relay machine does not recognize
itself as domain.net. Add domain.net to /etc/sendmail.cw
(if you are using FEATURE(use_cw_file)) or add "Cw domain.net"
to /etc/sendmail.cf.
	    </programlisting>
	  
	  <para>The sendmail FAQ is in
	    <filename>/usr/src/usr.sbin/sendmail</filename> and is recommended
	    reading if you want to do any <quote>tweaking</quote> of your mail
	    setup.</para>
	  
	</sect2>
	
	<sect2>
	  <title>How can I do E-Mail with a dialup PPP host?</title>
	  
	  <para>You want to connect a FreeBSD box on a lan, to the Internet.
	    The FreeBSD box will be a mail gateway for the lan. The PPP
	    connection is non-dedicated.</para>
	  
	  <para>There are at least two way to do this.</para>
	  
	  <para>The other is to use UUCP.</para>
	  
	  <para>The key is to get a Internet site to provide secondary MX
	    services for your domain. For example:</para>

	    <programlisting>
bigco.com.	      MX	10	bigco.com.
                      MX        20      smalliap.com.
	    </programlisting>
	  
	  <para>Only one host should be specified as the final recipient ( add
	    <literal>Cw bigco.com</literal> in <filename>/etc/sendmail.cf</filename> on
	    bigco.com).</para>
	  
	  <para>When the senders <command>sendmail</command> is trying to deliver the mail it
	    will try to connect to you over the modem link. It will most
	    likely time out because you are not online. <command>sendmail</command> will
	    automatically deliver it to the secondary MX site, ie your
	    Internet provider. The secondary MX site will try every
	    (<literal>sendmail_flags = "-bd -q15m"</literal> in
	    <filename>/etc/rc.conf</filename> ) 15 minutes to connect to your
	    host to deliver the mail to the primary MX site.</para>
	  
	  <para>You might wat to use something like this as a login script.</para>

	    <programlisting>
#!/bin/sh
# Put me in /usr/local/bin/pppbigco
( sleep 60 ; /usr/sbin/sendmail -q ) &amp;
/usr/sbin/ppp -direct pppbigco
	    </programlisting>

	  <para>If you are going to create a separate
	    login script for a user you could use <command>sendmail
	      -qRbigco.com</command> instead in the script above. This will
	    force all mail in your queue for bigco.com to be processed
	    immediately.</para>
	  
	  <para>A further refinement of the situation is as follows.</para>
	  
	  <para>Message stolen from the freebsd-isp mailing list.</para>

	    <programlisting>
&gt; we provide the secondary mx for a customer. The customer connects to
&gt; our services several times a day automatically to get the mails to
&gt; his primary mx (We do not call his site when a mail for his domains
&gt; arrived). Our sendmail sends the mailqueue every 30 minutes. At the
&gt; moment he has to stay 30 minutes online to be sure that all mail is
&gt; gone to the primary mx.
&gt;
&gt; Is there a command that would initiate sendmail to send all the mails
&gt; now? The user has not root-privileges on our machine of course.

In the 'privacy flags' section of sendmail.cf, there is a definition
Opgoaway,restrictqrun

Remove restrictqrun to allow non-root users to start the queue processing.
You might also like to rearrange the MXs. We are the 1st MX for our
customers like this, and we have defined:

# If we are the best MX for a host, try directly instead of generating
# local config error.
OwTrue

That way a remote site will deliver straight to you, without trying
the customer connection. You then send to your customer. Only works for
"hosts", so you need to get your customer to name their mail machine
"customer.com" as well as "hostname.customer.com" in the DNS. Just put
an A record in the DNS for "customer.com".</programlisting>
	  
	</sect2>
      </sect1>
    </chapter>
  </part>
  
  <part>
    <title>Advanced topics</title>
    
    
    <chapter>
      <title>The Cutting Edge: FreeBSD-current and FreeBSD-stable</title>
      
      <para>FreeBSD is under constant development between releases. For
	people who want to be on the cutting edge, there are several easy
	mechanisms for keeping your system in sync with the latest
	developments. Be warned: the cutting edge is not for everyone! This
	chapter will help you decide if you want to track the development
	system, or stick with one of the released versions.</para>
      
      
      <sect1 id="current">
	<title>Staying Current with FreeBSD</title>
	
	<para><emphasis>Contributed by &a.jkh;.</emphasis></para>
	
	
	<sect2>
	  <title>What is FreeBSD-current?</title>
	  
	  <para>FreeBSD-current is, quite literally, nothing more than a daily
	    snapshot of the working sources for FreeBSD. These include work
	    in progress, experimental changes and transitional mechanisms that
	    may or may not be present in the next official release of the
	    software. While many of us compile almost daily from
	    FreeBSD-current sources, there are periods of time when the
	    sources are literally un-compilable. These problems are generally
	    resolved as expeditiously as possible, but whether or not
	    FreeBSD-current sources bring disaster or greatly desired
	    functionality can literally be a matter of which part of any given
	    24 hour period you grabbed them in!</para>
	  
	</sect2>
	
	<sect2>
	  <title>Who needs FreeBSD-current?</title>
	  
	  <para>FreeBSD-current is made generally available for 3 primary
	    interest groups:</para>
	  
	    <orderedlist>
	      
	      <listitem>
		<para>Members of the FreeBSD group who are actively working
		  on some part of the source tree and for whom keeping
		  <quote>current</quote> is an absolute requirement.</para>
	      </listitem>
	      
	      <listitem>
		<para>Members of the FreeBSD group who are active testers,
		  willing to spend time working through problems in order to
		  ensure that FreeBSD-current remains as sane as possible.
		  These are also people who wish to make topical suggestions
		  on changes and the general direction of FreeBSD.</para>
	      </listitem>
	      
	      <listitem>
		<para>Peripheral members of the FreeBSD (or some other)
		  group who merely wish to keep an eye on things and use the
		  current sources for reference purposes (e.g. for
		  <emphasis>reading</emphasis>, not running). These people
		  also make the occasional comment or contribute code.</para>
	      </listitem>
	      
	    </orderedlist>
	  
	</sect2>
	
	<sect2>
	  <title>What is FreeBSD-current <emphasis>not</emphasis>?</title>
	  
	  
	    <orderedlist>
	      
	      <listitem>
		<para>A fast-track to getting pre-release bits because you
		  heard there is some cool new feature in there and you want
		  to be the first on your block to have it.</para>
	      </listitem>
	      
	      <listitem>
		<para>A quick way of getting bug fixes.</para>
	      </listitem>
	      
	      <listitem>
		<para>In any way <quote>officially supported</quote> by us. We do our
		  best to help people genuinely in one of the 3 <quote>legitimate</quote>
		  FreeBSD-current categories, but we simply <emphasis>do not
		    have the time</emphasis> to provide tech support for it.
		  This is not because we are mean and nasty people who do not
		  like helping people out (we would not even be doing FreeBSD
		  if we were), it is literally because we cannot answer 400
		  messages a day <emphasis>and</emphasis> actually work on
		  FreeBSD! I am sure that, if given the choice between having
		  us answer lots of questions or continuing to improve
		  FreeBSD, most of you would vote for us improving it.</para>
	      </listitem>
	      
	    </orderedlist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Using FreeBSD-current</title>
	  
	  
	    <orderedlist>
	      
	      <listitem>
		<para>Join the &a.current; and the &a.cvsall; . This is not
		  just a good idea, it is <emphasis>essential</emphasis>. If
		  you are not on the <emphasis>FreeBSD-current</emphasis>
		  mailing list you will not see the comments that people are
		  making about the current state of the system and thus will
		  probably end up stumbling over a lot of problems that others
		  have already found and solved. Even more importantly, you
		  will miss out on potentially critical information (e.g.
		  <quote>Yo, Everybody! Before you rebuild
		  <filename>/usr/src</filename>, you <emphasis>must</emphasis>
		  rebuild the kernel or your system will crash horribly!</quote>).
		  The <email>cvs-all</email> mailing list will allow you
		  to see the commit log entry for each change as it is made
		  along with any pertinent information on possible
		  side-effects. To join these lists, send mail to
		  &a.majordomo; and specify:

		  <programlisting>
subscribe freebsd-current
subscribe cvs-all
		  </programlisting>

		  in the
		  body of your message. Optionally, you can also say <literal>help</literal>
		  and Majordomo will send you full help on how to subscribe
		  and unsubscribe to the various other mailing lists we
		  support.</para>
	      </listitem>
	      
	      <listitem>
		<para>Grab the sources from <hostid role="fqdn">ftp.FreeBSD.ORG</hostid>. You can do
		  this in three ways:</para>
		  
		  <orderedlist>
		    
		    <listitem>
		  <para>Use the <application><xref linkend="ctm" remap="CTM"></application>
			facility. Unless you  have a good TCP/IP connection
			at a flat rate, this is  the way to do it.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Use the <xref linkend="cvsup" remap="cvsup">
			program with <ulink
			  URL="ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/share/examples/cvsup/standard-supfile">this supfile</ulink>. This is the second most recommended method, since it allows  you to grab the entire collection once and then only what has changed from then on. Many people run cvsup from cron and keep their sources up-to-date automatically.</para>
		    </listitem>
		    
		    <listitem>
		  <para>Use <command>ftp</command>. The source tree for FreeBSD-current is
			always <quote>exported</quote> on: <ulink
		      URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current">ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current</ulink> We also use <command>wu-ftpd</command> which allows compressed/tar'd grabbing of whole trees. e.g. you see:</para>

			<informalexample>
			  <screen>usr.bin/lex</screen>
			</informalexample>

		    <para>You can do:

			<informalexample>
			  <screen><prompt>ftp&gt;</prompt> <userinput>cd usr.bin</userinput>
<prompt>ftp&gt;</prompt> <userinput>get lex.tar.Z</userinput></screen>
			</informalexample>

		      and it will get the whole directory for you as a compressed tar file.</para>
		    </listitem>
		    
		  </orderedlist>
		  
		
	      </listitem>
	      
	      <listitem>
		<para>Essentially, if you need rapid on-demand access to the
		  source and communications bandwidth is not a consideration,
		use <command>cvsup</command> or <command>ftp</command>. Otherwise, use <application>CTM</application>.</para>
	      </listitem>
	      
	      <listitem>
		<para>If you are grabbing the sources to run, and not just
		  look at, then grab <emphasis>all</emphasis> of current, not
		  just selected portions. The reason for this is that various
		  parts of the source depend on updates elsewhere, and trying
		  to compile just a subset is almost guaranteed to get you
		  into trouble.</para>
	      </listitem>
	      
	      <listitem>
		<para>Before compiling current, read the Makefile in
		  <filename>/usr/src</filename> carefully. You should at
		  least run a <xref
		    linkend="makeworld" remap="make world"> the first time
		  through as part of the upgrading process. Reading the
		  &a.current; will keep you up-to-date on other bootstrapping
		  procedures that sometimes become necessary as we move
		  towards	the next release.</para>
	      </listitem>
	      
	      <listitem>
		<para>Be active! If you are  running FreeBSD-current, we
		  want to know what you have to say about it, especially if
		  you have suggestions for enhancements or bug fixes.
		  Suggestions with accompanying code are received most
		  enthusiastically!</para>
	      </listitem>
	      
	    </orderedlist>
	    
	</sect2>
      </sect1>
      
      <sect1 id="stable">
	<title>Staying Stable with FreeBSD</title>
	
	<para><emphasis>Contributed by &a.jkh;.</emphasis></para>
	
	
	<sect2>
	  <title>What is FreeBSD-stable?</title>
	  
	  <para>FreeBSD-stable is our development branch for a more low-key
	    and conservative set of changes intended for our next mainstream
	    release. Changes of an experimental or untested nature do not go
	    into this branch (see <xref linkend="current"
	      remap="FreeBSD-current">).</para>
	  
	</sect2>
	
	<sect2>
	  <title>Who needs FreeBSD-stable?</title>
	  
	  <para>If you are a commercial user or someone who puts maximum
	    stability of their FreeBSD system before all other concerns, you
	    should consider tracking <emphasis>stable</emphasis>. This is
	    especially true if you have installed the most recent release
	    (<ulink
	      URL="ftp://ftp.freebsd.org/pub/FreeBSD/&rel.current;-RELEASE">&rel.current;-RELEASE</ulink> at the time of this writing) since the <emphasis>stable</emphasis> branch is effectively a bug-fix stream relative to the previous release.</para>

	  <warning>
	    <para>The <emphasis>stable</emphasis> tree endeavors, above all,
	      to be fully compilable and stable at all times, but we do
	      occasionally make mistakes (these are still active sources with
	      quickly-transmitted updates, after all). We also do our best to
	      thoroughly test fixes in <emphasis>current</emphasis> before
	      bringing them into <emphasis>stable</emphasis>, but sometimes
	      our tests fail to catch every case. If something breaks for you
	      in <emphasis>stable</emphasis>, please let us know
	      <emphasis>immediately!</emphasis> (see next section).</para>
	  </warning>
	</sect2>
	
	<sect2>
	  <title>Using FreeBSD-stable</title>
	  
	  
	    <orderedlist>
	      
	      <listitem>
		<para>Join the &a.stable; . This will keep you informed of
		  build-dependencies that may appear in
		  <emphasis>stable</emphasis> or any other issues requiring
		  special attention. Developers will also make announcements
		  in this mailing list when they are contemplating some
		  controversial fix or update, giving the users a chance to
		  respond if they have any issues to raise concerning the
		  proposed change. To join this list, send mail to
		  &a.majordomo; and say:

		  <programlisting>
subscribe freebsd-stable
		  </programlisting> In the body of your
		  message. Optionally, you can also say `help' and Majordomo
		  will send you full help on how to subscribe and unsubscribe
		  to the various other mailing lists we support.</para>
	      </listitem>
	      
	      <listitem>
		<para>Grab the sources from <hostid role="fqdn">ftp.FreeBSD.ORG</hostid>. You can do
		  this in three ways:
		  
		  <orderedlist>
		    
		    <listitem>
		      <para>Use the <application><xref linkend="ctm" remap="CTM"></application>
			facility. Unless you  have a good TCP/IP connection
			at a flat rate, this is  the way to do it.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Use the <xref linkend="cvsup" remap="cvsup">
			program with <ulink
			  URL="ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/share/examples/cvsup/stable-supfile">this supfile</ulink>. This is the second most recommended method, since it allows  you to grab the entire collection once and then only what has changed from then on. Many people run cvsup from cron to keep their sources up-to-date automatically.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Use <command>ftp</command>. The source tree for FreeBSD-stable is
			always <quote>exported</quote> on: <ulink
			  URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-stable">ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-stable</ulink></para>
		      
		      <para>We also use <command>wu-ftpd</command> which allows
			compressed/tar'd grabbing of whole trees. e.g. you
			see:</para>

			<informalexample>
			  <screen>usr.bin/lex</screen>
			</informalexample>

		      <para>You can do:

			<informalexample>
			  <screen><prompt>ftp&gt;</prompt> <userinput>cd usr.bin</userinput>
<prompt>ftp&gt;</prompt> <userinput>get lex.tar.Z</userinput></screen>
			</informalexample>

			and it will get the
			whole directory for you as a compressed tar
			file.</para>
		    </listitem>
		    
		  </orderedlist>
		  
		</para>
	      </listitem>
	      
	      <listitem>
		<para>Essentially, if you need rapid on-demand access to the
		  source and communications bandwidth is not a consideration,
		  use <command>cvsup</command> or <command>ftp</command>. Otherwise, use <application>CTM</application>.</para>
	      </listitem>
	      
	      <listitem>
		<para>Before compiling stable, read the Makefile in
		  <filename>/usr/src</filename> carefully. You should at
		  least run a <xref
		    linkend="makeworld" remap="make world"> the first time
		  through as part of the upgrading process. Reading the
		  &a.stable; will keep you up-to-date on other bootstrapping
		  procedures that sometimes become necessary as we move
		  towards the next release.</para>
	      </listitem>
	      
	    </orderedlist>
	    
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="synching">
	<title>Synchronizing Source Trees over the Internet</title>
	
	<para><emphasis>Contributed by &a.jkh;.</emphasis></para>
	
	<para>There are various ways of using an Internet (or email)
	  connection to stay up-to-date with any given area of the FreeBSD
	  project sources, or all areas, depending on what interests you. The
	  primary services we offer are <application>CVSup</application> and <application>CTM</application>.</para>
	
	<para><application>CVSup</application> uses the
	  <emphasis>pull</emphasis> model of updating. The user (or a cron
	  script) invokes the <command>cvsup</command> program, and
	  it interacts with a <command>cvsupd</command> server
	  somewhere to bring your files up to date. The updates you receive
	  are up-to-the-minute and you get them when, and only when, you want
	  them. You can easily restrict your updates to the specific files or
	  directories that are of interest to you. Updates are generated on
	  the fly by the server, according to what you have and what you want
	  to have.</para>
	
	<para><application>CTM</application>, on the other hand, does not
	  interactively compare the sources you have with those on the master
	  archive. Instead, a script which identifies changes in files since
	  its previous run is executed several times a day on the master
	  archive, any detected changes being compressed, stamped with a
	  sequence-number and encoded for transmission over email (printable
	  ASCII only). Once received, these <quote>CTM deltas</quote> can then be handed
	  to the <citerefentry><refentrytitle>ctm_rmail</refentrytitle><manvolnum>1</manvolnum></citerefentry> utility which will automatically decode, verify
	  and apply the changes to the user's copy of the sources. This
	  process is far more efficient than <application>CVSup</application>, and places less strain on
	  our server resources since it is a <emphasis>push</emphasis> rather
	  than a <emphasis>pull</emphasis> model.</para>
	
	<para>There are other trade-offs, of course. If you inadvertently
	  wipe out portions of your archive, <application>CVSup</application> will detect and rebuild the
	  damaged portions for you. <application>CTM</application> won't do this, and if you wipe some
	  portion of your source tree out (and don't have it backed up) then
	  you will have to start from scratch (from the most recent CVS <quote>base
	  delta</quote>) and rebuild it all.</para>
	
	<para>For more information on <application>CTM</application> and <application>CVSup</application>, please see one of the
	  following sections:</para>
	
	
	<sect2 id="ctm">
	  <title><application>CTM</application></title>
	  
	  <para><emphasis>Contributed by &a.phk;. Updated
	      19-October-1997.</emphasis></para>
	  
	  <para><application>CTM</application> is a method for keeping a remote
	    directory tree in sync with a central one. It has been developed
	    for usage with FreeBSD's source trees, though other people may
	    find it useful for other purposes as time goes by. Little, if
	    any, documentation currently exists at this time on the process of
	    creating deltas, so talk to &a.phk; for more information should
	    you wish to use <application>CTM</application> for other things.</para>
	  
	  
	  <sect3>
	    <title>Why should I use <application>CTM</application>?</title>
	    
	    <para><application>CTM</application> will give you a local copy of the
	      FreeBSD source trees. There are a number of <quote>flavors</quote> of the
	      tree available. Whether you wish to track the entire cvs tree or
	      just one of the branches, <application>CTM</application> can provide you
	      the information. If you are an active developer on FreeBSD, but
	      have lousy or non-existent TCP/IP connectivity, or simply wish
	      to have the changes automatically sent to you,
	      <application>CTM</application> was made for you. You will need to obtain
	      up to three deltas per day for the most  active branches.
	      However, you should consider having them sent by automatic
	      email. The sizes of the updates are always kept as small as
	      possible. This is typically less than 5K, with an occasional
	      (one in ten) being 10-50K and every now and then a biggie of
	      100K+ or more coming around.</para>
	    
	    <para>You will also need to make yourself aware of the various
	      caveats  related to working directly from the development
	      sources rather than a pre-packaged release. This is particularly
	      true if you choose the <quote>current</quote> sources. It is recommended
	      that you read <xref linkend="current" remap="Staying current
		with
		FreeBSD">.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>What do I need to use <application>CTM</application>?</title>
	    
	    <para>You will need two things: The <application>CTM</application>
	      program and the initial deltas to feed it (to get up to
	      <quote>current</quote> levels).</para>
	    
	    <para>The <application>CTM</application> program has been part of FreeBSD
	      ever since version 2.0 was released, and lives in
	      <filename>/usr/src/usr.sbin/CTM</filename> if
	      you have a copy of the source online.</para>
	    
	    <para>If you are running a pre-2.0 version of FreeBSD, you can
	      fetch the current <application>CTM</application> sources directly
	      from:</para>
	    
	    <para><ulink
		URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current/src/usr.sbin/ctm">ftp://ftp.FreeBSD.ORG/pub/FreeBSD/FreeBSD-current/src/usr.sbin/ctm</ulink></para>
	    
	    <para>The <quote>deltas</quote> you feed <application>CTM</application> can be had
	      two ways, FTP or e-mail. If you have general FTP access to the
	      Internet then the following FTP sites support access to
	      <application>CTM</application>:</para>
	    
	    <para><ulink
		URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/CTM">ftp://ftp.FreeBSD.ORG/pub/FreeBSD/CTM</ulink></para>
	    
	    <para>or see section <xref linkend="mirrors-ctm"
		remap="mirrors">.</para>
	    
	    <para>FTP the relevant directory and fetch the
	      <filename>README</filename> file, starting from there.</para>
	    
	    <para>If you may wish to get your deltas via email:</para>
	    
	    <para>Send email to &a.majordomo; to subscribe to one of the
	      <application>CTM</application> distribution lists. <quote>ctm-cvs-cur</quote>
	      supports the entire cvs tree. <quote>ctm-src-cur</quote> supports the head
	      of the development branch. <quote>ctm-src-2_2</quote> supports the 2.2
	      release branch, etc. (If you do not know how to subscribe
	      yourself using majordomo, send a message first containing the
	      word <literal>help</literal> &mdash; it will send you back usage
	      instructions.)</para>
	    
	    <para>When you begin receiving your <application>CTM</application> updates
	      in the mail, you may use the <symbol>ctm_rmail</symbol> program
	      to unpack and apply them. You can actually use the
	      <symbol>ctm_rmail</symbol> program directly from a entry in
	      <filename>/etc/aliases</filename> if you want to have the
	      process run in a fully automated fashion. Check the
	      <symbol>ctm_rmail</symbol> man page for more details.</para>

	    <note>
	      <para>No matter what method you use to get the
		<application>CTM</application> deltas, you should subscribe to the
		<email>ctm-announce@FreeBSD.ORG</email> mailing list. In the
		future, this will be the only place where announcements
		concerning the operations of the <application>CTM</application> system
		will be posted. Send an email to &a.majordomo; with a single
		line of <literal>subscribe
		  ctm-announce</literal> to get added to the list.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title>Starting off with <application>CTM</application> for the first
	      time</title>
	    
	    <para>Before you can start using <application>CTM</application> deltas,
	      you will need to get a to a starting point for the deltas
	      produced subsequently to it.</para>
	    
	    <para>First you should determine what you already have. Everyone
	      can start from an <quote>empty</quote> directory. However, since the trees
	      are many tens of megabytes, you should prefer to start from
	      something already at hand. If you have a RELEASE CD, you can
	      copy or extract an initial source from it. This will save a
	      significant transfer of data.</para>
	    
	    <para>Once you identify a suitable starting point, you must use an
	      initial <quote>transition</quote> delta to transform your starting point
	      into a <application>CTM</application> supported tree.</para>
	    
	    <para>You can recognize these transition  deltas by the
	      <literal>X</literal> appended to the number
	      (<filename>src-cur.3210XEmpty.gz</filename> for instance). The
	      designation following the <filename>X</filename>
	      corresponds to the origin of your initial <quote>seed</quote>. <filename>Empty</filename> is
	      an empty directory, <filename>R225</filename> would designate the 2.2.5 release,
	      etc. As a rule a base transition from <filename>Empty</filename> is producted
	      every 100 deltas. By the way, they are large! 25 to 30
	      Megabytes of <command>gzip</command>'ed data is
	      common for the <filename>XEmpty</filename> deltas.</para>
	    
	    <para>Once you've picked a base delta to start from, you will also
	      need all deltas with higher numbers following it.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Using <application>CTM</application> in your daily life</title>
	    
	    <para>To apply the deltas, simply say:</para>
	    
	      <informalexample>
		<screen>&prompt.root; <userinput>cd /where/ever/you/want/the/stuff</userinput>
&prompt.root; <userinput>ctm -v -v /where/you/store/your/deltas/src-xxx.*</userinput></screen>
	      </informalexample>
	    
	    <para><application>CTM</application> understands deltas which have been
	      put through <command>gzip</command>, so you do not
	      need to gunzip them first, this saves disk space.</para>
	    
	    <para>Unless it feels very secure about the entire process,
	      <application>CTM</application> will not touch your tree. To verify a
	      delta you can also use the <option>-c</option> flag and
	      <application>CTM</application> will not actually touch your tree; it
	      will merely verify the integrity of the delta and see if it
	      would apply cleanly to your current tree.</para>
	    
	    <para>There are other options to <application>CTM</application> as well,
	      see the manual pages or look in the sources for more
	      information.</para>
	    
	    <para>I would also be very happy if somebody could help with the
	      <quote>user interface</quote> portions, as I have realized that I cannot
	      make up my mind on what options should do what, how and
	      when...</para>
	    
	    <para>That's really all there is to it. Every time you get a new
	      delta, just run it through <application>CTM</application> to keep your
	      sources up to date.</para>
	    
	    <para>Do not remove the deltas if they are hard to download again.
	      You just might want to keep them around in case something bad
	      happens. Even if you only have floppy disks, consider using
	      <command>fdwrite</command> to make a copy.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Keeping your local changes</title>
	    
	    <para>As a developer one would like to experiment with and change
	      files in the source tree. <application>CTM</application> supports local modifications in a
	      limited way: before checking for the presence of a file
	      <filename>foo</filename>, it first looks for
	      <filename>foo.ctm</filename>. If this file exists, CTM will
	      operate on it instead of <filename>foo</filename>.</para>
	    
	    <para>This behaviour gives us a simple way to maintain local
	      changes: simply copy the files you plan to modify to the
	      corresponding file names with a <filename>.ctm</filename>
	      suffix. Then you can freely hack  the code, while CTM keeps the
	      <filename>.ctm</filename> file up-to-date.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Other interesting <application>CTM</application> options</title>
	    
	    
	    <sect4>
	      <title>Finding out exactly what would be touched by an
		update</title>
	      
	      <para>You can determine the list of changes that <application>CTM</application> will make
		on your source repository using the <option>-l</option>
		option to <application>CTM</application>.</para>
	      
	      <para>This is useful if you would like to keep logs of the
		changes, pre- or post- process the modified files in any
		manner, or just  are feeling a tad paranoid <!-- smiley -->:-).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Making backups before updating</title>
	      
	      <para>Sometimes you may want to backup all the files that would
		be changed by a <application>CTM</application> update.</para>
	      
	      <para>Specifying the <option>-B backup-file</option> option
		causes <application>CTM</application> to backup all files that would be touched by a
		given <application>CTM</application> delta to <filename>backup-file</filename>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Restricting the files touched by an update</title>
	      
	      <para>Sometimes you would be interested in restricting the scope
		of a given <application>CTM</application> update, or may be interested in extracting just
		a few files from a sequence of deltas.</para>
	      
	      <para>You can control the list of files that <application>CTM</application> would operate
		on by specifying filtering regular expressions using the
		<option>-e</option> and <option>-x</option>
		options.</para>
	      
	      <para>For example, to extract an up-to-date copy of
		<filename>lib/libc/Makefile</filename> from your collection of
		saved CTM deltas, run the commands:</para>
	      
		<informalexample>
		  <screen>&prompt.root; <userinput>cd /where/ever/you/want/to/extract/it/</userinput>
&prompt.root; <userinput>ctm -e '^lib/libc/Makefile' ~ctm/src-xxx.*</userinput></screen>
		</informalexample>
	      
	      <para>For every file specified in a <application>CTM</application> delta, the
		<option>-e</option> and <option>-x</option> options
		are applied in the order given on the command line. The file
		is processed by <application>CTM</application> only if it is marked as eligible after all
		the <option>-e</option> and <option>-x</option>
		options are applied to it.</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Future plans for <application>CTM</application></title>
	    
	    <para>Tons of them:</para>
	    
	      <itemizedlist>
		
		<listitem>
		  <para>Use some kind of authentication into the CTM system,
		    so as to allow detection of spoofed CTM updates.</para>
		</listitem>
		
		<listitem>
		  <para>Clean up the options to <application>CTM</application>, they
		    became confusing and counter intuitive.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    <para>The bad news is that I am very busy, so any help in doing
	      this will be most welcome. And do not forget to tell me what
	      you want also...</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Miscellaneous stuff</title>
	    
	    <para>All the <quote>DES infected</quote> (e.g. export controlled) source is
	      not included. You will get the <quote>international</quote> version only.
	      If sufficient interest appears, we will set up a <literal>sec-cur</literal> sequence too. There is a
	      sequence of deltas for the <literal>ports</literal>
	      collection too, but interest has not been all that high yet.
	      Tell me if you want an email list for that too and we will
	      consider setting it up.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Thanks!</title>
	    
	    
	      <variablelist>
		<varlistentry><term>&a.bde;</term>
		  <listitem>
		    <para>for his pointed pen and invaluable comments.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>&a.sos;</term>
		  
		  <listitem>
		    <para>for patience.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>Stephen McKay</term>
		  
		  <listitem>
		    <para>wrote <command>ctm_[rs]mail</command>,
		      much appreciated.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>&a.jkh;</term>
		  
		  <listitem>
		    <para>for being so stubborn that I had to make it
		      better.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term>All the users</term>
		  
		  <listitem>
		    <para>I hope you like it...</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	</sect2>
	
	<sect2 id="cvsup">
	  <title><application>CVSup</application></title>
	  
	  <para><emphasis>Contributed by &a.jdp;</emphasis>.</para>
	  
	  
	  <sect3 id="cvsup-intro">
	    <title>Introduction</title>
	    
	    <para><application>CVSup</application> is a software package for distributing and updating
	      source trees from a master CVS repository on a remote server
	      host. The FreeBSD sources are maintained in a CVS repository on
	      a central development machine in California. With <application>CVSup</application>,
	      FreeBSD users can easily keep their own source trees up to
	      date.</para>
	    
	    <para><application>CVSup</application> uses the so-called <emphasis>pull</emphasis> model of
	      updating. Under the pull model, each client asks the server for
	      updates, if and when they are wanted. The server waits
	      passively for update requests from its clients. Thus all
	      updates are instigated by the client. The server never sends
	      unsolicited updates. Users must either run the <application>CVSup</application> client
	      manually to get an update, or they must set up a <command>cron</command> job to run
	      it automatically on a regular basis.</para>
	    
	    <para>The term <application>CVSup</application>, capitalized just so, refers to the entire
	      software package. Its main components are the client <command>cvsup</command>
	      which runs on each user's machine, and the server <command>cvsupd</command> which
	      runs at each of the FreeBSD mirror sites.</para>
	    
	    <para>As you read the FreeBSD documentation and mailing lists, you
	      may see references to <application>sup</application>. <application>Sup</application> was the
	      predecessor of <application>CVSup</application>, and it served a similar purpose. <application>CVSup</application> is
	      in used in much the same way as sup and, in fact, uses
	      configuration files which are backward-compatible with <command>sup</command>'s.
	      <application>Sup</application> is no longer used in the FreeBSD project, because <application>CVSup</application> is
	      both faster and more flexible.</para>
	    
	  </sect3>
	  
	  <sect3 id="cvsup-install">
	    <title>Installation</title>
	    
	    <para>The easiest way to install <application>CVSup</application> if you are running FreeBSD
	      2.2 or later is to use either <ulink
		URL="ftp://ftp.freebsd.org/pub/FreeBSD/ports-current/net/cvsup.tar">the port</ulink> from the FreeBSD <xref linkend="ports" remap="ports collection"> or the corresponding <ulink URL="ftp://ftp.freebsd.org/pub/FreeBSD/packages-current/net/cvsup-15.3.tgz">binary package</ulink>, depending on whether you prefer to roll your own or not.</para>
	    
	    <para>If you are running FreeBSD-2.1.6 or 2.1.7, you unfortunately
	      cannot use the binary package versions due to the fact that it
	      requires a version of the C library that does not yet exist in
	      FreeBSD-2.1.{6,7}. You can easily use <ulink
		URL="ftp://ftp.freebsd.org/pub/FreeBSD/ports-current/net/cvsup.tar">the port</ulink>, however, just as with FreeBSD 2.2. Simply unpack the tar file, cd to the cvsup subdirectory and type <command>make install</command>.</para>
	    
	    <para>Because <application>CVSup</application> is written in <ulink
		URL="http://www.research.digital.com/SRC/modula-3/html/home.html">Modula-3</ulink>, both the package and the port require that the Modula-3 runtime libraries be installed. These are available as the <ulink URL="ftp://ftp.freebsd.org/pub/FreeBSD/ports-current/lang/modula-3-lib.tar">lang/modula-3-lib</ulink> port and the <ulink URL="ftp://ftp.freebsd.org/pub/FreeBSD/packages-current/lang/modula-3-lib-3.6.tgz">lang/modula-3-lib-3.6</ulink> package. If you follow the same directions as for <command>cvsup</command>, these libraries will be compiled and/or installed automatically when you install the <application>CVSup</application> port or package.</para>
	    
	    <para>The Modula-3 libraries are rather large, and fetching and
	      compiling them is not an instantaneous process. For that
	      reason, a third option is provided. You can get
	      <emphasis>statically linked</emphasis> FreeBSD executables for
	      <application>CVSup</application> from either the USA distribution site:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsup-bin-15.3.tar.gz">ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsup-bin-15.3.tar.gz</ulink> (client including GUI).</para>
		</listitem>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsup.nogui-bin-15.3.tar.gz">ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsup.nogui-bin-15.3.tar.gz</ulink> (client without GUI).</para>
		</listitem>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsupd-bin-15.3.tar.gz">ftp://ftp.freebsd.org/pub/FreeBSD/CVSup/cvsupd-bin-15.3.tar.gz</ulink> (server).</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>or the German mirror:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsup-bin-15.3.tar.gz">ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsup-bin-15.3.tar.gz</ulink> (client including GUI).</para>
		</listitem>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsup.nogui-bin-15.3.tar.gz">ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsup.nogui-bin-15.3.tar.gz</ulink> (client without GUI).</para>
		</listitem>
		
		<listitem>
		  <para><ulink
		      URL="ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsupd-bin-15.3.tar.gz">ftp://ftp.cs.tu-berlin.de/pub/FreeBSD/CVSup/cvsupd-bin-15.3.tar.gz</ulink> (server).</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>Most users will need only the client. These executables are
	      entirely self-contained, and they will run on any version of
	      FreeBSD from FreeBSD-2.1.0 to FreeBSD-current.</para>
	    
	    <para>In summary, your options for installing CVSup are:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>FreeBSD-2.2 or later:		static binary, port,
		    or package</para>
		</listitem>
		
		<listitem>
		  <para>FreeBSD-2.1.6, 2.1.7:		static binary or
		    port</para>
		</listitem>
		
		<listitem>
		  <para>FreeBSD-2.1.5 or earlier:	static binary</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	  </sect3>
	  
	  <sect3 id="cvsup-config">
	    <title>Configuration</title>
	    
	    <para><application>CVSup</application>'s operation is controlled by a configuration file
	      called the <filename>supfile</filename>. Beginning with
	      FreeBSD-2.2, there are some sample <filename>supfiles</filename>
	      in the directory <ulink
		URL="file:/usr/share/examples/cvsup">/usr/share/examples/cvsup</ulink>. These examples are also available from <ulink URL="ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/share/examples/cvsup/">ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/share/examples/cvsup/</ulink> if you are on a pre-2.2 system.</para>
	    
	    <para>The information in a <filename>supfile</filename> answers
	      the following questions for cvsup:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><xref linkend="cvsup-config-files" remap="Which files
		      do you want to receive?"></para>
		</listitem>
		
		<listitem>
		  <para><xref linkend="cvsup-config-vers" remap="Which
		      versions of them do you want?"></para>
		</listitem>
		
		<listitem>
		  <para><xref linkend="cvsup-config-where" remap="Where do you
		      want to get them from?"></para>
		</listitem>
		
		<listitem>
		  <para><xref linkend="cvsup-config-dest" remap="Where do you
		      want to put them on your own machine?"></para>
		</listitem>
		
		<listitem>
		  <para><xref linkend="cvsup-config-status" remap="Where do
		      you want to put your status files?"></para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	    <para>In the following sections, we will construct a typical
	      <filename>supfile</filename> by answering each of these
	      questions in turn. First, we describe the overall structure of
	      a <filename>supfile</filename>.</para>
	    
	    <para>A <filename>supfile</filename> is a text file. Comments
	      begin with <literal>#</literal> and extend to the end of the line. Lines that
	      are blank and lines that contain only comments are
	      ignored.</para>
	    
	    <para>Each remaining line describes a set of files that the user
	      wishes to receive. The line begins with the name of a
	      <quote>collection</quote>, a logical grouping of files defined by the server.
	      The name of the collection tells the server which files you
	      want. After the collection name come zero or more fields,
	      separated by white space. These fields answer the questions
	      listed above. There are two types of fields: flag fields and
	      value fields. A flag field consists of a keyword standing
	      alone, e.g., <literal>delete</literal> or <literal>compress</literal>. A value field also begins
	      with a keyword, but the keyword is followed without intervening
	      white space by <literal>=</literal> and a second word. For example,
	      <literal>release=cvs</literal> is a value field.</para>
	    
	    <para>A <filename>supfile</filename> typically specifies more than
	      one collection to receive. One way to structure a
	      <filename>supfile</filename> is to specify all of the relevant
	      fields explicitly for each collection. However, that tends to
	      make the <filename>supfile</filename> lines quite long, and it
	      is inconvenient because most fields are the same for all of the
	      collections in a <filename>supfile</filename>. <application>CVSup</application> provides a
	      defaulting mechanism to avoid these problems. Lines beginning
	      with the special pseudo-collection name <literal>*default</literal> can be used
	      to set flags and values which will be used as defaults for the
	      subsequent collections in the <filename>supfile</filename>. A
	      default value can be overridden for an individual collection, by
	      specifying a different value with the collection itself.
	      Defaults can also be changed or augmented in mid-supfile by
	      additional <literal>*default</literal> lines.</para>
	    
	    <para>With this background, we will now proceed to construct a
	      <filename>supfile</filename> for receiving and updating the main
	      source tree of <xref
		linkend="current" remap="FreeBSD-current">.</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>Which files do you want to receive?<anchor id="cvsup-config-files"></para>
		  
		<para>The files available via <application>CVSup</application> are organized into named
		  groups called <quote>collections</quote>. The collections that are
		    available are described <xref linkend="cvsup-collec"
		      remap="here">. In this example, we wish to receive the
		    entire main source tree for the FreeBSD system. There is
		    a single large collection <literal>src-all</literal> which will give us all
		    of that, except the export-controlled cryptography
		    support. Let us assume for this example that we are in
		    the USA or Canada. Then we can get the cryptography code
		    with one additional collection, <literal>cvs-crypto</literal>. As a first
		    step toward constructing our <filename>supfile</filename>,
		    we simply list these collections, one per line:</para>
		  
		  <programlisting>
src-all
cvs-crypto
		  </programlisting>
		</listitem>
		
		<listitem>
		  <para>Which version(s) of them do you want?<anchor id="cvsup-config-vers"></para>
		  
		<para>With <application>CVSup</application>, you can receive virtually any version of
		    the sources that ever existed. That is possible because
		    the cvsupd server works directly from the CVS repository,
		    which contains all of the versions. You specify which one
		    of them you want using the <literal>tag=</literal> and <option>date=</option> value
		    fields.</para>

		<warning>
		  <para>e very
		    careful to specify any <literal>tag=</literal> fields correctly. Some tags
		    are valid only for certain collections of files. If you
		    specify an incorrect or misspelled tag, CVSup will delete
		    files which you probably do not want deleted. In
		    particular, use <emphasis>only
		    </emphasis> <literal>tag=.</literal> for the <literal>ports-*</literal>
		    collections.</para>
		</warning>
		
		  <para>The <literal>tag=</literal> field names a symbolic tag in the
		    repository. There are two kinds of tags, revision tags
		    and branch tags. A revision tag refers to a specific
		    revision. Its meaning stays the same from day to day. A
		    branch tag, on the other hand, refers to the latest
		    revision on a given line of development, at any given
		    time. Because a branch tag does not refer to a specific
		    revision, it may mean something different tomorrow than it
		    means today.</para>

		  <para>Here are the branch tags that users might be
		    interested in:</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>tag=.</term>
			<listitem>
			  <para>The main line of development, also known as
			    FreeBSD-current.</para>

			  <note>
			    <para>The <literal>.</literal> is not punctuation; it is the name
			      of the tag. Valid for all collections.</para>
			  </note>
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_2</term>
			
			<listitem>
			  <para>The line of development for FreeBSD-2.2.x,
			    also known as   FreeBSD-stable. Not valid for the
			    ports-* collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_0</term>
			
			<listitem>
			  <para>The line of development for FreeBSD-2.1.x -
			    this branch is largely obsolete. Not valid for the
			    ports-* collections.</para>
			  
			</listitem>
		      </varlistentry>
		    </variablelist>
		  

		  <para>Here are the revision tags that users might be
		    interested in:</para>
		  
		  
		    <variablelist>
		      <varlistentry><term>tag=RELENG_2_2_6_RELEASE</term>
			<listitem>
			  <para>FreeBSD-2.2.6. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_2_5_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.2.5. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_2_2_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.2.2. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_2_1_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.2.1. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_2_0_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.2.0. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_7_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.1.7. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_6_1_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.1.6.1. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_6_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.1.6. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_5_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.1.5. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		      
		      <varlistentry><term>tag=RELENG_2_1_0_RELEASE</term>
			
			<listitem>
			  <para>FreeBSD-2.1.0. Not valid for the ports-*
			    collections.</para>
			  
			</listitem>
		      </varlistentry>
		    </variablelist>
		  

		<warning>
		  <para>Be very
		    careful to type the tag name exactly as shown. <application>CVSup</application>
		    cannot distinguish between valid and invalid tags. If you
		    misspell the tag, <application>CVSup</application> will behave as though you had
		    specified a valid tag which happens to refer to no files
		    at all. It will delete your existing sources in that
		    case.</para>
		</warning>
		
		  <para>When you specify a branch tag, you normally receive
		    the latest versions of the files on that line of
		    development. If you wish to receive some past version,
		    you can do so by specifying a date with the <option>date=</option> value
		    field. The <citerefentry><refentrytitle>cvsup</refentrytitle><manvolnum>1</manvolnum></citerefentry> manual page explains how to do
		    that.</para>

		  <para>For our example, we wish to receive FreeBSD-current.
		    We add this line at the beginning of our
		    <filename>supfile</filename>:</para>
		  
		  <programlisting>
*default tag=.
		  </programlisting>

		  <para>There is an important special case that comes into
		    play if you specify neither a <literal>tag=</literal>
		  field nor a <literal>date=</literal>
		    field. In that case, you receive the actual RCS files
		    directly from the server's CVS repository, rather than
		    receiving a particular version. Developers generally
		    prefer this mode of operation. By maintaining a copy of
		    the repository itself on their systems, they gain the
		    ability to browse the revision histories and examine past
		    versions of files. This gain is achieved at a large cost
		    in terms of disk space, however.</para>
		</listitem>
		
		<listitem>
		  <para>Where do you want to get them from?<anchor id="cvsup-config-where"></para>
		  
		<para>We use the <literal>host=</literal> field to tell <command>cvsup</command> where to obtain
		    its updates. Any of the <xref linkend="mirrors-cvsup"
		      remap="CVSup
		      mirror sites"> will do, though you should try to select
		    one that's near to you. In this example, we'll use the
		    primary FreeBSD distribution site,
		  <hostid role="fqdn">cvsup.FreeBSD.org</hostid>:</para>
		  
		  <programlisting>
*default host=cvsup.FreeBSD.org
		  </programlisting>

		<para>On any particular run of <command>cvsup</command>, you can override this
		  setting on the command line, with <option>-h <replaceable>hostname</replaceable></option>.</para>
		</listitem>
		
		<listitem>
		  <para>Where do you want to put them on your own
		    machine?<anchor id="cvsup-config-dest"></para>
		  
		<para>The <literal>prefix=</literal> field tells <command>cvsup</command> where to put the files
		    it receives. In this example, we will put the source files
		    directly into our main source tree, <filename>/usr/src</filename>. The <filename>src</filename>
		    directory is already implicit in the collections we have
		    chosen to receive, so this is the correct
		    specification:</para>
		  
		  <programlisting>
*default prefix=/usr
		  </programlisting>
		</listitem>
		
		<listitem>
		<para>Where should <command>cvsup</command> maintain its status files?<anchor id="cvsup-config-status"></para>
		  
		  <para>The cvsup client maintains certain status files in
		    what is called the <quote>base</quote> directory. These files help
		  <application>CVSup</application> to work more efficiently, by keeping track of which
		    updates you have already received. We will use the
		    standard base directory, <filename>/usr/local/etc/cvsup</filename>:</para>
		  
		  <programlisting>
*default base=/usr/local/etc/cvsup
		  </programlisting>

		  <para>This setting is used by default if it is not specified
		    in the <filename>supfile</filename>, so we actually do not
		    need the above line.</para>

		  <para>If your base directory does not already exist, now
		  would be a good time to create it. The <command>cvsup</command> client will
		    refuse to run if the base directory does not exist.</para>
		</listitem>
		
		<listitem>
		  <para>Miscellaneous <filename>supfile</filename> settings:</para>
		  
		  <para>There is one more line of boiler plate that normally
		    needs to be present in the <filename>supfile</filename>:</para>
		  
		  <programlisting>
*default release=cvs delete use-rel-suffix compress
		  </programlisting>

		  <para><literal>release=cvs</literal> indicates that the server should get its
		    information out of the main FreeBSD CVS repository. This
		    is virtually always the case, but there are other
		    possibilities which are beyond the scope of this
		    discussion.</para>

		<para><literal>delete</literal> gives <application>CVSup</application> permission to delete files. You
		  should always specify this, so that <application>CVSup</application> can keep your
		  source tree fully up to date. <application>CVSup</application> is careful to delete
		    only those files for which it is responsible. Any extra
		    files you happen to have will be left strictly
		    alone.</para>

		  <para><literal>use-rel-suffix</literal> is ... arcane. If you really want to
		    know about it, see the <citerefentry><refentrytitle>cvsup</refentrytitle><manvolnum>1</manvolnum></citerefentry> manual page. Otherwise,
		    just specify it and do not worry about it.</para>

		  <para><literal>compress</literal> enables the use of gzip-style compression
		    on the communication channel. If your network link is T1
		    speed or faster, you probably should not use compression.
		    Otherwise, it helps substantially.</para>
		</listitem>
		
		<listitem>
		  <para>Putting it all together:</para>
		  
		  <para>Here is the entire <filename>supfile</filename> for
		    our example:</para>
		  
		  <programlisting>
*default tag=.
*default host=cvsup.FreeBSD.org
*default prefix=/usr
*default base=/usr/local/etc/cvsup
*default release=cvs delete use-rel-suffix compress

src-all
cvs-crypto
		  </programlisting>
		</listitem>
		
	      </itemizedlist>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Running <application>CVSup</application></title>
	    
	    <para>You are now ready to try an update. The command line for
	      doing this is quite simple:</para>
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>cvsup <replaceable>supfile</replaceable></userinput></screen>
	    </informalexample>
	    
	    <para>where <filename><replaceable>supfile</replaceable></filename> is of course the name of the supfile you
	      have just created. Assuming you are running under X11, <command>cvsup</command>
	      will display a GUI window with some buttons to do the usual
	      things. Press the <quote>go</quote> button, and watch it run.</para>
	    
	    <para>Since you are updating your actual <filename>/usr/src</filename> tree in this
	      example, you will need to run the program as <username>root</username> so that <command>cvsup</command>
	      has the permissions it needs to update your files. Having just
	      created your configuration file, and having never used this
	      program before, that might understandably make you nervous.
	      There is an easy way to do a trial run without touching your
	      precious files. Just create an empty directory somewhere
	      convenient, and name it as an extra argument on the command
	      line:</para>
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>mkdir /var/tmp/dest</userinput>
&prompt.root; <userinput>cvsup supfile /var/tmp/dest</userinput></screen>
	    </informalexample>
	    
	    <para>The directory you specify will be used as the destination
	      directory for all file updates. <application>CVSup</application> will examine your usual
	      files in <filename>/usr/src</filename>, but it will not modify
	      or delete any of them. Any file updates will instead land in
	      <filename>/var/tmp/dest/usr/src</filename>. <application>CVSup</application> will also
	      leave its base directory status files untouched when run this
	      way. The new versions of those files will be written into the
	      specified directory. As long as you have read access to
	      <filename>/usr/src</filename>, you do not even need to be root
	      to perform this kind of trial run.</para>
	    
	    <para>If you are not running X11 or if you just do not like GUIs,
	      you should add a couple of options to the command line when you
	      run cvsup:</para>
	    
	    <informalexample>
	      <screen>&prompt.root; <userinput>cvsup -g -L 2 supfile</userinput></screen>
	    </informalexample>
	    
	    <para>The <option>-g</option> tells cvsup not to use its GUI. This is automatic
	      if you are not running X11, but otherwise you have to specify
	      it.</para>
	    
	    <para>The <option>-L 2</option> tells cvsup to print out the details of all the
	      file updates it is doing. There are three levels of verbosity,
	      from <option>-L 0</option> to <option>-L 2</option>. The default is 0, which means total
	      silence except for error messages.</para>
	    
	    <para>There are plenty of other options available. For a brief
	      list of them, type <command>cvsup -H</command>. For more detailed descriptions,
	      see the manual page.</para>
	    
	    <para>Once you are satisfied with the way updates are working, you
	      can arrange for regular runs of cvsup using <citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Obviously,
	      you should not let cvsup use its GUI when running it from
	      cron.</para>
	    
	  </sect3>
	  
	  <sect3 id="cvsup-collec">
	    <title><application>CVSup</application> File Collections</title>
	    
	    <para>The file collections available via <application>CVSup</application> are organized
	      hierarchically. There are a few large collections, and they are
	      divided into smaller sub-collections. Receiving a large
	      collection is equivalent to receiving each of its
	      sub-collections. The hierarchical relationships among
	      collections are reflected by the use of indentation in the list
	      below.</para>
	    
	    <para>The most commonly used collections are <literal>src-all</literal>, <literal>cvs-crypto</literal>, and <literal>ports-all</literal>. The other collections are used
	      only by small groups of people for specialized purposes, and
	      some mirror sites may not carry all of them.</para>
	    
	    
	      <variablelist>
		<varlistentry><term><literal>cvs-all
		      release=cvs</literal></term>
		  <listitem>
		    <para>The main FreeBSD CVS repository, excluding the
		      export-restricted cryptography code.</para>
		    
		    
		      <variablelist>
			<varlistentry><term><literal>distrib
			      release=cvs</literal></term>
			  <listitem>
			    <para>Files related to the distribution and
			      mirroring of FreeBSD.</para>
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>doc-all
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>Sources for the FreeBSD handbook and other
			      documentation.</para>
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>ports-all
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>The FreeBSD ports collection.</para>
			    
			    
			      <variablelist>
				<varlistentry><term><literal>ports-archivers
				      release=cvs</literal></term>
				  <listitem>
				    <para>Archiving tools.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-astro
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Astronomical ports.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-audio
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Sound support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-base
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Miscellaneous files at the top of
				      /usr/ports.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-benchmarks
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Benchmarks.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-biology
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Biology.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-cad
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Computer aided design tools.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-chinese
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Chinese language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-comms
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Communication software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-converters
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>character code converters.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-databases
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Databases.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-devel
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Development utilities.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-editors
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Editors.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-emulators
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Emulators for other operating
				      systems.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-games
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Games.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-german
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>German language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-graphics
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Graphics utilities.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-japanese
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Japanese language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-korean
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Korean language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-lang
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Programming languages.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-mail
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Mail software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-math
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Numerical computation
				      software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-mbone
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>MBone applications.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-misc
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Miscellaneous utilities.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-net
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Networking software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-news
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>USENET news software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-plan9
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Various programs from Plan9.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-print
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Printing software.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-russian
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Russian language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-security
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Security utilities.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-shells
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Command line shells.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-sysutils
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>System utilities.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-textproc
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>text processing utilities (does not
				      include desktop publishing).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-vietnamese
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Vietnamese language support.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-www
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Software related to the World Wide
				      Web.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>ports-x11
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>X11 software.</para>
				    
				  </listitem>
				</varlistentry>
			      </variablelist>
			    
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>src-all
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>The main FreeBSD sources, excluding the
			      export-restricted cryptography code.</para>
			    
			    
			      <variablelist>
				<varlistentry><term><literal>src-base
				      release=cvs</literal></term>
				  <listitem>
				    <para>Miscellaneous files at the top of
				      <filename>/usr/src</filename>.</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-bin
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>User utilities that may be needed in
				      single-user mode
				      (<filename>/usr/src/bin</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-contrib
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Utilities and libraries from outside
				      the FreeBSD project, used relatively
				      unmodified
				      (<filename>/usr/src/contrib</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-etc
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>System configuration files
				      (<filename>/usr/src/etc</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-games
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Games
				      (<filename>/usr/src/games</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-gnu
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Utilities covered by the GNU Public
				      License
				      (<filename>/usr/src/gnu</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-include
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Header files
				      (<filename>/usr/src/include</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-kerberosIV
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>KerberosIV security package
				      (<filename>/usr/src/kerberosIV</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-lib
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Libraries
				      (<filename>/usr/src/lib</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-libexec
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>System programs normally executed by
				      other programs
				      (<filename>/usr/src/libexec</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-release
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Files required to produce a FreeBSD
				      release
				      (<filename>/usr/src/release</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-sbin
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>System utilities for single-user
				      mode
				      (<filename>/usr/src/sbin</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-share
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Files that can be shared across
				      multiple systems
				      (<filename>/usr/src/share</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-sys
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>The kernel
				      (<filename>/usr/src/sys</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-tools
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>Various tools for the maintenance of
				      FreeBSD
				      (<filename>/usr/src/tools</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-usrbin
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>User utilities
				      (<filename>/usr/src/usr.bin</filename>).</para>
				    
				  </listitem>
				</varlistentry>
				
				<varlistentry><term><literal>src-usrsbin
				      release=cvs</literal></term>
				  
				  <listitem>
				    <para>System utilities
				      (<filename>/usr/src/usr.sbin</filename>).</para>
				    
				  </listitem>
				</varlistentry>
			      </variablelist>
			    
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>www
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>The sources for the World Wide Web
			      data.</para>
			    
			  </listitem>
			</varlistentry>
		      </variablelist>
		    
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><literal>cvs-crypto
		      release=cvs</literal></term>
		  
		  <listitem>
		    <para>The export-restricted cryptography code.</para>
		    
		    
		      <variablelist>
			<varlistentry><term><literal>src-crypto
			      release=cvs</literal></term>
			  <listitem>
			    <para>Export-restricted utilities and libraries
			      from outside the FreeBSD project, used
			      relatively unmodified
			      (<filename>/usr/src/crypto</filename>).</para>
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>src-eBones
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>Kerberos and DES
			      (<filename>/usr/src/eBones</filename>).</para>
			    
			  </listitem>
			</varlistentry>
			
			<varlistentry><term><literal>src-secure
			      release=cvs</literal></term>
			  
			  <listitem>
			    <para>DES
			      (<filename>/usr/src/secure</filename>).</para>
			    
			  </listitem>
			</varlistentry>
		      </variablelist>
		    
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><literal>distrib
		      release=self</literal></term>
		  
		  <listitem>
		    <para>The CVSup server's own configuration files. Used by
		      CVSup mirror sites.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><literal>gnats
		      release=current</literal></term>
		  
		  <listitem>
		    <para>The GNATS bug-tracking database.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><literal>mail-archive
		      release=current</literal></term>
		  
		  <listitem>
		    <para>FreeBSD mailing list archive.</para>
		    
		  </listitem>
		</varlistentry>
		
		<varlistentry><term><literal>www
		      release=current</literal></term>
		  
		  <listitem>
		    <para>The installed World Wide Web data. Used by WWW
		      mirror sites.</para>
		    
		  </listitem>
		</varlistentry>
	      </variablelist>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Announcements, Questions, and Bug Reports</title>
	    
	    <para>Most FreeBSD-related discussion of <application>CVSup</application> takes place on the
	      &a.hackers;. New versions of the software are announced there,
	      as well as on the &a.announce;.</para>
	    
	    <para>Questions and bug reports should be addressed to the author
	      of the program at <email>cvsup-bugs@polstra.com</email>.</para>
	    
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="makeworld">
	<title>Using <command>make world</command> to rebuild your
	  system</title>
	
	<para><emphasis>Contributed by &a.nik;.</emphasis></para>
	
	<para>Once you have synchronised your local source tree against a
	  particular version of FreeBSD (<literal>stable</literal>,
	  <literal>current</literal> and so on) you must then use
	  the source tree to rebuild the system.</para>
	
	<para>Currently, the best source of information on how to do that is a
	  tutorial available from <ulink
	    URL="http://www.nothing-going-on.demon.co.uk/FreeBSD/make-world/make-world.html">http://www.nothing-going-on.demon.co.uk/FreeBSD/make-world/make-world.html</ulink>.</para>
	
	<para>A successor to this tutorial will be integrated into the
	  handbook.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="contrib">
      <title>Contributing to FreeBSD</title>
      
      <para><emphasis>Contributed by &a.jkh;.</emphasis></para>
      
      <para>So you want to contribute something to FreeBSD? That is great! We
	can always use the help, and FreeBSD is one of those systems that
	<emphasis>relies</emphasis> on the contributions of its user base in
	order to survive. Your contributions are not only appreciated, they
	are vital to FreeBSD's continued growth!</para>
      
      <para>Contrary to what some people might also have you believe, you do
	not need to be a hot-shot programmer or a close personal friend of the
	FreeBSD core team in order to have your contributions accepted. The
	FreeBSD Project's development is done by a large and growing number of
	international contributors whose ages and areas of technical expertise
	vary greatly, and there is always more work to be done than there are
	people available to do it.</para>
      
      <para>Since the FreeBSD project is responsible for an entire operating
	system environment (and its installation) rather than just a kernel or
	a few scattered utilities, our <filename>TODO</filename> list also spans a very wide
	range of tasks, from documentation, beta testing and presentation to
	highly specialized types of kernel development. No matter what your
	skill level, there is almost certainly something you can do to help
	the project!</para>
      
      <para>Commercial entities engaged in FreeBSD-related enterprises are
	also encouraged to contact us. Need a special extension to make your
	product work? You will find us receptive to your requests, given that
	they are not too outlandish. Working on a value-added product?
	Please let us know! We may be able to work cooperatively on some
	aspect of it. The free software world is challenging a lot of
	existing assumptions about how software is developed, sold, and
	maintained throughout its life cycle, and we urge you to at least give
	it a second look.</para>
      
      
      <sect1>
	<title>What Is Needed</title>
	
	<para>The following list of tasks and sub-projects represents
	  something of an amalgam of the various core team <filename>TODO</filename> lists and user
	  requests we have collected over the last couple of months. Where
	  possible, tasks have been ranked by degree of urgency. If you are
	  interested in working on one of the tasks you see here, send mail to
	  the coordinator listed by clicking on their names. If no
	  coordinator has been appointed, maybe you would like to
	  volunteer?</para>
	
	
	<sect2>
	  <title>High priority tasks</title>
	  
	  <para>The following tasks are considered to be urgent, usually
	    because they represent something that is badly broken or sorely
	    needed:</para>
	  
	    <orderedlist>
	      
	      <listitem>
		<para>3-stage boot issues. Overall coordination:
		  &a.hackers;</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>Autodetect memory over 64MB properly.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Move userconfig (-c) into 3rd stage boot.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Do WinNT compatible drive tagging so that the 3rd
			stage can provide an accurate mapping of BIOS
			geometries for disks.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	      
	      <listitem>
		<para>Filesystem problems. Overall coordination: &a.fs;
		  <itemizedlist>
		    
		    <listitem>
		      <para>Fix the MSDOS file system.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Clean up and document the nullfs filesystem code.
			Coordinator: &a.gibbs;</para>
		    </listitem>
		    
		    <listitem>
		      <para>Fix the union file system. Coordinator:
			&a.dyson;</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	      
	      <listitem>
		<para>Implement kernel and user vm86 support. Coordinator:
		  &a.hackers;</para>
	      </listitem>
	      
	      <listitem>
		<para>Implement Int13 vm86 disk driver. Coordinator:
		  &a.hackers;</para>
	      </listitem>
	      
	      <listitem>
		<para>SCSI driver issues. Overall coordination:
		  &a.hackers;</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>Support tagged queuing generically. Requires a
			rewrite of how we do our command queuing, but we need
			this anyway to for prioritized I/O (CD-R
			writers/scanners).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Better error handling (Busy status and
			retries).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Merged Scatter-Gather list creation code.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	      
	      <listitem>
		<para>Kernel issues. Overall coordination: &a.hackers;</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>Complete the eisaconf conversion of all existing
			drivers.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Change all interrupt routines to take a (void *)
			instead of using unit numbers.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Merge EISA/PCI/ISA interrupt registration
			code.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Split PCI/EISA/ISA probes out from drivers like
			bt742a.c (WIP)</para>
		    </listitem>
		    
		    <listitem>
		      <para>Fix the syscons ALT-Fn/vt switching hangs.
			Coordinator: &a.sos;</para>
		    </listitem>
		    
		    <listitem>
		      <para>Rewrite the Intel Etherexpress 16 driver.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Merge the 3c509 and 3c590 drivers (essentially
			provide a PCI probe for ep.c).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Support Adaptec 3985 (first as a simple 3 channel
			SCSI card) Coordinator: &a.gibbs;</para>
		    </listitem>
		    
		    <listitem>
		      <para>Support Advansys SCSI controller products.
			Coordinator: &a.gibbs;</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	      
	    </orderedlist>
	  
	</sect2>
	
	<sect2>
	  <title>Medium priority tasks</title>
	  
	  <para>The following tasks need to be done, but not with any
	    particular urgency:</para>
	  
	    <orderedlist>
	      
	      <listitem>
		<para>Port AFS (Andrew File System) to FreeBSD  Coordinator:
		  Alexander Seth Jones <email>ajones@ctron.com</email></para>
	      </listitem>
	      
	      <listitem>
		<para>MCA support? This should be finalized one way or the
		  other.</para>
	      </listitem>
	      
	      <listitem>
		<para>Full LKM based driver support/Configuration Manager.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>Devise a way to do all LKM registration without
			ld. This means some kind of symbol table in the
			kernel.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Write a configuration manager (in the 3rd stage
			boot?) that probes your hardware in a sane manner,
			keeps only the LKMs required for your hardware,
			etc.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	      
	      <listitem>
		<para>PCMCIA/PCCARD. Coordinators: &a.nate; and &a.phk;
		  <itemizedlist>
		    
		    <listitem>
		      <para>Documentation!</para>
		    </listitem>
		    
		    <listitem>
		      <para>Reliable operation of the pcic driver (needs
			testing).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Recognizer and handler for
			<filename>sio.c</filename> (mostly done).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Recognizer and handler for
			<filename>ed.c</filename> (mostly done).</para>
		    </listitem>
		    
		    <listitem>
		      <para>Recognizer and handler for
			<filename>ep.c</filename> (mostly done).</para>
		    </listitem>
		    
		    <listitem>
		      <para>User-mode recognizer and handler (partially
			done).</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	      
	      <listitem>
		<para>Advanced Power Management. Coordinators: &a.nate; and
		  &a.phk;
		  <itemizedlist>
		    
		    <listitem>
		      <para>APM sub-driver (mostly done).</para>
		    </listitem>
		    
		    <listitem>
		      <para>IDE/ATA disk sub-driver (partially done).</para>
		    </listitem>
		    
		    <listitem>
		      <para>syscons/pcvt sub-driver.</para>
		    </listitem>
		    
		    <listitem>
		      <para>Integration with the PCMCIA/PCCARD drivers
			(suspend/resume).</para>
		    </listitem>
		    
		  </itemizedlist>
		</para>
	      </listitem>
	      
	    </orderedlist>
	  
	</sect2>
	
	<sect2>
	  <title>Low priority tasks</title>
	  
	  <para>The following tasks are purely cosmetic or represent such an
	    investment of work that it is not likely that anyone will get them
	    done anytime soon:</para>
	  
	  <para>The first 20 items are from Terry Lambert
	    <email>terry@lambert.org</email></para>
	  
	    <orderedlist>
	      
	      <listitem>
		<para>Ability to make BIOS calls from protected mode using V86
		  mode on the processor and return the results via a mapped
		  interrupt IPC mechanism to the protected mode caller.</para>
	      </listitem>
	      
	      <listitem>
		<para>Drivers built into the kernel that use the BIOS call
		  mechanism to allow them to be independent of the actual
		  underlying hardware the same way that DOS is independent of
		  the underlying hardware. This includes NetWork and ASPI
		  drivers loaded in DOS prior to BSD being loaded by a
		  DOS-based loader program, which means potential polling,
		  which means DOS-not-busy interrupt generation for V86
		  machines by the protected mode kernel.</para>
	      </listitem>
	      
	      <listitem>
		<para>An image format that allows tagging of such drivers data
		  and text areas in the default kernel executable so that that
		  portion of the kernel address space may be recovered at a
		  later time, after hardware specific protected mode drivers
		  have been loaded and activated. This includes separation of
		  BIOS based drivers from each other, since it is better to
		  run with a BIOS based driver in all cases than to not run at
		  all.</para>
	      </listitem>
	      
	      <listitem>
		<para>Abstraction of the bus interface mechanism. Currently,
		  PCMCIA, EISA, and PCI busses are assumed to be bridged from
		  ISA. This is not something which should be assumed.</para>
	      </listitem>
	      
	      <listitem>
		<para>A configuration manager that knows about PNP events,
		  including power management events, insertion, extraction,
		  and bus (PNP ISA and PCMCIA bridging chips) vs. card level
		  event management.</para>
	      </listitem>
	      
	      <listitem>
		<para>A topological sort mechanism for assigning reassignable
		  addresses that do not collide with other reassignable and
		  non-reassignable device space resource usage by fixed
		  devices.</para>
	      </listitem>
	      
	      <listitem>
		<para>A registration based mechanism for hardware services
		  registration. Specifically, a device centric registration
		  mechanism for timer and sound and other system critical
		  service providers. Consider Timer2 and Timer0 and speaker
		  services as one example of a single monolithic service
		  provider.</para>
	      </listitem>
	      
	      <listitem>
		<para>A kernel exported symbol space in the kernel data space
		  accessible by an LKM loader mechanism that does relocation
		  and symbol space manipulation. The intent of this interface
		  is to support the ability to demand load and unload kernel
		  modules.</para>
	      </listitem>
	      
	      <listitem>
		<para>NetWare Server (protected mode ODI driver) loader and
		  subservices to allow the use of ODI card drivers supplied
		  with network cards. The same thing for NDIS drivers and
		  NetWare SCSI drivers.</para>
	      </listitem>
	      
	      <listitem>
		<para>An "upgrade system" option that works on Linux boxes
		  instead of just previous rev FreeBSD boxes.</para>
	      </listitem>
	      
	      <listitem>
		<para>Splitting of the console driver into abstraction layers,
		  both to make it easier to port and to kill the X and
		  ThinkPad and PS/2 mouse and LED and console switching and
		  bouncing NumLock problems once and for all.</para>
	      </listitem>
	      
	      <listitem>
		<para>Other kernel emulation environments for other foreign
		  drivers as opportunity permits. SCO and Solaris are good
		  candidates, followed by UnixWare, etc.</para>
	      </listitem>
	      
	      <listitem>
		<para>Processor emulation environments for execution of
		  foreign binaries. This is easier than it sounds if the
		  system call interface does not change much.</para>
	      </listitem>
	      
	      <listitem>
		<para>Streams to allow the use of commercial streams drivers.</para>
	      </listitem>
	      
	      <listitem>
		<para>Kernel multithreading (requires kernel preemption).</para>
	      </listitem>
	      
	      <listitem>
		<para>Symmetric Multiprocessing with kernel preemption
		  (requires kernel preemption).</para>
	      </listitem>
	      
	      <listitem>
		<para>A concerted effort at support for portable computers.
		  This is somewhat handled by changing PCMCIA bridging rules
		  and power management event handling. But there are things
		  like detecting internal vs. external display and picking a
		  different screen resolution based on that fact, not spinning
		  down the disk if the machine is in dock, and allowing
		  dock-based cards to disappear without affecting the machines
		  ability to boot (same issue for PCMCIA).</para>
	      </listitem>
	      
	      <listitem>
		<para>Reorganization of the source tree for multiple platform
		  ports.</para>
	      </listitem>
	      
	      <listitem>
		<para>A <command>make world</command> that "makes the world" (rename the
		  current one to <command>make regress</command> if that is all it is good
		  for).</para>
	      </listitem>
	      
	      <listitem>
		<para>A 4M (preferably smaller!) memory footprint.</para>
	      </listitem>
	      
	    </orderedlist>
	  
	</sect2>
	
	<sect2>
	  <title>Smaller tasks</title>
	  
	  <para>Most of the tasks listed in the previous sections require
	    either a considerable investment of time or an in-depth knowledge
	    of the FreeBSD kernel (or both). However, there are also many
	    useful tasks which are suitable for &quot;weekend hackers&quot;,
	    or people without programming skills.</para>
	  
	  
	    <orderedlist>
	      
	      <listitem>
		<para>If you run FreeBSD-current and have a good Internet
		connection, there is a machine <hostid role="fqdn">current.freebsd.org</hostid> which
		  builds a full release once a day &mdash; every now and again, try
		  and install the latest release from it and report any
		  failures in the process.</para>
	      </listitem>
	      
	      <listitem>
	      <para>Read the <email>freebsd-bugs</email> mailing list. There might be a
		  problem you can comment constructively on or with patches
		  you can test. Or you could even try to fix one of the
		  problems yourself.</para>
	      </listitem>
	      
	      <listitem>
		<para>Read through the FAQ and Handbook periodically. If
		  anything is badly explained, out of date or even just
		  completely wrong, let us know. Even better, send us a fix
		  (SGML is not difficult to learn, but there is no objection
		  to ASCII submissions).</para>
	      </listitem>
	      
	      <listitem>
		<para>Help translate FreeBSD documentation into your native
		  language (if not already available) &mdash; just send an email to
		  &a.doc; asking if anyone is working on it. Note that you
		  are not committing yourself to translating every single
		  FreeBSD document by doing this &mdash; in fact, the documentation
		  most in need of translation is the installation
		  instructions.</para>
	      </listitem>
	      
	      <listitem>
		<para>Read the freebsd-questions mailing list and the
		newsgroup <literal>comp.unix.bsd.freebsd.misc</literal> occasionally (or even
		  regularly). It can be very satisfying to share your
		  expertise and help people solve their problems; sometimes
		  you may even learn something new yourself! These forums can
		  also be a source of ideas for things to work on.</para>
	      </listitem>
	      
	      <listitem>
		<para>If you know of any bugfixes which have been successfully
		  applied to -current but have not been merged into -stable
		  after a decent interval (normally a couple of weeks), send
		  the committer a polite reminder.</para>
	      </listitem>
	      
	      <listitem>
		<para>Move contributed software to
		  <filename>src/contrib</filename> in the source tree.</para>
	      </listitem>
	      
	      <listitem>
		<para>Make sure code in <filename>src/contrib</filename> is up
		  to date.</para>
	      </listitem>
	      
	      <listitem>
		<para>Look for year 2000 bugs (and fix any you find!)</para>
	      </listitem>
	      
	      <listitem>
		<para>Build the source tree (or just part of it) with extra
		  warnings enabled and clean up the warnings.</para>
	      </listitem>
	      
	      <listitem>
		<para>Fix warnings for ports which do deprecated things like
		  using gets() or including malloc.h.</para>
	      </listitem>
	      
	      <listitem>
		<para>If you have contributed any ports, send your patches
		  back to the original author (this will make your life easier
		  when they bring out the next version)</para>
	      </listitem>
	      
	      <listitem>
		<para>Suggest further tasks for this list!</para>
	      </listitem>
	      
	    </orderedlist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1>
	<title>How to Contribute</title>
	
	<para>Contributions to the system generally fall into one or more of
	  the following 6 categories:</para>
	
	
	<sect2 id="contrib-general">
	  <title>Bug reports and general commentary</title>
	  
	  <para>An idea or suggestion of <emphasis>general</emphasis>
	    technical interest should be mailed to the &a.hackers;. Likewise,
	    people with an interest in such things (and a tolerance for a
	    <emphasis>high</emphasis> volume of mail!) may subscribe to the
	    hackers mailing list by sending mail to &a.majordomo;. See
	    <xref linkend="eresources-mail" remap="mailing lists"> for more
	    information about this and other mailing lists.</para>
	  
	  <para>If you find a bug or are submitting a specific change, please
	    report it using the <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry>program or its
	    <ulink URL="http://www.freebsd.org/send-pr.html">WEB-based
	      equivalent</ulink>. Try to fill-in each field of the bug report.
	    Unless they exceed 65KB, include any patches directly in the
	    report. Consider compressing them and using
	    <citerefentry><refentrytitle>uuencode</refentrytitle><manvolnum>1</manvolnum></citerefentry> if they exceed 20KB.</para>
	  
	  <para>After filing a report, you should receive confirmation along
	    with a tracking number. Keep this tracking number so that you can
	    update us with details about the problem by sending mail to <email>bug-followup@FreeBSD.ORG</email>. Use the number as the message subject, e.g. <literal>"Re: kern/3377"</literal>. Additional information for any bug report should be submitted this way.</para>
	  
	  <para>If you do not receive confirmation in a timely fashion (3 days
	    to a week, depending on your email connection) or are, for some
	    reason, unable to use the <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> command,
	    then you may ask someone to file it for you by sending mail to the
	    &a.bugs;.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Changes to the documentation</title>
	  
	  <para>Changes to the documentation are overseen by the &a.doc;. Send
	    submissions and changes (even small ones are welcome!) using
	    <command>send-pr</command> as described in
	    <xref linkend="contrib-general" remap="Bug Reports and General
	      Commentary">.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Changes to existing source code</title>
	  
	  <para>An addition or change to the existing source code is a
	    somewhat trickier affair and depends a lot on how far out of date
	    you are with the current state of the core FreeBSD development.
	    There is a special on-going release of FreeBSD known as
	    <quote>FreeBSD-current</quote> which is made available in a variety of ways
	    for the convenience of developers working actively on the system.
	    See <xref linkend="current"
	      remap="Staying    current with FreeBSD"> for more information
	    about getting and using FreeBSD-current.</para>
	  
	  <para>Working from older sources unfortunately means that your
	    changes may sometimes be too obsolete or too divergent for easy
	    re-integration into FreeBSD. Chances of this can be minimized
	    somewhat by subscribing to the &a.announce; and the &a.current;
	    lists, where discussions on the current state of the system take
	    place.</para>
	  
	  <para>Assuming that you can manage to secure fairly up-to-date
	    sources to base your changes on, the next step is to produce a set
	    of diffs to send to the FreeBSD maintainers. This is done with
	    the <citerefentry><refentrytitle>diff</refentrytitle><manvolnum>1</manvolnum></citerefentry> command, with the <quote>context diff</quote>
	    form being preferred. For example:</para>
	  
	    <para><informalexample>
	      <screen>&prompt.user; <userinput>diff -c oldfile newfile</userinput></screen>
	    </informalexample>

	    or
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>diff -c -r olddir newdir</userinput></screen>
	    </informalexample>

	    would generate such a set of context diffs for
	    the given source file or directory hierarchy. See the man page
	    for <citerefentry><refentrytitle>diff</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more details.</para>
	  
	  <para>Once you have a set of diffs (which you may test with the
	    <citerefentry><refentrytitle>patch</refentrytitle><manvolnum>1</manvolnum></citerefentry> command), you should submit them for
	    inclusion with FreeBSD. Use the <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry>
	    program as described in
	    <xref linkend="contrib-general" remap="Bug Reports and General
	      Commentary">. <emphasis>Do not</emphasis> just send the diffs to
	    the &a.hackers; or they will get lost! We greatly appreciate your
	    submission (this is a volunteer project!); because we are busy, we
	    may not be able to address it immediately, but it will remain in
	    the pr database until we do.</para>
	  
	  <para>If you feel it appropriate (e.g. you have added, deleted, or
	    renamed files), bundle your changes into a <command>tar</command> file and run the
	    <citerefentry><refentrytitle>uuencode</refentrytitle><manvolnum>1</manvolnum></citerefentry> program on it. Shar archives are
	    also welcome.</para>
	  
	  <para>If your change is of a potentially sensitive nature, e.g. you
	    are unsure of copyright issues governing its further distribution
	    or you are simply not ready to release it without a tighter review
	    first, then you should send it to &a.core; directly rather than
	    submitting it with <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry>. The core
	    mailing list reaches a much smaller group of people who do much of
	    the day-to-day work on FreeBSD. Note that this group is also
	    <emphasis>very busy</emphasis> and so you should only send mail to
	    them where it is truly necessary.</para>
	  
	  <para>Please refer to <command>man 9 intro</command> and
	    <command>man 9 style</command> for some information on
	    coding style. We would appreciate it if you were at least aware
	    of this information before submitting code.</para>
	  
	</sect2>
	
	<sect2>
	  <title>New code or major value-added packages</title>
	  
	  <para>In the rare case of a significant contribution of a large body
	    work, or the addition of an important new feature to FreeBSD, it
	    becomes almost always necessary to either send changes as
	    uuencode'd tar files or upload them to our ftp site <ulink
	      URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD/incoming">ftp://ftp.FreeBSD.ORG/pub/FreeBSD/incoming</ulink>.</para>
	  
	  <para>When working with large amounts of code, the touchy subject of
	    copyrights also invariably comes up. Acceptable copyrights for
	    code included in FreeBSD are:</para>
	  
	  
	    <orderedlist>
	      
	      <listitem>
		<para>The BSD copyright. This copyright is most preferred due
		  to its <quote>no strings attached</quote> nature and general
		  attractiveness to commercial enterprises. Far from
		  discouraging such commercial use, the FreeBSD Project
		  actively encourages such participation by commercial
		  interests who might eventually be inclined to invest
		  something of their own into FreeBSD.</para>
	      </listitem>
	      
	      <listitem>
		<para>The GNU Public License, or <QUOTE>GPL</QUOTE>. This license is not
		  quite as popular with us due to the amount of extra effort
		  demanded of anyone using the code for commercial purposes,
		  but given the sheer quantity of GPL'd code we currently
		  require (compiler, assembler, text formatter, etc) it would
		  be silly to refuse additional contributions under this
		  license. Code under the GPL also goes into a different part
		  of the tree, that being <filename>/sys/gnu</filename> or
		  <filename>/usr/src/gnu</filename>, and is therefore easily
		  identifiable to anyone for whom the GPL presents a
		  problem.</para>
	      </listitem>
	      
	    </orderedlist>
	  
	  
	  <para>Contributions coming under any other type of copyright must be
	    carefully reviewed before their inclusion into FreeBSD will be
	    considered. Contributions for which particularly restrictive
	    commercial copyrights apply are generally rejected, though the
	    authors are always encouraged to make such changes available
	    through their own channels.</para>
	  
	  <para>To place a <quote>BSD-style</quote> copyright on your work, include the
	    following text at the very beginning of every source code file you
	    wish to protect, replacing the text between the
	    <literal>%%</literal> with the appropriate information.</para>
	    
	    <programlisting>
Copyright (c) %%proper_years_here%%
        %%your_name_here%%, %%your_state%%  %%your_zip%%.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer as
   the first lines of this file unmodified.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY %%your_name_here%% ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL %%your_name_here%% BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	      
        &#36;Id&#36;
	    </programlisting>

	  <para>For your convenience, a copy of this text can
	    be found in
	    <filename>/usr/share/examples/etc/bsd-style-copyright</filename>.</para>
	  
	</sect2>
	
	<sect2 id="porting">
	  <title>Porting an existing piece of free software</title>
	  
	  <para><emphasis>Contributed by &a.jkh;, &a.gpalmer;, &a.asami; and
	      &a.obrien;.<!-- <br> -->28 August 1996.</emphasis></para>
	  
	  <para>The porting of freely available software, while perhaps not as
	    gratifying as developing your own from scratch, is still a vital
	    part of FreeBSD's growth and of great usefulness to those who
	    would not otherwise know where to turn for it. All ported
	    software is organized into a carefully organized hierarchy known
	    as <quote>the ports collection</quote>. The collection enables a new user to
	    get a quick and complete overview of what is available for FreeBSD
	    in an easy-to-compile form. It also saves considerable space by
	    not actually containing the majority of the sources being ported,
	    but merely those differences required for running under FreeBSD.</para>
	  
	  <para>What follows are some guidelines for creating a new port for
	    FreeBSD 3.x. The bulk of the work is done by
	    <filename>/usr/share/mk/bsd.port.mk</filename>, which all port
	    Makefiles include. Please refer to that file for more details on
	    the inner workings of the ports collection. Even if you don't
	    hack Makefiles daily, it is well commented, and you will still
	    gain much knowledge from it.</para>
	  
	  
	  <sect3 id="porting-starting">
	    <title>Before Starting the Port</title>

	    <note>
	      <para>Only a fraction of the overridable variables
		(<literal>&#36;{..}</literal>) are mentioned in
		this document. Most (if not all) are documented at the start
		of <filename>bsd.port.mk</filename>. This file uses a
		non-standard tab setting. <command>Emacs</command> and
		<command>Vim</command> should recognize the setting on loading
		the file. <command>vi</command> or <command>ex</command> can
		be set to using the correct value by typing <literal>:set
		  tabstop=4</literal> once the file has been loaded.</para>
	    </note>
	    
	    <para>You may come across code that needs modifications or
	      conditional compilation based upon what version of UNIX it is
	      running under. If you need to make such changes to the code for
	      conditional compilation, make sure you make the changes as
	      general as possible so that we can back-port code to FreeBSD 1.x
	      systems and cross-port to other BSD systems such as 4.4BSD from
	      CSRG, BSD/386, 386BSD, NetBSD, and OpenBSD.</para>
	    
	    <para>The preferred way to tell 4.3BSD/Reno (1990) and newer
	      versions of the BSD code apart is by using the
	      <acronym>BSD</acronym> macro defined in
	      <filename>&lt;sys/param.h&gt;</filename>. Hopefully that file
	      is already included; if not, add the code:</para>
	    
	    <programlisting>
#ifdef (defined(__unix__) || defined(unix)) &amp;&amp; !defined(USG)
#include &lt;sys/param.h&gt;
#endif
	    </programlisting>
	    
	    <para>to the proper place in the <filename>.c</filename> file. We
	      believe that every system that defines these to symbols has
	      <filename>sys/param.h</filename>. If you find a system that
	      doesn't, we would like to know. Please send mail to
	      &a.ports;.</para>
	    
	    <para>Another way is to use the GNU Autoconf style of doing
	      this:</para>
	    
	    <programlisting>
#ifdef HAVE_SYS_PARAM_H
#include &lt;sys/param.h&gt;
#endif
	    </programlisting>
	    
	    <para>Don't forget to add <literal>-DHAVE_SYS_PARAM_H</literal> to
	      the <makevar>CFLAGS</makevar> in the Makefile for this
	      method.</para>
	    
	    <para>Once you have <filename>sys/param.h</filename>
	      included, you may use:</para>
	    
	    <programlisting>
#if (defined(BSD) &amp;&amp; (BSD &gt;= 199103))
	    </programlisting>
	    
	    <para>to detect if the code is being compiled on a 4.3 Net2 code
	      base or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD,
	      BSD/386 1.1 and below).</para>
	    
	    <para>Use:</para>
	    
	    <programlisting>
#if (defined(BSD) &amp;&amp; (BSD &gt;= 199306))
	    </programlisting>
	    
	    <para>to detect if the code is being compiled on a 4.4 code base
	      or newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
	      above).</para>
	    
	    <para>The value of the BSD macro is 199506 for the 4.4BSD-Lite2
	      code base. This is stated for informational purposes only. It
	      should not be used to distinguish between version of FreeBSD
	      based only on 4.4-Lite vs. versions that have merged in changes
	      from 4.4-Lite2. The __FreeBSD__ macro should be used
	      instead.</para>
	    
	    <para>Use sparingly:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para><symbol>__FreeBSD__</symbol> is defined in all
		    versions of FreeBSD. Use it if the change you are making
		    ONLY affects FreeBSD. Porting gotchas like the use of
		    <literal>sys_errlist[]</literal> vs
		    <function>strerror()</function> are Berkeleyisms, not
		    FreeBSD changes.</para>
		</listitem>
		
		<listitem>
		  <para>In FreeBSD 2.x, <symbol>__FreeBSD__</symbol> is
		    defined to be <literal>2</literal>. In earlier
		    versions, it is <literal>1</literal>. Later
		    versions will bump it to match their major version number.</para>
		</listitem>
		
		<listitem>
		  <para>If you need to tell the difference between a FreeBSD
		    1.x system and a FreeBSD 2.x or 3.x system, usually the
		    right answer is to use the <acronym>BSD</acronym> macros
		    described above. If there actually is a FreeBSD specific
		    change (such as special shared library options when using
		    <command>ld</command>) then it is OK to use
		    <symbol>__FreeBSD__</symbol> and <literal>#if
		      __FreeBSD__ &gt; 1</literal> to detect a FreeBSD 2.x
		    and later system. If you need more granularity in
		    detecting FreeBSD systems since 2.0-RELEASE you can use
		    the following:
		    
		    <programlisting>
#if __FreeBSD__ &gt;= 2
#include &lt;osreldate.h&gt;
#    if __FreeBSD_version &gt;= 199504
         /* 2.0.5+ release specific code here */
#    endif
#endif
		    </programlisting>

		    <informaltable frame="none">
		      <tgroup cols="2">
			<thead>
			  <row>
			    <entry>Release</entry>
			    <entry><literal>_FreeBSD_version</literal></entry>
			  </row>
			</thead>
		      
			<tbody>
			  <row>
			    <entry>2.0-RELEASE</entry>
			    <entry>119411</entry>
			  </row>

			  <row>
			    <entry>2.1-currents</entry>
			    <entry>199501, 199503</entry>
			  </row>

			  <row>
			    <entry>2.0.5-RELEASE</entry>
			    <entry>199504</entry>
			  </row>

			  <row>
			    <entry>2.2-current before 2.1</entry>
			    <entry>199508</entry>
			  </row>

			  <row>
			    <entry>2.1.0-RELEASE</entry>
			    <entry>199511</entry>
			  </row>

			  <row>
			    <entry>2.2-current before 2.1.5</entry>
			    <entry>199512</entry>
			  </row>

			  <row>
			    <entry>2.1.5-RELEASE</entry>
			    <entry>199607</entry>
			  </row>

			  <row>
			    <entry>2.2-current before 2.1.6</entry>
			    <entry>199608</entry>
			  </row>

			  <row>
			    <entry>2.1.6-RELEASE</entry>
			    <entry>199612</entry>
			  </row>

			  <row>
			    <entry>2.1.7-RELEASE</entry>
			    <entry>199612</entry>
			  </row>

			  <row>
			    <entry>2.2-RELEASE</entry>
			    <entry>220000</entry>
			  </row>

			  <row>
			    <entry>2.2.1-RELEASE</entry>
			    <entry>220000 (no change)</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after 2.2.1-RELEASE</entry>
			    <entry>220000 (no change)</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after texinfo-3.9</entry>
			    <entry>221001</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after top</entry>
			    <entry>221002</entry>
			  </row>

			  <row>
			    <entry>2.2.2-RELEASE</entry>
			    <entry>222000</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after 2.2.2-RELEASE</entry>
			    <entry>222001</entry>
			  </row>

			  <row>
			    <entry>2.2.5-RELEASE</entry>
			    <entry>225000</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after 2.2.5-RELEASE</entry>
			    <entry>225001</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after ldconfig -R merge</entry>
			    <entry>225002</entry>
			  </row>

			  <row>
			    <entry>2.2.6-RELEASE</entry>
			    <entry>226000</entry>
			  </row>

			  <row>
			    <entry>2.2.7-RELEASE</entry>
			    <entry>227000</entry>
			  </row>

			  <row>
			    <entry>2.2-STABLE after 2.2.7-RELEASE</entry>
			    <entry>227001</entry>
			  </row>

			  <row>
			    <entry>3.0-current before mount(2) change</entry>
			    <entry>300000</entry>
			  </row>

			  <row>
			    <entry>3.0-current as of November 1996</entry>
			    <entry>300001</entry>
			  </row>
			</tbody>
		      </tgroup>
		    </informaltable>
		  </para>
		</listitem>
	      </itemizedlist>
	      
	      <note>
		<para>Note that 2.2-STABLE sometimes identifies itself as
		  <quote>2.2.5-STABLE</quote> after the 2.2.5-RELEASE. The pattern used to
		  be year followed by the month, but we decided to change it
		  to a more straightforward major/minor system starting from
		  2.2. This is because the parallel development on several
		  branches made it infeasible to classify the releases simply
		  by their real release dates. If you are making a port now,
		  you don't have to worry about old -current's; they are
		  listed here just for your reference.</para>
	      </note>
	    
	    
	    <para>In the hundreds of ports that have been done, there have
	      only been one or two cases where <literal>__FreeBSD__</literal>
	      should have been used. Just because an earlier port screwed up
	      and used it in the wrong place does not mean you should do so
	      too.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Quick Porting</title>
	    
	    <para>This section tells you how to do a quick port. In many
	      cases, it is not enough, but we will see.</para>
	    
	    <para>First, get the original tarball and put it into <makevar>&#36;{DISTDIR}</makevar>, which defaults to
	      <filename>/usr/ports/distfiles</filename>.</para>
	    
	    <note>
	      <para>The following assumes that the software compiled
		out-of-the-box, i.e., there was absolutely no change required
		for the port to work on your FreeBSD box. If you needed to
		change something, you will have to refer to the next section
		too.</para>
	    </note>
	    
	    <sect4>
	      <title>Writing the <filename>Makefile</filename></title>
	      
	      <para>The minimal <filename>Makefile</filename> would
		look something like this:</para>
	      
	      <programlisting>
# New ports collection makefile for:   oneko
# Version required:    1.1b
# Date created:        5 December 1994
# Whom:                asami
#
# $Id: handbook.sgml,v 1.52 1998-10-26 23:53:20 nik Exp $
#
       
DISTNAME=      oneko-1.1b
CATEGORIES=    games
MASTER_SITES=  ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/
       
MAINTAINER=    asami@FreeBSD.ORG
       
MAN1=          oneko.1
MANCOMPRESSED= yes
USE_IMAKE=     yes
       
.include &lt;bsd.port.mk&gt;
	      </programlisting>
	      
	      <para>See if you can figure it out. Do not worry about the
		contents of the <literal>&#36;Id&#36;</literal>
		line, it will be filled in automatically by CVS when the port
		is imported to our main ports tree. You can find a more
		detailed example in the <xref
		  linkend="porting-samplem" remap="sample Makefile">
		section.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Writing the description files</title>
	      
	      <para>There are three required description files that are
		required for any port, whether they actually package or not.
		They are <filename>COMMENT</filename>,
		<filename>DESCR</filename>, and <filename>PLIST</filename>,
		and reside in the <filename>pkg</filename>
		subdirectory.</para>
	      
	      
	      <sect5>
		<title><filename>COMMENT</filename></title>
		
		<para>This is the one-line description of the port.
		  <emphasis>Please</emphasis> do not include the package name (or version
		    number of the software) in the comment. Here is
		  an example:</para>

		  <programlisting>
A cat chasing a mouse all over the screen.
		  </programlisting>
		
	      </sect5>
	      
	      <sect5>
		<title><filename>DESCR</filename></title>
		
		<para>This is a longer description of the port. One to a few
		  paragraphs concisely explaining what the port does is
		  sufficient.</para>

		<note>
		  <para>This is <emphasis>not</emphasis> a manual nor an
		    in-depth description on how to use or compile the port. In
		    particular, <emphasis>please do not just copy the
		      <filename>README</filename> file here</emphasis>, unless,
		    of course, it is a concise description of the port.</para>
		</note>
		
		<para>It is recommended that you sign the name at the end of
		  this file, as in:</para>
		
		<programlisting>
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
 :
(etc.)

- Satoshi
asami@cs.berkeley.edu
		</programlisting>
		
	      </sect5>
	      
	      <sect5>
		<title><filename>PLIST</filename></title>
		
		<para>This file lists all the files installed by the port. It
		  is also called the `packing list' because the package is
		  generated by packing the files listed here. The pathnames
		  are relative to the installation prefix (usually
		  <filename>/usr/local</filename> or
		  <filename>/usr/X11R6</filename>). Also it is assumed the
		  manpages will be compressed.</para>
		
		<para>Here is a small example:</para>
		
		<programlisting>
bin/oneko
man/man1/oneko.1.gz
lib/X11/app-defaults/Oneko
lib/X11/oneko/cat1.xpm
lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
		</programlisting>
		
		<para>Refer to the <citerefentry><refentrytitle>pkg_create</refentrytitle><manvolnum>1</manvolnum></citerefentry> man page
		  for details on the packing list.</para>
		
	      </sect5>
	    </sect4>
	    
	    <sect4>
	      <title>Creating the checksum file</title>
	      
	      <para>Just type <command>make makesum</command>.
		The ports make rules will automatically generate the file
		<filename>files/md5</filename>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Testing the port</title>
	      
	      <para>You should make sure that the port rules do exactly what
		you want it to do, including packaging up the port. Try doing
		<command>make install</command>, <command>make package</command> and then <command>make deinstall</command> and see if all the files
		and directories are correctly deleted. Then do a <command>pkg_add `make package-name`.tgz</command> and see
		if everything re-appears and works correctly. Then do another
		<command>make deinstall</command> and then
		<command>make reinstall; make package</command>
		to make sure you haven't included in the packing list any
		files that are not installed by your port.</para>
	      
	    </sect4>
	    
	    <sect4 id="porting-submitting">
	      <title>Submitting the port</title>
	      
	      <para>Now that you are happy with your port, the only thing
		remaining is to put it in the main FreeBSD ports tree and make
		everybody else happy about it too. To accomplish this, pack
		the necessary files (everything described in this section &mdash;
		in particular do <emphasis>not</emphasis> include the original
		source tarball, the <filename>work</filename>
		subdirectory or the package) into a
		<filename>.tar.gz</filename> file, stick it in the directory
		<filename>ftp://ftp.FreeBSD.ORG/pub/FreeBSD/incoming/</filename> and send mail to us using
		<citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> (please classify it as category
		<literal>ports</literal> and class <literal>change-request</literal>). There is no need to
		upload the package, we will build it by ourselves. We will
		take a look, get back to you if necessary, and put it in the
		tree. Your name will also appear in the list of <quote>Additional
		FreeBSD contributors</quote> on the FreeBSD Handbook and other files.
		Isn't that great?!? <!-- smiley -->:)</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Slow Porting</title>
	    
	    <para>Ok, so it was not that simple, and the port required some
	      modifications to get it to work. In this section, we will
	      explain, step by step, how to modify it to get it to work with
	      the ports paradigm.</para>
	    
	    
	    <sect4>
	      <title>How things work</title>
	      
	      <para>First, this is the sequence of events which occurs when
		the user first types <command>make</command> in
		your port's directory, and you may find that having
		<filename>bsd.port.mk</filename> in another window while you
		read this really helps to understand it.</para>
	      
	      <para>But do not worry if you do not really understand what
		<filename>bsd.port.mk</filename> is doing, not many people
		do... <!-- smiley --><emphasis>:&gt;</emphasis></para>
	      
	      
		<procedure>
		  
		  <step>
		    <para>The <maketarget>fetch</maketarget> target is run. The <maketarget>fetch</maketarget> target is
		      responsible for making sure that the tarball exists
		      locally in <makevar>&#36;{DISTDIR}</makevar>.
		      If <maketarget>fetch</maketarget> cannot find the required files in <makevar>&#36;{DISTDIR}</makevar> it will look up the
		      URL <makevar>&#36;{MASTER_SITES}</makevar>,
		      which is set in the Makefile, as well as our main ftp
		      site at <ulink
			URL="ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <makevar>&#36;{FETCH}</makevar>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <makevar>&#36;{DISTDIR}</makevar> for future use and proceed.</para>
		  </step>
		  
		  <step>
		    <para>The <maketarget>extract</maketarget> target is run. It looks for your ports'
		      distribution file in <makevar>&#36;{DISTDIR}</makevar> (typically a gzip'd
		      tarball) and unpacks it into a temporary subdirectory
		      specified by <makevar>&#36;{WRKDIR}</makevar>
		      (defaults to <filename>work</filename>).</para>
		  </step>
		  
		  <step>
		    <para>The <maketarget>patch</maketarget> target is run. First, any patches defined
		      in <makevar>&#36;{PATCHFILES}</makevar> are
		      applied. Second, if any patches are found in <makevar>&#36;{PATCHDIR}</makevar> (defaults to the
		      <filename>patches</filename> subdirectory), they are
		      applied at this time in alphabetical order.</para>
		  </step>
		  
		  <step>
		    <para>The <maketarget>configure</maketarget> target is run. This can do any one of
		      many different things.
		      
		      <orderedlist>
			
			<listitem>
			  <para>If it exists,
			    <filename>scripts/configure</filename> is run.</para>
			</listitem>
			
			<listitem>
			  <para>If <makevar>&#36;{HAS_CONFIGURE}</makevar> or
			    <makevar>&#36;{GNU_CONFIGURE}</makevar>
			    is set,
			    <filename>&#36;{WRKSRC}/configure</filename> is
			    run.</para>
			</listitem>
			
			<listitem>
			  <para>If <makevar>&#36;{USE_IMAKE}</makevar> is set,
			    <makevar>&#36;{XMKMF}</makevar>
			    (default: <command>xmkmf
			      -a</command>) is run.</para>
			</listitem>
			
		      </orderedlist>
		      
		    </para>
		  </step>
		  
		  <step>
		    <para>The <maketarget>build</maketarget> target is run. This is responsible for
		      descending into the ports' private working directory
		      (<makevar>&#36;{WRKSRC}</makevar>) and
		      building it. If <makevar>&#36;{USE_GMAKE}</makevar> is set, GNU
		      <command>make</command> will be used,
		      otherwise the system <command>make</command>
		      will be used.</para>
		  </step>
		  
		</procedure>
	      
	      
	      <para>The above are the default actions. In addition, you can
		define targets <maketarget>pre-<replaceable>something</replaceable></maketarget> or <maketarget>post-<replaceable>something</replaceable></maketarget>, or put scripts
		with those names, in the <filename>scripts</filename>
		subdirectory, and they will be run before or after the default
		actions are done.</para>
	      
	      <para>For example, if you have a <maketarget>post-extract</maketarget> target defined in your
		Makefile, and a file <filename>pre-build</filename> in the
		<filename>scripts</filename> subdirectory, the
		<maketarget>post-extract</maketarget> target will be
		called after the regular extraction actions, and the
		<filename>pre-build</filename> script will be executed before
		the default build rules are done. It is recommended that you
		use <filename>Makefile</filename> targets if the actions are
		simple enough, because it will be easier for someone to figure
		out what kind of non-default action the port requires.</para>
	      
	      <para>The default actions are done by the
		<filename>bsd.port.mk</filename> targets <maketarget>do-<replaceable>something</replaceable></maketarget>. For example, the
		commands to extract a port are in the target <maketarget>do-extract</maketarget>. If you are not happy with
		the default target, you can fix it by redefining the
		<maketarget>do-<replaceable>something</replaceable></maketarget> target in
		your <filename>Makefile</filename>.</para>

	      <note>
		<para>The <quote>main</quote> targets (e.g., <maketarget>extract</maketarget>, <maketarget>configure</maketarget>, etc.) do nothing more than
		  make sure all  the stages up to that one is completed and
		  call the real targets or scripts, and they are not intended
		  to be changed. If you want to fix the extraction, fix
		  <maketarget>do-extract</maketarget>, but never ever
		  touch <maketarget>extract</maketarget>!</para>
	      </note>
	      
	      <para>Now that you understand what goes on when the user types
		<command>make</command>, let us go through the
		recommended steps to create the perfect port.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Getting the original sources</title>
	      
	      <para>Get the original sources (normally) as a compressed
		tarball (<filename><replaceable>foo</replaceable>.tar.gz</filename> or
		<filename><replaceable>foo</replaceable>.tar.Z</filename>) and copy it into
		<makevar>&#36;{DISTDIR}</makevar>. Always use
		<emphasis>mainstream</emphasis> sources when and where you
		can.</para>
	      
	      <para>If you cannot find a ftp/http site that is well-connected
		to the net, or can only find sites that have irritatingly
		non-standard formats, we can <quote>house</quote> it ourselves by putting
		it on <filename>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/</filename> as the last resort. Please refer to this
		location as <makevar>&#36;{MASTER_SITE_LOCAL}</makevar>. Send mail to
		the &a.ports;if you are not sure what to do.</para>
	      
	      <para>If your port requires some additional `patches' that are
		available on the Internet, fetch them too and put them in
		<makevar>&#36;{DISTDIR}</makevar>. Do not worry if
		they come from site other than where you got the main source
		tarball, we have a way to handle these situations (see the
		description of <xref linkend="porting-patchfiles"
		  remap="&#36;{PATCHFILES}"> below).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Modifying the port</title>
	      
	      <para>Unpack a copy of the tarball in a private directory and
		make whatever changes are necessary to get the port to compile
		properly under the current version of FreeBSD. Keep
		<emphasis>careful track</emphasis> of everything you do, as
		you will be automating the process shortly. Everything,
		including the deletion, addition or modification of files
		should be doable using an automated script or patch file when
		your port is finished.</para>
	      
	      <para>If your port requires significant user
		interaction/customization to compile or install, you should
		take a look at one of Larry Wall's classic <application>Configure</application> scripts
		and perhaps do something similar yourself. The goal of the
		new ports collection is to make each port as <quote>plug-and-play</quote>
		as possible for the end-user while using a minimum of disk
		space.</para>

	      <note>
		<para>Unless explicitly stated, patch files, scripts, and
		  other files you have created and contributed to the FreeBSD
		  ports collection are assumed to be covered by the standard
		  BSD copyright conditions.</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title>Patching</title>
	      
	      <para>In the preparation of the port, files that have been added
		or changed can be picked up with a recursive diff for later
		feeding to patch. Each set of patches you wish to apply
		should be collected into a file named
		<filename>patch-<replaceable>xx</replaceable></filename> where
		<replaceable>xx</replaceable> denotes the sequence in which
		the patches will be applied &mdash; these are done in
		<emphasis>alphabetical order</emphasis>, thus
		<literal>aa</literal> first, <literal>ab</literal> second and so on. These files
		should be stored in <makevar>&#36;{PATCHDIR}</makevar>, from where they will be
		automatically applied. All patches should be relative to
		<makevar>&#36;{WRKSRC}</makevar> (generally the
		directory your port's tarball unpacks itself into, that being
		where the build is done). To make fixes and upgrades easier
		you should avoid having more than one patch fix the same file
		(e.g., patch-aa and patch-ab both changing <makevar>&#36;{WRKSRC}</makevar>/foobar.c).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Configuring</title>
	      
	      <para>Include any additional customization commands to your
		<filename>configure</filename> script and save it in the
		<filename>scripts</filename> subdirectory. As mentioned
		above, you can also do this as <filename>Makefile</filename>
		targets and/or scripts with the name
		<filename>pre-configure</filename> or
		<filename>post-configure</filename>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Handling user input</title>
	      
	      <para>If your port requires user input to build, configure or
		install, then set <makevar>IS_INTERACTIVE</makevar> in your
		Makefile. This will allow <quote>overnight builds</quote> to skip your port
		if the user sets the variable <envar>BATCH</envar> in his
		environment (and if the user sets the variable
		<envar>INTERACTIVE</envar>, then <emphasis>only</emphasis>
		those ports requiring interaction are built).</para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Configuring the Makefile</title>
	    
	    <para>Configuring the Makefile is pretty simple, and again we
	      suggest that you look at existing examples before starting.
	      Also, there is a <xref linkend="porting-samplem" remap="sample
		Makefile"> in this handbook, so take a look and please follow
	      the ordering of variables and sections in that template to make
	      your port easier for others to read.</para>
	    
	    <para>Now, consider the following problems in sequence as you
	      design your new Makefile:</para>
	    
	    
	    <sect4>
	      <title>The original source</title>
	      
	      <para>Does it live in <makevar>&#36;{DISTDIR}</makevar> as a standard gzip'd
		tarball? If so, you can go on to the next step. If not, you
		should look at overriding any of the <makevar>&#36;{EXTRACT_CMD}</makevar>, <makevar>&#36;{EXTRACT_BEFORE_ARGS}</makevar>, <makevar>&#36;{EXTRACT_AFTER_ARGS}</makevar>, <makevar>&#36;{EXTRACT_SUFX}</makevar>, or <makevar>&#36;{DISTFILES}</makevar> variables, depending on
		how alien a format your port's distribution file is. (The
		most common case is <literal>EXTRACT_SUFX=.tar.Z</literal>,
		when the tarball is condensed by regular compress, not
		gzip.)</para>
	      
	      <para>In the worst case, you can simply create your own
		<maketarget>do-extract</maketarget> target to override
		the default, though this should be rarely, if ever,
		necessary.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>DISTNAME</makevar></title>
	      
	      <para>You should set <makevar>&#36;{DISTNAME}</makevar> to be the base name of
		your port. The default rules expect the distribution file
		list (<makevar>&#36;{DISTFILES}</makevar>) to be
		named <makevar>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</makevar> by
		default which, if it is a normal tarball, is going to be
		something like <literal>foozolix-1.0.tar.gz</literal> for a setting of
		<programlisting>
DISTNAME=foozolix-1.0
		</programlisting>.</para>
	      
	      <para>The default rules also expect the tarball(s) to extract
		into a subdirectory called
		<filename>work/&#36;{DISTNAME}</filename>, e.g. <filename>work/foozolix-1.0/</filename>.</para>
	      
	      <para>All this behavior can be overridden, of course, it simply
		represents the most common time-saving defaults. For a port
		requiring multiple distribution files, simply set <makevar>&#36;{DISTFILES}</makevar> explicitly. If only a
		subset of <makevar>&#36;{DISTFILES}</makevar> are
		actual extractable archives, then set them up in <makevar>&#36;{EXTRACT_ONLY}</makevar>, which will override
		the <makevar>&#36;{DISTFILES}</makevar> list when
		it comes to extraction, and the rest will be just left in
		<makevar>&#36;{DISTDIR}</makevar> for later
		use.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>CATEGORIES</makevar></title>
	      
	      <para>When a package is created, it is put under
		<filename>/usr/ports/packages/All</filename> and links are
		made from one or more subdirectories of
		<filename>/usr/ports/packages</filename>. The names of these
		subdirectories are specified by the variable <makevar>&#36;{CATEGORIES}</makevar>. It is intended to
		make life easier for the user when he is wading through the
		pile of packages on the ftp site or the CD-ROM. Please take a
		look at the existing categories (you can find them in <ulink
		  URL="http://www.freebsd.org/ports/">the ports
		  page</ulink>) and pick the ones that are suitable for your
		port. If your port truly belongs to something that is
		different from all the existing ones, you can even create a
		new category name.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>MASTER_SITES</makevar></title>
	      
	      <para>Record the directory part of the ftp/http-URL pointing at
		the original tarball in <makevar>&#36;{MASTER_SITES}</makevar>. Do not forget the
		trailing slash (<filename>/</filename>)!</para>
	      
	      <para>The <command>make</command> macros will try to use this specification for
		grabbing the distribution file with <makevar>&#36;{FETCH}</makevar> if they cannot find it
		already on the system.</para>
	      
	      <para>It is recommended that you put multiple sites on this
		list, preferably from different continents. This will
		safeguard against wide-area network problems, and we are even
		planning to add support for automatically determining the
		closest master site and fetching from there!</para>
	      
	      <para>If the original tarball is part of one of the following
		popular archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or
		Linux Sunsite, you refer to those sites in an easy compact
		form using <makevar>MASTER_SITE_XCONTRIB</makevar>, <makevar>MASTER_SITE_GNU</makevar>,
		<makevar>MASTER_SITE_PERL_CPAN</makevar>, <makevar>MASTER_SITE_TEX_CTAN</makevar>, and
		<makevar>MASTER_SITE_SUNSITE</makevar>. Simply set <makevar>MASTER_SITE_SUBDIR</makevar> to the
		path with in the archive. Here is an example:</para>

		<programlisting>
MASTER_SITES=         ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR=   applications
		</programlisting>
	      
	      <para>The user can also set the <makevar>MASTER_SITE_*</makevar> variables in
		<filename>/etc/make.conf</filename> to override our choices,
		and use their favorite mirrors of these popular archives
		instead.</para>
	      
	    </sect4>
	    
	    <sect4 id="porting-patchfiles">
	      <title><makevar>PATCHFILES</makevar></title>
	      
	      <para>If your port requires some additional patches that are
		available by ftp or http, set <makevar>&#36;{PATCHFILES}</makevar> to the names of the
		files and <makevar>&#36;{PATCH_SITES}</makevar> to
		the URL of the directory that contains them (the format is the
		same as <makevar>&#36;{MASTER_SITES}</makevar>).</para>
	      
	      <para>If the patch is not relative to the top of the source tree
		(i.e., <makevar>&#36;{WKRSRC}</makevar>) because it
		contains some extra pathnames, set <makevar>&#36;{PATCH_DIST_STRIP}</makevar> accordingly.
		For instance, if all the pathnames in the patch has an extra
		<literal>foozolix-1.0/</literal> in front of the
		filenames, then set
		<literal>PATCH_DIST_STRIP=-p1</literal>.</para>
	      
	      <para>Do not worry if the patches are compressed, they will be
		decompressed automatically if the filenames end with
		<filename>.gz</filename> or
		<filename>.Z</filename>.</para>
	      
	      <para>If the patch is distributed with some other files, such as
		documentation, in a gzip'd tarball, you can't just use
		<makevar>&#36;{PATCHFILES}</makevar>. If that is
		the case, add the name and the location of the patch tarball
		to <makevar>&#36;{DISTFILES}</makevar> and
		<makevar>&#36;{MASTER_SITES}</makevar>. Then, from
		the <maketarget>pre-patch</maketarget> target, apply the
		patch either by running the patch command from there, or
		copying the patch file into the <makevar>&#36;{PATCHDIR}</makevar> directory and calling it
		<filename>patch-<replaceable>xx</replaceable></filename>.</para>

	      <note>
		<para>Note the tarball will have been extracted alongside the
		  regular source by then, so there is no need to explicitly
		  extract it if it is a regular gzip'd or compress'd tarball.
		  If you do the latter, take extra care not to overwrite
		  something that already exists in that directory. Also do
		  not forget to add a command to remove the copied patch in
		  the <maketarget>pre-clean</maketarget> target.</para>
	      </note>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>MAINTAINER</makevar></title>
	      
	      <para>Set your mail-address here. Please. <!-- smiley --><emphasis>:)</emphasis></para>
	      
	      <para>For detailed description of the responsibility of
		maintainers, refer to <xref linkend="policies-maintainer"
		  remap="MAINTAINER
		  on Makefiles"> section.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Dependencies</title>
	      
	      <para>Many ports depend on other ports. There are five
		variables that you can use to ensure that all the required
		bits will be on the user's machine.</para>
	      
	      
	      <sect5>
		<title><makevar>LIB_DEPENDS</makevar></title>
		
		<para>This variable specifies the shared libraries this port
		  depends on. It is a list of <replaceable>lib</replaceable>:<replaceable>dir</replaceable> pairs where
		  <replaceable>lib</replaceable> is the name of the shared library,
		  and <replaceable>dir</replaceable> is the directory in which to
		  find it in case it is not available. For example,

		  <programlisting>
LIB_DEPENDS=   jpeg\\.6\\.:${PORTSDIR}/graphics/jpeg
		  </programlisting>

		  will check for a shared jpeg library with
		  major version 6, and descend into the
		  <filename>graphics/jpeg</filename> subdirectory of your
		  ports tree to build and install it if it is not
		  found.</para>

		<note>
		  <para>The <replaceable>lib</replaceable> part is just an argument
		    given to <command>ldconfig -r | grep</command>, so
		    periods should be escaped by two backslashes like in the
		    example above.</para>
		</note>
		
		<para>The dependency is checked from within the <maketarget>extract</maketarget> target. Also, the name of the
		  dependency is put in to the package so that
		  <symbol>pkg_add</symbol> will automatically install it if it
		  is not on the user's system.</para>
		
	      </sect5>
	      
	      <sect5>
		<title><makevar>RUN_DEPENDS</makevar></title>
		
		<para>This variable specifies executables or files this port
		  depends on during run-time. It is a list of <replaceable>path</replaceable>:<replaceable>dir</replaceable> pairs where
		  <replaceable>path</replaceable> is the name of the executable or
		  file, and <replaceable>dir</replaceable> is the directory in which
		  to find it in case it is not available. If
		  <replaceable>path</replaceable> starts with a slash
		  (<literal>/</literal>), it is treated as a file and its
		  existence is  tested with <command>test -e</command>;
		  otherwise, it is assumed to be an executable, and
		  <command>which -s</command> is used to determine if the
		  program exists in the user's search path.</para>
		
		<para>For example,

		  <programlisting>
RUN_DEPENDS=   ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
               wish:${PORTSDIR}/x11/tk
		  </programlisting>

		  will check if the file
		  <filename>/usr/local/etc/innd</filename> exists, and build
		  and install it from the <filename>news/inn</filename>
		  subdirectory of the ports tree if it is not found. It will
		  also see if an executable called <command>wish</command> is in your search path, and
		  descend into the <filename>x11/tk</filename> subdirectory of
		  your ports tree to build and install it if it is not
		  found.</para>

		<note>
		  <para>In this case, <command>innd</command> is actually an
		    executable; if an executable is in a place that is not
		    expected to be in a normal user's search path, you should
		    use the full pathname.</para>
		</note>
		
		<para>The dependency is checked from within the <maketarget>install</maketarget> target. Also, the name of the
		  dependency is put in to the  package so that
		  <command>pkg_add</command> will automatically install it if it
		  is not on the user's system.</para>
		
	      </sect5>
	      
	      <sect5>
		<title><makevar>BUILD_DEPENDS</makevar></title>
		
		<para>This variable specifies executables or files this port
		  requires to build. Like <makevar>RUN_DEPENDS</makevar>, it is
		  a list of <replaceable>path</replaceable>:<replaceable>dir</replaceable> pairs.
		  For example,
		
		  <programlisting>
BUILD_DEPENDS=   unzip:${PORTSDIR}/archivers/unzip
		  </programlisting>

		  will check for an executable called
		  <command>unzip</command>, and descend into the
		  <filename>archivers/unzip</filename> subdirectory of your
		  ports tree to build and install it if it is not
		  found.</para>

		<note>
		  <para><quote>build</quote> here means everything from extracting to
		    compilation. The dependency is checked from within the
		    <maketarget>extract</maketarget> target.</para>
		</note>
	      </sect5>
	      
	      <sect5>
		<title><makevar>FETCH_DEPENDS</makevar></title>
		
		<para>This variable specifies executables or files this port
		  requires to fetch. Like the previous two, it is a list of
		  <replaceable>path</replaceable>:<replaceable>dir</replaceable> pairs. For
		  example,

		  <programlisting>
FETCH_DEPENDS=   ncftp2:${PORTSDIR}/net/ncftp2
		  </programlisting>

		  will check for an executable called
		  <command>ncftp2</command>, and descend into the
		  <filename>net/ncftp2</filename> subdirectory of your ports
		  tree to build and install it if it is not found.</para>
		
		<para>The dependency is checked from within the <maketarget>fetch</maketarget> target.</para>
		
	      </sect5>
	      
	      <sect5>
		<title><makevar>DEPENDS</makevar></title>
		
		<para>If there is a dependency that does not fall into either
		  of the above four categories, or your port requires to have
		  the source of the other port extracted (i.e., having them
		  installed is not enough), then use this variable. This is
		  just a list of directories, as there is nothing to check,
		  unlike the previous four.</para>
		
	      </sect5>
	    </sect4>
	    
	    <sect4>
	      <title>Building mechanisms</title>
	      
	      <para>If your package uses GNU <command>make</command>, set
		<literal>USE_GMAKE=yes</literal>. If your package uses GNU
		<command>configure</command>, set
		<literal>GNU_CONFIGURE=yes</literal>. If you want to give
		some extra arguments to GNU <command>configure</command> (other than the default
		<literal>--prefix=&#36;{PREFIX}</literal>), set those extra
		arguments in <makevar>&#36;{CONFIGURE_ARGS}</makevar>.</para>
	      
	      <para>If your package is an X application that creates
		<filename>Makefile</filename>s from
		<filename>Imakefile</filename>s using <command>imake</command>, then set
		<literal>USE_IMAKE=yes</literal>. This will cause the
		configure stage to automatically do an <command>xmkmf
		  -a</command>. If the <option>-a</option> flag is a
		problem for your port, set
		<literal>XMKMF=xmkmf</literal>.</para>
	      
	      <para>If your port's source <filename>Makefile</filename> has
		something else than <maketarget>all</maketarget> as the
		main build target, set <makevar>&#36;{ALL_TARGET}</makevar> accordingly. Same
		goes for <maketarget>install</maketarget> and <makevar>&#36;{INSTALL_TARGET}</makevar>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>NO_INSTALL_MANPAGES</makevar></title>
	      
	      <para>If the port uses <command>imake</command> but does not understand the
		<filename>install.man</filename> target,
		<literal>NO_INSTALL_MANPAGES=yes</literal> should be set.
		In addition, the author of the original port should be shot.
		<!-- smiley --><emphasis>:&gt;</emphasis></para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Ports that require Motif</title>
	    
	    <para>There are many programs that require a Motif library
	      (available from several commercial vendors, while there is (at
	      least) one effort to create a free clone) to compile. Since it
	      is a popular toolkit and their licenses usually permit
	      redistribution of statically linked binaries, we have made
	      special provisions for handling ports that require Motif in a
	      way that we can easily compile binaries linked either
	      dynamically or statically.</para>
	    
	    
	    <sect4>
	      <title><makevar>REQUIRES_MOTIF</makevar></title>
	      
	      <para>If your port requires Motif, define this variable in the
		Makefile. This will prevent people who don't own a copy of
		Motif from even attempting to build it.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>&#36;{MOTIFLIB}</makevar></title>
	      
	      <para>This variable will be set by
		<filename>bsd.port.mk</filename> to be the appropriate
		reference to the Motif library. Please patch the source to
		use this wherever the Motif library is referenced in the
		Makefile or Imakefile.</para>
	      
	      <para>There are two common cases:</para>
	      
		<orderedlist>
		  
		  <listitem>
		    <para>If the port refers to the Motif library as
		      <option>-lXm</option> in its Makefile or Imakefile,
		      simply substitute <makevar>&#36;{MOTIFLIB}</makevar> for it.</para>
		  </listitem>
		  
		  <listitem>
		    <para>If the port uses <literal>XmClientLibs</literal> in its Imakefile,
		      change it to <makevar>&#36;{MOTIFLIB}
			&#36;{XTOOLLIB} &#36;{XLIB}</makevar>.</para>
		  </listitem>
		  
		</orderedlist>

	      <note>
		<para><makevar>&#36;{MOTIFLIB}</makevar> (usually)
		  expands to <literal>-L/usr/X11R6/lib -lXm</literal> or
		  <literal>/usr/X11R6/lib/libXm.a</literal>, so there is
		  no need to add <option>-L</option> or
		  <option>-l</option> in front.</para>
	      </note>
	    </sect4>
	  </sect3>
	  
	  <sect3>
	    <title>Info files</title>
	    
	    <para>The new version of texinfo (included in 2.2.2-RELEASE and
	      onwards) contains a utility called <command>install-info</command> to add and delete entries to
	      the <filename>dir</filename> file. If your port installs any
	      info documents, please follow these instructions so your
	      port/package will correctly update the user's
	      <filename>&#36;{PREFIX}/info/dir</filename> file. (Sorry for
	      the length of this section, but it is imperative to weave all
	      the info files together. If done correctly, it will produce a
	      <emphasis>beautiful</emphasis> listing, so please bear with me!
	      <!-- smiley --><emphasis>:)</emphasis></para>
	    
	    <para>First, this is what you (as a porter) need to know:</para>
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>install-info --help</userinput>
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
  Install INFO-FILE in the Info directory file DIR-FILE.

Options:
--delete          Delete existing entries in INFO-FILE;
                    don't insert any new entries.
 :
--entry=TEXT      Insert TEXT as an Info directory entry.
 :
--section=SEC     Put this file's entries in section SEC of the directory. :</screen>
	    </informalexample>

	    <note>
	      <para>This program will not actually
		<emphasis>install</emphasis> info files; it merely inserts or
		deletes entries in the <filename>dir</filename> file.</para>
	    </note>
	    
	    <para>Here's a seven-step procedure to convert ports to use
	      <command>install-info</command>. I will use
	      <filename>editors/emacs</filename> as an example.</para>
	    
	    <procedure>
	      <step>
		<para>Look at the texinfo sources and make a patch to insert
		  <literal>@dircategory</literal> and <literal>@direntry</literal>
		  statements to files that don't have them. This is part of
		  my patch:</para>
		  
		  <programlisting>
--- ./man/vip.texi.org  Fri Jun 16 15:31:11 1995
+++ ./man/vip.texi      Tue May 20 01:28:33 1997
@@ -2,6 +2,10 @@
             
 @setfilename ../info/vip
 @settitle VIP
+@dircategory The Emacs editor and associated tools
+@direntry
+* VIP: (vip).          A VI-emulation for Emacs.
+@end direntry
             
 @iftex
 @finalout
 :
		  </programlisting>
		  
		  <para>The format should be self-explanatory. Many authors
		    leave a <filename>dir</filename> file in the source tree
		    that contains all the entries you need, so look around
		    before you try to write your own. Also, make sure you
		    look into related ports and make the section names and
		    entry indentations consistent (we recommend that all entry
		    text start at the 4th tab stop).</para>
		
		  <note>
		    <para>Note that you can put only one info entry per file
		      because of a bug in <command>install-info
			--delete</command> that deletes only the first entry
		      if you specify multiple entries in the
		      <email>@direntry</email> section.</para>
		  </note>
		  
		  <para>You can give the <literal>dir</literal>
		    entries to <command>install-info</command> as
		    arguments (<option>--section</option> and
		    <option>--entry</option>) instead of patching the texinfo
		    sources. I do not think this is a good idea for ports
		    because you need to duplicate the same information in
		    <emphasis>three</emphasis> places
		    (<filename>Makefile</filename> and
		    <literal>@exec</literal>/<literal>@unexec</literal> of
		    <filename>PLIST</filename>; see below). However, if you
		    have a Japanese (or other multibyte encoding) info files,
		    you will have to use the extra arguments to <command>install-info</command> because <command>makeinfo</command> can't handle those texinfo
		    sources. (See <filename>Makefile</filename> and
		    <filename>PLIST</filename> of
		    <filename>japanese/skk</filename> for examples on how to
		    do this).</para>
		</step>
		
		<step>
		  <para>Go back to the port directory and do a <command>make clean; make</command> and verify that
		    the info files are regenerated from the texinfo sources.
		    Since the texinfo sources are newer than the info files,
		    they should be rebuilt when you type <command>make</command>; but many
		    <filename>Makefile</filename>s don't include correct
		  dependencies for info files. In <command>emacs</command>' case, I had to
		    patch the main <filename>Makefile.in</filename> so it will
		    descend into the <filename>man</filename>
		    subdirectory to rebuild the info pages.</para>
		    
		    <programlisting>
--- ./Makefile.in.org   Mon Aug 19 21:12:19 1996
+++ ./Makefile.in       Tue Apr 15 00:15:28 1997
@@ -184,7 +184,7 @@
 # Subdirectories to make recursively.  `lisp' is not included
 # because the compiled lisp files are part of the distribution
 # and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
             
 # The makefiles of the directories in $SUBDIR.
 SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org       Thu Jun 27 15:27:19 1996
+++ ./man/Makefile.in   Tue Apr 15 00:29:52 1997
@@ -66,6 +66,7 @@
 ${srcdir}/gnu1.texi \
 ${srcdir}/glossary.texi
             
+all: info
 info: $(INFO_TARGETS)
             
 dvi: $(DVI_TARGETS)
		    </programlisting>
		  
		  <para>The second hunk was necessary because the default
		    target in the <filename>man</filename> subdir is called
		    <maketarget>info</maketarget>, while the main
		    <filename>Makefile</filename> wants to call <maketarget>all</maketarget>. I also deleted the installation
		    of the <filename>info</filename> info file
		    because we already have one with the same name in
		    <filename>/usr/share/info</filename> (that patch is not
		    shown here).</para>
		</step>
		
		<step>
		  <para>If there is a place in the
		    <filename>Makefile</filename> that is installing the
		    <filename>dir</filename> file, delete it. Your
		    port may not be doing it. Also, remove any commands that
		    are otherwise mucking around with the
		    <filename>dir</filename> file.</para>
		    
		    <programlisting>
--- ./Makefile.in.org   Mon Aug 19 21:12:19 1996
+++ ./Makefile.in       Mon Apr 14 23:38:07 1997
@@ -368,14 +368,8 @@
        if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
        then \
          (cd ${infodir};  \
-          if [ -f dir ]; then \
-            if [ ! -f dir.old ]; then mv -f dir dir.old; \
-            else mv -f dir dir.bak; fi; \
-          fi; \
           cd ${srcdir}/info ; \
-          (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
-          (cd $${thisdir}; chmod a+r ${infodir}/dir); \
           for f in ccmode* cl* dired-x* ediff* emacs* forms* gnus* info* message* mh-e* sc* vip*; do \
             (cd $${thisdir}; \
              ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
              chmod a+r ${infodir}/$$f); \
		    </programlisting>
		</step>
		
		<step>
		  <para>(This step is only necessary if you are modifying an
		    existing port.) Take a look at
		    <filename>pkg/PLIST</filename> and delete anything that is
		    trying to patch up <filename>info/dir</filename>. They
		    may be in <filename>pkg/INSTALL</filename> or some other
		    file, so search extensively.</para>
		    
		    <programlisting>
Index: pkg/PLIST
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v
retrieving revision 1.15
diff -u -r1.15 PLIST
--- PLIST       1997/03/04 08:04:00     1.15
+++ PLIST       1997/04/15 06:32:12
@@ -15,9 +15,6 @@
 man/man1/emacs.1.gz
 man/man1/etags.1.gz
 man/man1/ctags.1.gz
-@unexec cp %D/info/dir %D/info/dir.bak
-info/dir
-@unexec cp %D/info/dir.bak %D/info/dir
 info/cl
 info/cl-1
 info/cl-2		    
		    </programlisting>
		</step>
		
		<step>
		  <para>Add a <maketarget>post-install</maketarget>
		    target to the <filename>Makefile</filename> to create a
		    <filename>dir</filename> file if it is not there. Also,
		    call <maketarget>install-info</maketarget> with the
		    installed info files.</para>
		    
		    <programlisting>
Index: Makefile
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile    1996/11/19 13:14:40     1.26
+++ Makefile    1997/05/20 10:25:09     1.28
@@ -20,5 +20,11 @@
 post-install:
 .for file in emacs-19.34 emacsclient etags ctags b2m
        strip ${PREFIX}/bin/${file}
 .endfor
+       if [ ! -f ${PREFIX}/info/dir ]; then \
+         ${SED} -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \
+       fi
+.for info in emacs vip viper forms gnus mh-e cl sc dired-x ediff ccmode
+       install-info ${PREFIX}/info/${info} ${PREFIX}/info/dir
+.endfor
             
 .include &lt;bsd.port.mk&gt;
		    </programlisting>
		
		  <para>Do not use anything other than
		    <filename>/usr/share/info/dir</filename> and the above
		    command to create a new info file. In fact, I'd add the
		    first three lines of the above patch to
		    <filename>bsd.port.mk</filename> if you (the porter)
		    wouldn't have to do it in <filename>PLIST</filename> by
		    yourself anyway.</para>
		</step>
		
		<step>
		  <para>Edit <filename>PLIST</filename> and add equivalent
		    <literal>@exec</literal> statements and also
		    <literal>@unexec</literal> for <command>pkg_delete</command>.
		    You do not need to delete <filename>info/dir</filename>
		    with <literal>@unexec</literal>.</para>
		    
		    <programlisting>
Index: pkg/PLIST
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v
retrieving revision 1.15
diff -u -r1.15 PLIST
--- PLIST       1997/03/04 08:04:00     1.15
+++ PLIST       1997/05/20 10:25:12     1.17
@@ -16,7 +14,15 @@
 man/man1/etags.1.gz
 man/man1/ctags.1.gz
+@unexec install-info --delete %D/info/emacs %D/info/dir
 :
+@unexec install-info --delete %D/info/ccmode %D/info/dir
 info/cl
 info/cl-1
@@ -87,6 +94,18 @@
 info/viper-3
 info/viper-4
+@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir
+@exec install-info %D/info/emacs %D/info/dir
 :
+@exec install-info %D/info/ccmode %D/info/dir
 libexec/emacs/19.34/i386--freebsd/cvtmail
 libexec/emacs/19.34/i386--freebsd/digest-doc
		    </programlisting>

		  <note>
		    <para>The <literal>@unexec install-info
			--delete</literal> commands have to be listed before
		      the info files themselves so they can read the files.
		      Also, the <literal>@exec install-info</literal> commands
		      have to be after the info files and the
		      <literal>@exec</literal> command that creates the the
		      <filename>dir</filename> file.</para>
		  </note>
		</step>
		
		<step>
		  <para>Test and admire your work. <!-- smiley --><emphasis>:)</emphasis> The sequence I recommend is:
		    <command>make package</command>,
		    <command>pkg_delete</command>, then
		    <command>pkg_add</command>. Check the <filename>dir</filename> file before and after each
		    step.</para>
		</step>
		
	      </procedure>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Licensing Problems</title>
	    
	    <para>Some software packages have restrictive licenses or can be
	      in violation to the law (PKP's patent on public key crypto, ITAR
	      (export of crypto software) to name just two of them). What we
	      can do with them vary a lot, depending on the exact wordings of
	      the respective licenses.</para>

	    <note>
	      <para>It is your responsibility as a porter to read the
		licensing terms of the software and make sure that the FreeBSD
		project will not be held accountable of violating them by
		redistributing the source or compiled binaries either via ftp
		or CD-ROM. If in doubt, please contact the &a.ports;.</para>
	    </note>
	    
	    <para>There are two variables you can set in the Makefile to
	      handle  the situations that arise frequently:</para>
	    
	    
	      <orderedlist>
		
		<listitem>
		<para>If the port has a <quote>do not sell for profit</quote> type of
		    license, set the variable <makevar>NO_CDROM</makevar>. We
		    will make sure such ports won't go into the CD-ROM come
		    release time. The distfile and package will still be
		    available via ftp.</para>
		</listitem>
		
		<listitem>
		  <para>If the resulting package needs to be built uniquely
		    for each site, or the resulting binary package can't be
		    distributed due to licensing; set the variable
		    <makevar>NO_PACKAGE</makevar>. We will make sure such
		    packages won't go on the ftp site, nor  into the CD-ROM
		    come release time. The distfile will still be included on
		    both however.</para>
		</listitem>
		
		<listitem>
		  <para>If the port has legal restrictions on who can use it
		  (e.g., crypto stuff) or has a <quote>no commercial use</quote> license,
		    set the variable <makevar>RESTRICTED</makevar> to be the
		    string describing the reason why. For such ports, the
		    distfiles/packages will not be available even from our ftp
		    sites.</para>
		</listitem>
		
	      </orderedlist>
	    

	    <note>
	      <para>The GNU General Public License (GPL), both version 1
		and 2, should not be a problem for ports.</para>
	    </note>

	    <note>
	      <para>If you are a committer, make sure you update the
		<filename>ports/LEGAL</filename> file too.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title>Upgrading</title>
	    
	    <para>When you notice that a port is out of date compared to the
	      latest version from the original authors, first make sure you
	      have the latest port. You can find them in the
	      <filename>ports-current</filename> directory of the ftp mirror
	      sites.</para>
	    
	    <para>The next step is to send a mail to the maintainer, if one is
	      listed in the port's <filename>Makefile</filename>. That person may already be
	      working on an upgrade, or have a reason to not upgrade the port
	      right now (because of, for example, stability problems of the
	      new version).</para>
	    
	    <para>If the maintainer asks you to do the upgrade or there isn't
	      any such person to begin with, please make the upgrade and send
	      the recursive diff (either unified or context diff is fine, but
	      port committers appear to prefer unified diff more) of the new
	      and old ports directories to us (i.e., if your modified ports
	      directory is called <filename>superedit</filename>
	      and the original as in our tree is
	      <filename>superedit.bak</filename>, then send us the result of
	      <command>diff -ruN superedit.bak
		superedit</command>). Please examine the output to make
	      sure all the changes make sense. The best way to send us the
	      diff is by including it to <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry>
	      (category <literal>ports</literal>). Please mention any added or deleted files
	      in the message, as they have to be explicitly specified to CVS
	      when doing a commit. If the diff is more than about 20KB, please
	      compress and uuencode it; otherwise, just include it in as is in
	      the PR.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Do's and Dont's</title>
	    
	    <para>Here is a list of common do's and dont's that you encounter
	      during the porting process.</para>
	    
	    
	    <sect4>
	      <title><makevar>WRKDIR</makevar></title>
	      
	      <para>Do not leave anything valuable lying around in the
		<filename>work</filename> subdirectory, <command>make clean</command> will
		<emphasis>nuke</emphasis> it completely! If you need
		auxiliary files that are not scripts or patches, put them in
		the <makevar>&#36;{FILESDIR}</makevar> subdirectory
		(<filename>files</filename> by default) and use the
		<maketarget>post-extract</maketarget> target to copy them
		to the <filename>work</filename> subdirectory.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Package information</title>
	      
	      <para>Do include package information, i.e.
		<filename>COMMENT</filename>, <filename>DESCR</filename>, and
		<filename>PLIST</filename>, in <filename>pkg</filename>.</para>

	      <note>
		<para>Note that these files are not used only for packaging
		  anymore, and are <emphasis>mandatory</emphasis> now, even if
		  <makevar>&#36;{NO_PACKAGE}</makevar> is
		  set.</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title>Compress manpages, strip binaries</title>
	      
	      <para>Do compress manpages and strip binaries. If the original
		source already strips the binary, fine; otherwise, you can add
		a <maketarget>post-install</maketarget> rule to do it
		yourself. Here is an example:</para>

		<programlisting>
post-install:
        strip ${PREFIX}/bin/xdl
		</programlisting>
	      
	      <para>Use the <command>file</command> command on the
		installed executable to check whether the binary is stripped
		or not. If it does not say `not stripped', it is
		stripped.</para>
	      
	      <para>To automagically compress the manpages, use the <makevar>MAN[1-9LN]</makevar>
		variables. They will check the variable
		<makevar>NOMANCOMPRESS</makevar> that the user can set in
		<filename>/etc/make.conf</filename> to disable man page
		compression. Place them last in the section below the
		<makevar>MAINTAINER</makevar> variable. Here is an example:</para>

		<programlisting>
MAN1=      foo.1 bar.1
MAN5=      foo.conf.5
MAN8=      baz.8
		</programlisting>

	      <note>
		<para>This is not usually necessary with ports that are X
		  applications and use Imake to build.</para>
	      </note>
	      
	      <para>If your port anchors its man tree somewhere other than
		<makevar>PREFIX</makevar>, you can use the
		<makevar>MANPREFIX</makevar> to set it. Also, if only manpages
		in certain section go in a non-standard place, such as many
		Perl modules ports, you can set individual man paths using
		<makevar>MAN<replaceable>sect</replaceable>PREFIX</makevar>
		(where <replaceable>sect</replaceable> is one of 1-9, L or
		N).</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>INSTALL_*</makevar> macros</title>
	      
	      <para>Do use the macros provided in
		<filename>bsd.port.mk</filename> to ensure correct modes and
		ownership of files in your own *-install targets. They
		are:</para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para><makevar>${INSTALL_PROGRAM}</makevar> is
		      a command to install binary executables.</para>
		  </listitem>
		  
		  <listitem>
		    <para><makevar>${INSTALL_SCRIPT}</makevar> is a
		      command to install executable scripts.</para>
		  </listitem>
		  
		  <listitem>
		    <para><makevar>${INSTALL_DATA}</makevar> is a
		      command to install sharable data.</para>
		  </listitem>
		  
		  <listitem>
		    <para><makevar>${INSTALL_MAN}</makevar> is a
		      command to install manpages and other documentation (it
		      doesn't compress anything).</para>
		  </listitem>
		  
		</itemizedlist>
	      
	      
	      <para>These are basically the <command>install</command> command with all the appropriate
		flags. See below for an example on how to use them.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><filename>INSTALL</filename> package script</title>
	      
	      <para>If your port needs execute commands when the binary
		package is installed with pkg_add you can do with via the
		<filename>pkg/INSTALL</filename> script. This script will
		automatically be added to the  package, and will be run twice
		by pkg_add. The first time will as <command>INSTALL ${PKGNAME} PRE-INSTALL</command> and the
		second time as <command>INSTALL ${PKGNAME}
		  POST-INSTALL</command>. <literal>&#36;2</literal> can be tested to determine which
		mode the script is being run in. The
		<envar>PKG_PREFIX</envar> environmental variable will be
		set to the package installation directory. See man
		<citerefentry><refentrytitle>pkg_add</refentrytitle><manvolnum>1</manvolnum></citerefentry> for additional
		information.</para>

	      <note>
		<para>This script is not run automatically if you install the
		  port with <command>make install</command>. If you are
		  depending on it being run, you will have to explicitly call
		  it on your port's <filename>Makefile</filename>.</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title><filename>REQ</filename> package script</title>
	      
	      <para>If your port needs to determine if it should install or
		not, you can create a <filename>pkg/REQ</filename>
		<quote>requirements</quote> script. It will be invoked automatically at
		installation/deinstallation time to determine whether or not
		installation/deinstallation should proceed. See man
		<citerefentry><refentrytitle>pkg_create</refentrytitle><manvolnum>1</manvolnum></citerefentry> and man
		<citerefentry><refentrytitle>pkg_add</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more information.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Install additional documentation</title>
	      
	      <para>If your software has some documentation other than the
		standard man and info pages that you think is useful for the
		user, install it under
		<filename>&#36;{PREFIX}/share/doc</filename>. This can be
		done, like the previous item, in the <maketarget>post-install</maketarget> target.</para>
	      
	      <para>Create a new directory for your port. The directory name
		should reflect what the port is. This usually means <makevar>&#36;{PKGNAME}</makevar> minus the version part.
		However, if you think the user might want different versions
		of the port to be installed at the same time, you can use the
		whole <makevar>&#36;{PKGNAME}</makevar>.</para>
	      
	      <para>Make the installation dependent to the variable
		<makevar>NOPORTDOCS</makevar> so that users can disable it in
		<filename>/etc/make.conf</filename>, like this:</para>

		<programlisting>
post-install:
.if !defined(NOPORTDOCS)
        ${MKDIR}${PREFIX}/share/doc/xv
        ${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv
.endif
		</programlisting>
	      
	      <para>Do not forget to add them to
		<filename>pkg/PLIST</filename> too! (Do not worry about
		<makevar>NOPORTDOCS</makevar> here; there is currently no way
		for the packages to read variables from
		<filename>/etc/make.conf</filename>.)</para>
	      
	      <para>If you need to display a message to the installer, you may
		place the message in <filename>pkg/MESSAGE</filename>. This
		capibility is often useful to display additional installation
		steps to be taken after a pkg_add, or to display licensing
		information.</para>

	      <note>
		<para><filename>MESSAGE</filename> does not need to be added
		  to <filename>pkg/PLIST</filename>).</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title><makevar>DIST_SUBDIR</makevar></title>
	      
	      <para>Do not let your port clutter
		<filename>/usr/ports/distfiles</filename>. If your port
		requires a lot of files to be fetched, or contains a file that
		has a name that might conflict with other ports (e.g.,
		<filename>Makefile</filename>), set <makevar>&#36;{DIST_SUBDIR}</makevar> to the name of the
		port (<makevar>&#36;{PKGNAME}</makevar> without the
		version part should work fine). This will change <makevar>&#36;{DISTDIR}</makevar> from the default
		<filename>/usr/ports/distfiles</filename> to
		<filename>/usr/ports/distfiles/&#36;{DIST_SUBDIR}</filename>,
		and in effect puts everything that is required for your port
		into that subdirectory.</para>
	      
	      <para>It will also look at the subdirectory with the same name
		on the backup master site at
		<filename>ftp.freebsd.org</filename>. (Setting <makevar>&#36;{DISTDIR}</makevar> explicitly in your
		<makevar>Makefile</makevar> will not accomplish this, so please use <makevar>&#36;{DIST_SUBDIR}</makevar>.)</para>

	      <note>
		<para>This does not affect the <makevar>&#36;{MASTER_SITES}</makevar> you define in your
		  Makefile.</para>
	      </note>
	    </sect4>
	    
	    <sect4>
	      <title>Feedback</title>
	      
	      <para>Do send applicable changes/patches to the original
		author/maintainer for inclusion in next release of the code.
		This will only make your job that much easier for the next
		release.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>RCS strings</title>
	      
	      <para>Do not put RCS strings in patches. CVS will mangle them
		when we put the files into the ports tree, and when we check
		them out again, they will come out different and the patch
		will fail. RCS strings are surrounded by dollar (<literal>&#36;</literal>) signs, and typically start with
		<literal>&#36;Id</literal> or <literal>&#36;RCS</literal>.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Recursive diff</title>
	      
	      <para>Using the recurse (<option>-r</option>) option to
		<command>diff</command> to generate patches is
		fine, but please take a look at the resulting patches to make
		sure you don't have any unnecessary junk in there. In
		particular, diffs between two backup files, <filename>Makefiles</filename> when the
		port uses <command>Imake</command> or GNU <command>configure</command>, etc., are unnecessary and
		should be deleted. Also, if you had to delete a file, then you
		can do it in the <maketarget>post-extract</maketarget>
		target rather than as part of the patch. Once you are happy
		with the resuling diff, please split it up into one source
		file per patch file.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title><makevar>PREFIX</makevar></title>
	      
	      <para>Do try to make your port install relative to <makevar>&#36;{PREFIX}</makevar>. (The value of this
		variable will be set to <makevar>&#36;{LOCALBASE}</makevar> (default
		<filename>/usr/local</filename>), unless <makevar>&#36;{USE_IMAKE}</makevar> or <makevar>&#36;{USE_X11}</makevar> is set, in which case it
		will be <makevar>&#36;{X11BASE}</makevar> (default
		<filename>/usr/X11R6</filename>).)</para>
	      
	      <para>Not hard-coding <filename>/usr/local</filename> or
		<filename>/usr/X11R6</filename> anywhere in the source will
		make the port much more flexible and able to cater to the
		needs of other sites. For X ports that use <command>imake</command>, this is
		automatic; otherwise, this can often be done by simply
		replacing the occurrences of <filename>/usr/local</filename>
		(or <filename>/usr/X11R6</filename> for X ports that do not
		use imake) in the various scripts/Makefiles in the port to
		read <makevar>&#36;{PREFIX}</makevar>, as this
		variable is automatically passed down to every stage of the
		build and install processes.</para>
	      
	      <para>The variable <makevar>&#36;{PREFIX}</makevar>
		can be reassigned in your Makefile or in the user's
		environment. However, it is strongly discouraged for
		individual ports to set this variable explicitly in the
		Makefiles. (If your port is an X port but does not use <command>imake</command>,
		set <literal>USE_X11=yes</literal>; this is quite different
		from setting <literal>PREFIX=/usr/X11R6</literal>.)</para>
	      
	      <para>Also, refer to programs/files from other ports with the
		variables mentioned above, not explicit pathnames. For
		instance, if your port requires a macro
		<literal>PAGER</literal> to be the full pathname of <command>less</command>, use the compiler flag:

		<programlisting>
-DPAGER=\"&#36;{PREFIX}/bin/less\"
		</programlisting>

		or

		<programlisting>
-DPAGER=\"&#36;{LOCALBASE}/bin/less\"
		</programlisting>

		if this is an X port, instead of  <literal>-DPAGER=\"/usr/local/bin/less\".</literal> This way it will have a better chance of working if the system administrator has moved the whole `/usr/local' tree somewhere else.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>Subdirectories</title>
	      
	      <para>Try to let the port put things in the right subdirectories
		of <makevar>&#36;{PREFIX}</makevar>. Some ports
		lump everything and put it in the subdirectory with the port's
		name, which is incorrect. Also, many ports put everything
		except binaries, header files and manual pages in the a
		subdirectory of <filename>lib</filename>, which does not
		bode well with the BSD paradigm. Many of the files should be
		moved to one of the following: <filename>etc</filename>
		(setup/configuration files), <filename>libexec</filename>
		(executables started internally), <filename>sbin</filename>
		(executables for superusers/managers),
		<filename>info</filename> (documentation for info browser)
		or  <filename>share</filename> (architecture independent
		files). See man <citerefentry><refentrytitle>hier</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
		details, the rule governing <filename>/usr</filename> pretty
		much applies to <filename>/usr/local</filename> too. The
		exception are ports dealing with USENET <quote>news</quote>. They may use
		<filename>&#36;{PREFIX}/news</filename> as a destination for
		their files.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>ldconfig</title>
	      
	      <para>If your port installs a shared library, add a <maketarget>post-install</maketarget> target to your Makefile
		that runs <command>/sbin/ldconfig -m</command> on
		the directory where the new library is installed (usually
		<filename>&#36;{PREFIX}/lib</filename>) to register it into
		the shared library cache.</para>
	      
	      <para>Also, add an <literal>@exec</literal> line to your
		<filename>pkg/PLIST</filename> file so that a user who
		installed the package can start using the shared library
		immediately. This line should  immediately follow the line
		for the shared library itself, as in:</para>

		<programlisting>
lib/libtcl80.so.1.0
@exec /sbin/ldconfig -m %D/lib
		</programlisting>
	      
	      <para>Never, ever, <emphasis>ever</emphasis> add a line that
		says <command>ldconfig</command> without any
		arguments to your <filename>Makefile</filename> or <filename>pkg/PLIST</filename>. This will reset the
		shared library cache to the contents of
		<filename>/usr/lib</filename> only, and will royally screw up
		the user's machine (<quote>Help, xinit does not run anymore after I
		install this port!</quote>). Anybody who does this will be shot and
		cut into 65,536 pieces by a rusty knife and have his liver
		chopped out by a bunch of crows and will eternally rot to
		death in the deepest bowels of hell (not necessarily in that
		order)....</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>UIDs</title>
	      
	      <para>If your port requires a certain user ID to be on the
		installed system, let the <filename>pkg/INSTALL</filename>
		script call <command>pw</command> to create it
		automatically. Look at <filename>japanese/Wnn</filename> or
		<filename>net/cvsup-mirror</filename> for examples. It is
		customary to use UIDs in the upper 2-digit range (i.e., from
		around 50 to 99) for this purpose.</para>
	      
	      <para>Make sure you don't use a UID already used by the system
		or other ports. This is the current list of UIDs between 50
		and 99.</para>
	      
	      <programlisting>
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
gnats:*:61:1:GNATS database owner:/usr/local/share/gnats/gnats-db:/bin/sh
uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67:X-10 daemon:/usr/local/xten:/nonexistent
pop:*:68:6:Post Office Owner (popper):/nonexistent:/nonexistent
wnn:*:69:7:Wnn:/nonexistent:/nonexistent
ifmail:*:70:66:Ifmail user:/nonexistent:/nonexistent
pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh
ircd:*:72:72:IRCd hybrid:/nonexistent:/nonexistent
alias:*:81:81:QMail user:/var/qmail/alias:/nonexistent
qmaill:*:83:81:QMail user:/var/qmail:/nonexistent
qmaild:*:82:81:QMail user:/var/qmail:/nonexistent
qmailq:*:85:82:QMail user:/var/qmail:/nonexistent
qmails:*:87:82:QMail user:/var/qmail:/nonexistent
qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
	      </programlisting>
	      
	      <para>Please send a notice to &a.ports; if you submit or commit
		a port that allocates a new UID in this range so we can keep
		this list up to date.</para>
	      
	    </sect4>
	    
	    <sect4>
	      <title>If you are stuck....</title>
	      
	      <para>Do look at existing examples and the
		<filename>bsd.port.mk</filename> file before asking us
		questions! <!-- smiley --><emphasis>;)</emphasis></para>
	      
	      <para>Do ask us questions if you have any trouble! Do not just
		beat your head against a wall! <!-- smiley --><emphasis>:)</emphasis></para>
	      
	    </sect4>
	  </sect3>
	  
	  <sect3 id="porting-samplem">
	    <title>A Sample <filename>Makefile</filename></title>
	    
	    <para>Here is a sample <filename>Makefile</filename> that you can
	      use to create a new port. Make sure you remove all the extra
	      comments (ones between brackets)!</para>
	    
	    <para>It is recommended that you follow this format (ordering of
	      variables, empty lines between sections, etc.). Not all of the
	      existing <filename>Makefile</filename>s are in this format
	      (mostly old ones), but we are trying to uniformize how they
	      look. This format is designed so that the most important
	      information is easy to locate.</para>

	    <programlisting>
[the header...just to make it easier for us to identify the ports.]
# New ports collection makefile for:   xdvi
[the version required header should updated when upgrading a port.]
# Version required:    pl18 [things like "1.5alpha" are fine here too]
[this is the date when the first version of this Makefile was created. 
Never change this when doing an update of the port.]
# Date created:                26 May 1995
[this is the person who did the original port to FreeBSD, in particular, the
person who wrote the first version of this Makefile.  Remember, this should
not be changed when upgrading the port later.]
# Whom:                        Satoshi Asami &lgt;asami@FreeBSD.ORG&gt;
#
# &#36;Id&#36;
[ ^^^^ This will be automatically replaced with RCS ID string by CVS 
when it is committed to our repository.]
#
       
[section to describe the port itself and the master site - DISTNAME
 is always first, followed by PKGNAME (if necessary), CATEGORIES,
 and then MASTER_SITES, which can be followed by MASTER_SITE_SUBDIR.
 After those, one of EXTRACT_SUFX or DISTFILES can be specified too.]
DISTNAME=      xdvi
PKGNAME=       xdvi-pl18
CATEGORIES=    print
[do not forget the trailing slash ("/")! 
 if you aren't using MASTER_SITE_* macros]
MASTER_SITES=  ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= applications
[set this if the source is not in the standard ".tar.gz" form]
EXTRACT_SUFX=  .tar.Z
       
[section for distributed patches -- can be empty]
PATCH_SITES=   ftp://ftp.sra.co.jp/pub/X11/japanese/
PATCHFILES=    xdvi-18.patch1.gz xdvi-18.patch2.gz
       
[maintainer; *mandatory*!  This is the person (preferably with commit
 privileges) who a user can contact for questions and bug reports - this
 person should be the porter or someone who can forward questions to the
 original porter reasonably promptly.  If you really do not want to have
 your address here, set it to "ports@FreeBSD.ORG".]
MAINTAINER=    asami@FreeBSD.ORG
       
[dependencies -- can be empty]
RUN_DEPENDS=   gs:${PORTSDIR}/print/ghostscript
LIB_DEPENDS=   Xpm\\.4\\.:${PORTSDIR}/graphics/xpm
       
[this section is for other standard bsd.port.mk variables that do not
 belong to any of the above]
[If it asks questions during configure, build, install...]
IS_INTERACTIVE=        yes
[If it extracts to a directory other than ${DISTNAME}...]
WRKSRC=                ${WRKDIR}/xdvi-new
[If the distributed patches were not made relative to ${WRKSRC}, you
 may need to tweak this]
PATCH_DIST_STRIP=      -p1
[If it requires a "configure" script generated by GNU autoconf to be run]
GNU_CONFIGURE= yes
[If it requires GNU make, not /usr/bin/make, to build...]
USE_GMAKE=     yes
[If it is an X application and requires "xmkmf -a" to be run...]
USE_IMAKE=     yes
[et cetera.]
       
[non-standard variables to be used in the rules below]
MY_FAVORITE_RESPONSE=  "yeah, right"
       
[then the special rules, in the order they are called]
pre-fetch:
        i go fetch something, yeah
       
post-patch:
        i need to do something after patch, great
       
pre-install:
        and then some more stuff before installing, wow
       
[and then the epilogue]
.include &lt;bsd.port.mk&gt;
	    </programlisting>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Package Names</title>
	    
	    <para>The following are the conventions you should follow in
	      naming your packages. This is to have our package directory
	      easy to scan, as there are already lots and lots of packages and
	      users are going to turn away if they hurt their eyes!</para>
	    
	    <para>The package name should look like <filename><replaceable>language-</replaceable>name<replaceable>-compiled.specifics</replaceable><replaceable>-version.numbers</replaceable></filename>.</para>
	    
	    <para>If your <makevar>&#36;{DISTNAME}</makevar>
	      doesn't look like that, set <makevar>&#36;{PKGNAME}</makevar> to something in that
	      format.</para>
	    
	    
	      <orderedlist>
		
		<listitem>
		  <para>FreeBSD strives to support the native language of its
		    users. The <replaceable>language-</replaceable> part should be a two letter
		    abbreviation of the natural language defined by ISO-639 if
		    the port is specific to a certain language. Examples are
		    <literal>ja</literal> for Japanese, <literal>ru</literal> for Russian, <literal>vi</literal> for Vietnamese,
		    <literal>zh</literal> for Chinese, <literal>ko</literal> for Korean and <literal>de</literal> for German.</para>
		</listitem>
		
		<listitem>
		  <para>The <filename>name</filename> part
		    should be all lowercases, except for a really large
		    package (with lots of programs in it). Things like
		    XFree86 (yes there really is a package of it, check it
		    out) and ImageMagick fall into this category. Otherwise,
		    convert the name (or at least the first letter) to
		    lowercase. If the software in question really is called
		    that way, you can have numbers, hyphens and underscores in
		  the name too (like <literal>kinput2</literal>).</para>
		</listitem>
		
		<listitem>
		  <para>If the port can be built with different hardcoded
		    defaults (usually specified as environment variables or on
		    the <command>make</command> command line), the
		    <replaceable>-compiled.specifics</replaceable> part should state the
		    compiled-in defaults (the hyphen is optional). Examples
		    are papersize and font units.</para>
		</listitem>
		
		<listitem>
		  <para>The version string should be a period-separated list
		    of integers and single lowercase alphabetics. The only
		    exception is the string <literal>pl</literal> (meaning `patchlevel'), which
		    can be used <emphasis>only</emphasis> when there are no
		    major and minor version numbers in the software.</para>
		</listitem>
		
	      </orderedlist>
	    
	    
	    <para>Here are some (real) examples on how to convert a <makevar>&#36;{DISTNAME}</makevar> into a suitable <makevar>&#36;{PKGNAME}</makevar>:</para>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<thead>
		  <row>
		    <entry>Distribution Name</entry>
		    <entry>Package Name</entry>
		    <entry>Reason</entry>
		  </row>
		</thead>

		<tbody>
		  <row>
		    <entry>mule-2.2.2.</entry>
		    <entry>mule-2.2.2</entry>
		    <entry>No changes required</entry>
		  </row>

		  <row>
		    <entry>XFree86-3.1.2</entry>
		    <entry>XFree86-3.1.2</entry>
		    <entry>No changes required</entry>
		  </row>

		  <row>
		    <entry>EmiClock-1.0.2</entry>
		    <entry>emiclock-1.0.2</entry>
		    <entry>No uppercase names for single programs</entry>
		  </row>

		  <row>
		    <entry>gmod1.4</entry>
		    <entry>gmod-1.4</entry>
		    <entry>Need a hyphen before version numbers</entry>
		  </row>

		  <row>
		    <entry>xmris.4.0.2</entry>
		    <entry>xmris-4.0.2</entry>
		    <entry>Need a hyphen before version numbers</entry>
		  </row>

		  <row>
		    <entry>rdist-1.3alpha</entry>
		    <entry>rdist-1.3a</entry>
		    <entry>No strings like <literal>alpha</literal>
		      allowed</entry>
		  </row>

		  <row>
		    <entry>es-0.9-beta1</entry>
		    <entry>es-0.9b1</entry>
		    <entry>No strings like <literal>beta</literal>
		      allowed</entry>
		  </row>

		  <row>
		    <entry>v3.3beta021.src</entry>
		    <entry>tiff-3.3</entry>
		    <entry>What the heck was that anyway?</entry>
		  </row>

		  <row>
		    <entry>tvtwm</entry>
		    <entry>tvtwm-pl11</entry>
		    <entry>Version string always required</entry>
		  </row>

		  <row>
		    <entry>piewm</entry>
		    <entry>piewm-1.0</entry>
		    <entry>Version string always required</entry>
		  </row>

		  <row>
		    <entry>xvgr-2.10pl1</entry>
		    <entry>xvgr-2.10.1</entry>
		    <entry><literal>pl</literal> allowed only when no
		      major/minor version numbers</entry>
		  </row>

		  <row>
		    <entry>gawk-2.15.6</entry>
		    <entry>ja-gawk-2.15.6</entry>
		    <entry>Japanese language version</entry>
		  </row>

		  <row>
		    <entry>psutils-1.13</entry>
		    <entry>psutils-letter-1.13</entry>
		    <entry>Papersize hardcoded at package build time</entry>
		  </row>

		  <row>
		    <entry>pkfonts</entry>
		    <entry>pkfonts300-1.0</entry>
		    <entry>Package for 300dpi fonts</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>
	    
	    <para>If there is absolutely no trace of version information in
	      the original source and it is unlikely that the original author
	      will ever release another version, just set the version string
	      to <literal>1.0</literal> (like the piewm example above). Otherwise, ask the
	      original author or use the date string (<literal><replaceable>yy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>) as the
	      version.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>That is It, Folks!</title>
	    
	    <para>Boy, this sure was a long tutorial, wasn't it? Thanks for
	      following us to here, really.</para>
	    
	    <para>Well, now that you know how to do a port, let us go at it
	      and convert everything in the world into ports! That is the
	      easiest way to start contributing to the FreeBSD Project!
	      <!-- smiley --><emphasis>:)</emphasis></para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Money, Hardware or Internet access</title>
	  
	  <para>We are always very happy to accept donations to further the
	    cause of the FreeBSD Project and, in a volunteer effort like ours,
	    a little can go a long way! Donations of hardware are also very
	    important to expanding our list of supported peripherals since we
	    generally lack the funds to buy such items ourselves.</para>
	  
	  
	  <sect3>
	    <title>Donating funds</title>
	    
	    <para>While the FreeBSD Project is not a 501(C3) (non-profit)
	      corporation and hence cannot offer special tax incentives for
	      any donations made, any such donations will be gratefully
	      accepted on behalf of the project by FreeBSD, Inc.</para>
	    
	    <para>FreeBSD, Inc. was founded in early 1995 by &a.jkh; and
	      &a.davidg; with the goal of furthering the aims of the FreeBSD
	      Project and giving it a minimal corporate presence. Any and all
	      funds donated (as well as any profits that may eventually be
	      realized by FreeBSD, Inc.) will be used exclusively to further
	      the project's goals.</para>
	    
	    <para>Please make any checks payable to FreeBSD, Inc., sent in
	      care of the following address:</para>
	    
	    <address>
	      <otheraddr>FreeBSD, Inc.</otheraddr>
	      <otheraddr>c/o Jordan Hubbard</otheraddr>
	      <street>4041 Pike Lane, Suite F</street>
	      <city>Concord</city>
	      <state>CA</state>, <postcode>94520</postcode>
	    </address>
	    
	    <para>Wire transfers may also be sent directly to:</para>
	    
	    <address>
	      <otheraddr>Bank Of America</otheraddr>
	      <otheraddr>Concord Main Office</otheraddr>
	      <pob>P.O. Box 37176</pob>
	      <city>San Francisco</city>
	      <state>CA</state>, <postcode>94137-5176</postcode>

	      <otheraddr>Routing #: 121-000-358</otheraddr>
	      <otheraddr>Account #: 01411-07441 (FreeBSD, Inc.)</otheraddr>
	    </address>
	    
	    <para>Any correspondence related to donations should be sent to
	      Jordan Hubbard <email>jkh@FreeBSD.org</email>,
	      either via email or to the FreeBSD, Inc. postal address given
	      above.</para>
	    
	    <para>If you do not wish to be listed in our <xref
		linkend="donors" remap="donors"> section, please specify this
	      when making your donation. Thanks!</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Donating hardware</title>
	    
	    <para>Donations of hardware in any of the 3 following categories
	      are also gladly accepted by the FreeBSD Project:</para>
	    
	    
	      <itemizedlist>
		
		<listitem>
		  <para>General purpose hardware such as disk drives, memory
		    or complete systems should be sent to the FreeBSD, Inc.
		    address listed in the <emphasis>donating funds</emphasis>
		    section.</para>
		</listitem>
		
		<listitem>
		  <para>Hardware for which ongoing compliance testing is
		    desired. We are currently trying to put together a testing
		    lab of all components that FreeBSD supports so that proper
		    regression testing can be done with each new release. We
		    are still lacking many important pieces (network cards,
		    motherboards, etc) and if you would like to make such a
		    donation, please contact &a.davidg; for information on
		    which items are still required.</para>
		</listitem>
		
		<listitem>
		  <para>Hardware currently unsupported by FreeBSD for which
		    you would like to see such support added. Please contact
		    the &a.core; before sending such items as we will need to
		    find a developer willing to take on the task before we can
		    accept delivery of new hardware.</para>
		</listitem>
		
	      </itemizedlist>
	    
	    
	  </sect3>
	  
	  <sect3>
	    <title>Donating Internet access</title>
	    
	    <para>We can always use new mirror sites for FTP, WWW or <command>cvsup</command>. If
	      you would like to be such a mirror, please contact the FreeBSD project
		administrators <email>admin@FreeBSD.ORG</email> for more information.</para>
	    
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="donors">
	<title>Donors Gallery</title>
	
	<para>The FreeBSD Project is indebted to the following donors and
	  would like to publically thank them here!</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><emphasis>Contributors to the central server
		  project:</emphasis></para>
	      
	      <para>The following individuals and businesses made it possible
		for the FreeBSD Project to build a new central server machine
		to eventually replace
		<hostid role="fqdn">freefall.freebsd.org</hostid> by donating the
		following items:</para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para>Ade
			Barkah <email>mbarkah@freebsd.org</email> and his employer, <ulink
			URL="http://www.hemi.com">Hemisphere Online</ulink>,
		      donated a <emphasis>Pentium Pro (P6) 200Mhz
			CPU</emphasis></para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.asacomputers.com">ASA
			Computers</ulink> donated a <emphasis>Tyan
			1662 motherboard</emphasis>.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Joe McGuckin <email>joe@via.net</email>
		      of <ulink URL="http://www.via.net">ViaNet
			Communications</ulink> donated a <emphasis>Kingston ethernet controller.</emphasis></para>
		  </listitem>
		  
		  <listitem>
		    <para>Jack
			O'Neill <email>jack@diamond.xtalwind.net</email> donated an <emphasis>NCR
			53C875 SCSI controller card</emphasis>.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Ulf
			Zimmermann <email>ulf@Alameda.net</email> of <ulink
			URL="http://www.Alameda.net">Alameda Networks</ulink>
		      donated <emphasis>128MB of memory</emphasis>, a
		      <emphasis>4 Gb disk drive and the
			case.</emphasis></para>
		  </listitem>
		  
		</itemizedlist>
	      
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Direct funding:</emphasis></para>
	      
	      <para>The following individuals and businesses have generously
		contributed direct funding to the project:</para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para>Annelise
			Anderson <email>ANDRSN@HOOVER.STANFORD.EDU</email></para>
		  </listitem>
		  
		  <listitem>
		    <para>Matt
			Dillon <email>dillon@best.net</email></para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.epilogue.com/">Epilogue
			Technology Corporation</ulink></para>
		  </listitem>
		  
		  <listitem>
		    <para>Sean Eric Fagan</para>
		  </listitem>
		  
		  <listitem>
		    <para>Gianmarco
			Giovannelli <email>gmarco@masternet.it</email></para>
		  </listitem>
		  
		  <listitem>
		    <para>Josef C.
			Grosch <email>joeg@truenorth.org</email></para>
		  </listitem>
		  
		  <listitem>
		    <para>Chuck
			Robey <email>chuckr@freebsd.org</email></para>
		  </listitem>
		  
		  <listitem>
		    <para>Kenneth
			P. Stox <email>ken@stox.sa.enteract.com</email> of <ulink
			URL="http://www.imagescape.com">Imaginary Landscape,
			LLC.</ulink></para>
		  </listitem>
		  
		  <listitem>
		    <para>Dmitry S.
			Kohmanyuk <email>dk@dog.farm.org</email></para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.cdrom.co.jp/">Laser5</ulink>
		      of Japan (a portion of the profits from sales of their
		      various FreeBSD CD-ROMs.</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.mmjp.or.jp/fuki/">Fuki
			Shuppan Publishing Co.</ulink> donated a portion of
		      their profits from <emphasis>Hajimete no
			FreeBSD</emphasis> (FreeBSD, Getting started) to the
		      FreeBSD and XFree86 projects.</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.ascii.co.jp/">ASCII
			Corp.</ulink> donated a portion of their profits from
		      several FreeBSD-related books to the FreeBSD
		      project.</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.yokogawa.co.jp/">Yokogawa
			Electric Corp</ulink> has generously donated
		      significant funding to the FreeBSD project.</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink
			URL="http://www.buffnet.net/">BuffNET</ulink></para>
		  </listitem>
		  
		</itemizedlist>
	      
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Hardware contributors:</emphasis></para>
	      
	      <para>The following individuals and businesses have generously
		contributed hardware for testing and device driver
		development/support:</para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para>Walnut Creek CDROM for providing the Pentium P5-90
		      and 486/DX2-66 EISA/VL systems that are being used for
		      our development work, to say nothing of the network
		      access and other donations of hardware resources.</para>
		  </listitem>
		  
		  <listitem>
		    <para>TRW Financial Systems, Inc. provided 130 PCs, three
		      68 GB fileservers, twelve Ethernets, two routers and an
		      ATM switch for debugging the diskless code. They also
		      keep a couple of FreeBSD hackers alive and busy.
		      Thanks!</para>
		  </listitem>
		  
		  <listitem>
		    <para>Dermot McDonnell donated the Toshiba XM3401B CDROM
		      drive currently used in freefall.</para>
		  </listitem>
		  
		  <listitem>
		    <para>&a.chuck; contributed his floppy tape streamer for
		      experimental work.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Larry Altneu <email>larry@ALR.COM</email>, and &a.wilko;, provided Wangtek and Archive QIC-02 tape drives in order to improve the <devicename>wt</devicename> driver.</para>
		  </listitem>
		  
		  <listitem>
		    <para>Ernst Winter <email>ewinter@lobo.muc.de</email> contributed a 2.88 MB floppy drive to the project. This will hopefully increase the pressure for rewriting the floppy disk driver. <!-- smiley -->;-)</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.tekram.com">Tekram
			Technologies</ulink> sent one each of their DC-390,
		      DC-390U and DC-390F FAST and ULTRA SCSI host adapter
		      cards for regression testing of the NCR and AMD drivers
		      with their cards. They are also to be applauded for
		      making driver sources for free operating systems
		      available from their  FTP server <ulink
			URL="ftp://ftp.tekram.com/scsi/FreeBSD">ftp://ftp.tekram.com/scsi/FreeBSD</ulink>.</para>
		  </listitem>
		  
		  <listitem>
		    <para><email>Larry M.
			Augustin</email> contributed not only a Symbios
		      Sym8751S SCSI card, but also a set of data books,
		      including one about the forthcoming Sym53c895 chip with
		      Ultra-2 and LVD support, and the latest programming
		      manual with information on how to safely use the
		      advanced features of the latest  Symbios SCSI chips.
		      Thanks a lot!</para>
		  </listitem>
		  
		  <listitem>
		    <para>Christoph
			Kukulies <email>kuku@freebsd.org</email> donated an FX120 12 speed Mitsumi
		      CDROM drive for IDE CDROM driver development.</para>
		  </listitem>
		  
		</itemizedlist>
	      
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Special contributors:</emphasis></para>
	      
	      
		<itemizedlist>
		  
		  <listitem>
		    <para><ulink URL="http://www.cdrom.com">Walnut Creek
			CDROM</ulink> has donated almost more than we can say
		      (see the
		      <xref linkend="history" remap="history"> document for
		      more details). In particular, we would like to thank
		      them for the original hardware used for
		      <hostid role="fqdn">freefall.FreeBSD.ORG</hostid>, our primary
		      development machine, and for
		      <hostid role="fqdn">thud.FreeBSD.ORG</hostid>, a testing and
		      build box. We are also indebted to them for funding
		      various contributors over the years and providing us
		      with unrestricted use of their T1 connection to the
		      Internet.</para>
		  </listitem>
		  
		  <listitem>
		    <para>The <ulink
			URL="http://www.interface-business.de">interface
			business GmbH, Dresden</ulink> has been patiently
		      supporting &a.joerg; who has often preferred FreeBSD
		      work over paywork, and used to fall back to their (quite
		      expensive) EUnet Internet connection whenever his
		      private connection became too slow or flakey to work
		      with it...</para>
		  </listitem>
		  
		  <listitem>
		    <para><ulink URL="http://www.bsdi.com">Berkeley Software
			Design, Inc.</ulink> has contributed their DOS
		      emulator code to the remaining BSD world, which is used
		      in the <emphasis>dosemu</emphasis> command.</para>
		  </listitem>
		  
		</itemizedlist>
	      
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Derived Software Contributors</title>
	
	<para>This software was originally derived from William F. Jolitz's
	  386BSD release 0.1, though almost none of the original 386BSD
	  specific code remains. This software has been essentially
	  re-implemented from the 4.4BSD-Lite release provided by the Computer
	  Science Research Group (CSRG) at the University of California,
	  Berkeley and associated academic contributors.</para>
	
	<para>There are also portions of NetBSD that have been integrated into
	  FreeBSD as well, and we would therefore like to thank all the
	  contributors to NetBSD for their work.</para>
	
      </sect1>
      
      <sect1 id="contrib-additional">
	<title>Additional FreeBSD Contributors</title>
	
	<para>(in alphabetical order by first name):</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>A JOSEPH KOSHY <email>koshy@india.hp.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>ABURAYA Ryushirou <email>rewsirow@ff.iij4u.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ada T Lim <email>ada@bsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Adam Glass <email>glass@postgres.berkeley.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Adrian T. Filipi-Martin <email>atf3r@agate.cs.virginia.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Akito Fujita <email>fujita@zoo.ncl.omron.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Alain Kalker <email>A.C.P.M.Kalker@student.utwente.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Alan Cox <email>alc@cs.rice.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andreas Kohout <email>shanee@rabbit.augusta.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andreas Lohr <email>andreas@marvin.RoBIN.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Gordon <email>andrew.gordon@net-tel.co.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Herbert <email>andrew@werple.apana.org.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew McRae <email>amcrae@cisco.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Moore <email>alm@FreeBSD.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Stevenson <email>andrew@ugh.net.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew V. Stesin <email>stesin@elvisti.kiev.ua</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrey Zakhvatov <email>andy@icc.surw.chel.su</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andy Whitcroft <email>andy@sarc.city.ac.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Angelo Turetta <email>ATuretta@stylo.it</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Anthony Yee-Hang Chan <email>yeehang@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ari Suutari <email>ari@suutari.iki.fi</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brent J. Nordquist <email>bjn@visi.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Bernd Rosauer <email>br@schiele-ct.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Bill Kish <email>kish@osf.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.wlloyd;</para>
	    </listitem>
	    
	    <listitem>
	      <para>Bob Wilcox <email>bob@obiwan.uucp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Boyd Faulkner <email>faulkner@mpd.tandem.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brent J. Nordquist <email>bjn@visi.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brett Taylor <email>brett@peloton.physics.montana.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brian Clapper <email>bmc@willscreek.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brian Handy <email>handy@lambic.space.lockheed.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brian Tao <email>taob@risc.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Brion Moss <email>brion@queeg.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Bruce Gingery <email>bgingery@gtcs.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Carey Jones <email>mcj@acquiesce.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Carl Fongheiser <email>cmf@netins.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Charles Hannum <email>mycroft@ai.mit.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Charles Mott <email>cmott@srv.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chet Ramey <email>chet@odin.INS.CWRU.Edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Dabrowski <email>chris@vader.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris G. Demetriou <email>cgd@postgres.berkeley.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Shenton <email>cshenton@angst.it.hq.nasa.gov</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Stenton <email>jacs@gnome.co.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Timmons <email>skynyrd@opus.cts.cwu.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Torek <email>torek@ee.lbl.gov</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Christian Gusenbauer <email>cg@fimp01.fim.uni-linz.ac.at</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Christian Haury <email>Christian.Haury@sagem.fr</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Christoph Robitschko <email>chmr@edvz.tu-graz.ac.at</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Choi Jun Ho <email>junker@jazz.snu.ac.kr</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chuck Hein <email>chein@cisco.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Conrad Sabatier <email>conrads@neosoft.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Cornelis van der Laan <email>nils@guru.ims.uni-stuttgart.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Craig Struble <email>cstruble@vt.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Cristian Ferretti <email>cfs@riemann.mat.puc.cl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Curt Mayer <email>curt@toad.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dai Ishijima <email>ishijima@tri.pref.osaka.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dan Cross <email>tenser@spitfire.ecsel.psu.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Daniel Baker <email>dbaker@crash.ops.neosoft.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Daniel M. Eischen <email>deischen@iworks.InterWorks.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Daniel O'Connor <email>doconnor@gsoft.com.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Danny J. Zerkel <email>dzerkel@feephi.phofarm.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Bodenstab <email>imdave@synet.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Burgess <email>burgess@hrd769.brooks.af.mil</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Chapeskie <email>dchapes@zeus.leitch.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Edmondson <email>davided@sco.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Rivers <email>rivers@ponds.uucp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David A. Bader <email>dbader@umiacs.umd.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David Dawes <email>dawes@physics.su.OZ.AU</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David Holloway <email>daveh@gwythaint.tamis.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David Leonard <email>d@scry.dstc.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dean Huxley <email>dean@fsa.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dirk Froemberg <email>dirk@hal.in-berlin.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dmitrij Tejblum <email>dima@tejblum.dnttm.rssi.ru</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dmitry Kohmanyuk <email>dk@farm.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.whiteside;</para>
	    </listitem>
	    
	    <listitem>
	      <para>Don Yuniskis <email>dgy@rtd.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Donald Burr <email>d_burr@ix.netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Doug Ambrisko <email>ambrisko@ambrisko.roble.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Douglas Carmichael <email>dcarmich@mcs.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Eiji-usagi-MATSUmoto <email>usagi@ruby.club.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>ELISA Font Project</para>
	    </listitem>
	    
	    <listitem>
	      <para>Eric A. Griff <email>eagriff@global2000.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Eric Blood <email>eblood@cs.unr.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Eric J. Chet <email>ejc@bazzle.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Eric J. Schwertfeger <email>eric@cybernut.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Francis M J Hsieh <email>mjhsieh@life.nthu.edu.tw</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Frank Bartels <email>knarf@camelot.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Frank Chen Hsiung Chan <email>frankch@waru.life.nthu.edu.tw</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Frank Maclachlan <email>fpm@crash.cts.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Frank Nobis <email>fn@trinity.radio-do.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>FUJIMOTO Kensaku <email>fujimoto@oscar.elec.waseda.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>FURUSAWA Kazuhisa <email>furusawa@com.cs.osakafu-u.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gary A. Browning <email>gab10@griffcd.amdahl.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gary Kline <email>kline@thought.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gerard Roudier <email>groudier@club-internet.fr</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Greg Ungerer <email>gerg@stallion.oz.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Harlan Stenn <email>Harlan.Stenn@pfcs.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Havard Eidnes <email>Havard.Eidnes@runit.sintef.no</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hideaki Ohmon <email>ohmon@tom.sfc.keio.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hidekazu Kuroki <email>hidekazu@cs.titech.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hidetoshi Shimokawa <email>simokawa@sat.t.u-tokyo.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hideyuki Suzuki <email>hideyuki@sat.t.u-tokyo.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hironori Ikura <email>hikura@kaisei.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Holger Veit <email>Holger.Veit@gmd.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Hung-Chi Chu <email>hcchu@r350.ee.ntu.edu.tw</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ian Vaudrey <email>i.vaudrey@bigfoot.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Igor Vinokurov <email>igor@zynaps.ru</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ikuo Nakagawa <email>ikuo@isl.intec.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>IMAMURA Tomoaki <email>tomoak-i@is.aist-nara.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ishii Masahiro</para>
	    </listitem>
	    
	    <listitem>
	      <para>Issei Suzuki <email>issei@t-cnet.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Itsuro Saito <email>saito@miv.t.u-tokyo.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>J. David Lowe <email>lowe@saturn5.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>J.T. Conklin <email>jtc@cygnus.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>James Clark <email>jjc@jclark.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>James da Silva <email>jds@cs.umd.edu</email> et al</para>
	    </listitem>
	    
	    <listitem>
	      <para>Janusz Kokot <email>janek@gaja.ipan.lublin.pl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jason Thorpe <email>thorpej@nas.nasa.gov</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Javier Martin Rueda <email>jmrueda@diatel.upm.es</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jeff Bartig <email>jeffb@doit.wisc.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jeffrey Wheat <email>jeff@cetlink.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jian-Da Li <email>jdli@csie.NCTU.edu.tw</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jim Binkley <email>jrb@cs.pdx.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jim Lowe <email>james@cs.uwm.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jim Wilson <email>wilson@moria.cygnus.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Joao Carlos Mendes Luis <email>jonny@coppe.ufrj.br</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Joel Sutton <email>sutton@aardvark.apana.org.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Johann Tonsing <email>jtonsing@mikom.csir.co.za</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Capo <email>jc@irbs.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Heidemann <email>johnh@isi.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Perry <email>perry@vishnu.alias.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Polstra <email>jdp@polstra.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Rochester <email>jr@cs.mun.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Josef Karthauser <email>joe@uk.freebsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Joseph Stein <email>joes@seaport.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Josh Gilliam <email>josh@quick.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Josh Tiefenbach <email>josh@ican.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Juergen Lock <email>nox@jelal.hb.north.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Juha Inkari <email>inkari@cc.hut.fi</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Julian Assange <email>proff@suburbia.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Julian Jenkins <email>kaveman@magna.com.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Julian Stacey <email>jhs@freebsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Junichi Satoh <email>junichi@jp.freebsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kapil Chowksey <email>kchowksey@hss.hns.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kazuhiko Kiriyama <email>kiri@kiri.toba-cmt.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Keith Bostic <email>bostic@bostic.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Keith Moore</para>
	    </listitem>
	    
	    <listitem>
	      <para>Kenneth Monville <email>desmo@bandwidth.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kent Vander Velden <email>graphix@iastate.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kirk McKusick <email>mckusick@mckusick.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kiroh HARADA <email>kiroh@kh.rim.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Koichi Sato <email>copan@ppp.fastnet.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kostya Lukin <email>lukin@okbmei.msk.su</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kurt Olsen <email>kurto@tiny.mcs.usu.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Lars Koeller <email>Lars.Koeller@Uni-Bielefeld.DE</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Lucas James <email>Lucas.James@ldjpc.apana.org.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Luigi Rizzo <email>luigi@iet.unipi.it</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Makoto MATSUSHITA <email>matusita@jp.freebsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Manu Iyengar <email>iyengar@grunthos.pscwa.psca.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Marc Frajola <email>marc@dev.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Marc Ramirez <email>mrami@mramirez.sy.yale.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Marc Slemko <email>marcs@znep.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Marc van Kempen <email>wmbfmk@urc.tue.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mario Sergio Fujikawa Ferreira <email>lioux@gns.com.br</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mark Huizer <email>xaa@stack.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mark J. Taylor <email>mtaylor@cybernet.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mark Krentel <email>krentel@rice.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mark Tinguely <email>tinguely@plains.nodak.edu</email> <email>tinguely@hookie.cs.ndsu.NoDak.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Martin Birgmeier</para>
	    </listitem>
	    
	    <listitem>
	      <para>Martti Kuparinen <email>erakupa@kk.etx.ericsson.se</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Masachika ISHIZUKA <email>ishizuka@isis.min.ntt.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mats Lofkvist <email>mal@algonet.se</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matt Bartley <email>mbartley@lear35.cytex.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matt Thomas <email>thomas@lkg.dec.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matt White <email>mwhite+@CMU.EDU</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matthew Hunt <email>mph@pobox.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matthew N. Dodd <email>winter@jurai.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Matthew Stein <email>matt@bdd.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Maurice Castro <email>maurice@planet.serc.rmit.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Michael Butschky <email>butsch@computi.erols.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Michael Elbel <email>me@FreeBSD.ORG</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Michael Searle <email>searle@longacre.demon.co.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Miguel Angel Sagreras <email>msagre@cactus.fi.uba.ar</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mikael Hybsch <email>micke@dynas.se</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mikhail Teterin <email>mi@aldan.ziplink.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mike McGaughey <email>mmcg@cs.monash.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mike Peck <email>mike@binghamton.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ming-I Hseh <email>PA@FreeBSD.ee.Ntu.edu.TW</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>MITA Yoshio <email>mita@jp.FreeBSD.ORG</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>MOROHOSHI Akihiko <email>moro@race.u-tokyo.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Murray Stokely <email>murray@cdrom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>NAKAMURA Kazushi <email>nkazushi@highway.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Naoki Hamada <email>nao@tom-yam.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Narvi <email>narvi@haldjas.folklore.ee</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>NIIMI Satoshi <email>sa2c@and.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nick Sayer <email>nsayer@quack.kfu.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nicolas Souchu <email>Nicolas.Souchu@prism.uvsq.fr</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nisha Talagala <email>nisha@cs.berkeley.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nobuhiro Yasutomi <email>nobu@psrc.isac.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nobuyuki Koganemaru <email>kogane@kces.koganemaru.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Noritaka Ishizumi <email>graphite@jp.FreeBSD.ORG</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Oliver Fromme <email>oliver.fromme@heim3.tu-clausthal.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Oliver Laumann <email>net@informatik.uni-bremen.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Oliver Oberdorf <email>oly@world.std.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Fox <email>pgf@foxharp.boston.ma.us</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Kranenburg <email>pk@cs.few.eur.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Mackerras <email>paulus@cs.anu.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paulo Menezes <email>paulo@isr.uc.pt</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul T. Root <email>proot@horton.iaces.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Pedro Giffuni <email>giffunip@asme.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Pedro A M Vazquez <email>vazquez@IQM.Unicamp.BR</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Peter Cornelius <email>pc@inr.fzk.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Peter Haight <email>peterh@prognet.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Peter Hawkins <email>peter@rhiannon.clari.net.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Peter Stubbs <email>PETERS@staidan.qld.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Pierre Beyssac <email>bp@fasterix.freenix.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Phil Maker <email>pjm@cs.ntu.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>R. Kym Horsell</para>
	    </listitem>
	    
	    <listitem>
	      <para>Randall Hopper <email>rhh@stealth.ct.picker.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Richard Hwang <email>rhwang@bigpanda.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Richard Seaman, Jr. <email>dick@tar.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Richard Stallman <email>rms@gnu.ai.mit.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Richard Wiwatowski <email>rjwiwat@adelaide.on.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Rob Mallory <email>rmallory@csusb.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Rob Shady <email>rls@id.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Rob Snow <email>rsnow@txdirect.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Robert Sanders <email>rsanders@mindspring.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Robert Withrow <email>witr@rwwa.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ronald Kuehn <email>kuehn@rz.tu-clausthal.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Roland Jesse <email>jesse@cs.uni-magdeburg.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ruslan Shevchenko <email>rssh@cki.ipri.kiev.ua</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Samuel Lam <email>skl@ScalableNetwork.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sander Vesik <email>sander@haldjas.folklore.ee</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sandro Sigala <email>ssigala@globalnet.it</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sascha Blank <email>blank@fox.uni-trier.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sascha Wildner <email>swildner@channelz.GUN.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Satoshi Taoka <email>taoka@infonets.hiroshima-u.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Scott Blachowicz <email>scott.blachowicz@seaslug.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Scott A. Kenney <email>saken@rmta.ml.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Serge V. Vakulenko <email>vak@zebub.msk.su</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sheldon Hearn <email>axl@iafrica.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Simon Marlow <email>simonm@dcs.gla.ac.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Slaven Rezic (Tomic) <email>eserte@cs.tu-berlin.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Soren Dayton <email>csdayton@midway.uchicago.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Soren Dossing <email>sauber@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Stefan Moeding <email>moeding@bn.DeTeMobil.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Stephane Legrand <email>stephane@lituus.fr</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Stephen J. Roznowski <email>sjr@home.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Steve Gerakines <email>steve2@genesis.tiac.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Suzuki Yoshiaki <email>zensyo@ann.tama.kawasaki.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tadashi Kumano <email>kumano@strl.nhk.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Taguchi Takeshi <email>taguchi@tohoku.iij.ad.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Takayuki Ariga <email>a00821@cc.hc.keio.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Terry Lambert <email>terry@lambert.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Terry Lee <email>terry@uivlsi.csl.uiuc.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tetsuya Furukawa <email>tetsuya@secom-sis.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Theo Deraadt <email>deraadt@fsa.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Thomas K&ouml;nig <email>Thomas.Koenig@ciw.uni-karlsruhe.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>&THORN;&oacute;r&eth;ur &Iacute;varsson <email>totii@est.is</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tim Kientzle <email>kientzle@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tim Wilkinson <email>tim@sarc.city.ac.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tom Samplonius <email>tom@misery.sdf.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Torbjorn Granlund <email>tege@matematik.su.se</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Toshihiro Kanda <email>candy@fct.kgc.co.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Trefor S. <email>trefor@flevel.co.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ville Eerola <email>ve@sci.fi</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Werner Griessl <email>werner@btp1da.phy.uni-bayreuth.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wes Santee <email>wsantee@wsantee.oz.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wilko Bulte <email>wilko@yedi.iaf.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wolfgang Stanglmeier <email>wolf@kintaro.cologne.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wu Ching-hong <email>woju@FreeBSD.ee.Ntu.edu.TW</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yen-Shuo Su <email>yssu@CCCA.NCTU.edu.tw</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yoshiaki Uchikawa <email>yoshiaki@kt.rim.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yoshiro Mihira <email>sanpei@yy.cs.keio.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yukihiro Nakai <email>nakai@mlab.t.u-tokyo.ac.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yuval Yarom <email>yval@cs.huji.ac.il</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yves Fonk <email>yves@cpcoup5.tn.tudelft.nl</email></para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>386BSD Patch Kit Patch Contributors</title>
	
	<para>(in alphabetical order by first name):</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Adam Glass <email>glass@postgres.berkeley.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Adrian Hall <email>adrian@ibmpcug.co.uk</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrey A. Chernov <email>ache@astral.msk.su</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Herbert <email>andrew@werple.apana.org.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andrew Moore <email>alm@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Andy Valencia <email>ajv@csd.mot.com</email> <email>jtk@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Arne Henrik Juul <email>arnej@Lise.Unit.NO</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Bakul Shah <email>bvs@bitblocks.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Barry Lustig <email>barry@ictv.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Bob Wilcox <email>bob@obiwan.uucp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Branko Lankester</para>
	    </listitem>
	    
	    <listitem>
	      <para>Brett Lymn <email>blymn@mulga.awadi.com.AU</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Charles Hannum <email>mycroft@ai.mit.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris G. Demetriou <email>cgd@postgres.berkeley.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Chris Torek <email>torek@ee.lbl.gov</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Christoph Robitschko <email>chmr@edvz.tu-graz.ac.at</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Daniel Poirot <email>poirot@aio.jsc.nasa.gov</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Burgess <email>burgess@hrd769.brooks.af.mil</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Dave Rivers <email>rivers@ponds.uucp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David Dawes <email>dawes@physics.su.OZ.AU</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>David Greenman <email>davidg@Root.COM</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Eric J. Haug <email>ejh@slustl.slu.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Felix Gaehtgens <email>felix@escape.vsse.in-berlin.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Frank Maclachlan <email>fpm@crash.cts.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gary A. Browning <email>gab10@griffcd.amdahl.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Gary Howland <email>gary@hotlava.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Geoff Rehmet <email>csgr@alpha.ru.ac.za</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Goran Hammarback <email>goran@astro.uu.se</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Guido van Rooij <email>guido@gvr.win.tue.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Guy Harris <email>guy@auspex.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Havard Eidnes <email>Havard.Eidnes@runit.sintef.no</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Herb Peyerl <email>hpeyerl@novatel.cuc.ab.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Holger Veit <email>Holger.Veit@gmd.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ishii Masahiro, R. Kym Horsell</para>
	    </listitem>
	    
	    <listitem>
	      <para>J.T. Conklin <email>jtc@cygnus.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jagane D Sundar <email>jagane@netcom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>James Clark <email>jjc@jclark.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>James Jegers <email>jimj@miller.cs.uwm.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>James W. Dolter</para>
	    </listitem>
	    
	    <listitem>
	      <para>James da Silva <email>jds@cs.umd.edu</email> et al</para>
	    </listitem>
	    
	    <listitem>
	      <para>Jay Fenlason <email>hack@datacube.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jim Wilson <email>wilson@moria.cygnus.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>J&ouml;rg Lohse <email>lohse@tech7.informatik.uni-hamburg.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>J&ouml;rg Wunsch <email>joerg_wunsch@uriah.heep.sax.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Dyson <email>formerly
		    dyson@ref.tfs.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>John Woods <email>jfw@eddie.mit.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Jordan K. Hubbard <email>jkh@whisker.hubbard.ie</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Julian Elischer <email>julian@dialix.oz.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Julian Stacey <email>jhs@freebsd.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Karl Lehenbauer <email>karl@NeoSoft.com</email> <email>karl@one.neosoft.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Keith Bostic <email>bostic@toe.CS.Berkeley.EDU</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ken Hughes</para>
	    </listitem>
	    
	    <listitem>
	      <para>Kent Talarico <email>kent@shipwreck.tsoft.net</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Kevin Lahey <email>kml%rokkaku.UUCP@mathcs.emory.edu</email> <email>kml@mosquito.cis.ufl.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Marc Frajola <email>marc@dev.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mark Tinguely <email>tinguely@plains.nodak.edu</email> <email>tinguely@hookie.cs.ndsu.NoDak.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Martin Renters <email>martin@tdc.on.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Michael Clay <email>mclay@weareb.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Michael Galassi <email>nerd@percival.rain.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Mike Durkin <email>mdurkin@tsoft.sf-bay.org</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Naoki Hamada <email>nao@tom-yam.or.jp</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nate Williams <email>nate@bsd.coe.montana.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Nick Handel <email>nhandel@NeoSoft.com</email>  <email>nick@madhouse.neosoft.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Pace Willisson <email>pace@blitz.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Kranenburg <email>pk@cs.few.eur.nl</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Mackerras <email>paulus@cs.anu.edu.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Paul Popelka <email>paulp@uts.amdahl.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Peter da Silva <email>peter@NeoSoft.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Phil Sutherland <email>philsuth@mycroft.dialix.oz.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Poul-Henning Kamp<email>phk@FreeBSD.ORG</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Ralf Friedl <email>friedl@informatik.uni-kl.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Rick Macklem <email>root@snowhite.cis.uoguelph.ca</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Robert D. Thrush <email>rd@phoenix.aii.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Rodney W. Grimes <email>rgrimes@cdrom.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sascha Wildner <email>swildner@channelz.GUN.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Scott Burris <email>scott@pita.cns.ucla.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Scott Reynolds <email>scott@clmqt.marquette.mi.us</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Sean Eric Fagan <email>sef@kithrup.com</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Simon J Gerraty <email>sjg@melb.bull.oz.au</email> <email>sjg@zen.void.oz.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Stephen McKay <email>syssgm@devetir.qld.gov.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Terry Lambert <email>terry@icarus.weber.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Terry Lee <email>terry@uivlsi.csl.uiuc.edu</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Tor Egge <email>Tor.Egge@idi.ntnu.no</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Warren Toomey <email>wkt@csadfa.cs.adfa.oz.au</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wiljo Heinen <email>wiljo@freeside.ki.open.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>William Jolitz <email>withheld</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wolfgang Solfrank <email>ws@tools.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Wolfgang Stanglmeier <email>wolf@dentaro.GUN.de</email></para>
	    </listitem>
	    
	    <listitem>
	      <para>Yuval Yarom <email>yval@cs.huji.ac.il</email></para>
	    </listitem>
	    
	  </itemizedlist>
	  
	
	
      </sect1>
    </chapter>
    
    <chapter id="policies">
      <title>Source Tree Guidelines and Policies</title>
      
      <para><emphasis>Contributed by &a.phk;.</emphasis></para>
      
      <para>This chapter documents various guidelines and policies in force
	for the FreeBSD source tree.</para>
      
      
      <sect1 id="policies-maintainer">
	<title><makevar>MAINTAINER</makevar> on Makefiles</title>
	
	<para>June 1996.</para>
	
	<para>If a particular portion of the FreeBSD distribution is being
	  maintained by a person or group of persons, they can communicate
	  this fact to the world by adding a
	
	<programlisting>
MAINTAINER= email-addresses
	</programlisting>
	
	line to the <filename>Makefile</filename>s covering this portion
	  of the source tree.</para>
	
	<para>The semantics of this are as follows:</para>
	
	<para>The maintainer owns and is responsible for that code. This
	  means that he is responsible for fixing bugs and answer problem
	  reports pertaining to that piece of the code, and in the case of
	  contributed  software, for tracking new versions, as
	  appropriate.</para>
	
	<para>Changes to directories which have a maintainer defined shall be
	  sent to the maintainer for review before being committed. Only if
	  the maintainer does not respond for an unacceptable period of time,
	  to several emails, will it be acceptable to commit changes without
	  review by the maintainer. However, it is suggested that you try and
	  have the changes reviewed  by someone else if at all
	  possible.</para>
	
	<para>It is of course not acceptable to add a person or group as
	  maintainer unless they agree to assume this duty. On the other hand
	  it doesn't have to be a committer and it can easily be a group of
	  people.</para>
	
      </sect1>
      
      <sect1>
	<title>Contributed Software</title>
	
	<para>June 1996.</para>
	
	<para>Some parts of the FreeBSD distribution consist of software that
	  is actively being maintained outside the FreeBSD project. For
	  historical reasons, we call this <emphasis>contributed</emphasis>
	  software. Some examples are perl, gcc and patch.</para>
	
	<para>Over the last couple of years, various methods have been used in
	  dealing with this type of software and all have some number of
	  advantages and drawbacks. No clear winner has emerged.</para>
	
	<para>Since this is the case, after some debate one of these methods
	  has been selected as the <quote>official</quote> method and will be required for
	  future imports of software of this kind. Furthermore, it is
	  strongly suggested that existing contributed software converge on
	  this model over time, as it has significant advantages over the old
	  method, including the ability to easily obtain diffs relative to the
	  <quote>official</quote> versions of the source by everyone (even without cvs
	  access). This will make it significantly easier to return changes
	  to the primary developers of the contributed software.</para>
	
	<para>Ultimately, however, it comes down to the people actually doing
	  the work. If using this model is particularly unsuited to the
	  package being dealt with, exceptions to these rules may be granted
	  only with the approval of the core team and with the general
	  consensus of the other developers. The ability to maintain the
	  package in the future will be a key issue in the decisions.</para>
	
	<para>The <application>Tcl</application> embedded programming
	  language will be used as example of how this model works:</para>
	
	<para><filename>src/contrib/tcl</filename> contains the source as
	  distributed by the maintainers of this package. Parts that are
	  entirely not applicable for FreeBSD can be removed. In the case of
	  Tcl, the <filename>mac</filename>, <filename>win</filename> and
	  <filename>compat</filename> subdirectories were eliminated before
	  the import</para>
	
	<para><filename>src/lib/libtcl</filename> contains only a "bmake style"
	  <filename>Makefile</filename> that uses the standard
	  <filename>bsd.lib.mk</filename> makefile rules to produce the
	  library and install the documentation.</para>
	
	<para><filename>src/usr.bin/tclsh</filename> contains only a bmake style
	  <filename>Makefile</filename> which will produce and install the
	  <command>tclsh</command> program and its associated man-pages using the standard
	  <filename>bsd.prog.mk</filename> rules.</para>
	
	<para><filename>src/tools/tools/tcl_bmake</filename> contains a couple of
	  shell-scripts that can be of help when the tcl software needs
	  updating. These are not part of the built or installed
	  software.</para>
	
	<para>The important thing here is that the
	  <filename>src/contrib/tcl</filename> directory is created according
	  to the rules: It is supposed to contain the sources as distributed
	  (on a proper CVS vendor-branch) with as few FreeBSD-specific changes
	  as possible. The 'easy-import' tool on freefall will assist in
	  doing the import, but if there are any doubts on how to go about it,
	  it is imperative that you ask first and not blunder ahead and hope
	  it <quote>works out</quote>. CVS is not forgiving of import accidents and a fair
	  amount of effort is required to back out major mistakes.</para>
	
	<para>Because of some unfortunate design limitations with CVS's vendor
	  branches, it is required that <quote>official</quote> patches from the vendor be
	  applied to the original distributed sources and the result
	  re-imported onto the vendor branch again. Official patches should
	  never be patched into the FreeBSD checked out version and
	  "committed", as this destroys the vendor branch coherency and makes
	  importing future versions rather difficult as there will be
	  conflicts.</para>
	
	<para>Since many packages contain files that are meant for
	  compatibility with other architectures and environments that
	  FreeBSD, it is permissible to remove parts of the distribution tree
	  that are of no interest to FreeBSD in order to save space. Files
	  containing copyright notices and release-note kind of information
	  applicable to the remaining files shall <emphasis>not</emphasis> be
	  removed.</para>
	
	<para>If it seems easier, the <command>bmake</command> <filename>Makefile</filename>s
	  can be produced from the dist tree automatically by some utility,
	  something which would hopefully make it even easier to upgrade to a
	  new version. If this is done, be sure to check in such utilities
	  (as necessary) in the <filename>src/tools</filename> directory along
	  with the port itself so that it is available to future
	  maintainers.</para>
	
	<para>In the <filename>src/contrib/tcl</filename> level directory, a
	  file called <filename>FREEBSD-upgrade</filename> should be added and
	  it should states things like:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Which files have been left out</para>
	    </listitem>
	    
	    <listitem>
	      <para>Where the original distribution was obtained from and/or
		the official master site.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Where to send patches back to the original authors</para>
	    </listitem>
	    
	    <listitem>
	      <para>Perhaps an overview of the FreeBSD-specific changes that
		have been made.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>However, please do not import
	  <filename>FREEBSD-upgrade</filename> with the contributed source.
	  Rather you should <command>cvs add FREEBSD-upgrade ; cvs ci</command> after the
	  initial import. Example wording from
	  <filename>src/contrib/cpio</filename> is below:</para>
	
	<programlisting>
This directory contains virgin sources of the original distribution files
on a "vendor" branch. Do not, under any circumstances, attempt to upgrade
the files in this directory via patches and a cvs commit. New versions or
official-patch versions must be imported. Please remember to import with
"-ko" to prevent CVS from corrupting any vendor RCS Ids.

For the import of GNU cpio 2.4.2, the following files were removed:

        INSTALL         cpio.info       mkdir.c             
        Makefile.in     cpio.texi       mkinstalldirs

To upgrade to a newer version of cpio, when it is available:
        1. Unpack the new version into an empty directory.
           [Do not make ANY changes to the files.]

        2. Remove the files listed above and any others that don't apply to
           FreeBSD.

        3. Use the command:
                cvs import -ko -m 'Virgin import of GNU cpio v&lt;version&gt;' \
                        src/contrib/cpio GNU cpio_&lt;version&gt;

           For example, to do the import of version 2.4.2, I typed:
                cvs import -ko -m 'Virgin import of GNU v2.4.2' \
                        src/contrib/cpio GNU cpio_2_4_2

        4. Follow the instructions printed out in step 3 to resolve any
           conflicts between local FreeBSD changes and the newer version.

Do not, under any circumstances, deviate from this procedure.

To make local changes to cpio, simply patch and commit to the main
branch (aka HEAD).  Never make local changes on the GNU branch.

All local changes should be submitted to "cpio@gnu.ai.mit.edu" for
inclusion in the next vendor release.

obrien@freebsd.org - 30 March 1997
	</programlisting>
	
      </sect1>
      
      <sect1 id="policies-shlib">
	<title>Shared Libraries</title>
	
	<para><emphasis>Contributed by &a.asami;, &a.peter;, and
	    &a.obrien;.<!-- <br> --> 9 December 1996.</emphasis></para>
	
	<para>If you are adding shared library support to a port or other
	  piece of software that doesn't have one, the version numbers should
	  follow these rules. Generally, the resulting numbers will have
	  nothing to do with the release version of the software.</para>
	
	<para>The three principles of shared library building are:</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	    <para>Start from <literal>1.0</literal></para>
	    </listitem>
	    
	    <listitem>
	      <para>If there is a change that is backwards compatible, bump
		minor number</para>
	    </listitem>
	    
	    <listitem>
	      <para>If there is an incompatible change, bump major
		number</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para>For instance, added functions and bugfixes result in the minor
	  version number being bumped, while deleted functions, changed
	  function call syntax etc. will force the major version number to
	  change.</para>
	
	<para>Stick to version numbers of the form major.minor (<replaceable>x</replaceable>.<replaceable>y</replaceable>). Our
	  dynamic linker does not handle version numbers of the form <replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>z</replaceable>
	  well. Any version number after the <replaceable>y</replaceable> (ie. the third digit) is
	  totally ignored when comparing shared lib version numbers to decide
	  which library to link with. Given two shared libraries that differ
	  only in the <quote>micro</quote> revision, <command>ld.so</command> will link with the higher one.
	  Ie: if you link with <filename>libfoo.so.3.3.3</filename>, the
	  linker only records <literal>3.3</literal> in the headers, and will link with anything
	  starting with <replaceable>libfoo.so.3</replaceable>.<replaceable>(anything &gt;=
	    3)</replaceable>.<replaceable>(highest available)</replaceable>.</para>

	<note>
	  <para><command>ld.so</command> will always use the highest
	    <quote>minor</quote> revision. Ie: it will use <filename>libc.so.2.2</filename>
	    in preference to <filename>libc.so.2.0</filename>, even if the
	    program was initially linked with
	    <filename>libc.so.2.0</filename>.</para>
	</note>
	
	<para>For non-port libraries, it is also our policy to change the
	  shared library version number only once between releases. When you
	  make a change to a system library that requires the version number
	  to be bumped, check the <filename>Makefile</filename>'s commit logs.
	  It is the responsibility of the committer to ensure that the first
	  such change since the release will result in the shared library
	  version number in the <filename>Makefile</filename> to be updated,
	  and any subsequent changes will not.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="kernelopts">
      <title>Adding New Kernel Configuration Options</title>
      
      <para><emphasis>Contributed by &a.joerg;</emphasis></para>

      <note>
	<para>You should be familiar with the section about <xref
	    linkend="kernelconfig" remap="kernel configuration">
	  before reading here.</para>
      </note>
      
      <sect1>
	<title>What's a <emphasis>Kernel Option</emphasis>, Anyway?</title>
	
	<para>The use of kernel options is basically described in the <xref
	    linkend="kernelconfig-options" remap="kernel configuration">
	  section. There's also an explanation of <quote>historic</quote> and
	  <quote>new-style</quote> options. The ultimate goal is to eventually turn all
	  the supported options in the kernel into new-style ones, so for
	  people who correctly did a <command>make depend</command>
	  in their kernel compile directory after running
	  <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry>, the build process will automatically
	  pick up modified options, and only recompile those files where it is
	  necessary. Wiping out the old compile directory on each run of
	  <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> as it is still done now can then be
	  eliminated again.</para>
	
	<para>Basically, a kernel option is nothing else than the definition
	  of a C preprocessor macro for the kernel compilation process. To
	  make the build truly optional, the corresponding part of the kernel
	  source (or kernel <filename>.h</filename> file) must be written with
	  the option concept in mind, i.e. the default must have been made
	  overridable by the config option. This is usually done with
	  something like:</para>
	
	<programlisting>
#ifndef THIS_OPTION
#define THIS_OPTION (some_default_value)
#endif /* THIS_OPTION */
	</programlisting>
	
	<para>This way, an administrator mentioning another value for the
	  option in his config file will take the default out of effect, and
	  replace it with his new value. Clearly, the new value will be
	  substituted into the source code during the preprocessor run, so it
	  must be a valid C expression in whatever context the default value
	  would have been used.</para>
	
	<para>It is also possible to create value-less options that simply
	  enable or disable a particular piece of code by embracing it
	  in</para>
	
	<programlisting>
#ifdef THAT_OPTION

[your code here]

#endif
	</programlisting>
	
	<para>Simply mentioning <literal>THAT_OPTION</literal> in the config
	  file (with or without any value) will then turn on the corresponding
	  piece of code.</para>
	
	<para>People familiar with the C language will immediately recognize
	  that everything could be counted as a <quote>config option</quote> where there
	  is at least a single <literal>#ifdef</literal>
	  referencing it... However, it's unlikely that many people would
	  put</para>
	
	<programlisting>
options		notyet,notdef
	</programlisting>
	
	<para>in their config file, and then wonder why the kernel compilation
	  falls over. <!-- smiley -->:-)</para>
	
	<para>Clearly, using arbitrary names for the options makes it very
	  hard to track their usage throughout the kernel source tree. That
	  is the rationale behind the <emphasis>new-style</emphasis> option
	  scheme, where each option goes into a separate
	  <filename>.h</filename> file in the kernel compile directory, which
	  is by convention named
	  <filename>opt_<replaceable>foo</replaceable>.h</filename>. This way,
	  the usual Makefile dependencies could be applied, and <command>make</command> can determine what needs to be recompiled
	  once an option has been changed.</para>
	
	<para>The old-style option mechanism still has one advantage for local
	  options or maybe experimental options that have a short anticipated
	  lifetime: since it is easy to add a new <literal>#ifdef</literal> to the kernel source, this has already
	  made it a kernel config option. In this case, the administrator
	  using such an option is responsible himself for knowing about its
	  implications (and maybe manually forcing the recompilation of parts
	  of his kernel). Once the transition of all supported options has
	  been done, <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> will warn whenever an
	  unsupported option appears in the config file, but it will
	  nevertheless include it into the kernel Makefile.</para>
	
      </sect1>
      
      <sect1>
	<title>Now What Do I Have to Do for it?</title>
	
	<para>First, edit <filename>sys/conf/options</filename> (or
	  <filename>sys/i386/conf/options.<replaceable>&lt;arch&gt;</replaceable></filename>, e. g. <filename>sys/i386/conf/options.i386</filename>), and select an <filename>opt_<replaceable>foo</replaceable>.h</filename> file where your new option would best go into.</para>
	
	<para>If there is already something that comes close to the purpose of
	  the new option, pick this. For example, options modifying the
	  overall behaviour of the SCSI subsystem can go into
	  <filename>opt_scsi.h</filename>. By default, simply mentioning an
	  option in the appropriate option file, say <literal>FOO</literal>,
	  implies its value will go into the corresponding file
	  <filename>opt_foo.h</filename>. This can be overridden on the
	  right-hand side of a rule by specifying another filename.</para>
	
	<para>If there is no
	  <filename>opt_<replaceable>foo</replaceable>.h</filename> already
	  available for the intended new option, invent a new name. Make it
	  meaningful, and comment the new section in the
	  <filename>options[<replaceable>.&lt;arch&gt;</replaceable>]</filename> file. <citerefentry><refentrytitle>config</refentrytitle><manvolnum>8</manvolnum></citerefentry> will automagically pick up the change, and create that file next time it is run. Most options should go in a header file by themselves..</para>
	
	<para>Packing too many options into a single
	  <filename>opt_<replaceable>foo</replaceable>.h</filename> will cause
	  too many kernel files to be rebuilt when one of the options has been
	  changed in the config file.</para>
	
	<para>Finally, find out which kernel files depend on the new option.
	  Unless you have just invented your option, and it does not exist
	  anywhere yet,
	
	<informalexample>
	  <screen>&prompt.user; <userinput>find /usr/src/sys -name type f | xargs fgrep NEW_OPTION</userinput></screen>
	</informalexample>
	
	is your friend in finding them. Go and edit all those files,
	  and add
	
	<programlisting>
#include "opt_foo.h"
	</programlisting>
	
	<emphasis>on top</emphasis>, before all the <literal>#include &lt;xxx.h&gt;</literal> stuff. This sequence
	  is most important as the options could override defaults from the
	  regular include files, if the defaults are of the form
	
	<programlisting>
#ifndef NEW_OPTION
#define NEW_OPTION (something)
#endif
	</programlisting>
	
	in the regular header.</para>
	
	<para>Adding an option that overrides something in a system header
	  file (i.e., a file sitting in
	  <filename>/usr/include/sys/</filename>) is almost always a mistake.
	  <filename>opt_<replaceable>foo</replaceable>.h</filename> cannot be
	  included into those files since it would break the headers more
	  seriously, but if it is not included, then places that include it
	  may get an inconsistent value for the option. Yes, there are
	  precedents for this right now, but that does not make them more
	  correct.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="kerneldebug">
      <title>Kernel Debugging</title>
      
      <para><emphasis>Contributed by &a.paul; and &a.joerg;</emphasis></para>
      
      
      <sect1>
	<title>Debugging a Kernel Crash Dump with <command>kgdb</command></title>
	
	<para>Here are some instructions for getting kernel debugging working
	  on a crash dump. They assume that you have enough swap space for a
	  crash dump. If you have multiple swap partitions and the first one
	  is too small to hold the dump, you can configure your kernel to use
	  an alternate dump device (in the <literal>config
	    kernel</literal> line), or you can specify an alternate using the
	  <citerefentry><refentrytitle>dumpon</refentrytitle><manvolnum>8</manvolnum></citerefentry> command. Dumps to non-swap devices, tapes for example,
	  are currently not supported. Config your kernel using
	  <command>config -g</command>. See <xref linkend="kernelconfig"
	    remap="Kernel Configuration"> for
	  details on configuring the FreeBSD kernel.</para>
	
	<para>Use the <citerefentry><refentrytitle>dumpon</refentrytitle><manvolnum>8</manvolnum></citerefentry> command to tell the kernel
	  where to dump to (note that this will have to be done after
	  configuring the partition in question as swap space via
	  <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>). This is normally arranged via
	  <filename>/etc/rc.conf</filename> and <filename>/etc/rc</filename>.
	  Alternatively, you can hard-code the dump device via the <literal>dump</literal>
	  clause in the <literal>config</literal> line of your kernel config file. This is
	  deprecated and should be used only if you want a crash dump from a
	  kernel that crashes during booting.</para>

	<note>
	  <para>In the following, the term <command>kgdb</command> refers to
	    <command>gdb</command> run in <quote>kernel debug mode</quote>. This can be
	    accomplished by either starting the <command>gdb</command> with
	    the option <option>-k</option>, or by linking and starting it
	    under the name <command>kgdb</command>. This is not being done by
	    default, however, and the idea is basically deprecated since the
	    GNU folks do not like their tools to behave differently when
	    called by another name. This feature may well be discontinued in
	    further releases.</para>
	</note>
	
	<para>When the kernel has been built make a copy of it, say
	  <filename>kernel.debug</filename>, and then run <command>strip
	    -d</command> on the original. Install the original as normal. You
	  may also install the unstripped kernel, but symbol table lookup time
	  for some programs will drastically increase, and since the whole
	  kernel is loaded entirely at boot time and cannot be swapped out
	  later, several megabytes of physical memory will be wasted.</para>
	
	<para>If you are testing a new kernel, for example by typing the new
	  kernel's name at the boot prompt, but need to boot a different one
	  in order to get your system up and running again, boot it only into
	  single user state using the <option>-s</option> flag at the boot
	  prompt, and then perform the following steps:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>fsck -p</userinput>
&prompt.root; <userinput>mount -a -t ufs</userinput>       # so your file system for /var/crash is writable
&prompt.root; <userinput>savecore -N /kernel.panicked /var/crash</userinput>
&prompt.root; <userinput>exit</userinput>                  # ...to multi-user</screen>
	  </informalexample>

	<para>This instructs <citerefentry><refentrytitle>savecore</refentrytitle><manvolnum>8</manvolnum></citerefentry> to
	  use another kernel for symbol name extraction. It would otherwise
	  default to the currently running kernel and most likely not do
	  anything at all since the crash dump and the kernel symbols
	  differ.</para>
	
	<para>Now, after a crash dump, go to
	  <filename>/sys/compile/WHATEVER</filename> and run <command>kgdb</command>. From <command>kgdb</command>
	  do:
	  
	  <informalexample>
	    <screen><userinput>symbol-file kernel.debug</userinput>
<userinput>exec-file /var/crash/kernel.0</userinput>
<userinput>core-file /var/crash/vmcore.0</userinput></screen>
	  </informalexample>

	  and voila, you can debug the crash dump using the
	  kernel sources just like you can for any other program.</para>
	
	<para>Here is a script log of a <command>kgdb</command>
	  session illustrating the procedure. Long lines have been folded to
	  improve readability, and the lines are numbered for reference.
	  Despite this, it is a real-world error trace taken during the
	  development of the pcvt console driver.</para>

	  <informalexample>
	    <screen> 1:Script started on Fri Dec 30 23:15:22 1994
 2:&prompt.root; <userinput>cd /sys/compile/URIAH</userinput>
 3:&prompt.root; <userinput>kgdb kernel /var/crash/vmcore.1</userinput> 
 4:Reading symbol data from /usr/src/sys/compile/URIAH/kernel...done.
 5:IdlePTD 1f3000
 6:panic: because you said to!
 7:current pcb at 1e3f70
 8:Reading in symbols for ../../i386/i386/machdep.c...done.
 9:<prompt>(kgdb)</prompt> <userinput>where</userinput>
10:#0  boot (arghowto=256) (../../i386/i386/machdep.c line 767)
11:#1  0xf0115159 in panic ()
12:#2  0xf01955bd in diediedie () (../../i386/i386/machdep.c line 698)
13:#3  0xf010185e in db_fncall ()
14:#4  0xf0101586 in db_command (-266509132, -266509516, -267381073)
15:#5  0xf0101711 in db_command_loop ()
16:#6  0xf01040a0 in db_trap ()
17:#7  0xf0192976 in kdb_trap (12, 0, -272630436, -266743723)
18:#8  0xf019d2eb in trap_fatal (...)
19:#9  0xf019ce60 in trap_pfault (...)
20:#10 0xf019cb2f in trap (...)
21:#11 0xf01932a1 in exception:calltrap ()
22:#12 0xf0191503 in cnopen (...)
23:#13 0xf0132c34 in spec_open ()
24:#14 0xf012d014 in vn_open ()
25:#15 0xf012a183 in open ()
26:#16 0xf019d4eb in syscall (...)
27:<prompt>(kgdb)</prompt> <userinput>up 10</userinput>
28:Reading in symbols for ../../i386/i386/trap.c...done.
29:#10 0xf019cb2f in trap (frame={tf_es = -260440048, tf_ds = 16, tf_\
30:edi = 3072, tf_esi = -266445372, tf_ebp = -272630356, tf_isp = -27\
31:2630396, tf_ebx = -266427884, tf_edx = 12, tf_ecx = -266427884, tf\
32:_eax = 64772224, tf_trapno = 12, tf_err = -272695296, tf_eip = -26\
33:6672343, tf_cs = -266469368, tf_eflags = 66066, tf_esp = 3072, tf_\
34:ss = -266427884}) (../../i386/i386/trap.c line 283)
35:283                             (void) trap_pfault(&frame, FALSE);
36:<prompt>(kgdb)</prompt> <userinput>frame frame-&gt;tf_ebp frame-&gt;tf_eip</userinput>
37:Reading in symbols for ../../i386/isa/pcvt/pcvt_drv.c...done.
38:#0  0xf01ae729 in pcopen (dev=3072, flag=3, mode=8192, p=(struct p\
39:roc *) 0xf07c0c00) (../../i386/isa/pcvt/pcvt_drv.c line 403)
40:403             return ((*linesw[tp-&gt;t_line].l_open)(dev, tp));
41:<prompt>(kgdb)</prompt> <userinput>list</userinput>
42:398        
43:399             tp-&gt;t_state |= TS_CARR_ON;
44:400             tp-&gt;t_cflag |= CLOCAL;  /* cannot be a modem (:-) */
45:401     
46:402     #if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
47:403             return ((*linesw[tp-&gt;t_line].l_open)(dev, tp));
48:404     #else
49:405             return ((*linesw[tp-&gt;t_line].l_open)(dev, tp, flag));
50:406     #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */
51:407     }
52:<prompt>(kgdb)</prompt> <userinput>print tp</userinput>
53:Reading in symbols for ../../i386/i386/cons.c...done.
54:$1 = (struct tty *) 0x1bae
55:<prompt>(kgdb)</prompt> <userinput>print tp-&gt;t_line</userinput>
56:$2 = 1767990816
57:<prompt>(kgdb)</prompt> <userinput>up</userinput>
58:#1  0xf0191503 in cnopen (dev=0x00000000, flag=3, mode=8192, p=(st\
59:ruct proc *) 0xf07c0c00) (../../i386/i386/cons.c line 126)
60:       return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p));
61:<prompt>(kgdb)</prompt> <userinput>up</userinput>
62:#2  0xf0132c34 in spec_open ()
63:<prompt>(kgdb)</prompt> <userinput>up</userinput>
64:#3  0xf012d014 in vn_open ()
65:<prompt>(kgdb)</prompt> <userinput>up</userinput>
66:#4  0xf012a183 in open ()
67:<prompt>(kgdb)</prompt> <userinput>up</userinput>
68:#5  0xf019d4eb in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi =\
69: 2158592, tf_esi = 0, tf_ebp = -272638436, tf_isp = -272629788, tf\
70:_ebx = 7086, tf_edx = 1, tf_ecx = 0, tf_eax = 5, tf_trapno = 582, \
71:tf_err = 582, tf_eip = 75749, tf_cs = 31, tf_eflags = 582, tf_esp \
72:= -272638456, tf_ss = 39}) (../../i386/i386/trap.c line 673)
73:673             error = (*callp-&gt;sy_call)(p, args, rval);
74:<prompt>(kgdb)</prompt> <userinput>up</userinput>
75:Initial frame selected; you cannot go up.
76:<prompt>(kgdb)</prompt> <userinput>quit</userinput>
77:&prompt.root; <userinput>exit</userinput>
78:exit
79:
80:Script done on Fri Dec 30 23:18:04 1994</screen>
	  </informalexample>

	<para>Comments to the above script:</para>
	
	
	  <variablelist>
	    <varlistentry><term>line 6:</term>
	      <listitem>
		<para>This is a dump taken from within DDB (see below), hence
		  the panic comment <quote>because you said to!</quote>, and a rather
		  long stack trace; the initial reason for going into DDB has
		  been a page fault trap though.</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>line 20:</term>
	      
	      <listitem>
		<para>This is the location of function
		  <function>trap()</function> in the stack trace.</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>line 36:</term>
	      
	      <listitem>
		<para>Force usage of a new stack frame; this is no longer
		  necessary now. The stack frames are supposed to point to
		  the right locations now, even in case of a trap. (I do not
		  have a new core dump handy &lt;g&gt;, my kernel has not
		  panicked for a rather long time.) From looking at the code
		  in source line 403, there is a high probability that either
		  the pointer access for <quote>tp</quote> was messed up, or the array
		  access was out of bounds.</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>line 52:</term>
	      
	      <listitem>
		<para>The pointer looks suspicious, but happens to be a valid
		  address.</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>line 56:</term>
	      
	      <listitem>
		<para>However, it obviously points to garbage, so we have
		  found our error! (For those unfamiliar with that particular
		  piece of code: <literal>tp-&gt;t_line</literal>
		  refers to the line discipline  of the console device here,
		  which must be a rather small integer number.)</para>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
      </sect1>
      
      <sect1>
	<title>Post-mortem Analysis of a Dump</title>
	
	<para>What do you do if a kernel dumped core but you did not expect
	  it, and it is therefore not compiled using <command>config
	    -g</command>? Not everything is lost here. Do not panic!</para>
	
	<para>Of course, you still need to enable crash dumps. See above on
	  the options you have to specify in order to do this.</para>
	
	<para>Go to your kernel compile directory, and edit the line
	  containing <literal>COPTFLAGS?=-O</literal>. Add the
	  <option>-g</option> option there (but <emphasis>do not</emphasis>
	  change anything on the level of optimization). If you do already
	  know roughly the probable location of the failing piece of code
	  (e.g., the <devicename>pcvt</devicename> driver in the example
	  above), remove all the object files for this code. Rebuild the
	  kernel. Due to the time stamp change on the Makefile, there will be
	  some other object files rebuild, for example
	  <filename>trap.o</filename>. With a bit of luck, the added
	  <option>-g</option> option will not change anything for the
	  generated code, so you will finally get a new kernel with similar
	  code to the faulting one but some debugging symbols. You should at
	  least verify the old and new sizes with the
	  <citerefentry><refentrytitle>size</refentrytitle><manvolnum>1</manvolnum></citerefentry> command. If there is a mismatch, you
	  probably need to give up here.</para>
	
	<para>Go and examine the dump as described above. The debugging
	  symbols might be incomplete for some places, as can be seen in the
	  stack trace in the example above where some functions are displayed
	  without line numbers and argument lists. If you need more debugging
	  symbols, remove the appropriate object files and repeat the
	  <command>kgdb</command> session until you know
	  enough.</para>
	
	<para>All this is not guaranteed to work, but it will do it fine in
	  most cases.</para>
	
      </sect1>
      
      <sect1>
	<title>On-line Kernel Debugging Using DDB</title>
	
	<para>While <command>kgdb</command> as an offline debugger
	  provides a very high level of user interface, there are some things
	  it cannot do. The most important ones being breakpointing and
	  single-stepping kernel code.</para>
	
	<para>If you need to do low-level debugging on your kernel, there is
	  an on-line debugger available called DDB. It allows to setting
	  breakpoints, single-steping kernel functions, examining and changing
	  kernel variables, etc. However, it cannot access kernel source
	  files, and only has access to the global and static symbols, not to
	  the full debug information like <command>kgdb</command>.</para>
	
	<para>To configure your kernel to include DDB, add the option line

	  <programlisting>
options DDB
	  </programlisting> to your config file, and rebuild. (See <xref
	    linkend="kernelconfig"
	    remap="Kernel Configuration"> for details on configuring the
	  FreeBSD kernel.</para>

	<note>
	  <para>Note that if you have an older version of the boot blocks,
	    your debugger symbols might not be loaded at all. Update the boot
	    blocks; the recent ones load the DDB symbols
	    automagically.)</para>
	</note>
	
	<para>Once your DDB kernel is running, there are several ways to enter
	  DDB. The first, and earliest way is to type the boot flag
	  <option>-d</option> right at the boot prompt. The kernel will start
	  up in debug mode and enter DDB prior to any device probing. Hence
	  you can even debug the device probe/attach functions.</para>
	
	<para>The second scenario is a hot-key on the keyboard, usually
	  Ctrl-Alt-ESC. For syscons, this can be remapped; some of the
	  distributed maps do this, so watch out. There is an option available
	  for serial consoles that allows the use of a serial line BREAK on
	  the console line to enter DDB (<literal>options
	    BREAK_TO_DEBUGGER</literal> in the kernel config file). It is
	  not the default since there are a lot of crappy serial adapters
	  around that gratuitously generate a BREAK condition, for example
	  when pulling the cable.</para>
	
	<para>The third way is that any panic condition will branch to DDB if
	  the kernel is configured to use it. For this reason, it is not
	  wise to configure a kernel with DDB for a machine running
	  unattended.</para>
	
	<para>The DDB commands roughly resemble some <command>gdb</command> commands. The first thing you probably
	  need to do is to set a breakpoint:</para>
	
	  <informalexample>
	    <screen><userinput>b function-name</userinput>
<userinput>b address</userinput></screen>
	  </informalexample>
	
	<para>Numbers are taken hexadecimal by default, but to make them
	  distinct from symbol names; hexadecimal numbers starting with the
	  letters <literal>a-f</literal> need to be preceded with
	  <literal>0x</literal> (this is optional for other numbers). Simple
	  expressions are allowed, for example: <literal>function-name +
	    0x103</literal>.</para>
	
	<para>To continue the operation of an interrupted kernel, simply type:</para>

	  <informalexample>
	    <screen><userinput>c</userinput></screen>
	  </informalexample>

	<para>To get a stack trace, use:</para>

	  <informalexample>
	    <screen><userinput>trace</userinput></screen>
	  </informalexample>

	<note>
	  <para>Note that when entering DDB via a hot-key, the kernel is
	    currently servicing an interrupt, so the stack trace might be not
	    of much use for you.</para>
	</note>
	
	<para>If you want to remove a breakpoint, use</para>

	  <informalexample>
	    <screen><userinput>del</userinput>
<userinput>del address-expression</userinput></screen>
	  </informalexample>

	<para>The first form will be accepted immediately after
	  a breakpoint hit, and deletes the current breakpoint. The second
	  form can remove any breakpoint, but you need to specify the exact
	  address; this can be obtained from:</para>

	  <informalexample>
	    <screen><userinput>show b</userinput></screen>
	  </informalexample>

	<para>To single-step the kernel, try:</para>

	  <informalexample>
	    <screen><userinput>s</userinput></screen>
	  </informalexample>

	<para>This will step into functions, but you can make
	  DDB trace them until the matching return statement is reached by:</para>

	  <informalexample>
	    <screen><userinput>n</userinput></screen>
	  </informalexample>

	<note>
	  <para>This is different from <command>gdb</command>'s <command>next</command>
	    statement; it is like <command>gdb</command>'s <command>finish</command>.</para>
	</note>
	
	<para>To examine data from memory, use (for example):

	  <informalexample>
	    <screen><userinput>x/wx 0xf0133fe0,40</userinput>
<userinput>x/hd db_symtab_space</userinput>
<userinput>x/bc termbuf,10</userinput>
<userinput>x/s stringbuf</userinput></screen>
	  </informalexample>

	  for word/halfword/byte access, and
	  hexadecimal/decimal/character/ string display. The number after the
	  comma is the object count. To display the next 0x10 items, simply
	  use:</para>

	  <informalexample>
	    <screen><userinput>x ,10</userinput></screen>
	  </informalexample>

	<para>Similarly, use

	  <informalexample>
	    <screen><userinput>x/ia foofunc,10</userinput></screen>
	  </informalexample>

	  to disassemble the first 0x10 instructions of
	  <function>foofunc</function>, and display them along with
	  their offset from the beginning of <function>foofunc</function>.</para>
	
	<para>To modify memory, use the write command:</para>

	  <informalexample>
	    <screen><userinput>w/b termbuf 0xa 0xb 0</userinput>
<userinput>w/w 0xf0010030 0 0</userinput></screen>
	  </informalexample>

	<para>The command modifier
	  (<literal>b</literal>/<literal>h</literal>/<literal>w</literal>) specifies the size of the data to be
	  written, the first following expression is the address to write to
	  and the remainder is interpreted as data to write to successive
	  memory locations.</para>
	
	<para>If you need to know the current registers, use:</para>

	  <informalexample>
	    <screen><userinput>show reg</userinput></screen>
	  </informalexample>

	<para>Alternatively, you can display a single register
	  value by e.g.

	  <informalexample>
	    <screen><userinput>p $eax</userinput></screen>
	  </informalexample> and modify it by:</para>

	  <informalexample>
	    <screen><userinput>set $eax new-value</userinput></screen>
	  </informalexample>
	
	<para>Should you need to call some kernel functions from DDB, simply
	  say:</para>

	  <informalexample>
	    <screen><userinput>call func(arg1, arg2, ...)</userinput></screen>
	  </informalexample>

	<para>The return value will be printed.</para>
	
	<para>For a <citerefentry><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry> style summary of all running
	  processes, use:</para>

	  <informalexample>
	    <screen><userinput>ps</userinput></screen>
	  </informalexample>
	
	<para>Now you have now examined why your kernel failed, and you wish
	  to reboot. Remember that, depending on the severity of previous
	  malfunctioning, not all parts of the kernel might still be working
	  as expected. Perform one of the following actions to shut down and
	  reboot your system:</para>

	  <informalexample>
	    <screen><userinput>call diediedie()</userinput></screen>
	  </informalexample>
	
	<para>This will cause your kernel to dump core and reboot, so you can
	  later analyze the core on a higher level with kgdb. This command
	  usually must be followed by another <command>continue</command> statement. There is now an alias for
	  this: <command>panic</command>.</para>
	
	  <informalexample>
	    <screen><userinput>call boot(0)</userinput></screen>
	  </informalexample>

	<para>Which might be a good way to cleanly shut down the
	  running system, <function>sync()</function> all disks, and finally
	  reboot. As long as the disk and file system interfaces of the
	  kernel are not damaged, this might be a good way for an almost clean
	  shutdown.</para>
	
	<para>
	  <informalexample>
	    <screen><userinput>call cpu_reset()</userinput></screen>
	  </informalexample> is the final way out of disaster and almost the
	  same as hitting the Big Red Button.</para>
	
	<para>If you need a short command summary, simply type:</para>
	
	  <informalexample>
	    <screen><userinput>help</userinput></screen>
	  </informalexample>

	<para>However, it is highly recommended to have a
	  printed copy of the <citerefentry><refentrytitle>ddb</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page
	  ready for a debugging session. Remember that it is hard to read the
	  on-line manual while single-stepping the kernel.</para>
	
      </sect1>
      
      <sect1>
	<title>On-line Kernel Debugging Using Remote GDB</title>
	
	<para>This feature has been supported since FreeBSD 2.2, and it's
	  actually a very neat one.</para>
	
	<para>GDB has already supported <emphasis>remote debugging</emphasis>
	  for a long time. This is done using a very simple protocol along a
	  serial line. Unlike the other methods described above, you will
	  need two machines for doing this. One is the host providing the
	  debugging environment, including all the sources, and a copy of the
	  kernel binary with all the symbols in it, and the other one is the
	  target machine that simply runs a similar copy of the very same
	  kernel (but stripped of the debugging information).</para>
	
	<para>You should configure the kernel in question with <command>config
	    -g</command>, include <option>DDB</option> into the
	  configuration, and compile it as usual. This gives a large blurb of
	  a binary, due to the debugging information. Copy this kernel to the
	  target machine, strip the debugging symbols off with <command>strip
	    -x</command>, and boot it using the <option>-d</option> boot
	  option. Connect the first serial line of the target machine to any
	  serial line of the debugging host. Now, on the debugging machine,
	  go to the compile directory of the target kernel, and start gdb:</para>

	  <informalexample>
	    <screen>&prompt.user; <userinput>gdb -k kernel</userinput>
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-freebsd),
Copyright 1996 Free Software Foundation, Inc...
<prompt>(kgdb)</prompt> </screen>
	  </informalexample>
	
	<para>Initialize the remote debugging session (assuming the first
	  serial port is being used) by:</para>

	  <informalexample>
	    <screen><prompt>(kgdb)</prompt> <userinput>target remote /dev/cuaa0</userinput></screen>
	  </informalexample>
	
	<para>Now, on the target host (the one that entered DDB right before
	  even starting the device probe), type:</para>

	  <informalexample>
	    <screen>Debugger("Boot flags requested debugger")
Stopped at Debugger+0x35: movb	$0, edata+0x51bc
<prompt>db&gt;</prompt> <userinput>gdb</userinput></screen>
	  </informalexample>
	
	<para>DDB will respond with:</para>
	
	  <informalexample>
	    <screen>Next trap will enter GDB remote protocol mode</screen>
	  </informalexample>
	
	<para>Every time you type <command>gdb</command>, the mode will be toggled between
	  remote GDB and local DDB. In order to force a next trap
	  immediately, simply type <command>s</command> (step). Your hosting GDB will now
	  gain control over the target kernel:</para>
	
	  <informalexample>
	    <screen>Remote debugging using /dev/cuaa0
Debugger (msg=0xf01b0383 "Boot flags requested debugger")
    at ../../i386/i386/db_interface.c:257
<prompt>(kgdb)</prompt></screen>
	  </informalexample>
	
	<para>You can use this session almost as any other GDB session,
	  including full access to the source, running it in gud-mode inside
	  an Emacs window (which gives you an automatic source code display in
	  another Emacs window) etc.</para>
	
	<para>Remote GDB can also be used to debug LKMs. First build the LKM
	  with debugging symbols:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>cd /usr/src/lkm/linux</userinput>
&prompt.root; <userinput>make clean; make COPTS=-g</userinput></screen>
	  </informalexample>
	
	<para>Then install this version of the module on the target machine,
	  load it and use <command>modstat</command> to find out
	  where it was loaded:</para>

	  <informalexample>
	    <screen>&prompt.root; <userinput>linux</userinput>
&prompt.root; <userinput>modstat</userinput>
Type     Id Off Loadaddr Size Info     Rev Module Name
EXEC      0   4 f5109000 001c f510f010   1 linux_mod</screen>
	  </informalexample>
	
	<para>Take the load address of the module and add 0x20 (probably to
	  account for the a.out header). This is the address that the module
	  code was relocated to. Use the <command>add-symbol-file</command> command in GDB to tell the
	  debugger about the module:</para>

	  <informalexample>
	    <screen><prompt>(kgdb)</prompt> <userinput>add-symbol-file /usr/src/lkm/linux/linux_mod.o 0xf5109020</userinput>
add symbol table from file "/usr/src/lkm/linux/linux_mod.o" at
text_addr = 0xf5109020? (y or n) <userinput>y</userinput>
<prompt>(kgdb)</prompt></screen>
	  </informalexample>
	
	<para>You now have access to all the symbols in the LKM.</para>
	
      </sect1>
      
      <sect1>
	<title>Debugging a Console Driver</title>
	
	<para>Since you need a console driver to run DDB on, things are more
	  complicated if the console driver itself is failing. You might
	  remember the use of a serial console (either with modified boot
	  blocks, or by specifying <option>-h</option> at the <prompt>Boot:</prompt> prompt), and hook up a standard terminal
	  onto your first serial port. DDB works on any configured console
	  driver, of course also on a serial console.</para>
	
      </sect1>
    </chapter>
    
    <chapter id="linuxemu">
      <title>Linux Emulation</title>
      
      <para><emphasis>Contributed by &a.handy; and &a.rich;</emphasis></para>
      
      
      <sect1>
	<title>How to Install the Linux Emulator</title>
	
	<para>Linux emulation in FreeBSD has reached a point where it is
	  possible to run a large fraction of Linux binaries in both a.out and
	  ELF format. The linux emulation in the 2.1-STABLE branch is capable
	  of running Linux DOOM and Mathematica; the version present in
	  FreeBSD-2.2-RELEASE is vastly more capable and runs all these as
	  well as Quake, Abuse, IDL, netrek for Linux and a whole host of
	  other programs.</para>
	
	<para>There are some Linux-specific operating system features that are
	  not supported on FreeBSD. Linux binaries will not work on FreeBSD
	  if they use the Linux <filename>/proc</filename> filesystem (which
	  is different from the optional FreeBSD <filename>/proc</filename>
	  filesystem) or i386-specific calls, such as enabling virtual 8086
	  mode.</para>
	
	<para>To tell whether your kernel is configured for Linux
	  compatibility simply run any Linux binary. If it prints the error
	  message <errorname>linux-executable: Exec format error. Wrong Architecture.</errorname> then you do not have linux compatibility support
	  and you need to configure and install a new kernel.</para>
	
	<para>Depending on which version of FreeBSD you are running, how you
	  get  Linux-emulation up will vary slightly:</para>
	
	
	<sect2>
	  <title>Installing Linux Emulation in 2.1-STABLE</title>
	  
	  <para>The <filename>GENERIC</filename> kernel in 2.1-STABLE is not
	    configured for linux compatibility so you must reconfigure your
	    kernel for it. There are two ways to do this: 1. linking the
	    emulator statically in the kernel itself and 2. configuring your
	    kernel to dynamically load the linux loadable kernel module
	    (LKM).</para>
	  
	  <para>To enable the emulator, add the following to your
	    configuration file (c.f.
	    <filename>/sys/i386/conf/LINT</filename>):</para>

	    <programlisting>
options COMPAT_LINUX
	    </programlisting>

	  <para>If you want to run doom or other applications
	    that need shared memory, also add the following.</para>

	    <programlisting>
options SYSVSHM
	    </programlisting>

	  <para>The linux system calls require 4.3BSD system
	    call compatibility. So make sure you have the following.</para>

	    <programlisting>
options "COMPAT_43"
	    </programlisting>
	  
	  <para>If you prefer to statically link the emulator in the kernel
	    rather than use the loadable kernel module (LKM), then add</para>

	    <programlisting>
options  LINUX
	    </programlisting>

	  <para>Then run config and install the new kernel as
	    described in the
	    <xref linkend="kernelconfig" remap="kernel configuration">
	    section.</para>
	  
	  <para>If you decide to use the LKM you must also install the
	    loadable module. A mismatch of versions between the kernel and
	    loadable module can cause the kernel to crash, so the safest thing
	    to do is to reinstall the LKM when you install the kernel.</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /usr/src/lkm/linux</userinput>
&prompt.root; <userinput>make all install</userinput></screen>
	    </informalexample>

	  <para>Once you have installed the kernel and the LKM,
	    you can invoke `linux' as root to load the LKM.</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>linux</userinput>
Linux emulator installed
Module loaded as ID 0</screen>
	    </informalexample>

	  <para>To see whether the LKM is loaded, run
	    <command>modstat</command>.</para>
	  
	    <informalexample>
	      <screen>&prompt.user; modstat
Type     Id Off Loadaddr Size Info     Rev
Module Name EXEC      0   3 f0baf000 0018 f0bb4000   1 linux_emulator</screen>
	    </informalexample>

	  <para>You can cause the LKM to be loaded when the
	    system boots in either of two ways. In FreeBSD 2.2.1-RELEASE and
	    2.1-STABLE enable it in <filename>/etc/sysconfig</filename>

	    <programlisting>
linux=YES
	    </programlisting> by changing it from NO to YES. FreeBSD 2.1
	    RELEASE and earlier do not have such a line and on those you will
	    need to edit <filename>/etc/rc.local</filename> to add the following line.</para>

	    <programlisting>
linux
	    </programlisting>
	  
	</sect2>
	
	<sect2>
	  <title>Installing Linux Emulation in 2.2.2-RELEASE and later</title>
	  
	  <para>It is no longer necessary to specify <literal>options LINUX</literal> or
	    <literal>options COMPAT_LINUX</literal>. Linux emulation is done with an LKM
	    (<quote>Loadable Kernel Module</quote>) so it can be installed on the fly
	    without having to reboot. You will need the following things in
	    your startup files, however:
	    <orderedlist>
	      
	      <listitem>
		<para>In <filename>/etc/rc.conf</filename>, you need the
		  following line:</para>

		  <programlisting>
linux_enable=YES
		  </programlisting>
	      </listitem>
	      
	      <listitem>
		<para>This, in turn, triggers the following action in
		  <filename>/etc/rc.i386</filename>:</para>

		  <programlisting>
# Start the Linux binary emulation if requested.
if [ "X${linux_enable}" = X"YES" ]; then echo -n '
        linux';               linux &gt; /dev/null 2&gt;&amp;1
fi
		  </programlisting>
	      </listitem>
	      
	    </orderedlist>
	  </para>
	  
	  <para>If you want to verify it is running, modstat will do that:</para>

	    <informalexample>
	      <screen>&prompt.user; modstat
Type     Id Off Loadaddr Size Info     Rev Module Name
EXEC      0   4 f09e6000 001c f09ec010   1 linux_mod</screen>
	    </informalexample>

	  <para>However, there have been reports that this
	    fails on some 2.2-RELEASE and later systems. If for some reason
	    you cannot load the linux LKM, then statically link the emulator
	    in the kernel by adding

	    <programlisting>
options  LINUX
	    </programlisting>

	    to your kernel config file. Then run config
	    and install the new kernel as described in the <xref
	      linkend="kernelconfig"
	      remap="kernel configuration"> section.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Installing Linux Runtime Libraries</title>
	  
	  
	  <sect3>
	    <title>Installing using the linux_lib port</title>
	    
	    <para>Most linux applications use shared libraries, so you are
	      still not done until you install the shared libraries. It is
	      possible to do this by hand, however, it is vastly simpler to
	      just grab the linux_lib port:</para>

	      <informalexample>
		<screen>&prompt.root; <userinput>cd /usr/ports-current/emulators/linux_lib</userinput>
&prompt.root; <userinput>make all install</userinput></screen>
	      </informalexample>
	    
	    <para>and you should have a working linux emulator. Legend (and
	      the mail archives <!-- smiley -->:-) seems to hold that Linux emulation works
	      best with linux binaries linked against the ZMAGIC libraries;
	      QMAGIC libraries (such as those used in Slackware V2.0) may tend
	      to give the Linuxulator heartburn. As of this writing (March
	      1996) ELF emulation is still in the formulative stages but seems
	      to work pretty well. Also, expect some programs to complain
	      about incorrect minor versions. In  general this does not seem
	      to be a problem.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>Installing libraries manually</title>
	    
	    <para>If you do not have the <quote>ports</quote> distribution, you can
	      install the libraries by hand instead. You will need the Linux
	      shared libraries that the program depends on and the runtime
	      linker. Also, you will need to create a "shadow root"
	      directory, <filename>/compat/linux</filename>, for Linux
	      libraries on your FreeBSD system. Any shared libraries opened
	      by Linux programs run under FreeBSD will look in this tree
	      first. So, if a Linux program loads, for example,
	      <filename>/lib/libc.so</filename>, FreeBSD will first try to
	      open <filename>/compat/linux/lib/libc.so</filename>, and if that
	      does not exist then it will try
	      <filename>/lib/libc.so</filename>. Shared libraries should be
	      installed in the shadow tree
	      <filename>/compat/linux/lib</filename> rather than the paths
	      that the Linux <command>ld.so</command> reports.</para>
	    
	    <para>FreeBSD-2.2-RELEASE and later works slightly differently
	      with respect to <command>/compat/linux</command>. On -CURRENT, all files, not just
	      libraries, are searched for from the <quote>shadow root</quote>
	      <filename>/compat/linux</filename>.</para>
	    
	    <para>Generally, you will need to look for the shared libraries
	      that Linux  binaries depend on only the first few times that you
	      install a Linux  program on your FreeBSD system. After a while,
	      you will have a sufficient set of Linux shared libraries on your
	      system to be able to run newly  imported Linux binaries without
	      any extra work.</para>
	    
	  </sect3>
	  
	  <sect3>
	    <title>How to install additional shared libraries</title>
	    
	    <para>What if you install the <filename>linux_lib</filename> port and your application
	      still complains about missing shared libraries? How do you know
	      which shared libraries Linux binaries need, and where to get
	      them? Basically, there are 2 possibilities (when following these
	      instructions: you will need to be root on your FreeBSD system to
	      do the necessary installation steps).</para>
	    
	    <para>If you have access to a Linux system, see what shared
	      libraries it needs, and copy them to your FreeBSD system.
	      Example: you have just ftp'ed the Linux binary of Doom. Put it
	      on the Linux system you have access to, and check which shared
	      libraries it needs by running <command>ldd linuxxdoom</command>:</para>
	    
	    
	      <informalexample>
		<screen>&prompt.user; <userinput>ldd linuxxdoom</userinput>
libXt.so.3 (DLL Jump 3.1) =&gt; /usr/X11/lib/libXt.so.3.1.0
libX11.so.3 (DLL Jump 3.1) =&gt; /usr/X11/lib/libX11.so.3.1.0
libc.so.4 (DLL Jump 4.5pl26) =&gt; /lib/libc.so.4.6.29</screen>
	      </informalexample>
	    
	    <para>You would need to get all the files from the last column,
	      and put them under <filename>/compat/linux</filename>, with the
	      names in the first column as symbolic links pointing to them.
	      This means you eventually have these files on your FreeBSD
	      system:</para>
	      
	      <informalexample>
		<screen>/compat/linux/usr/X11/lib/libXt.so.3.1.0
/compat/linux/usr/X11/lib/libXt.so.3 -&gt; libXt.so.3.1.0
/compat/linux/usr/X11/lib/libX11.so.3.1.0
/compat/linux/usr/X11/lib/libX11.so.3 -&gt; libX11.so.3.1.0
/compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -&gt; libc.so.4.6.29</screen>
	      </informalexample>

	    <note>
	      <para>Note that if you already have a Linux shared library with
		a matching major revision number to the first column of the
		<command>ldd</command> output, you will not need to copy the file named in the
		last column to your system, the one you already have should
		work. It is advisable to copy the shared library anyway if it
		is a newer version, though. You can remove the old one, as
		long as you make the symbolic link point to the new one. So,
		if you have these libraries on your system:</para>

		<informalexample>
		  <screen>/compat/linux/lib/libc.so.4.6.27
/compat/linux/lib/libc.so.4 -&gt; libc.so.4.6.27</screen>
		</informalexample>
	    
	      <para>and you find a new binary that claims to require a later
		version according to the output of <command>ldd</command>:</para>

		<informalexample>
		  <screen>libc.so.4 (DLL Jump 4.5pl26) -&gt; libc.so.4.6.29</screen>
		</informalexample>

	      <para>If it is only one or two versions out of date in the in
		the trailing digit then do not worry about copying
		<filename>/lib/libc.so.4.6.29</filename> too, because the
		program should work fine with the slightly older version.
		However, if you like you can decide to replace the
		<filename>libc.so</filename> anyway, and that should leave you
		with:</para>

		<informalexample>
		  <screen>/compat/linux/lib/libc.so.4.6.29
/compat/linux/lib/libc.so.4 -&gt; libc.so.4.6.29</screen>
		</informalexample>
	    </note>

	    <note>
	      <para>The symbolic link mechanism is <emphasis>only</emphasis>
		needed for Linux binaries. The FreeBSD runtime linker takes
		care of looking for matching major revision numbers itself and
		you do not need to worry about it.</para>
	    </note>
	  </sect3>
	  
	  <sect3>
	    <title>Configuring the <filename>ld.so</filename> &mdash; for FreeBSD
	      2.2-RELEASE only</title>
	    
	    <para>This section applies only to FreeBSD 2.2-RELEASE and later.
	      Those running 2.1-STABLE should skip this section.</para>
	    
	    <para>Finally, if you run FreeBSD 2.2-RELEASE you must make sure
	      that you have the Linux runtime linker and its config files on
	      your system. You should copy these files from the Linux system
	      to their appropriate place on your FreeBSD system (to the
	      <filename>/compat/linux</filename> tree):</para>

	      <informalexample>
		<screen>/compat/linux/lib/ld.so
/compat/linux/etc/ld.so.config</screen>
	      </informalexample>
	    
	    <para>If you do not have access to a Linux system, you should get
	      the extra files you need from various ftp sites. Information on
	      where to look for the various files is appended below. For now,
	      let us assume you know where to get the files.</para>
	    
	    <para>Retrieve the following files (all from the same ftp site to
	      avoid any version mismatches), and install them under
	      <filename>/compat/linux</filename> (i.e.
	      <filename>/foo/bar</filename> is installed as
	      <filename>/compat/linux/foo/bar</filename>):</para>

	      <informalexample>
		<screen>/sbin/ldconfig
/usr/bin/ldd
/lib/libc.so.x.y.z
/lib/ld.so</screen>
	      </informalexample>
	    
	    <para><command>ldconfig</command> and <command>ldd</command> do not necessarily need to be under
	      <filename>/compat/linux</filename>; you can install them
	      elsewhere in the system too. Just make sure they do not conflict
	      with their FreeBSD counterparts. A good idea would be to install
	      them in <filename>/usr/local/bin</filename> as <command>ldconfig-linux</command>
	      and <command>ldd-linux</command>.</para>
	    
	    <para>Create the file
	      <filename>/compat/linux/etc/ld.so.conf</filename>, containing
	      the directories in which the Linux runtime linker should look
	      for shared libs. It is a plain text file, containing a directory
	      name on each line. <filename>/lib</filename> and
	      <filename>/usr/lib</filename> are standard, you could add the
	      following:</para>

	      <programlisting>
/usr/X11/lib
/usr/local/lib
	      </programlisting>
	    
	    <para>When a linux binary opens a library such as
	      <filename>/lib/libc.so</filename> the emulator maps the name to
	      <filename>/compat/linux/lib/libc.so</filename> internally. All
	      linux libraries should be installed under /compat/linux (e.g.
	      <filename>/compat/linux/lib/libc.so</filename>,
	      <filename>/compat/linux/usr/X11/lib/libX11.so</filename>, etc.)
	      in order for the emulator to find them.</para>
	    
	    <para>Those running FreeBSD 2.2-RELEASE should run the Linux
	      ldconfig program.</para>

	      <informalexample>
		<screen>&prompt.root <userinput>cd /compat/linux/lib</userinput>
&prompt.root; <userinput>/compat/linux/sbin/ldconfig</userinput>
		</screen>
	      </informalexample>
	    
	    <para><command>ldconfig</command> is statically linked, so it does not need any
	      shared libraries to run. It creates the file
	      <filename>/compat/linux/etc/ld.so.cache</filename> which
	      contains the names of all the shared libraries and should be
	      rerun to recreate this file whenever you install additional
	      shared libraries.</para>
	    
	    <para>On 2.1-STABLE do not install
	      <filename>/compat/linux/etc/ld.so.cache</filename> or run
	      <command>ldconfig</command>; in 2.1-STABLE the syscalls are implemented differently
	      and <command>ldconfig</command> is not needed or used.</para>
	    
	    <para>You should now be set up for Linux binaries which only need
	      a shared libc. You can test this by running the Linux <command>ldd</command> on
	      itself. Supposing that you have it installed as <command>ldd-linux</command>, it
	      should produce something like:</para>

	      <informalexample>
		<screen>&prompt.root; <userinput>ldd-linux `which ldd-linux`</userinput>
libc.so.4 (DLL Jump 4.5pl26) =&gt; /lib/libc.so.4.6.29</screen>
	      </informalexample>
	    
	    <para>This being done, you are ready to install new Linux
	      binaries. Whenever you install a new Linux program, you should
	      check if it needs shared libraries, and if so, whether you have
	      them installed in the <filename>/compat/linux</filename> tree.
	      To do this, you run the Linux version <command>ldd</command> on the new program,
	      and watch its output. <command>ldd</command> (see also the manual page for <citerefentry><refentrytitle>ldd</refentrytitle><manvolnum>1</manvolnum></citerefentry>)
	      will print a list of shared libraries that the program depends
	      on, in the form <literal><replaceable>majorname</replaceable> (<replaceable>jumpversion</replaceable>) =&gt; <replaceable>fullname</replaceable></literal>.</para>
	    
	    <para>If it prints <literal>not found</literal> instead of <replaceable>fullname</replaceable> it means that
	      you need an extra library. The library needed is shown in
	      majorname and will be of the form <literal>lib<replaceable>XXXX</replaceable>.so.<replaceable>N</replaceable></literal>. You will need to
	      find a <filename>lib<replaceable>XXXX</replaceable>.so.N.mm</filename> on a Linux ftp site, and install it on
	      your system. The <replaceable>XXXX</replaceable> (name) and <replaceable>N</replaceable> (major revision number)
	      should match; the minor number(s) <replaceable>mm</replaceable> are less important, though
	      it is advised to take the most recent version.</para>
	    
	  </sect3>
	</sect2>
	
	<sect2>
	  <title>Configuring the host name resolver</title>
	  
	  <para>If DNS does not work or you get the messages

	    <informalexample>
	      <screen>resolv+: "bind" is an invalid keyword resolv+:
"hosts" is an invalid keyword</screen>
	    </informalexample>
	  
	  then you need to configure a
	    <filename>/compat/linux/etc/host.conf</filename> file containing:

	    <programlisting>
order hosts, bind
multi on
	    </programlisting>
	  
	  where the order here specifies that
	    <filename>/etc/hosts</filename> is searched first and DNS is
	    searched second. When
	    <filename>/compat/linux/etc/host.conf</filename> is not installed
	    linux applications find FreeBSD's
	    <filename>/etc/host.conf</filename> and complain about the
	    incompatible FreeBSD syntax. You should remove <literal>bind</literal> if you
	    have not configured a name-server using the
	    <filename>/etc/resolv.conf</filename> file.</para>
	  
	  <para>Lastly, those who run 2.1-STABLE need to set an the
	    <envar>RESOLV_HOST_CONF</envar> environment variable so that applications will
	    know how to search the host tables. If you run FreeBSD
	    2.2-RELEASE, you can skip this. For the
	    <filename>/bin/csh</filename> shell use:</para>

	    <informalexample>
	      <screen>&prompt.user; <userinput>setenv RESOLV_HOST_CONF /compat/linux/etc/host.conf</userinput></screen>
	    </informalexample>
	  
	  <para>For <filename>/bin/sh</filename> use:</para>

	    <informalexample>
	      <screen>&prompt.user; <userinput>RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF</userinput></screen>
	    </informalexample>
	  
	</sect2>
	
	<sect2>
	  <title>Finding the necessary files</title>

	  <note>
	    <para>The information below is valid as of the time this document
	      was written, but certain details such as names of ftp sites,
	      directories and distribution names may have changed by the time
	      you read this.</para>
	  </note>
	  
	  <para>Linux is distributed by several groups that make their own set
	    of binaries that they distribute. Each distribution has its own
	    name, like <quote>Slackware</quote> or <quote>Yggdrasil</quote>. The distributions are
	    available on a lot of ftp sites. Sometimes the files are unpacked,
	    and you can get the individual files you need, but mostly they are
	    stored in distribution sets, usually consisting of subdirectories
	    with gzipped tar files in them. The primary ftp sites for the
	    distributions are:</para>

	    <orderedlist>
	      <listitem>
		<para>sunsite.unc.edu:/pub/Linux/distributions</para>
	      </listitem>

	      <listitem>
		<para>tsx-11.mit.edu:/pub/linux/distributions</para>
	      </listitem>
	    </orderedlist>
	  
	  <para>Some European mirrors:</para>

	    <orderedlist>
	      <listitem>
		<para>ftp.luth.se:/pub/linux/distributions</para>
	      </listitem>

	      <listitem>
		<para>ftp.demon.co.uk:/pub/linux/distributions</para>
	      </listitem>

	      <listitem>
		<para>src.doc.ic.ac.uk:/packages/linux/distributions</para>
	      </listitem>
	    </orderedlist>
	  
	  
	  <para>For simplicity, let us concentrate on Slackware here. This
	    distribution consists of a number of subdirectories, containing
	    separate packages. Normally, they are controlled by an install
	    program, but you can retrieve files <quote>by hand</quote> too. First of all,
	    you will need to look in the <filename>contents</filename> subdir of the
	    distribution. You will find a lot of small text files here
	    describing the contents of the separate packages. The fastest way
	    to look something up is to retrieve all the files in the contents
	    subdirectory, and grep through them for the file you need. Here is
	    an example of a list of files that you might need, and in which
	    contents-file you will find it by grepping through them:</para>

	    <informaltable frame="none">
	      <tgroup cols="2">
		<thead>
		  <row>
		    <entry>Library</entry>
		    <entry>Package</entry>
		  </row>
		</thead>

		<tbody>
		  <row><entry><filename>ld.so</filename> </entry><entry>ldso
		    </entry></row>
		  <row><entry><filename>ldconfig</filename>
		    </entry><entry>ldso </entry></row>
		  <row><entry><filename>ldd</filename> </entry><entry>ldso
		    </entry></row>
		  <row><entry><filename>libc.so.4</filename>
		    </entry><entry>shlibs </entry></row>
		  <row><entry><filename>libX11.so.6.0</filename>
		    </entry><entry>xf_lib
		    </entry></row>
		  <row><entry><filename>libXt.so.6.0</filename>
		    </entry><entry>xf_lib
		    </entry></row>
		  <row><entry><filename>libX11.so.3</filename>
		    </entry><entry>oldlibs
		    </entry></row>
		  <row><entry><filename>libXt.so.3</filename>
		    </entry><entry>oldlibs
		    </entry></row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  
	  <para>So, in this case, you will need the packages ldso, shlibs,
	    xf_lib and oldlibs. In each of the contents-files for these
	    packages, look for a line saying <literal>PACKAGE LOCATION</literal>, it will
	    tell you on which <quote>disk</quote> the package is, in our case it will tell
	    us in which subdirectory we need to look. For our example, we
	    would find the following locations:</para>

	    <informaltable frame="none">
	      <tgroup cols="2">
		<thead
		  <row>
		    <entry>Package</entry>
		    <entry>Location</entry>
		  </row>
		</thead>
		
		<tbody>
		  <row><entry>ldso </entry><entry>diska2 </entry></row>
		  <row><entry>shlibs </entry><entry>diska2 </entry></row>
		  <row><entry>oldlibs </entry><entry>diskx6 </entry></row>
		  <row><entry>xf_lib </entry><entry>diskx9 </entry></row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  
	  <para>The locations called <quote>disk<replaceable>XX</replaceable></quote> refer to the <filename>slakware/<replaceable>XX</replaceable></filename>
	    subdirectories of the distribution, others may be found in the
	    <filename>contrib</filename> subdirectory. In this case, we
	    could now retrieve the packages we need by retrieving the
	    following files (relative to the root of the Slackware
	    distribution tree):</para>
	  
	    <itemizedlist>
	      <listitem>
		<para><filename>slakware/a2/ldso.tgz</filename></para>
	      </listitem>

	      <listitem>
		<para><filename>slakware/a2/shlibs.tgz</filename></para>
	      </listitem>

	      <listitem>
		<para><filename>slakware/x6/oldlibs/tgz</filename></para>
	      </listitem>

	      <listitem>
		<para><filename>slakware/x9/xf_lib.tgz</filename></para>
	      </listitem>
	    </itemizedlist>
	  
	  
	  <para>Extract the files from these gzipped tarfiles in your
	    <filename>/compat/linux</filename> directory (possibly omitting or
	    afterwards removing files you do not need), and you are
	    done.</para>
	  
	  <para><emphasis>See also:</emphasis>
	    <filename>ftp.freebsd.org:pub/FreeBSD/2.0.5-RELEASE/xperimnt/linux-emu/README</filename> and <filename>/usr/src/sys/i386/ibcs2/README.iBCS2</filename></para>
	  
	</sect2>
      </sect1>
      
      <sect1 id="mathematica">
	<title>How to Install Mathematica on FreeBSD</title>
	
	<para><emphasis>Contributed by &a.rich; and
	    &a.chuck;</emphasis></para>
	
	<para>This document shows how to install the Linux binary distribution
	  of Mathematica 2.2 on FreeBSD 2.1.</para>
	
	<para>Mathematica supports Linux but not FreeBSD as it stands. So
	  once you have configured your system for Linux compatibility you
	  have most of what you need to run Mathematica.</para>
	
	<para>For those who already have the student edition of Mathematica
	  for DOS the cost of upgrading to the Linux version at the time this
	  was written, March 1996, was &#36;45.00. It can be ordered directly
	  from Wolfram at (217) 398-6500 and paid for by credit card.</para>
	
	
	<sect2>
	  <title>Unpacking the Mathematica distribution</title>
	  
	  <para>The binaries are currently distributed by Wolfram on CDROM.
	    The CDROM has about a dozen tar files, each of which is a binary
	    distribution for one of the supported architectures. The one for
	    Linux is named <filename>LINUX.TAR</filename>. You can, for
	    example, unpack this into
	    <filename>/usr/local/Mathematica</filename>:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /usr/local</userinput>
&prompt.root; <userinput>mkdir Mathematica</userinput>
&prompt.root; <userinput>cd Mathematica</userinput>
&prompt.root; <userinput>tar -xvf /cdrom/LINUX.TAR</userinput></screen>
	    </informalexample>
	  
	</sect2>
	
	<sect2>
	  <title>Obtaining your Mathematica Password</title>
	  
	  <para>Before you can run Mathematica you will have to obtain a
	    password from Wolfram that corresponds to your <quote>machine
	    ID</quote>.</para>
	  
	  <para>Once you have installed the linux compatibility runtime
	    libraries and unpacked the mathematica you can obtain the <quote>machine
	      ID</quote> by running the program <command>mathinfo</command> in the Install directory.</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /usr/local/Mathematica/Install</userinput>
&prompt.root; <userinput>mathinfo</userinput>
LINUX: 'ioctl' fd=5, typ=0x89(), num=0x27 not implemented
richc.isdn.bcm.tmc.edu   9845-03452-90255</screen>
	    </informalexample>

	  <para>So, for example, the <quote>machine ID</quote> of <hostid>richc</hostid> is
	    <literal>9845-03452-90255</literal>. You can ignore the message about the ioctl
	    that is not implemented. It will not prevent Mathematica from
	    running in any way and you can safely ignore it, though you will
	    see the message every time you run Mathematica.</para>
	  
	  <para>When you register with Wolfram, either by email, phone or fax,
	    you will give them the <quote>machine ID</quote> and they will respond with a
	    corresponding password consisting of groups of numbers. You need
	    to add them both along with the machine name and license number in
	    your mathpass file.</para>
	  
	  <para>You can do this by invoking:</para>

	    <informalexample>
	      <screen>&prompt.root; <userinput>cd /usr/local/Mathematica/Install</userinput>
&prompt.root; <userinput>math.install</userinput></screen>
	    </informalexample>

	  <para>It will ask you to enter your license number
	    and the Wolfram supplied password. If you get them mixed up or
	    for some reason the math.install fails, that is OK; you can simply
	    edit the file <filename>mathpass</filename> in this same directory to correct the
	    info manually.</para>
	  
	  <para>After getting past the password, math.install will ask you if
	    you accept the install defaults provided, or if you want to use
	    your own. If you are like us and distrust all install programs,
	    you probably want to specify the actual directories. Beware.
	    Although the math.install program asks you to specify directories,
	    it will not create them for you, so you should perhaps have a
	    second window open with another shell so that you can create them
	    before you give them to the install program. Or, if it fails, you
	    can create the directories and then restart the <command>math.install</command>
	    program. The directories we chose to create beforehand and
	    specify to <command>math.install</command> were:</para>

	    <informaltable frame="none">
	      <tgroup cols="2">
		<tbody>
		  <row>
		    <entry><filename>/usr/local/Mathematica/bin</filename></entry>
		    <entry>for binaries</entry>
		  </row>

		  <row>
		    <entry><filename>/usr/local/Mathematica/man/man1</filename></entry>
		    <entry>for man pages</entry>
		  </row>

		  <row>
		    <entry>/usr/local/Mathematica/lib/X11</entry>
		    <entry>for the XKeysymb file</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>

	  <para>You can also tell it to use
	    <filename>/tmp/math.record</filename> for the system record file,
	    where it puts logs of sessions. After this <command>math.install</command> will
	    continue on to unpacking things and placing everything where it
	    should go.</para>
	  
	  <para>The Mathematica Notebook feature is included separately, as
	    the X Front End, and you have to install it separately. To get the
	    X Front End stuff correctly installed, cd into the
	    <filename>/usr/local/Mathematica/FrontEnd</filename> directory and
	    execute the <command>xfe.install</command> shell script. You will have to tell it
	    where to put things, but you do not have to create any directories
	    because it will use the same directories that had been created for
	    math.install. When it finishes, there should be a new shell script
	    in <filename>/usr/local/Mathematica/bin</filename> called
	    <filename>mathematica</filename>.</para>
	  
	  <para>Lastly, you need to modify each of the shell scripts that
	    Mathematica has installed. At the beginning of every shell script
	    in <filename>/usr/local/Mathematica/bin</filename> add the
	    following line:</para>

	    <informalexample>
	      <screen>&prompt.user; <userinput>XKEYSYMDB=/usr/local/Mathematica/lib/X11/XKeysymDB; export XKEYSYMDB</userinput></screen>
	    </informalexample>

	  <para>This tells Mathematica were to find its own
	    version of the key mapping file <filename>XKeysymDB</filename>.
	    Without this you will get pages of error messages about missing
	    key mappings.</para>
	  
	  <para>On 2.1-STABLE you need to add the following as well:</para>

	    <informalexample>
	      <screen>&prompt.user; <userinput>RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF</userinput></screen>
	    </informalexample>

	  <para>This tells Mathematica to use the linux version
	    of host.conf. This file has a different syntax from FreeBSD's
	    host.conf, so you will get an error message about
	    <filename>/etc/host.conf</filename> if you leave this out.</para>
	  
	  <para>You might also want to modify your
	    <filename>/etc/manpath.config</filename> file to read the new man
	    directory, and you may need to edit your
	    <filename>~/.cshrc</filename> file to add
	    <filename>/usr/local/Mathematica/bin</filename> to your
	    path.</para>
	  
	  <para>That is about all it takes. With this you should be able to
	    type <command>mathematica</command> and get a really slick looking Mathematica
	    Notebook screen up. Mathematica has included the Motif user
	    interfaces, but it is compiled in statically, so you do not need
	    the Motif libraries. Good luck doing this yourself!</para>
	  
	</sect2>
	
	<sect2>
	  <title>Bugs</title>
	  
	  <para>The Notebook front end is known to hang sometimes when reading
	    notebook files with an error messages similar to:</para>
	  
	    <informalexample>
	      <screen><errorname>File .../Untitled-1.mb appears to be broken for OMPR.257.0</errorname></screen>
	    </informalexample>
	  
	  <para>We have not found the cause for this, but it only affects the
	    Notebook's X Window front end, not the mathematica engine itself.
	    So the command line interface invoked by 'math' is unaffected by
	    this bug.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Acknowledgments</title>
	  
	  <para>A well-deserved thanks should go to &a.sos; and &a.peter; who
	    made linux emulation what it is today, and Michael Smith who drove
	    these two guys like dogs to get it to the point where it runs
	    Linux binaries better than linux! :-)</para>
	  
	</sect2>
      </sect1>
    </chapter>
    
    <chapter>
      <title>FreeBSD Internals</title>
      
      
      <sect1 id="booting">
	<title>The FreeBSD Booting Process</title>
	
	<para><emphasis>Contributed by &a.phk;. v1.1, April
	    26th.</emphasis></para>
	
	<para>Booting FreeBSD is essentially a three step process: load the
	  kernel, determine the root filesystem and initialize user-land
	  things. This leads to some interesting possibilities shown
	  below.</para>
	
	
	<sect2>
	  <title>Loading a kernel</title>
	  
	  <para>We presently have three basic mechanisms for loading the
	    kernel as described below: they all pass some information to the
	    kernel to help the kernel decide what to do next.</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>Biosboot</term>
		<listitem>
		  <para>Biosboot is our <quote>bootblocks</quote>. It consists of two
		    files which will be installed in the first 8Kbytes of the
		    floppy or hard-disk slice to be booted from.</para>
		  
		  <para>Biosboot can load a kernel from a FreeBSD
		    filesystem.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Dosboot</term>
		
		<listitem>
		  <para>Dosboot was written by DI. Christian Gusenbauer, and
		    is unfortunately at this time one of the few pieces of
		    code that will not compile under FreeBSD itself because it
		    is written for Microsoft compilers.</para>
		  
		  <para>Dosboot will boot the kernel from a MS-DOS file or
		    from a FreeBSD filesystem partition on the disk. It
		    attempts to negotiate with the various and strange kinds
		    of memory manglers that lurk in high memory on MS/DOS
		    systems and usually wins them for its case.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Netboot</term>
		
		<listitem>
		  <para>Netboot will try to find a supported Ethernet card,
		    and use BOOTP, TFTP and NFS to find a kernel file to
		    boot.</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Determine the root filesystem</title>
	  
	  <para>Once the kernel is loaded and the boot-code jumps to it, the
	    kernel will initialize itself, trying to determine what hardware
	    is present and so on; it then needs to find a root
	    filesystem.</para>
	  
	  <para>Presently we support the following types of root
	    filesystems:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>UFS</term>
		<listitem>
		  <para>This is the most normal type of root filesystem. It
		    can reside on a floppy or on hard disk.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>MSDOS</term>
		
		<listitem>
		  <para>While this is technically possible, it is not
		    particular useful because of the <acronym>FAT</acronym> filesystem's
		    inability to deal with links, device nodes and other such
		    <quote>UNIXisms</quote>.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>MFS</term>
		
		<listitem>
		  <para>This is actually a UFS filesystem which has been
		    compiled into the kernel. That means that the kernel does
		    not really need any hard disks, floppies or other hardware
		    to function.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>CD9660</term>
		
		<listitem>
		  <para>This is for using a CD-ROM as root filesystem.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>NFS</term>
		
		<listitem>
		  <para>This is for using a fileserver as root filesystem,
		    basically making it a diskless machine.</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Initialize user-land things</title>
	  
	  <para>To get the user-land going, the kernel, when it has finished
	    initialization, will create a process with <literal>pid ==
	      1</literal> and execute a program on the root filesystem; this
	    program is normally <filename>/sbin/init</filename>.</para>
	  
	  <para>You can substitute any program for
	    <command>/sbin/init</command>, as long as you keep in mind
	    that:</para>
	  
	  <para>there is no stdin/out/err unless you open it yourself. If you
	    exit, the machine panics. Signal handling is special for
	    <literal>pid == 1</literal>.</para>
	  
	  <para>An example of this is the
	    <command>/stand/sysinstall</command> program on the
	    installation floppy.</para>
	  
	</sect2>
	
	<sect2>
	  <title>Interesting combinations</title>
	  
	  <para>Boot a kernel with a MFS in it with a special
	    <filename>/sbin/init</filename> which...</para>
	    
	    <variablelist>
	      <varlistentry><term>A &mdash; Using DOS</term>
		<listitem>
		  
		    <itemizedlist>
		      
		      <listitem>
			<para>mounts your <filename>C:</filename> as
			  <filename>/C:</filename></para>
		      </listitem>
		      
		      <listitem>
			<para>Attaches <filename>C:/freebsd.fs</filename> on
			  <filename>/dev/vn0</filename></para>
		      </listitem>
		      
		      <listitem>
			<para>mounts <filename>/dev/vn0</filename> as
			  <filename>/rootfs</filename></para>
		      </listitem>
		      
		      <listitem>
			<para>makes symlinks<!-- <br> -->
			  <filename>/rootfs/bin</filename> -&gt;
			  <filename>/bin</filename><!-- <br> -->
			  <filename>/rootfs/etc</filename> -&gt;
			  <filename>/etc</filename><!-- <br> -->
			  <filename>/rootfs/sbin</filename> -&gt;
			  <filename>/sbin</filename><!-- <br> --> (etc...)<!--
			<br> --></para>
		      </listitem>
		      
		    </itemizedlist>
		  
		  
		  <para>Now you are running FreeBSD without repartitioning
		    your hard disk...</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>B &mdash; Using NFS</term>
		
		<listitem>
		  <para>NFS mounts your
		    <filename>server:~you/FreeBSD</filename> as
		    <filename>/nfs</filename>, chroots to
		    <filename>/nfs</filename> and executes
		    <filename>/sbin/init</filename> there</para>
		  
		  <para>Now you are running FreeBSD diskless, even though you
		    do not control the NFS server...</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>C &mdash; Start an X-server</term>
		
		<listitem>
		  <para>Now you have an X-terminal, which is better than that
		    dingy X-under-windows-so-slow-you-can-see-what-it-does
		    thing that your boss insist is better than forking out
		    money on hardware.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>D &mdash; Using a tape</term>
		
		<listitem>
		  <para>Takes a copy of <filename>/dev/rwd0</filename> and
		    writes it to a remote tape station or fileserver.</para>
		  
		  <para>Now you finally get that backup you should have made a
		    year ago...</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>E &mdash; Acts as a firewall/web-server/what do I
		  know...</term>
		
		<listitem>
		  <para>This is particularly interesting since you can boot
		    from a write- protected floppy, but still write to your
		    root filesystem...</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	</sect2>
      </sect1>
      
      <sect1 id="memoryuse">
	<title>PC Memory Utilization</title>
	
	<para><emphasis>Contributed by &a.joerg;.<!-- <br> --> 16 Apr
	    1995.</emphasis></para>
	
	<para><emphasis>A short description of how FreeBSD uses memory on the
	    i386  platform</emphasis></para>
	
	<para>The boot sector will be loaded at <literal>0:0x7c00</literal>,
	  and relocates itself immediately to <literal>0x7c0:0</literal>.
	  (This is nothing magic, just an adjustment for the
	  <literal>%cs</literal> selector, done by an <literal>ljmp</literal>.)</para>
	
	<para>It then loads the first 15 sectors at <literal>0x10000</literal>
	  (segment <makevar>BOOTSEG</makevar> in the biosboot Makefile), and sets up the stack to
	  work below <literal>0x1fff0</literal>. After this, it jumps to the
	  entry of boot2 within that code. I.e., it jumps over itself and the
	  (dummy) partition table, and it is going to adjust the %cs
	  selector&mdash;we are still in 16-bit mode there.</para>
	
	<para>boot2 asks for the boot file, and examines the
	  <filename>a.out</filename> header. It masks the file entry point
	  (usually <literal>0xf0100000</literal>) by
	  <literal>0x00ffffff</literal>, and loads the file there. Hence the
	  usual load point is 1 MB (<literal>0x00100000</literal>). During
	  load, the boot code toggles back and forth between real and
	  protected mode, to use the BIOS in real mode.</para>
	
	<para>The boot code itself uses segment selectors
	  <literal>0x18</literal> and <literal>0x20</literal> for
	  <literal>%cs</literal> and <literal>%ds/%es</literal> in
	  protected mode, and <literal>0x28</literal> to jump back into real
	  mode. The kernel is finally started with <literal>%cs</literal> <literal>0x08</literal> and
	  <literal>%ds/%es/%ss</literal> <literal>0x10</literal>, which
	  refer to dummy descriptors covering the entire address space.</para>
	
	<para>The kernel will be started at its load point. Since it has been
	  linked for another (high) address, it will have to execute PIC until
	  the page table and page directory stuff is setup properly, at which
	  point paging will be enabled and the kernel will finally run at the
	  address for which it was linked.</para>
	
	<para><emphasis>Contributed by &a.davidg;.<!-- <br> --> 16 Apr
	    1995.</emphasis></para>
	
	<para>The physical pages immediately following the kernel BSS contain
	  proc0's page directory, page tables, and upages. Some time later
	  when the VM system is initialized, the physical memory between
	  <literal>0x1000-0x9ffff</literal> and the physical memory after the
	  kernel (text+data+bss+proc0 stuff+other misc) is made available in
	  the form of general VM pages and added to the global free page
	  list.</para>
	
      </sect1>
      
      <sect1 id="dma">
	<title>DMA: What it Is and How it Works</title>
	
	<para><emphasis>Copyright &copy; 1995,1997 &a.uhclem;, All Rights
	    Reserved.<!-- <br> --> 10 December 1996. Last Update 8 October
	    1997.</emphasis></para>
	
	<para>Direct Memory Access (DMA) is a method of allowing data to be
	  moved from one location to another in a computer without
	  intervention from the central processor (CPU).</para>
	
	<para>The way that the DMA function is implemented varies between
	  computer architectures, so this discussion will limit itself to the
	  implementation and workings of the DMA subsystem on the IBM Personal
	  Computer (PC), the IBM PC/AT and all of its successors and
	  clones.</para>
	
	<para>The PC DMA subsystem is based on the Intel 8237 DMA controller.
	  The 8237 contains four DMA channels that can be programmed
	  independently and any one of the channels may be active at any
	  moment. These channels are numbered 0, 1, 2 and 3. Starting with
	  the PC/AT, IBM added a second 8237 chip, and numbered those channels
	  4, 5, 6 and 7.</para>
	
	<para>The original DMA controller (0, 1, 2 and 3) moves one byte in
	  each transfer. The second DMA controller (4, 5, 6, and 7) moves
	  16-bits from two adjacent memory locations in each transfer, with
	  the first byte always coming from an even-numbered address. The two
	  controllers are identical components and the difference in transfer
	  size is caused by the way the second controller is wired into the
	  system.</para>
	
	<para>The 8237 has two electrical signals for each channel, named DRQ
	  and -DACK. There are additional signals with the names HRQ (Hold
	  Request), HLDA (Hold Acknowledge), -EOP (End of Process), and the
	  bus control signals -MEMR (Memory Read), -MEMW (Memory Write), -IOR
	  (I/O Read), and -IOW (I/O Write).</para>
	
	<para>The 8237 DMA is known as a <quote>fly-by</quote> DMA controller. This
	  means that the data being moved from one location to another does
	  not pass through the DMA chip and is not stored in the DMA chip.
	  Subsequently, the DMA can only transfer data between an I/O port and
	  a memory address, but not between two I/O ports or two memory
	  locations.</para>
	
	<note>
	  <para>The 8237 does allow two channels to be connected together to
	    allow memory-to-memory DMA operations in a
	    non-<quote>fly-by</quote> mode, but nobody in the PC industry uses
	    this scarce resource this way since it is faster to move data
	    between memory locations using the CPU.</para>
	</note>
	
	<para>In the PC architecture, each DMA channel is normally activated
	  only when the hardware that uses a given DMA channel requests a
	  transfer by asserting the DRQ line for that channel.</para>
	
	
	<sect2>
	  <title>A Sample DMA transfer</title>
	  
	  <para>Here is an example of the steps that occur to cause and
	    perform a DMA transfer. In this example, the floppy disk
	    controller (FDC) has just read a byte from a diskette and wants
	    the DMA to place it in memory at location 0x00123456. The process
	    begins by the FDC asserting the DRQ2 signal (the DRQ line for DMA
	    channel 2) to alert the DMA controller.</para>
	  
	  <para>The DMA controller will note that the DRQ2 signal is asserted.
	    The DMA controller will then make sure that DMA channel 2 has been
	    programmed and is unmasked (enabled). The DMA controller also
	    makes sure that none of the other DMA channels are active or want
	    to be active and have a higher priority. Once these checks are
	    complete, the DMA asks the CPU to release the bus so that the DMA
	    may use the bus. The DMA requests the bus by asserting the HRQ
	    signal which goes to the CPU.</para>
	  
	  <para>The CPU detects the HRQ signal, and will complete executing
	    the current instruction. Once the processor has reached a state
	    where it can release the bus, it will. Now all of the signals
	    normally generated by the CPU (-MEMR, -MEMW, -IOR, -IOW and a few
	    others) are placed in a tri-stated condition (neither high or low)
	    and then the CPU asserts the HLDA signal which tells the DMA
	    controller that it is now in charge of the bus.</para>
	  
	  <para>Depending on the processor, the CPU may be able to execute a
	    few additional instructions now that it no longer has the bus, but
	    the CPU will eventually have to wait when it reaches an
	    instruction that must read something from memory that is not in
	    the internal processor cache or pipeline.</para>
	  
	  <para>Now that the DMA <quote>is in charge</quote>, the DMA activates its
	    -MEMR, -MEMW, -IOR, -IOW output signals, and the address outputs
	    from the DMA are set to 0x3456, which will be used to direct the
	    byte that is about to transferred to a specific memory
	    location.</para>
	  
	  <para>The DMA will then let the device that requested the DMA
	    transfer know that the transfer is commencing. This is done by
	    asserting the -DACK signal, or in the case of the floppy disk
	    controller, -DACK2 is asserted.</para>
	  
	  <para>The floppy disk controller is now responsible for placing the
	    byte to be transferred on the bus Data lines. Unless the floppy
	    controller needs more time to get the data byte on the bus (and if
	    the peripheral does need more time it alerts the DMA via the READY
	    signal), the DMA will wait one DMA clock, and then de-assert the
	    -MEMW and -IOR signals so that the memory will latch and store the
	    byte that was on the bus, and the FDC will know that the byte has
	    been transferred.</para>
	  
	  <para>Since the DMA cycle only transfers a single byte at a time,
	    the FDC now drops the DRQ2 signal, so the DMA knows that it is no
	    longer needed. The DMA will de-assert the -DACK2 signal, so that
	    the FDC knows it must stop placing data on the bus.</para>
	  
	  <para>The DMA will now check to see if any of the other DMA channels
	    have any work to do. If none of the channels have their DRQ lines
	    asserted, the DMA controller has completed its work and will now
	    tri-state the -MEMR, -MEMW, -IOR, -IOW and address signals.</para>
	  
	  <para>Finally, the DMA will de-assert the HRQ signal. The CPU sees
	    this, and de-asserts the HOLDA signal. Now the CPU activates its
	    -MEMR, -MEMW, -IOR, -IOW and address lines, and it resumes
	    executing instructions and accessing main memory and the
	    peripherals.</para>
	  
	  <para>For a typical floppy disk sector, the above process is
	    repeated 512 times, once for each byte. Each time a byte is
	    transferred, the address register in the DMA is incremented and
	    the counter in the DMA that shows how many bytes are to be
	    transferred is decremented.</para>
	  
	  <para>When the counter reaches zero, the DMA asserts the EOP signal,
	    which indicates that the counter has reached zero and no more data
	    will be transferred until the DMA controller is reprogrammed by
	    the CPU. This event is also called the Terminal Count (TC).
	    There is only one EOP signal, and since only DMA channel can be
	    active at any instant, the DMA channel that is currently active
	    must be the DMA channel that just completed its task.</para>
	  
	  <para>If a peripheral wants to generate an interrupt when the
	    transfer of a buffer is complete, it can test for its -DACKn
	    signal and the EOP signal both being asserted at the same time.
	    When that happens, it means the DMA will not transfer any more
	    information for that peripheral without intervention by the CPU.
	    The peripheral can then assert one of the interrupt signals to get
	    the processors' attention. In the PC architecture, the DMA chip
	    itself is not capable of generating an interrupt. The peripheral
	    and its associated hardware is responsible for generating any
	    interrupt that occurs. Subsequently, it is possible to have a
	    peripheral that uses DMA but does not use interrupts.</para>
	  
	  <para>It is important to understand that although the CPU always
	    releases the bus to the DMA when the DMA makes the request, this
	    action is invisible to both applications and the operating
	    systems, except for slight changes in the amount of time the
	    processor takes to execute instructions when the DMA is active.
	    Subsequently, the processor must poll the peripheral, poll the
	    registers in the DMA chip, or receive an interrupt from the
	    peripheral to know for certain when a DMA transfer has
	    completed.</para>
	  
	</sect2>
	
	<sect2>
	  <title>DMA Page Registers and 16Meg address space
	    limitations</title>
	  
	  <para>You may have noticed earlier that instead of the DMA setting
	    the address lines to 0x00123456 as we said earlier, the DMA only
	    set 0x3456. The reason for this takes a bit of explaining.</para>
	  
	  <para>When the original IBM PC was designed, IBM elected to use both
	    DMA and interrupt controller chips that were designed for use with
	    the 8085, an 8-bit processor with an address space of 16 bits
	    (64K). Since the IBM PC supported more than 64K of memory,
	    something had to be done to allow the DMA to read or write memory
	    locations above the 64K mark. What IBM did to solve this problem
	    was to add an external data latch for each DMA channel that holds
	    the upper bits of the address to be read to or written from.
	    Whenever a DMA channel is active, the contents of that latch are
	    written to the address bus and kept there until the DMA operation
	    for the channel ends. IBM called these latches <quote>Page
	    Registers</quote>.</para>
	  
	  <para>So for our example above, the DMA would put the 0x3456 part of
	    the address on the bus, and the Page Register for DMA channel 2
	    would put 0x0012xxxx on the bus. Together, these two values form
	    the complete address in memory that is to be accessed.</para>
	  
	  <para>Because the Page Register latch is independent of the DMA
	    chip, the area of memory to be read or written must not span a 64K
	    physical boundary. For example, if the DMA accesses memory
	    location 0xffff, after that transfer the DMA will then increment
	    the address register and the DMA will access the next byte at
	    location 0x0000, not 0x10000. The results of letting this happen
	    are probably not intended.</para>
	  
	  <note>
	    <para><quote>Physical</quote> 64K boundaries should not be
	      confused with 8086-mode 64K <quote>Segments</quote>, which are
	      created by mathematically adding a segment register with an
	      offset register. Page Registers have no address overlap and are
	      mathematically OR-ed together.</para>
	  </note>
	  
	  <para>To further complicate matters, the external DMA address
	    latches on the PC/AT hold only eight bits, so that gives us
	    8+16=24 bits, which means that the DMA can only point at memory
	    locations between 0 and 16Meg. For newer computers that allow
	    more than 16Meg of memory, the standard PC-compatible DMA cannot
	    access memory locations above 16Meg.</para>
	  
	  <para>To get around this restriction, operating systems will reserve
	    a RAM buffer in an area below 16Meg that also does not span a
	    physical 64K boundary. Then the DMA will be programmed to
	    transfer data from the peripheral and into that buffer. Once the
	    DMA has moved the data into this buffer, the operating system will
	    then copy the data from the buffer to the address where the data
	    is really supposed to be stored.</para>
	  
	  <para>When writing data from an address above 16Meg to a DMA-based
	    peripheral, the data must be first copied from where it resides
	    into a buffer located below 16Meg, and then the DMA can copy the
	    data from the buffer to the hardware. In FreeBSD, these reserved
	    buffers are called <quote>Bounce Buffers</quote>. In the MS-DOS world, they
	    are sometimes called <quote>Smart Buffers</quote>.</para>
	  
	  <note>
	    <para>A new implementation of the 8237, called the 82374, allows
	      16 bits of page register to be specified, allows access to the
	      entire 32 bit address space, without the use of bounce
	      buffers.</para>
	  </note>
	</sect2>
	
	<sect2>
	  <title>DMA Operational Modes and Settings</title>
	  
	  <para>The 8237 DMA can be operated in several modes. The main ones
	    are:</para>
	  
	  
	    <variablelist>
	      <varlistentry><term>Single</term>
		<listitem>
		  <para>A single byte (or word) is transferred. The DMA must
		    release and re-acquire the bus for each additional byte.
		    This is commonly-used by devices that cannot transfer the
		    entire block of data immediately. The peripheral will
		    request the DMA each time it is ready for another
		    transfer.</para>
		  
		  <para>The standard PC-compatible floppy disk controller (NEC
		    765) only has a one-byte buffer, so it uses this
		    mode.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Block/Demand</term>
		
		<listitem>
		  <para>Once the DMA acquires the system bus, an entire block
		    of data is transferred, up to a maximum of 64K. If the
		    peripheral needs additional time, it can assert the READY
		    signal to suspend the transfer briefly. READY should not
		    be used excessively, and for slow peripheral transfers,
		    the Single Transfer Mode should be used instead.</para>
		  
		  <para>The difference between Block and Demand is that once a
		    Block transfer is started, it runs until the transfer
		    count reaches zero. DRQ only needs to be asserted until
		    -DACK is asserted. Demand Mode will transfer one more
		    bytes until DRQ is de-asserted, at which point the DMA
		    suspends the transfer and releases the bus back to the
		    CPU. When DRQ is asserted later, the transfer resumes
		    where it was suspended.</para>
		  
		  <para>Older hard disk controllers used Demand Mode until CPU
		    speeds increased to the point that it was more efficient
		    to transfer the data using the CPU, particularly if the
		    memory locations used in the transfer were above the 16Meg
		    mark.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Cascade</term>
		
		<listitem>
		  <para>This mechanism allows a DMA channel to request the
		    bus, but then the attached peripheral device is
		    responsible for placing the addressing information on the
		    bus instead of the DMA. This is also used to implement a
		    technique known as <quote>Bus Mastering</quote>.</para>
		  
		  <para>When a DMA channel in Cascade Mode receives control of
		    the bus, the DMA does not place addresses and I/O control
		    signals on the bus like the DMA normally does when it is
		    active. Instead, the DMA only asserts the -DACK signal
		    for the active DMA channel.</para>
		  
		  <para>At this point it is up to the peripheral connected to
		    that DMA channel to provide address and bus control
		    signals. The peripheral has complete control over the
		    system bus, and can do reads and/or writes to any address
		    below 16Meg. When the peripheral is finished with the
		    bus, it de-asserts the DRQ line, and the DMA controller
		    can then return control to the CPU or to some other DMA
		    channel.</para>
		  
		  <para>Cascade Mode can be used to chain multiple DMA
		    controllers together, and this is exactly what DMA Channel
		    4 is used for in the PC architecture. When a peripheral
		    requests the bus on DMA channels 0, 1, 2 or 3, the slave
		    DMA controller asserts HLDREQ, but this wire is actually
		    connected to DRQ4 on the primary DMA controller instead of
		    to the CPU. The primary DMA controller, thinking it has
		    work to do on Channel 4, requests the bus from the CPU
		    using HLDREQ signal. Once the CPU grants the bus to the
		    primary DMA controller, -DACK4 is asserted, and that wire
		    is actually connected to the HLDA signal on the slave DMA
		    controller. The slave DMA controller then transfers data
		    for the DMA channel that requested it (0, 1, 2 or 3), or
		    the slave DMA may grant the bus to a peripheral that wants
		    to perform its own bus-mastering, such as a SCSI
		    controller.</para>
		  
		  <para>Because of this wiring arrangement, only DMA channels
		    0, 1, 2, 3, 5, 6 and 7 are usable with peripherals on
		    PC/AT systems.</para>
		  
		  <note>
		    <para>DMA channel 0 was reserved for refresh operations in
		      early IBM PC computers, but is generally available for
		      use by peripherals in modern systems.</para>
		  </note>
		  
		  <para>When a peripheral is performing Bus Mastering, it is
		    important that the peripheral transmit data to or from
		    memory constantly while it holds the system bus. If the
		    peripheral cannot do this, it must release the bus
		    frequently so that the system can perform refresh
		    operations on main memory.</para>
		  
		  <para>The Dynamic RAM used in all PCs for main memory must
		    be accessed frequently to keep the bits stored in the
		    components <quote>charged</quote>. Dynamic RAM essentially consists of
		    millions of capacitors with each one holding one bit of
		    data. These capacitors are charged with power to
		    represent a <literal>1</literal> or drained to represent a <literal>0</literal>. Because
		    all capacitors leak, power must be added at regular
		    intervals to keep the <literal>1</literal> values intact. The RAM chips
		    actually handle the task of pumping power back into all of
		    the appropriate locations in RAM, but they must be told
		    when to do it by the rest of the computer so that the
		    refresh activity won't interfere with the computer wanting
		    to access RAM normally. If the computer is unable to
		    refresh memory, the contents of memory will become
		    corrupted in just a few milliseconds.</para>
		  
		  <para>Since memory read and write cycles <quote>count</quote> as
		    refresh cycles (a dynamic RAM refresh cycle is actually an
		    incomplete memory read cycle), as long as the peripheral
		    controller continues reading or writing data to sequential
		    memory locations, that action will refresh all of
		    memory.</para>
		  
		  <para>Bus-mastering is found in some SCSI host interfaces
		    and other high-performance peripheral controllers.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>Autoinitialize</term>
		
		<listitem>
		  <para>This mode causes the DMA to perform Byte, Block or
		    Demand transfers, but when the DMA transfer counter
		    reaches zero, the counter and address are set back to
		    where they were when the DMA channel was originally
		    programmed. This means that as long as the peripheral
		    requests transfers, they will be granted. It is up to the
		    CPU to move new data into the fixed buffer ahead of where
		    the DMA is about to transfer it when doing output
		    operations, and read new data out of the buffer behind
		    where the DMA is writing when doing input
		    operations.</para>
		  
		  <para>This technique is frequently used on audio devices
		    that have small or no hardware <quote>sample</quote> buffers. There
		    is additional CPU overhead to manage this <quote>circular</quote>
		    buffer, but in some cases this may be the only way to
		    eliminate the latency that occurs when the DMA counter
		    reaches zero and the DMA stops transfers until it is
		    reprogrammed.</para>
		  
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Programming the DMA</title>
	  
	  <para>The DMA channel that is to be programmed should always be
	    <quote>masked</quote> before loading any settings. This is because the
	    hardware might unexpectedly assert the DRQ for that channel, and
	    the DMA might respond, even though not all of the parameters have
	    been loaded or updated.</para>
	  
	  <para>Once masked, the host must specify the direction of the
	    transfer (memory-to-I/O or I/O-to-memory), what mode of DMA
	    operation is to be used for the transfer (Single, Block, Demand,
	    Cascade, etc), and finally the address and length of the transfer
	    are loaded. The length that is loaded is one less than the amount
	    you expect the DMA to transfer. The LSB and MSB of the address
	    and length are written to the same 8-bit I/O port, so another port
	    must be written to first to guarantee that the DMA accepts the
	    first byte as the LSB and the second byte as the MSB of the length
	    and address.</para>
	  
	  <para>Then, be sure to update the Page Register, which is external
	    to the DMA and is accessed through a different set of I/O
	    ports.</para>
	  
	  <para>Once all the settings are ready, the DMA channel can be
	    un-masked. That DMA channel is now considered to be <quote>armed</quote>,
	    and will respond when the DRQ line for that channel is
	    asserted.</para>
	  
	  <para>Refer to a hardware data book for precise programming details
	    for the 8237. You will also need to refer to the I/O port map for
	    the PC system, which describes where the DMA and Page Register
	    ports are located. A complete port map table is located
	    below.</para>
	  
	</sect2>
	
	<sect2>
	  <title>DMA Port Map</title>
	  
	  <para>All systems based on the IBM-PC and PC/AT have the DMA
	    hardware located at the same I/O ports. The complete list is
	    provided below. Ports assigned to DMA Controller #2 are undefined
	    on non-AT designs.</para>
	  
	  
	  <sect3>
	    <title>0x00&ndash;0x1f DMA Controller #1 (Channels 0, 1, 2 and
	      3)</title>
	    
	    <para>DMA Address and Count Registers</para>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0x00</entry>
		    <entry>write</entry>
		    <entry>Channel 0 starting address</entry>
		  </row>

		  <row>
		    <entry>0x00</entry>
		    <entry>read</entry>
		    <entry>Channel 0 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0x01</entry>
		    <entry>write</entry>
		    <entry>Channel 0 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0x01</entry>
		    <entry>read</entry>
		    <entry>Channel 0 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0x02</entry>
		    <entry>write</entry>
		    <entry>Channel 1 starting address</entry>
		  </row>

		  <row>
		    <entry>0x02</entry>
		    <entry>read</entry>
		    <entry>Channel 1 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0x03</entry>
		    <entry>write</entry>
		    <entry>Channel 1 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0x03</entry>
		    <entry>read</entry>
		    <entry>Channel 1 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0x04</entry>
		    <entry>write</entry>
		    <entry>Channel 2 starting address</entry>
		  </row>

		  <row>
		    <entry>0x04</entry>
		    <entry>read</entry>
		    <entry>Channel 2 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0x05</entry>
		    <entry>write</entry>
		    <entry>Channel 2 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0x05</entry>
		    <entry>read</entry>
		    <entry>Channel 2 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0x06</entry>
		    <entry>write</entry>
		    <entry>Channel 3 starting address</entry>
		  </row>

		  <row>
		    <entry>0x06</entry>
		    <entry>read</entry>
		    <entry>Channel 3 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0x07</entry>
		    <entry>write</entry>
		    <entry>Channel 3 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0x07</entry>
		    <entry>read</entry>
		    <entry>Channel 3 remaining word count</entry>
		  </row>		  
		</tbody>
	      </tgroup>
	    </informaltable>

	    <para>DMA Command Registers</para>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0x08</entry>
		    <entry>write</entry>
		    <entry>Command Register</entry>
		  </row>

		  <row>
		    <entry>0x08</entry>
		    <entry>read</entry>
		    <entry>Status Register</entry>
		  </row>

		  <row>
		    <entry>0x09</entry>
		    <entry>write</entry>
		    <entry>Request Register</entry>
		  </row>

		  <row>
		    <entry>0x09</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0x0a</entry>
		    <entry>write</entry>
		    <entry>Single Mask Register Bit</entry>
		  </row>

		  <row>
		    <entry>0x0a</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0x0b</entry>
		    <entry>write</entry>
		    <entry>Mode Register</entry>
		  </row>

		  <row>
		    <entry>0x0b</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>
		  
		  <row>
		    <entry>0x0c</entry>
		    <entry>write</entry>
		    <entry>Clear LSB/MSB Flip-Flop</entry>
		  </row>

		  <row>
		    <entry>0x0c</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0x0d</entry>
		    <entry>write</entry>
		    <entry>Master Clear/Reset</entry>
		  </row>

		  <row>
		    <entry>0x0d</entry>
		    <entry>read</entry>
		    <entry>Termporary Register (not available on newer
		      versions)</entry>
		  </row>
		  <row>
		    <entry>0x0e</entry>
		    <entry>write</entry>
		    <entry>Clear Mask Register</entry>
		  </row>

		  <row>
		    <entry>0x0e</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0x0f</entry>
		    <entry>write</entry>
		    <entry>Write All Mask Register Bits</entry>
		  </row>

		  <row>
		    <entry>0x0f</entry>
		    <entry>read</entry>
		    <entry>Read All Mask Register Bits (only in Intel
		      82374)</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  </sect3>
	  
	  <sect3>
	    <title>0xc0&ndash;0xdf DMA Controller #2 (Channels 4, 5, 6 and
	      7)</title>
	    
	    <para>DMA Address and Count Registers</para>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0xc0</entry>
		    <entry>write</entry>
		    <entry>Channel 4 starting address</entry>
		  </row>

		  <row>
		    <entry>0xc0</entry>
		    <entry>read</entry>
		    <entry>Channel 4 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0xc2</entry>
		    <entry>write</entry>
		    <entry>Channel 4 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0xc2</entry>
		    <entry>read</entry>
		    <entry>Channel 4 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0xc4</entry>
		    <entry>write</entry>
		    <entry>Channel 5 starting address</entry>
		  </row>

		  <row>
		    <entry>0xc4</entry>
		    <entry>read</entry>
		    <entry>Channel 5 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0xc6</entry>
		    <entry>write</entry>
		    <entry>Channel 5 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0xc6</entry>
		    <entry>read</entry>
		    <entry>Channel 5 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0xc8</entry>
		    <entry>write</entry>
		    <entry>Channel 6 starting address</entry>
		  </row>

		  <row>
		    <entry>0xc8</entry>
		    <entry>read</entry>
		    <entry>Channel 6 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0xca</entry>
		    <entry>write</entry>
		    <entry>Channel 6 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0xca</entry>
		    <entry>read</entry>
		    <entry>Channel 6 remaining word count</entry>
		  </row>

		  <row>
		    <entry>0xcc</entry>
		    <entry>write</entry>
		    <entry>Channel 7 starting address</entry>
		  </row>

		  <row>
		    <entry>0xcc</entry>
		    <entry>read</entry>
		    <entry>Channel 7 current address</entry>
		  </row>
		  
		  <row>
		    <entry>0xce</entry>
		    <entry>write</entry>
		    <entry>Channel 7 starting word count</entry>
		  </row>
		  
		  <row>
		    <entry>0xce</entry>
		    <entry>read</entry>
		    <entry>Channel 7 remaining word count</entry>
		  </row>		  
		</tbody>
	      </tgroup>
	    </informaltable>
	    
	    <para>DMA Command Registers</para>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0xd0</entry>
		    <entry>write</entry>
		    <entry>Command Register</entry>
		  </row>

		  <row>
		    <entry>0xd0</entry>
		    <entry>read</entry>
		    <entry>Status Register</entry>
		  </row>

		  <row>
		    <entry>0xd2</entry>
		    <entry>write</entry>
		    <entry>Request Register</entry>
		  </row>

		  <row>
		    <entry>0xd2</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0xd4</entry>
		    <entry>write</entry>
		    <entry>Single Mask Register Bit</entry>
		  </row>

		  <row>
		    <entry>0xd4</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0xd6</entry>
		    <entry>write</entry>
		    <entry>Mode Register</entry>
		  </row>

		  <row>
		    <entry>0xd6</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>
		  
		  <row>
		    <entry>0xd8</entry>
		    <entry>write</entry>
		    <entry>Clear LSB/MSB Flip-Flop</entry>
		  </row>

		  <row>
		    <entry>0xd8</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0xda</entry>
		    <entry>write</entry>
		    <entry>Master Clear/Reset</entry>
		  </row>

		  <row>
		    <entry>0xda</entry>
		    <entry>read</entry>
		    <entry>Termporary Register (not present in Intel
		      82374)</entry>
		  </row>

		  <row>
		    <entry>0xdc</entry>
		    <entry>write</entry>
		    <entry>Clear Mask Register</entry>
		  </row>

		  <row>
		    <entry>0xdc</entry>
		    <entry>read</entry>
		    <entry>-</entry>
		  </row>

		  <row>
		    <entry>0xde</entry>
		    <entry>write</entry>
		    <entry>Write All Mask Register Bits</entry>
		  </row>

		  <row>
		    <entry>0xdf</entry>
		    <entry>read</entry>
		    <entry>Read All Mask Register Bits (only in Intel
		      82374)</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  </sect3>
	  
	  <sect3>
	    <title>0x80&ndash;0x9f DMA Page Registers</title>

	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0x87</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x83</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x81</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x82</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x8b</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x89</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x8a</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 Low byte (23-16) page Register</entry>
		  </row>

		  <row>
		    <entry>0x8f</entry>
		    <entry>r/w</entry>
		    <entry>Low byte page Refresh</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  </sect3>
	  
	  <sect3>
	    <title>0x400&ndash;0x4ff 82374 Enhanced DMA Registers</title>
	    
	    <para>The Intel 82374 EISA System Component (ESC) was introduced
	      in early 1996 and includes a DMA controller that provides a
	      superset of 8237 functionality as well as other PC-compatible
	      core peripheral components in a single package. This chip is
	      targeted at both EISA and PCI platforms, and provides modern DMA
	      features like scatter-gather, ring buffers as well as direct
	      access by the system DMA to all 32 bits of address space.</para>
	    
	    <para>If these features are used, code should also be included to
	      provide similar functionality in the previous 16 years worth of
	      PC-compatible computers. For compatibility reasons, some of the
	      82374 registers must be programmed <emphasis>after</emphasis>
	      programming the traditional 8237 registers for each  transfer.
	      Writing to a traditional 8237 register forces the contents of
	      some of the 82374 enhanced registers to zero to provide backward
	      software compatibility.</para>
	    
	    <informaltable frame="none">
	      <tgroup cols="3">
		<tbody>
		  <row>
		    <entry>0x401</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x403</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x405</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x407</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x4c6</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x4ca</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x4ce</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 High byte (bits 23-16) word count</entry>
		  </row>

		  <row>
		    <entry>0x487</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x483</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x481</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x482</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x48b</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x489</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x48a</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 High byte (bits 31-24) page
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x48f</entry>
		    <entry>r/w</entry>
		    <entry>High byte page Refresh</entry>
		  </row>

		  <row>
		    <entry>0x4e0</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4e1</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4e2</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4e4</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4e5</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4e6</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4e8</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4e9</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4ea</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4ec</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4ed</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4ee</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4f4</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4f5</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4f6</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4f8</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4f9</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4fa</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x4fc</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 Stop Register (bits 7-2)</entry>
		  </row>

		  <row>
		    <entry>0x4fd</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 Stop Register (bits 15-8)</entry>
		  </row>

		  <row>
		    <entry>0x4fe</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 Stop Register (bits 23-16)</entry>
		  </row>

		  <row>
		    <entry>0x40a</entry>
		    <entry>write</entry>
		    <entry>Channels 0-3 Chaining Mode Register</entry>
		  </row>

		  <row>
		    <entry>0x40a</entry>
		    <entry>read</entry>
		    <entry>Channel Interrupt Status Register</entry>
		  </row>

		  <row>
		    <entry>0x4d4</entry>
		    <entry>write</entry>
		    <entry>Channels 4-7 Chaining Mode Register</entry>
		  </row>

		  <row>
		    <entry>0x4d4</entry>
		    <entry>read</entry>
		    <entry>Chaining Mode Status</entry>
		  </row>

		  <row>
		    <entry>0x40c</entry>
		    <entry>read</entry>
		    <entry>Chain Buffer Expiration Control Register</entry>
		  </row>

		  <row>
		    <entry>0x410</entry>
		    <entry>write</entry>
		    <entry>Channel 0 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x411</entry>
		    <entry>write</entry>
		    <entry>Channel 1 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x412</entry>
		    <entry>write</entry>
		    <entry>Channel 2 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x413</entry>
		    <entry>write</entry>
		    <entry>Channel 3 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x415</entry>
		    <entry>write</entry>
		    <entry>Channel 5 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x416</entry>
		    <entry>write</entry>
		    <entry>Channel 6 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x417</entry>
		    <entry>write</entry>
		    <entry>Channel 7 Scatter-Gather Command Register</entry>
		  </row>

		  <row>
		    <entry>0x418</entry>
		    <entry>read</entry>
		    <entry>Channel 0 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x419</entry>
		    <entry>read</entry>
		    <entry>Channel 1 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x41a</entry>
		    <entry>read</entry>
		    <entry>Channel 2 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x41b</entry>
		    <entry>read</entry>
		    <entry>Channel 3 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x41d</entry>
		    <entry>read</entry>
		    <entry>Channel 5 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x41e</entry>
		    <entry>read</entry>
		    <entry>Channel 5 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x41f</entry>
		    <entry>read</entry>
		    <entry>Channel 7 Scatter-Gather Status Register</entry>
		  </row>

		  <row>
		    <entry>0x420-0x423</entry>
		    <entry>r/w</entry>
		    <entry>Channel 0 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x424-0x427</entry>
		    <entry>r/w</entry>
		    <entry>Channel 1 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x428-0x42b</entry>
		    <entry>r/w</entry>
		    <entry>Channel 2 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x42c-0x42f</entry>
		    <entry>r/w</entry>
		    <entry>Channel 3 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x434-0x437</entry>
		    <entry>r/w</entry>
		    <entry>Channel 5 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x438-0x43b</entry>
		    <entry>r/w</entry>
		    <entry>Channel 6 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>

		  <row>
		    <entry>0x43c-0x43f</entry>
		    <entry>r/w</entry>
		    <entry>Channel 7 Scatter-Gather Descriptor Table Pointer
		      Register</entry>
		  </row>
		</tbody>
	      </tgroup>
	    </informaltable>
	  </sect3>
	</sect2>
      </sect1>
    </chapter>
  </part>
  
  <part>
    <title>Appendices</title>
    
    
    <chapter id="mirrors">
      <title>Obtaining FreeBSD</title>
      
      
      <sect1>
	<title>CD-ROM Publishers</title>
	
	<para>FreeBSD is available on CD-ROM from Walnut Creek CDROM:

	  <address>
	    <otheraddr>Walnut Creek CDROM</otheraddr>
	    <street>4041 Pike Lane, Suite F</street>
	    <city>Concord</city>
	    <state>CA</state>, <postcode>94520</postcode>
	    <country>USA</country>
	    Phone: <phone>+1 925 674-0783</phone>
	    Fax: <fax>+1 925 674-0821</fax>
	    Email: <email>info@cdrom.com</email>
	    WWW: <otheraddr>http://www.cdrom.com/</otheraddr>
	  </address></para>
      </sect1>
      
      <sect1 id="mirrors-ftp">
	<title>FTP Sites</title>
	
	<para>The official sources for FreeBSD are available via anonymous FTP
	  from:
	  <blockquote>
	    <para><ulink
		URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.FreeBSD.ORG/pub/FreeBSD</ulink>.</para>
	  </blockquote></para>
	
	<para>Additionally, FreeBSD is available via anonymous FTP from the
	  following mirror sites. If you choose to obtain FreeBSD via
	  anonymous FTP, please try to use a site near you.</para>
	
	<para><xref linkend="mirrors-ar" remap="Argentina">, 
	  <xref linkend="mirrors-au" remap="Australia">, 
	  <xref linkend="mirrors-br" remap="Brazil">, 
	  <xref linkend="mirrors-ca" remap="Canada">,
	  <xref linkend="mirrors-cz" remap="Czech Republic">,
	  <xref linkend="mirrors-dk" remap="Denmark">,
	  <xref linkend="mirrors-ee" remap="Estonia">,
	  <xref linkend="mirrors-fi" remap="Finland">,
	  <xref linkend="mirrors-fr" remap="France">,
	  <xref linkend="mirrors-de" remap="Germany">,
	  <xref linkend="mirrors-hk" remap="Hong Kong">,
	  <xref linkend="mirrors-ie" remap="Ireland">,
	  <xref linkend="mirrors-il" remap="Israel">,
	  <xref linkend="mirrors-jp" remap="Japan">,
	  <xref linkend="mirrors-kr" remap="Korea">,
	  <xref linkend="mirrors-nl" remap="Netherlands">,
	  <xref linkend="mirrors-pl" remap="Poland">,
	  <xref linkend="mirrors-pt" remap="Portugal">,
	  <xref linkend="mirrors-ru" remap="Russia">,
	  <xref linkend="mirrors-za" remap="South Africa">,
	  <xref linkend="mirrors-si" remap="Slovenia">,
	  <xref linkend="mirrors-se" remap="Sweden">,
	  <xref linkend="mirrors-tw" remap="Taiwan">,
	  <xref linkend="mirrors-th" remap="Thailand">,
	  <xref linkend="mirrors-ua" remap="Ukraine">,
	  <xref linkend="mirrors-uk" remap="UK">,
	  <xref linkend="mirrors-us" remap="USA">.</para>
	
	
	  <variablelist>
	    <varlistentry><term><anchor id="mirrors-ar">Argentina</term>
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@ar.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ar.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.ar.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-au">Australia</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@au.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.au.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.au.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.au.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.au.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.au.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.au.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.au.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.au.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-br">Brazil</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@br.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp5.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp5.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp6.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp6.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp7.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp7.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-ca">Canada</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@ca.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ca.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.ca.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-cz">Czech Republic</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://sunsite.mff.cuni.cz/OS/FreeBSD">ftp://sunsite.mff.cuni.cz/OS/FreeBSD</ulink><!-- <br> --> Contact: <email>jj@sunsite.mff.cuni.cz</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-dk">Denmark</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@dk.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.dk.freeBSD.ORG/pub/FreeBSD">ftp://ftp.dk.freeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-ee">Estonia</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@ee.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ee.freebsd.ORG/pub/FreeBSD">ftp://ftp.ee.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-fi">Finland</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@fi.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.fi.freebsd.ORG/pub/FreeBSD">ftp://ftp.fi.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-fr">France</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ibp.fr/pub/FreeBSD">ftp://ftp.ibp.fr/pub/FreeBSD</ulink><!-- <br> --> Contact: <email>Remy.Card@ibp.fr</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-de">Germany</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@de.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp5.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp5.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp6.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp6.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp7.de.FreeBSD.ORG/pub/FreeBSD">ftp://ftp7.de.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-hk">Hong Kong</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.hk.super.net/pub/FreeBSD">ftp://ftp.hk.super.net/pub/FreeBSD</ulink><!-- <br> --> Contact: <email>ftp-admin@HK.Super.NET</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-ie">Ireland</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@ie.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ie.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.ie.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-il">Israel</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@il.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.il.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.il.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.il.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.il.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-jp">Japan</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@jp.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp5.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp5.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp6.jp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp6.jp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-kr">Korea</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@kr.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.kr.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.kr.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.kr.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.kr.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-nl">Netherlands</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@nl.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.nl.freebsd.ORG/pub/FreeBSD">ftp://ftp.nl.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-pl">Poland</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@pl.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.pl.freebsd.ORG/pub/FreeBSD">ftp://ftp.pl.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-pt">Portugal</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@pt.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.pt.freebsd.org/pub/FreeBSD">ftp://ftp.pt.freebsd.org/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.pt.freebsd.org/pub/FreeBSD">ftp://ftp2.pt.freebsd.org/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-ru">Russia</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@ru.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ru.freebsd.org/pub/FreeBSD">ftp://ftp.ru.freebsd.org/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.ru.freebsd.org/pub/FreeBSD">ftp://ftp2.ru.freebsd.org/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.ru.freebsd.org/pub/FreeBSD">ftp://ftp3.ru.freebsd.org/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-za">South Africa</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@za.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.za.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.za.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.za.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.za.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.za.FreeBSD.ORG/FreeBSD">ftp://ftp3.za.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-si">Slovenia</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@si.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.si.freebsd.ORG/pub/FreeBSD">ftp://ftp.si.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-se">Sweden</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@se.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.se.freebsd.ORG/pub/FreeBSD">ftp://ftp.se.freebsd.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-tw">Taiwan</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@tw.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.tw.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.tw.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.tw.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.tw.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.tw.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.tw.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-th">Thailand</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.nectec.or.th/pub/FreeBSD">ftp://ftp.nectec.or.th/pub/FreeBSD</ulink><!-- <br> --> Contact: <email>ftpadmin@ftp.nectec.or.th</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-ua">Ukraine</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.ua.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.ua.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --> Contact: <email>archer@lucky.net</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-uk">UK</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@uk.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.uk.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.uk.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.uk.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.uk.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.uk.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.uk.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.uk.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.uk.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term><anchor id="mirrors-us">USA</term>
	      
	      <listitem>
		<para>In case of problems, please contact the hostmaster <email>hostmaster@FreeBSD.ORG</email> for
		  this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp3.FreeBSD.ORG/pub/FreeBSD">ftp://ftp3.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp4.FreeBSD.ORG/pub/FreeBSD">ftp://ftp4.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp5.FreeBSD.ORG/pub/FreeBSD">ftp://ftp5.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp6.FreeBSD.ORG/pub/FreeBSD">ftp://ftp6.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>The latest versions of export-restricted code for FreeBSD (2.0C
	  or later) (eBones and secure) are being made available at the
	  following locations. If you are outside the U.S. or Canada, please
	  get secure (DES) and eBones (Kerberos) from one of the following
	  foreign distribution sites:</para>
	
	
	  <variablelist>
	    <varlistentry><term>South Africa</term>
	      <listitem>
		<para>Hostmaster <email>hostmaster@internat.FreeBSD.ORG</email> for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.internat.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.internat.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp2.internat.FreeBSD.ORG/pub/FreeBSD">ftp://ftp2.internat.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Brazil</term>
	      
	      <listitem>
		<para>Hostmaster <email>hostmaster@br.FreeBSD.ORG</email>
		  for this domain.</para>
		
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.br.FreeBSD.ORG/pub/FreeBSD">ftp://ftp.br.FreeBSD.ORG/pub/FreeBSD</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Finland</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://nic.funet.fi/pub/unix/FreeBSD/eurocrypt">ftp://nic.funet.fi/pub/unix/FreeBSD/eurocrypt</ulink><!-- <br> --> Contact: <email>count@nic.funet.fi</email>.</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
      </sect1>
      
      <sect1 id="mirrors-ctm">
	<title>CTM Sites</title>
	
	<para><xref linkend="ctm" remap="CTM">/FreeBSD is available via
	  anonymous FTP from the following mirror sites. If you choose to
	  obtain CTM via anonymous FTP, please try to use a site near
	  you.</para>
	
	<para>In case of problems, please contact &a.phk;.</para>
	
	
	  <variablelist>
	    <varlistentry><term>California, Bay Area, official source</term>
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.freebsd.org/pub/FreeBSD/CTM">ftp://ftp.freebsd.org/pub/FreeBSD/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Germany, Trier</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.uni-trier.de/pub/unix/systems/BSD/FreeBSD/CTM">ftp://ftp.uni-trier.de/pub/unix/systems/BSD/FreeBSD/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>South Africa, backup server for old
		deltas</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ftp.internat.freebsd.org/pub/FreeBSD/CTM">ftp://ftp.internat.freebsd.org/pub/FreeBSD/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Taiwan/R.O.C, Chiayi</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ctm.tw.freebsd.org/pub/FreeBSD/CTM">ftp://ctm.tw.freebsd.org/pub/FreeBSD/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ctm2.tw.freebsd.org/pub/FreeBSD/CTM">ftp://ctm2.tw.freebsd.org/pub/FreeBSD/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		    <listitem>
		      <para><ulink
			  URL="ftp://ctm3.tw.freebsd.org/pub/freebsd/CTM">ftp://ctm3.tw.freebsd.org/pub/freebsd/CTM</ulink><!-- <br> --></para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>If you did not find a mirror near to you or the mirror is
	  incomplete, try  <ulink URL="http://ftpsearch.ntnu.no/">FTP
	    search</ulink> at <ulink
	    URL="http://ftpsearch.ntnu.no/ftpsearch/">http://ftpsearch.ntnu.no/ftpsearch</ulink>. FTP search is a great free archie server in Trondheim, Norway.</para>
	
      </sect1>
      
      <sect1 id="mirrors-cvsup">
	<title>CVSup Sites</title>
	
	<para><xref linkend="cvsup" remap="CVSup"> servers for FreeBSD are
	  running at the following sites:</para>
	
	
	  <variablelist>
	    <varlistentry><term>Argentina</term>
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.ar.FreeBSD.ORG (maintainer <email>msagre@cactus.fi.uba.ar</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Australia</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.au.FreeBSD.ORG (maintainer <email>dawes@physics.usyd.edu.au</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Brazil</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.br.FreeBSD.ORG (maintainer <email>cvsup@cvsup.br.freebsd.org</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Canada</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.ca.FreeBSD.ORG (maintainer <email>james@ican.net</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Estonia</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.ee.FreeBSD.ORG (maintainer <email>taavi@uninet.ee</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Finland</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.fi.FreeBSD.ORG (maintainer <email>count@key.sms.fi</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Germany</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.de.FreeBSD.ORG (maintainer <email>wosch@freebsd.org</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup2.de.FreeBSD.ORG (maintainer <email>petzi@freebsd.org</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup3.de.FreeBSD.ORG (maintainer <email>ag@leo.org</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Japan</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.jp.FreeBSD.ORG (maintainer <email>simokawa@sat.t.u-tokyo.ac.jp</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup2.jp.FreeBSD.ORG (maintainer <email>max@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Netherlands</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.nl.FreeBSD.ORG (maintainer <email>xaa@stack.nl</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Norway</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.no.FreeBSD.ORG (maintainer <email>Tor.Egge@idt.ntnu.no</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Russia</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.ru.FreeBSD.ORG (maintainer <email>mishania@demos.su</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>South Africa</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.za.FreeBSD.ORG (maintainer <email>markm@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup2.za.FreeBSD.ORG (maintainer <email>markm@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Taiwan</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.tw.FreeBSD.ORG (maintainer <email>jdli@freebsd.csie.nctu.edu.tw</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Ukraine</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup2.ua.FreeBSD.ORG (maintainer <email>archer@lucky.net</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>United Kingdom</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.uk.FreeBSD.ORG (maintainer <email>joe@pavilion.net</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>USA</term>
	      
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.FreeBSD.ORG (maintainer <email>skynyrd@opus.cts.cwu.edu</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup2.FreeBSD.ORG (maintainer <email>jdp@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		    <listitem>
		      <para>cvsup3.FreeBSD.ORG (maintainer <email>wollman@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>The export-restricted code for FreeBSD (eBones and secure) is
	  available via <application>CVSup</application> at the following international repository.
	  Please use this site to get the export-restricted code, if you are
	  outside the USA or Canada.</para>
	
	
	  <variablelist>
	    <varlistentry><term>South Africa</term>
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>cvsup.internat.FreeBSD.ORG (maintainer <email>markm@FreeBSD.ORG</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
	<para>The following <application>CVSup</application> site is especially designed for <xref
	    linkend="ctm" remap="CTM"> users. Unlike the other CVSup mirrors,
	  it is kept up-to-date by <application>CTM</application>. That means if you <application>CVSup</application> <literal>cvs-all</literal> with <literal>release=cvs</literal>
	  from this site, you get a version of the repository (including the
	  inevitable <filename>.ctm_status</filename> file) which is
	  suitable for being updated using the <application>CTM</application> <literal>cvs-cur</literal> deltas. This allows users who track
	  the entire <literal>cvs-all</literal> tree to go from
	  <application>CVSup</application> to <application>CTM</application> without having to rebuild their repository from scratch
	  using a fresh <application>CTM</application> base delta.</para>

	<note>
	  <para>This special feature only works for the <literal>cvs-all</literal> distribution with
	    <command>cvs</command> as the release tag. CVSupping any other
	    distribution and/or release will get you the specified
	    distribution, but it will not be suitable for <application>CTM</application> updating.</para>
	</note>

	<note>
	  <para>Because the current version of <application>CTM</application> does not preserve the
	    timestamps of files, the timestamps at this mirror site are not
	    the same as those at other mirror sites. Switching between this
	    site and other sites is not recommended. It will work correctly,
	    but will be somewhat inefficient.</para>
	</note>
	  
	
	  <variablelist>
	    <varlistentry><term>Germany</term>
	      <listitem>
		
		  <itemizedlist>
		    
		    <listitem>
		      <para>ctm.FreeBSD.ORG (maintainer <email>blank@fox.uni-trier.de</email>)</para>
		    </listitem>
		    
		  </itemizedlist>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	  
	
	
      </sect1>
    </chapter>
    
    <chapter id="bibliography">
      <title>Bibliography</title>
      
      <para>While the manual pages provide the definitive reference for
	individual pieces of the FreeBSD operating system, they are notorious
	for not illustrating how to put the pieces together to make the whole
	operating system run smoothly. For this, there is no substitute for a
	good book on UNIX system administration and a good users'
	manual.</para>
      
      
      <sect1>
	<title>Books &amp; Magazines Specific to FreeBSD</title>
	
	<para><emphasis>International books &amp;
	    Magazines:</emphasis></para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><ulink
		  URL="http://freebsd.csie.nctu.edu.tw/~jdli/book.html">Using
		  FreeBSD</ulink> (in Chinese).</para>
	    </listitem>
	    
	    <listitem>
	      <para>FreeBSD for PC 98'ers (in Japanese), published by SHUWA
		System Co, LTD. ISBN 4-87966-468-5 C3055 P2900E.</para>
	    </listitem>
	    
	    <listitem>
	      <para>FreeBSD (in Japanese), published by CUTT. ISBN
		4-906391-22-2 C3055 P2400E.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.shoeisha.co.jp/pc/index/shinkan/97_05_06.htm">Complete Introduction to FreeBSD</ulink> (in Japanese), published by <ulink URL="http://www.shoeisha.co.jp/">Shoeisha Co., Ltd</ulink>. ISBN 4-88135-473-6 P3600E.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.ascii.co.jp/pb/book1/shinkan/detail/1322785.html">Personal UNIX Starter Kit FreeBSD</ulink> (in Japanese), published by <ulink URL="http://www.ascii.co.jp/">ASCII</ulink>. ISBN 4-7561-1733-3 P3000E.</para>
	    </listitem>
	    
	    <listitem>
	      <para>FreeBSD Handbook (Japanese translation), published by
		<ulink URL="http://www.ascii.co.jp/">ASCII</ulink>. ISBN
		4-7561-1580-2 P3800E.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
	<para><emphasis>English language books &amp;
	    Magazines:</emphasis></para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.cdrom.com/titles/os/bsdbook2.htm">The
		  Complete FreeBSD</ulink>, published by <ulink
		  URL="http://www.cdrom.com">Walnut Creek
		  CDROM</ulink>.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Users' Guides</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD User's Reference Manual</emphasis>. O'Reilly
		&amp; Associates, Inc., 1994.<!-- <br> --> ISBN
		1-56592-075-9</para>
	    </listitem>
	    
	    <listitem>
	      <para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD User's Supplementary Documents</emphasis>.
		O'Reilly &amp; Associates, Inc., 1994.<!-- <br> --> ISBN
		1-56592-076-7</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>UNIX in a Nutshell</emphasis>. O'Reilly
		&amp; Associates, Inc., 1990.<!-- <br> --> ISBN
		093717520X</para>
	    </listitem>
	    
	    <listitem>
	      <para>Mui, Linda. <emphasis>What You Need To Know When You Can't
		  Find Your UNIX System Administrator</emphasis>. O'Reilly
		&amp; Associates, Inc., 1995. <!-- <br> --> ISBN 1-56592-104-6</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink URL="http://www-wks.acs.ohio-state.edu/">Ohio State
		  University</ulink> has written a <ulink
		  URL="http://www-wks.acs.ohio-state.edu/unix_course/unix.html">UNIX Introductory Course</ulink> which is available online in HTML and postscript format.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Administrators' Guides</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Albitz, Paul and Liu, Cricket. <emphasis>DNS and
		  BIND</emphasis>, 2nd Ed. O'Reilly &amp; Associates, Inc.,
		1997. <!-- <br> --> ISBN 1-56592-236-0</para>
	    </listitem>
	    
	    <listitem>
	      <para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD System Manager's Manual</emphasis>. O'Reilly
		&amp; Associates, Inc., 1994. <!-- <br> --> ISBN
		1-56592-080-5</para>
	    </listitem>
	    
	    <listitem>
	      <para>Costales, Brian, et al. <emphasis>Sendmail</emphasis>, 2nd
		Ed. O'Reilly &amp; Associates, Inc., 1997.<!-- <br> --> ISBN
		1-56592-222-0</para>
	    </listitem>
	    
	    <listitem>
	      <para>Frisch, &AElig;leen. <emphasis>Essential System
		  Administration</emphasis>, 2nd Ed. O'Reilly &amp;
		Associates, Inc., 1995. <!-- <br> -->ISBN 1-56592-127-5</para>
	    </listitem>
	    
	    <listitem>
	      <para>Hunt, Craig. <emphasis>TCP/IP Network
		  Administration</emphasis>. O'Reilly &amp; Associates, Inc.,
		1992. <!-- <br> --> ISBN 0-937175-82-X</para>
	    </listitem>
	    
	    <listitem>
	      <para>Nemeth, Evi. <emphasis>UNIX System Administration
		  Handbook</emphasis>. 2nd ed. Prentice Hall, 1995. <!-- <br>
		--> ISBN 0131510517</para>
	    </listitem>
	    
	    <listitem>
	      <para>Stern, Hal <emphasis>Managing NFS and NIS</emphasis>
		O'Reilly &amp; Associates, Inc., 1991. <!-- <br> --> ISBN
		0-937175-75-7</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Programmers' Guides</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Asente, Paul. <emphasis>X Window System
		  Toolkit</emphasis>. Digital Press. <!-- <br> --> ISBN
		1-55558-051-3</para>
	    </listitem>
	    
	    <listitem>
	      <para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD Programmer's Reference Manual</emphasis>.
		O'Reilly &amp; Associates, Inc., 1994. <!-- <br> --> ISBN
		1-56592-078-3</para>
	    </listitem>
	    
	    <listitem>
	      <para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD Programmer's Supplementary
		  Documents</emphasis>. O'Reilly &amp; Associates, Inc., 1994.
		<!-- <br> --> ISBN 1-56592-079-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Ellis, Margaret A. and Stroustrup, Bjarne. <emphasis>The
		  Annotated C++ Reference Manual</emphasis>. Addison-Wesley,
		1990. <!-- <br> --> ISBN 0-201-51459-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Harbison, Samuel P. and Steele, Guy L. Jr. <emphasis>C: A
		  Reference Manual</emphasis>. 4rd ed. Prentice Hall, 1995.
		<!-- <br> -->ISBN 0-13-326224-3</para>
	    </listitem>
	    
	    <listitem>
	      <para>Kernighan, Brian and Dennis M. Ritchie. <emphasis>The C
		  Programming Language.</emphasis>. PTR Prentice Hall, 1988.
		<!-- <br> --> ISBN 0-13-110362-9</para>
	    </listitem>
	    
	    <listitem>
	      <para>Lehey, Greg. <emphasis>Port UNIX Software</emphasis>.
		O'Reilly &amp; Associates, Inc., 1995.<!-- <br> --> ISBN
		1-56592-126-7</para>
	    </listitem>
	    
	    <listitem>
	      <para>Plauger, P. J. <emphasis>The Standard C
		  Library</emphasis>. Prentice Hall, 1992. <!-- <br> --> ISBN
		0-13-131509-9</para>
	    </listitem>
	    
	    <listitem>
	      <para>Stevens, W. Richard. <emphasis>Advanced Programming in the
		  UNIX Environment</emphasis>. Reading, Mass. :
		Addison-Wesley, 1992<!-- <br> --> ISBN 0-201-56317-7</para>
	    </listitem>
	    
	    <listitem>
	      <para>Stevens, W. Richard. <emphasis>UNIX Network
		  Programming</emphasis>. PTR Prentice Hall, 1990. <!-- <br>
		--> ISBN 0-13-949876-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Wells, Bill. <quote>Writing Serial Drivers for UNIX</quote>.
		<emphasis>Dr. Dobb's Journal</emphasis>. 19(15), December
		1994. pp68-71, 97-99.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Operating System Internals</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Andleigh, Prabhat K. <emphasis>UNIX System
		  Architecture</emphasis>. Prentice-Hall, Inc., 1990.<!-- <br>
		--> ISBN 0-13-949843-5</para>
	    </listitem>
	    
	    <listitem>
	      <para>Jolitz, William. <quote>Porting UNIX to the
		386</quote>. <emphasis>Dr.
		  Dobb's Journal</emphasis>. January 1991-July 1992.</para>
	    </listitem>
	    
	    <listitem>
	      <para>Leffler, Samuel J., Marshall Kirk McKusick, Michael J
		Karels and John Quarterman <emphasis>The Design and
		  Implementation of the 4.3BSD UNIX Operating
		  System</emphasis>. Reading, Mass. : Addison-Wesley,
		1989.<!-- <br> --> ISBN 0-201-06196-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Leffler, Samuel J., Marshall Kirk McKusick, <emphasis>The
		  Design and Implementation of the 4.3BSD UNIX Operating
		  System: Answer Book</emphasis>. Reading, Mass. :
		Addison-Wesley, 1991.<!-- <br> --> ISBN 0-201-54629-9</para>
	    </listitem>
	    
	    <listitem>
	      <para>McKusick, Marshall Kirk, Keith Bostic, Michael J Karels,
		and John Quarterman. <emphasis>The Design and Implementation
		  of the 4.4BSD Operating System</emphasis>. Reading, Mass. :
		Addison-Wesley, 1996.<!-- <br> --> ISBN 0-201-54979-4</para>
	    </listitem>
	    
	    <listitem>
	      <para>Stevens, W. Richard. <emphasis>TCP/IP Illustrated, Volume
		  1: The Protocols</emphasis>. Reading, Mass. :
		Addison-Wesley, 1996.<!-- <br> --> ISBN 0-201-63346-9</para>
	    </listitem>
	    
	    <listitem>
	      <para>Stevens, W. Richard. <emphasis>TCP/IP Illustrated, Volume
		  3: TCP for Transactions, HTTP, NNTP and the UNIX Domain
		  Protocols</emphasis>. Reading, Mass. : Addison-Wesley,
		1996.<!-- <br> --> ISBN 0-201-63495-3</para>
	    </listitem>
	    
	    <listitem>
	      <para>Vahalia, Uresh. <emphasis>UNIX Internals -- The New
		  Frontiers</emphasis>. Prentice Hall, 1996.<!-- <br> --> ISBN
		0-13-101908-2</para>
	    </listitem>
	    
	    <listitem>
	      <para>Wright, Gary R. and W. Richard Stevens. <emphasis>TCP/IP
		  Illustrated, Volume 2: The Implementation</emphasis>.
		Reading, Mass. : Addison-Wesley, 1995.<!-- <br> --> ISBN
		0-201-63354-X</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Security Reference</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Cheswick, William R. and Steven M. Bellovin.
		<emphasis>Firewalls and Internal Security: Repelling the Wily
		  Hacker</emphasis>. Reading, Mass. : Addison-Wesley,
		1995.<!-- <br> --> ISBN 0-201-63357-4</para>
	    </listitem>
	    
	    <listitem>
	      <para>Garfinkel, Simson and Gene Spafford. <emphasis>Practical
		  UNIX Security</emphasis>. 2nd Ed. O'Reilly &amp; Associates,
		Inc., 1996. <!-- <br> --> ISBN 1-56592-148-8</para>
	    </listitem>
	    
	    <listitem>
	      <para>Garfinkel, Simson. <emphasis>PGP Pretty Good
		  Privacy</emphasis> O'Reilly &amp; Associates, Inc., 1995.
		<!-- <br> --> ISBN 1-56592-098-8</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Hardware Reference</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Anderson, Don and Tom Shanley. <emphasis>Pentium Processor
		  System Architecture</emphasis>. 2nd ed. Reading, Mass. :
		Addison-Wesley, 1995.<!-- <br> --> ISBN 0-201-40992-5</para>
	    </listitem>
	    
	    <listitem>
	      <para>Ferraro, Richard F. <emphasis>Programmer's Guide to the
		  EGA, VGA, and Super VGA Cards</emphasis>. 3rd ed. Reading,
		Mass. : Addison-Wesley, 1995.<!-- <br> --> ISBN
		0-201-62490-7</para>
	    </listitem>
	    
	    <listitem>
	      <para>Shanley, Tom. <emphasis>80486 System
		  Architecture</emphasis>. 3rd ed. Reading, Mass. :
		Addison-Wesley, 1995. <!-- <br> -->ISBN 0-201-40994-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Shanley, Tom. <emphasis>ISA System
		  Architecture</emphasis>. 3rd ed. Reading, Mass. :
		Addison-Wesley, 1995.<!-- <br> --> ISBN 0-201-40996-8</para>
	    </listitem>
	    
	    <listitem>
	      <para>Shanley, Tom. <emphasis>PCI System
		  Architecture</emphasis>. 3rd ed. Reading, Mass. :
		Addison-Wesley, 1995. <!-- <br> -->ISBN 0-201-40993-3</para>
	    </listitem>
	    
	    <listitem>
	      <para>Van Gilluwe, Frank. <emphasis>The Undocumented
		  PC</emphasis>. Reading, Mass: Addison-Wesley Pub. Co.,
		1994.<!-- <br> --> ISBN 0-201-62277-7</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>UNIX History</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>Lion, John <emphasis>Lion's Commentary on UNIX, 6th Ed.
		  With Source Code</emphasis>. ITP Media Group, 1996.<!-- <br>
		--> ISBN 1573980137</para>
	    </listitem>
	    
	    <listitem>
	      <para>Raymond, Eric s. <emphasis>The New Hacker's Dictonary, 3rd
		  edition</emphasis>. MIT Press, 1996.<!-- <br> --> ISBN
		0-262-68092-0<!-- <br> --> Also known as the <ulink
		  URL="http://www.ccil.org/jargon/jargon.html">Jargon
		  File</ulink></para>
	    </listitem>
	    
	    <listitem>
	      <para>Salus, Peter H. <emphasis>A quarter century of
		  UNIX</emphasis>. Addison-Wesley Publishing Company, Inc.,
		1994.<!-- <br> --> ISBN 0-201-54777-5</para>
	    </listitem>
	    
	    <listitem>
	      <para>Simon Garfinkel, Daniel Weise, Steven Strassmann.
		<emphasis>The UNIX-HATERS Handbook</emphasis>. IDG Books
		Worldwide, Inc., 1994.<!-- <br> --> ISBN 1-56884-203-1</para>
	    </listitem>
	    
	    <listitem>
	      <para>Don Libes, Sandy Ressler <emphasis>Life with
		  UNIX</emphasis> &mdash; special edition. Prentice-Hall, Inc.,
		1989.<!-- <br> --> ISBN 0-13-536657-7</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>The BSD family tree</emphasis>. 1997.<!-- <br>
		--> <ulink
		  URL="http://www.de.freebsd.org/de/ftp/unix-stammbaum">http://www.de.freebsd.org/de/ftp/unix-stammbaum</ulink> or <ulink URL="file:/usr/share/misc/bsd-family-tree">local</ulink> on a FreeBSD-current machine.</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>The BSD Release Announcements
		  collection</emphasis>. 1997.<!-- <br> --> <ulink
		  URL="http://www.de.FreeBSD.ORG/de/ftp/releases/">http://www.de.FreeBSD.ORG/de/ftp/releases/</ulink></para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Networked Computer Science Technical Reports
		  Library</emphasis>.<!-- <br> --> <ulink
		  URL="http://www.ncstrl.org/">http://www.ncstrl.org/</ulink></para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1>
	<title>Magazines and Journals</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><emphasis>The C/C++ Users Journal</emphasis>. R&amp;D
		Publications Inc. ISSN 1075-2838</para>
	    </listitem>
	    
	    <listitem>
	      <para><emphasis>Sys Admin &mdash; The Journal for UNIX System
		  Administrators</emphasis> Miller Freeman, Inc., ISSN
		1061-2688</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
    </chapter>
    
    <chapter id="eresources">
      <title>Resources on the Internet</title>
      
      <para><emphasis>Contributed by &a.jkh;.</emphasis></para>
      
      <para>The rapid pace of FreeBSD progress makes print media impractical
	as a means of following the latest developments. Electronic resources
	are the best, if not often the only, way stay informed of the latest
	advances. Since FreeBSD is a volunteer effort, the user community
	itself also generally serves as a <quote>technical support department</quote> of
	sorts, with electronic mail and  USENET news being the most effective
	way of reaching that community.</para>
      
      <para>The most important points of contact with the FreeBSD user
	community are outlined below. If you are aware of other resources not
	mentioned here, please send them to the &a.doc;so that they may also
	be included.</para>
      
      
      <sect1 id="eresources-mail">
	<title>Mailing lists</title>
	
	<para>Though many of the FreeBSD development members read USENET, we
	  cannot always guarantee that we will get to your questions in a
	  timely fashion (or at all) if you post them only to one of the
	  <literal>comp.unix.bsd.freebsd.*</literal> groups. By addressing your questions to the
	  appropriate mailing list you will reach both us and a concentrated
	  FreeBSD audience, invariably assuring a better (or at least faster)
	  response.</para>
	
	<para>The charters for the various lists are given at the bottom of
	  this document. <emphasis>Please read the charter before
	    joining or sending mail to any list</emphasis>. Most of our list
	  subscribers now receive many hundreds of FreeBSD related messages
	  every day, and by setting down charters and rules for proper use we
	  are striving to keep the signal-to-noise ratio of the lists high.
	  To do less would see the mailing lists ultimately fail as an
	  effective communications medium for the project.</para>
	
	<para>Archives are kept for all of the mailing lists and can be
	  searched using the <ulink
	    URL="http://www.FreeBSD.ORG/search.html">FreeBSD World Wide Web
	    server</ulink>. The keyword searchable archive offers an
	  excellent way of finding answers to frequently asked questions and
	  should be consulted before posting a question.</para>
	
	
	<sect2 id="eresources-summary">
	  <title>List summary</title>
	  
	  <para><emphasis>General lists:</emphasis> The following are
	    general lists which anyone is free to join:</para>

	  <informaltable frame="none">
	    <tgroup cols="2">
	      <thead>
		<row>
		  <entry>List</entry>
		  <entry>Purpose</entry>
		</row>
	      </thead>

	      <tbody>
		<row>
		  <entry>freebsd-announce</entry>
		  <entry>Important events and project milestones</entry>
		</row>

		<row>
		  <entry>freebsd-bugs</entry>
		  <entry>Bug reports</entry>
		</row>

		<row>
		  <entry>freebsd-chat</entry>
		  <entry>Non-technical items related to the FreeBSD
		    community</entry>
		</row>

		<row>
		  <entry>freebsd-current</entry>
		  <entry>Discussion concerning the use of
		    FreeBSD-current</entry>
		</row>

		<row>
		  <entry>freebsd-stable</entry>
		  <entry>Discussion concerning the use of
		    FreeBSD-stable</entry>
		</row>

		<row>
		  <entry>freebsd-isp</entry>
		  <entry>Issues for Internet Service Providers using
		    FreeBSD</entry>
		</row>

		<row>
		  <entry>freebsd-jobs</entry>
		  <entry>FreeBSD employment and consulting
		    opportunities</entry>
		</row>

		<row>
		  <entry>freebsd-questions</entry>
		  <entry>User questions</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	  
	  <para><emphasis>Technical lists:</emphasis> The following
	    lists are for technical discussion. You should read the charter
	    for each list carefully before joining or sending mail to one as
	    there are firm guidelines for their use and content.</para>

	  <informaltable frame="none">
	    <tgroup cols="2">
	      <thead>
		<row>
		  <entry>List</entry>
		  <entry>Purpose</entry>
		</row>
	      </thead>

	      <tbody>
		<row>
		  <entry>freebsd-afs</entry>
		  <entry>Porting AFS to FreeBSD</entry>
		</row>

		<row>
		  <entry>freebsd-alpha</entry>
		  <entry>Porting FreeBSD to the Alpha</entry>
		</row>

		<row>
		  <entry>freebsd-doc</entry>
		  <entry>The FreeBSD Documentation project</entry>
		</row>

		<row>
		  <entry>freebsd-emulation</entry>
		  <entry>Emulation of other systems such as
		    Linux/DOS/Windows</entry>
		</row>

		<row>
		  <entry>freebsd-fs</entry>
		  <entry>Filesystems</entry>
		</row>
		
		<row>
		  <entry>freebsd-hackers</entry>
		  <entry>General technical discussion</entry>
		</row>

		<row>
		  <entry>freebsd-hardware</entry>
		  <entry>General discussion of hardware for running
		    FreeBSD</entry>
		</row>

		<row>
		  <entry>freebsd-isdn</entry>
		  <entry>ISDN developers</entry>
		</row>

		<row>
		  <entry>freebsd-java</entry>
		  <entry>Java developers and people porting JDKs to
		    FreeBSD</entry>
		</row>

		<row>
		  <entry>freebsd-mobile</entry>
		  <entry>Discussions about mobile computing</entry>
		</row>

		<row>
		  <entry>freebsd-multimedia</entry>
		  <entry>Multimedia discussion</entry>
		</row>

		<row>
		  <entry>freebsd-platforms</entry>
		  <entry>Concerning ports to non-Intel architecture
		    platforms</entry>
		</row>

		<row>
		  <entry>freebsd-ports</entry>
		  <entry>Discussion of the ports collection</entry>
		</row>

		<row>
		  <entry>freebsd-scsi</entry>
		  <entry>The SCSI subsystem</entry>
		</row>

		<row>
		  <entry>freebsd-security</entry>
		  <entry>Security issues</entry>
		</row>

		<row>
		  <entry>freebsd-smp</entry>
		  <entry>Design discussions for [A]Symmetric
		    MultiProcessing</entry>
		</row>

		<row>
		  <entry>freebsd-sparc</entry>
		  <entry>Porting FreeBSD to Sparc systems</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	  
	  <para><emphasis>Limited lists:</emphasis> The following
	    lists require approval from <email>core@FreeBSD.ORG</email> to join,
	    though anyone is free to send messages to them which fall within
	    the scope of their charters. It is also a good idea establish a
	    presence in the technical lists before asking to join one of these
	    limited lists.</para>

	  <informaltable frame="none">
	    <tgroup cols="2">
	      <thead>
		<row>
		  <entry>List</entry>
		  <entry>Purpose</entry>
		</row>
	      </thead>
	      
	      <tbody>
		<row>
		  <entry>freebsd-admin</entry>
		  <entry>Administrative issues</entry>
		</row>
		
		<row>
		  <entry>freebsd-arch</entry>
		  <entry>Architecture and design discussions</entry>
		</row>
		
		<row>
		  <entry>freebsd-core</entry>
		  <entry>FreeBSD core team</entry>
		</row>
		
		<row>
		  <entry>freebsd-hubs</entry>
		  <entry>People running mirror sites (infrastructural
		    support)</entry>
		</row>
		
		<row>
		  <entry>freebsd-install</entry>
		  <entry>Installation development</entry>
		</row>
		
		<row>
		  <entry>freebsd-security-notifications</entry>
		  <entry>Security notifications</entry>
		</row>
		
		<row>
		  <entry>freebsd-user-groups</entry>
		  <entry>User group coordination</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	  
	  <para><emphasis>CVS lists:</emphasis> The following lists
	    are for people interested in seeing the log messages for changes
	    to various areas of the source tree. They are <emphasis>Read-Only</emphasis> lists and should not have mail
	    sent to them.</para>
	  
	  <informaltable frame="none">
	    <tgroup cols="3">
	      <thead>
		<row>
		  <entry>List</entry>
		  <entry>Source area</entry>
		  <entry>Area Description (source for)</entry>
		</row>
	      </thead>
	      
	      <tbody>
		<row>
		  <entry>cvs-CVSROOT</entry>
		  <entry>/usr/src/[A-Z]*</entry>
		  <entry>Top level /usr/src file changes</entry>
		</row>

		<row>
		  <entry>cvs-all</entry>
		  <entry>/usr/src</entry>
		  <entry>All changes to the tree (superset)</entry>
		</row>

		<row>
		  <entry>cvs-bin</entry>
		  <entry>/usr/src/bin</entry>
		  <entry>System binaries</entry>
		</row>

		<row>
		  <entry>cvs-etc</entry>
		  <entry>/usr/src/etc</entry>
		  <entry>System files</entry>
		</row>

		<row>
		  <entry>cvs-games</entry>
		  <entry>/usr/src/games</entry>
		  <entry>Games</entry>
		</row>

		<row>
		  <entry>cvs-gnu</entry>
		  <entry>/usr/src/gnu</entry>
		  <entry>GPL'd utilities</entry>
		</row>

		<row>
		  <entry>cvs-include</entry>
		  <entry>/usr/src/include</entry>
		  <entry>Include files</entry>
		</row>

		<row>
		  <entry>cvs-kerberosIV</entry>
		  <entry>/usr/src/kerberosIV</entry>
		  <entry>Kerberos encryption code</entry>
		</row>

		<row>
		  <entry>cvs-lib</entry>
		  <entry>/usr/src/lib</entry>
		  <entry>System libraries</entry>
		</row>

		<row>
		  <entry>cvs-libexec</entry>
		  <entry>/usr/src/libexec</entry>
		  <entry>System binaries</entry>
		</row>

		<row>
		  <entry>cvs-ports</entry>
		  <entry>/usr/ports</entry>
		  <entry>Ported software</entry>
		</row>

		<row>
		  <entry>cvs-sbin</entry>
		  <entry>/usr/src/sbin</entry>
		  <entry>System binaries</entry>
		</row>

		<row>
		  <entry>cvs-share</entry>
		  <entry>/usr/src/share</entry>
		  <entry>System shared files</entry>
		</row>

		<row>
		  <entry>cvs-sys</entry>
		  <entry>/usr/src/sys</entry>
		  <entry>Kernel</entry>
		</row>

		<row>
		  <entry>cvs-usrbin</entry>
		  <entry>/usr/src/usr.bin</entry>
		  <entry>Use binaries</entry>
		</row>

		<row>
		  <entry>cvs-usrsbin</entry>
		  <entry>/usr/src/usr.sbin</entry>
		  <entry>System binaries</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </informaltable>
	</sect2>
	
	<sect2 id="eresources-subscribe">
	  <title>How to subscribe</title>
	  
	  <para>All mailing lists live on <hostid role="fqdn">FreeBSD.ORG</hostid>, so
	    to post to a given list you simply mail to
	    <email><replaceable>listname</replaceable>@FreeBSD.ORG</email>. It will
	    then be redistributed to mailing list members world-wide.</para>
	  
	  <para>To subscribe to a list, send mail to &a.majordomo; and include

	    <programlisting>
subscribe &lt;listname&gt; [&lt;optional address&gt;]
	    </programlisting>

	    in the body of your message. For example, to
	    subscribe yourself to <literal>freebsd-announce</literal>, you'd do:</para>
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>mail majordomo@FreeBSD.ORG</userinput>
subscribe freebsd-announce
^D</screen>
	    </informalexample>

	  <para>If you want to subscribe yourself under a
	    different name, or submit a subscription request for a local
	    mailing list (this is more efficient if you have several
	    interested parties at one site, and highly appreciated by us!),
	    you would do something like:</para>
	    
	    <informalexample>
	      <screen>&prompt.user; <userinput>mail majordomo@FreeBSD.ORG</userinput>
subscribe freebsd-announce local-announce@somesite.com
^D</screen>
	    </informalexample>

	  <para>Finally, it is also possible to unsubscribe
	    yourself from a list, get a list of other list members or see the
	    list of mailing lists again by sending other types of control
	    messages to majordomo. For a complete list of available commands,
	    do this:</para>

	    <informalexample>
	      <screen>&prompt.user; <userinput>mail majordomo@FreeBSD.ORG</userinput>
help
^D</screen>
	    </informalexample>

	  <para>Again, we would like to request that you keep
	    discussion in the technical mailing lists on a technical track.
	    If you are only interested in the <quote>high points</quote> then it is
	    suggested that you join freebsd-announce, which is intended only
	    for infrequent traffic.</para>
	  
	</sect2>
	
	<sect2 id="eresources-charters">
	  <title>List charters</title>
	  
	  <para><emphasis>All</emphasis>FreeBSD mailing lists have
	    certain basic rules which must be adhered to by anyone using them.
	    Failure to comply with these guidelines will result in two (2)
	    written warnings from the FreeBSD Postmaster <email>postmaster@freebsd.org</email>, after
	    which, on a third offense, the poster will removed from all
	    FreeBSD mailing lists and filtered from further posting to them.
	    We regret that such rules and measures are necessary at all, but
	    today's Internet is a pretty harsh environment, it would seem, and
	    many fail to appreciate just how fragile some of its mechanisms
	    are.</para>
	  
	  <para>Rules of the road:</para>
	  
	    <itemizedlist>
	      
	      <listitem>
		<para>The topic of any posting should adhere to the basic
		  charter of the list it is posted to, e.g. if the list is
		  about technical issues then your posting should contain
		  technical discussion. Ongoing irrelevant chatter or flaming
		  only detracts from the value of the mailing list for
		  everyone on it and will not be tolerated. For free-form
		  discussion on no particular topic, the freebsd-chat <email>freebsd-chat@freebsd.org</email>
		  mailing list is freely available and should be used
		  instead.</para>
	      </listitem>
	      
	      <listitem>
		<para>No posting should be made to more than 2 mailing lists,
		  and only to 2 when a clear and obvious need to post to both
		  lists exists. For most lists, there is already a great deal
		  of subscriber overlap and except for the most esoteric mixes
		  (say "-stable &amp; -scsi"), there really is no reason to
		  post to more than one list at a time. If a message is sent
		  to you in such a way that multiple mailing lists appear on
		  the Cc line then the cc line should also be trimmed before
		  sending it out again. <emphasis>You are <emphasis>still</emphasis> responsible for your own
		    cross-postings, no matter who the originator might have
		    been.</emphasis></para>
	      </listitem>
	      
	      <listitem>
		<para>Personal attacks and profanity (in the context of an
		  argument) are not allowed, and that includes users and
		  developers alike. Gross breaches of netiquette, like
		  excerpting or reposting private mail when permission to do
		  so was not and would not be forthcoming, are frowned upon
		  but not specifically enforced. <emphasis>However</emphasis>, there are also very few cases
		  where such content would fit within the charter of a list
		  and it would therefore probably rate a warning (or ban) on
		  that basis alone.</para>
	      </listitem>
	      
	      <listitem>
		<para>Advertising of non-FreeBSD related products or services
		  is strictly prohibited and will result in an immediate ban
		  if it is clear that the offender is advertising by
		  spam.</para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  <para><emphasis>Individual list charters:</emphasis></para>
	  
	  
	    <variablelist>
	      <varlistentry><term>FREEBSD-AFS</term>
		<listitem>
		  <para><emphasis>Andrew File System</emphasis></para>
		    
		    <para>This list is for discussion on porting and using AFS from
		    CMU/Transarc</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-ADMIN</term>
		
		<listitem>
		  <para><emphasis>Administrative issues</emphasis></para>

		<para>This list is purely for discussion of <hostid role="domainname">freebsd.org</hostid>
		    related issues and to report problems or abuse of project
		    resources. It is a closed list, though anyone may report
		    a problem (with our systems!) to it.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-ANNOUNCE</term>
		
		<listitem>
		  <para><emphasis>Important events /
		      milestones</emphasis></para>

		  <para>This is the mailing list for people interested only
		    in occasional announcements of significant freebsd events.
		    This includes announcements about snapshots and other
		    releases. It contains announcements of new FreeBSD
		    capabilities. It may contain calls for volunteers etc.
		    This is a low volume, strictly moderated mailing
		    list.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-ARCH</term>
		
		<listitem>
		  <para><emphasis>Architecture and design
		      discussions</emphasis></para>

		  <para>This is the mailing
		    list for people discussing FreeBSD architectural issues.
		    It is a closed list, and not for general
		    subscription.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-BUGS</term>
		
		<listitem>
		  <para><emphasis>Bug reports</emphasis></para>

		  <para>This is
		    the mailing list for reporting bugs in FreeBSD Whenever
		    possible, bugs should be submitted using the <citerefentry><refentrytitle>send-pr</refentrytitle><manvolnum>1</manvolnum></citerefentry>
		    command or the <ulink
		      URL="http://www.freebsd.org/send-pr.html">WEB
		      interface</ulink> to it.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-CHAT</term>
		
		<listitem>
		  <para><emphasis>Non technical items related to the FreeBSD
		      community</emphasis></para>

		  <para>This list contains the
		    overflow from the other lists about non-technical, social
		    information. It includes discussion about whether Jordan
		    looks like a toon ferret or not, whether or not to type in
		    capitals, who is drinking too much coffee, where the best
		    beer is brewed, who is brewing beer in their basement, and
		    so on. Occasional announcements of important events (such
		    as upcoming parties, weddings, births, new jobs, etc) can
		    be made to the technical lists, but the follow ups should
		    be directed to this -chat list.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-CORE</term>
		
		<listitem>
		  <para><emphasis>FreeBSD core team</emphasis></para>

		  <para>This is an internal mailing list for use by the core
		    members. Messages can be sent to it when a serious
		    FreeBSD-related matter requires arbitration or high-level
		    scrutiny.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-CURRENT</term>
		
		<listitem>
		  <para><emphasis>Discussions about the use of
		      FreeBSD-current</emphasis></para>

		  <para>This is the
		    mailing list for users of freebsd-current. It includes
		    warnings about new features coming out in -current that
		    will affect the users, and instructions on steps that must
		    be taken to remain -current. Anyone running <quote>current</quote> must
		    subscribe to this list. This is a technical mailing list
		    for which strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-CURRENT-DIGEST</term>
		
		<listitem>
		  <para><emphasis>Discussions about the use of
		      FreeBSD-current</emphasis></para>

		  <para>This is the
		    digest version of the freebsd-current mailing list. The
		    digest consists of all messages sent to freebsd-current
		    bundled together and mailed out as a single message. The
		    average digest size is about 40kB. This list is <emphasis>Read-Only</emphasis> and should not be posted
		    to.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-STABLE</term>
		
		<listitem>
		  <para><emphasis>Discussions about the use of
		      FreeBSD-stable</emphasis></para>

		  <para>This is the
		    mailing list for users of freebsd-stable. It includes
		    warnings about new features coming out in -stable that
		    will affect the users, and instructions on steps that must
		    be taken to remain -stable. Anyone running <quote>stable</quote>
		    should subscribe to this list. This is a technical mailing
		    list for which strictly technical content is
		    expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-DOC</term>
		
		<listitem>
		  <para><emphasis>Documentation project</emphasis></para>

		  <para>This mailing list belongs to the FreeBSD Doc Project
		    and is for the discussion of documentation related issues
		    and projects.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-FS</term>
		
		<listitem>
		  <para><emphasis>Filesystems</emphasis></para>

		  <para>Discussions concerning FreeBSD filesystems. This is a
		    technical mailing list for which strictly technical
		    content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-ISDN</term>
		
		<listitem>
		  <para><emphasis>ISDN Communications</emphasis></para>

		  <para>This is the mailing list for people discussing the
		    development of ISDN support for FreeBSD.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-JAVA</term>
		
		<listitem>
		  <para><emphasis>Java Development</emphasis></para>

		  <para>
		    This is the mailing list for people discussing the
		    development of significant Java applications for FreeBSD
		    and the porting and maintenance of JDKs.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-HACKERS</term>
		
		<listitem>
		  <para><emphasis>Technical discussions</emphasis></para>

		  <para>This is a forum for technical discussions related to
		    FreeBSD. This is the primary technical mailing list. It
		    is for individuals actively working on FreeBSD, to bring
		    up problems or discuss alternative solutions. Individuals
		    interested in following the technical discussion are also
		    welcome. This is a technical mailing list for which
		    strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-HACKERS-DIGEST</term>
		
		<listitem>
		  <para><emphasis>Technical discussions</emphasis></para>

		  <para>This is the digest version of the freebsd-hackers
		    mailing list. The digest consists of all messages sent to
		    freebsd-hackers bundled together and mailed out as a
		    single message. The average digest size is about 40kB.
		    This list is <emphasis>Read-Only</emphasis> and
		    should not be posted to.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-HARDWARE</term>
		
		<listitem>
		  <para><emphasis>General discussion of FreeBSD
		      hardware</emphasis></para>

		  <para>General discussion
		    about the types of hardware that FreeBSD runs on, various
		    problems and suggestions concerning what to buy or
		    avoid.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-INSTALL</term>
		
		<listitem>
		  <para><emphasis>Installation discussion</emphasis></para>

		  <para>This mailing list is for discussing FreeBSD
		    installation development for the future releases and is
		    closed.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-ISP</term>
		
		<listitem>
		  <para><emphasis>Issues for Internet Service
		      Providers</emphasis></para>

		  <para>This mailing list is
		    for discussing topics relevant to Internet Service
		    Providers (ISPs) using FreeBSD. This is a technical
		    mailing list for which strictly technical content is
		    expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-MULTIMEDIA</term>
		
		<listitem>
		  <para><emphasis>Multimedia discussions</emphasis></para>

		  <para>This is a forum about multimedia applications using
		    FreeBSD. Discussion center around multimedia applications,
		    their installation, their development and their support
		    within FreeBSD This is a technical mailing list for which
		    strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-PLATFORMS</term>
		
		<listitem>
		  <para><emphasis>Porting to Non-Intel
		      platforms</emphasis></para>

		  <para>Cross-platform freebsd
		    issues, general discussion and proposals for non-Intel
		    FreeBSD ports. This is a technical mailing list for which
		    strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-PORTS</term>
		
		<listitem>
		  <para><emphasis>Discussion of
		      <quote>ports</quote></emphasis></para>

		  <para>Discussions concerning FreeBSD's <quote>ports collection</quote>
		  (<filename>/usr/ports</filename>), proposed ports, modifications to ports
		    collection infrastructure and general coordination
		    efforts. This is a technical mailing list for which
		    strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-QUESTIONS</term>
		
		<listitem>
		  <para><emphasis>User questions</emphasis></para>

		  <para>This
		    is the mailing list for questions about FreeBSD. You
		    should not send <quote>how to</quote> questions to the technical lists
		    unless you consider the question to be pretty
		    technical.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-QUESTIONS-DIGEST</term>
		
		<listitem>
		  <para><emphasis>User questions</emphasis></para>

		<para>This
		    is the digest version of the freebsd-questions mailing
		    list. The digest consists of all messages sent to
		    freebsd-questions bundled together and mailed out as a
		    single message. The average digest size is about
		    40kB.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-SCSI</term>
		
		<listitem>
		  <para><emphasis>SCSI subsystem</emphasis></para>

		  <para>This
		    is the mailing list for people working on the scsi
		    subsystem for FreeBSD. This is a technical mailing list
		    for which strictly technical content is expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-SECURITY</term>
		
		<listitem>
		  <para><emphasis>Security issues</emphasis></para>

		  <para>FreeBSD computer security issues (DES, Kerberos, known
		    security holes and fixes, etc). This is a technical
		    mailing list for which strictly technical content is
		    expected.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-SECURITY-NOTIFICATIONS</term>
		
		<listitem>
		  <para><emphasis>Security Notifications</emphasis><!-- <br>
		    --> Notifications of FreeBSD security problems and fixes.
		    This is not a discussion list. The discussion list is
		    FreeBSD-security.</para>
		</listitem>
	      </varlistentry>
	      
	      <varlistentry><term>FREEBSD-USER-GROUPS</term>
		
		<listitem>
		  <para><emphasis>User Group Coordination
		      List</emphasis></para>

		  <para>This is the mailing list for the coordinators from
		    each of the  local area Users Groups to discuss matters
		    with each other and a  designated individual from the Core
		    Team. This mail list should be limited to meeting
		    synopsis and coordination of projects that span User
		    Groups. It is a closed list.</para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="eresources-news">
	<title>Usenet newsgroups</title>
	
	<para>In addition to two FreeBSD specific newsgroups, there are many
	  others in which FreeBSD is discussed or are otherwise relevant to
	  FreeBSD users. <ulink
	    URL="http://minnie.cs.adfa.oz.au/BSD-info/bsdnews_search.html">Keyword searchable archives</ulink> are available for some of these newsgroups from courtesy of Warren Toomey <email>wkt@cs.adfa.oz.au</email>.</para>
	
	
	<sect2>
	  <title>BSD specific newsgroups</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.bsd.freebsd.announce">comp.unix.bsd.freebsd.announce</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.bsd.freebsd.misc">comp.unix.bsd.freebsd.misc</ulink></para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>Other Unix newsgroups of interest</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><ulink URL="news:comp.unix">comp.unix</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.questions">comp.unix.questions</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.admin">comp.unix.admin</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.programmer">comp.unix.programmer</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.shell">comp.unix.shell</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.user-friendly">comp.unix.user-friendly</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.security.unix">comp.security.unix</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.sources.unix">comp.sources.unix</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.advocacy">comp.unix.advocacy</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.misc">comp.unix.misc</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.announc">comp.os.386bsd.announc</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.app">comp.os.386bsd.app</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.bugs">comp.os.386bsd.bugs</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.development">comp.os.386bsd.development</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.misc">comp.os.386bsd.misc</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.os.386bsd.questions">comp.os.386bsd.questions</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.bugs.4bsd">comp.bugs.4bsd</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.bugs.4bsd.ucb-fixes">comp.bugs.4bsd.ucb-fixes</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.unix.bsd">comp.unix.bsd</ulink></para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	</sect2>
	
	<sect2>
	  <title>X Window System</title>
	  
	  
	    <itemizedlist>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.i386unix">comp.windows.x.i386unix</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x">comp.windows.x</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.apps">comp.windows.x.apps</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.announce">comp.windows.x.announce</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.intrinsics">comp.windows.x.intrinsics</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.motif">comp.windows.x.motif</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.windows.x.pex">comp.windows.x.pex</ulink></para>
	      </listitem>
	      
	      <listitem>
		<para><ulink
		    URL="news:comp.emulators.ms-windows.wine">comp.emulators.ms-windows.wine</ulink></para>
	      </listitem>
	      
	    </itemizedlist>
	  
	  
	</sect2>
      </sect1>
      
      <sect1 id="eresources-web">
	<title>World Wide Web servers</title>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.FreeBSD.ORG/">http://www.FreeBSD.ORG/</ulink> &mdash; Central Server.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.au.freebsd.org/FreeBSD/">http://www.au.freebsd.org/FreeBSD/</ulink> &mdash; Australia.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.br.freebsd.org/">http://www.br.freebsd.org/</ulink> &mdash; Brazil.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.ca.freebsd.org/">http://www.ca.freebsd.org/</ulink> &mdash; Canada.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://sunsite.mff.cuni.cz/www.freebsd.org/">http://sunsite.mff.cuni.cz/www.freebsd.org/</ulink> &mdash; Czech Republic.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://sunsite.auc.dk/www.freebsd.org/">http://sunsite.auc.dk/www.freebsd.org/</ulink> &mdash; Denmark.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.ee.freebsd.org/">http://www.ee.freebsd.org/</ulink> &mdash; Estonia.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.fi.freebsd.org/">http://www.fi.freebsd.org/</ulink> &mdash; Finland.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.de.freebsd.org/">http://www.de.freebsd.org/</ulink> &mdash; Germany.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.ie.freebsd.org/">http://www.ie.freebsd.org/</ulink> &mdash; Ireland.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.jp.freebsd.org/">http://www.jp.freebsd.org/</ulink> &mdash; Japan.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.kr.freebsd.org/">http://www.kr.freebsd.org/</ulink> &mdash; Korea.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.nl.freebsd.org/">http://www.nl.freebsd.org/</ulink> &mdash; Netherlands.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.pt.freebsd.org/">http://www.pt.freebsd.org/</ulink> &mdash; Portugal.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.se.freebsd.org/www.freebsd.org/">http://www.se.freebsd.org/www.freebsd.org/</ulink> &mdash; Sweden.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www.tw.freebsd.org/freebsd.html">http://www.tw.freebsd.org/freebsd.html</ulink> &mdash; Taiwan.</para>
	    </listitem>
	    
	    <listitem>
	      <para><ulink
		  URL="http://www2.ua.freebsd.org/">http://www2.ua.freebsd.org/</ulink> &mdash; Ukraine.</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
    </chapter>
    
    <chapter id="staff">
      <title>FreeBSD Project Staff</title>
      
      <para>The FreeBSD Project is managed and operated by the following
	groups of people:</para>
      
      
      <sect1 id="staff-core">
	<title>The FreeBSD Core Team</title>
	
	<para>The FreeBSD core team constitutes the project's <quote>Board of
	  Directors</quote>, responsible for deciding the project's overall goals
	  and direction as well as managing <xref linkend="staff-who"
	    remap="specific
	    areas"> of the FreeBSD project landscape.</para>
	
	<para>(in alphabetical order by last name):</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>&a.asami;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jmb;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.ache;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.dyson;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.bde;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.gibbs;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.davidg;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jkh;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.phk;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.rich;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.gpalmer;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jdp;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.guido;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.sos;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.peter;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.wollman;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.joerg;</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="staff-committers">
	<title>The FreeBSD Developers</title>
	
	<para>These are the people who have commit privileges and do the
	  engineering work on the FreeBSD source tree. All core team members
	  and most FreeBSD Documentation project personnel are also
	  developers.</para>
	
	
	  <itemizedlist>
	    
	    <listitem>
	      <para>&a.mbarkah;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.stb;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jb;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.torstenb;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.danny;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.charnier;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.kjc;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.gclarkii;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.cracauer;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.adam;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.dufault;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.uhclem;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.tegge;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.eivind;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.julian;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.rse;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.se;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.sef;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.fenner;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jfieber;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jfitz;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.lars;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.scrappy;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.tg;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.brandon;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.graichen;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jgreco;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.rgrimes;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jmg;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.hanai;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.ahasty;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jhay;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.helbig;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.erich;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.hsu;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.itojun;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.ugen;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.gj;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.nsj;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.ljo;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.kato;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.andreas;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.imp;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.smace;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.mckay;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jlemon;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.tedm;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.amurai;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.markm;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.max;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.alex;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.davidn;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.obrien;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.fsmp;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.smpatel;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.wpaul;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jmacd;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.steve;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.mpp;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.dfr;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jraynard;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.darrenr;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.csgr;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.martin;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.paul;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.roberto;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.chuckr;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.dima;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.wosch;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.ats;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jseger;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.vanilla;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.msmith;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.brian;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.stark;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.karl;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.cwt;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.pst;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.hoek;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.swallace;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.nate;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.yokota;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.jmz;</para>
	    </listitem>
	    
	    <listitem>
	      <para>&a.hosokawa;</para>
	    </listitem>
	    
	  </itemizedlist>
	
	
      </sect1>
      
      <sect1 id="staff-doc">
	<title>The FreeBSD Documentation Project</title>
	
	<para>The <ulink URL="http://www.freebsd.org/docproj.html">FreeBSD
	    Documentation Project</ulink> is responsible for a number of
	  different services, each service being run by an individual and his
	  <emphasis>deputies</emphasis> (if any):</para>
	
	
	  <variablelist>
	    <varlistentry><term>Documentation Project Manager</term>
	      <listitem>
		<para>&a.jfieber;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Webmaster</term>
	      
	      <listitem>
		<para>&a.mbarkah;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.paul;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Handbook &amp; FAQ Editor</term>
	      
	      <listitem>
		<para>&a.faq;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Build Engineer</term>
	      
	      <listitem>
		<para>&a.paul;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.dave;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Mirror Manager</term>
	      
	      <listitem>
		<para>&a.ulf;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.john;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>News Editor</term>
	      
	      <listitem>
		<para>&a.nsj;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.john;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Gallery and Commercial Editor</term>
	      
	      <listitem>
		<para>&a.nsj;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.cawimm;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Style Police &amp; Art Director</term>
	      
	      <listitem>
		<para>&a.dave;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.opsys;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Database Engineer</term>
	      
	      <listitem>
		<para>&a.mayo;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.cracauer;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>CGI Engineer</term>
	      
	      <listitem>
		<para>&a.cracauer;</para>
		
		<para><emphasis>Deputy:</emphasis> &a.stb;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Bottle Washing</term>
	      
	      <listitem>
		<para>&a.nsj;</para>
		
		<para><emphasis>Drying plates:</emphasis> &a.nik;</para>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
      </sect1>
      
      <sect1 id="staff-who">
	<title>Who Is Responsible for What</title>
	
	
	  <variablelist>
	    <varlistentry><term>Principal Architect</term>
	      <listitem>
		<para>&a.davidg;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Documentation Project Manager</term>
	      
	      <listitem>
		<para>&a.jfieber;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Internationalization</term>
	      
	      <listitem>
		<para>&a.ache;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Networking</term>
	      
	      <listitem>
		<para>&a.wollman;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Postmaster</term>
	      
	      <listitem>
		<para>&a.jmb;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Release Coordinator</term>
	      
	      <listitem>
		<para>&a.jkh;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Public Relations &amp; Corporate
		Liaison</term>
	      
	      <listitem>
		<para>&a.jkh;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Security Officer</term>
	      
	      <listitem>
		<para>&a.guido;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Source Repository Managers</term>
	      
	      <listitem>
		<para>Principal: &a.peter;</para>
	      
		<para>Assistant: &a.jdp;</para>

  	        <para>International (Crypto): &a.markm;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Ports Manager</term>
	      
	      <listitem>
		<para>&a.asami;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>XFree86 Project, Inc. Liaison</term>
	      
	      <listitem>
		<para>&a.rich;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>Usenet Support</term>
	      
	      <listitem>
		<para>&a.joerg;</para>
		
	      </listitem>
	    </varlistentry>
	    
	    <varlistentry><term>GNATS Administrator</term>
	      
	      <listitem>
		<para>&a.steve;</para>
		
	      </listitem>
	    </varlistentry>
	  </variablelist>
	
	
      </sect1>
    </chapter>
    
    <chapter id="pgpkeys">
      <title>PGP keys</title>
      
      <para>In case you need to verify a signature or send encrypted email to
	one of the officers or core team members a  number of keys are
	provided here for your convenience.</para>
      
      
      <sect1>
	<title>Officers</title>
	
	
	<sect2>
	  <title>FreeBSD Security Officer <email>security-officer@freebsd.org</email></title>
	  
	  <programlisting>
FreeBSD Security Officer &lt;security-officer@freebsd.org&gt;
Fingerprint = 41 08 4E BB DB 41 60 71  F9 E5 0E 98 73 AF 3F 11

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i
	    
mQCNAzF7MY4AAAEEAK7qBgPuBejER5HQbQlsOldk3ZVWXlRj54raz3IbuAUrDrQL
h3g57T9QY++f3Mot2LAf5lDJbsMfWrtwPrPwCCFRYQd6XH778a+l4ju5axyjrt/L
Ciw9RrOC+WaPv3lIdLuqYge2QRC1LvKACIPNbIcgbnLeRGLovFUuHi5z0oilAAUR
tDdGcmVlQlNEIFNlY3VyaXR5IE9mZmljZXIgPHNlY3VyaXR5LW9mZmljZXJAZnJl
ZWJzZC5vcmc+iQCVAwUQMX6yrOJgpPLZnQjrAQHyowQA1Nv2AY8vJIrdp2ttV6RU
tZBYnI7gTO3sFC2bhIHsCvfVU3JphfqWQ7AnTXcD2yPjGcchUfc/EcL1tSlqW4y7
PMP4GHZp9vHog1NAsgLC9Y1P/1cOeuhZ0pDpZZ5zxTo6TQcCBjQA6KhiBFP4TJql
3olFfPBh3B/Tu3dqmEbSWpuJAJUDBRAxez3C9RVb+45ULV0BAak8A/9JIG/jRJaz
QbKom6wMw852C/Z0qBLJy7KdN30099zMjQYeC9PnlkZ0USjQ4TSpC8UerYv6IfhV
nNY6gyF2Hx4CbEFlopnfA1c4yxtXKti1kSN6wBy/ki3SmqtfDhPQ4Q31p63cSe5A
3aoHcjvWuqPLpW4ba2uHVKGP3g7SSt6AOYkAlQMFEDF8mz0ff6kIA1j8vQEBmZcD
/REaUPDRx6qr1XRQlMs6pfgNKEwnKmcUzQLCvKBnYYGmD5ydPLxCPSFnPcPthaUb
5zVgMTjfjS2fkEiRrua4duGRgqN4xY7VRAsIQeMSITBOZeBZZf2oa9Ntidr5PumS
9uQ9bvdfWMpsemk2MaRG9BSoy5Wvy8VxROYYUwpT8Cf2iQCVAwUQMXsyqWtaZ42B
sqd5AQHKjAQAvolI30Nyu3IyTfNeCb/DvOe9tlOn/o+VUDNJiE/PuBe1s2Y94a/P
BfcohpKC2kza3NiW6lLTp00OWQsuu0QAPc02vYOyseZWy4y3Phnw60pWzLcFdemT
0GiYS5Xm1o9nAhPFciybn9j1q8UadIlIq0wbqWgdInBT8YI/l4f5sf6JAJUDBRAx
ezKXVS4eLnPSiKUBAc5OBACIXTlKqQC3B53qt7bNMV46m81fuw1PhKaJEI033mCD
ovzyEFFQeOyRXeu25Jg9Bq0Sn37ynISucHSmt2tUD5W0+p1MUGyTqnfqejMUWBzO
v4Xhp6a8RtDdUMBOTtro16iulGiRrCKxzVgEl4i+9Z0ZiE6BWlg5AetoF5n3mGk1
lw==
=ipyA
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	  
	</sect2>
	
	<sect2>
	  <title>&a.imp;</title>
	  
	  <programlisting>
Warner Losh &lt;imp@village.org&gt;
	aka &lt;imp@freebsd.org&gt;
Fingerprint = D4 31 FD B9 F7 90 17 E8 37 C5 E7 7F CF A6 C1 B9
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzDzTiAAAAEEAK8D7KWEbVFUrmlqhUEnAvphNIqHEbqqT8s+c5f5c2uHtlcH
V4mV2TlUaDSVBN4+/D70oHmZc4IgiQwMPCWRrSezg9z/MaKlWhaslc8YT6Xc1q+o
EP/fAdKUrq49H0QQbkQk6Ks5wKW6v9AOvdmsS6ZJEcet6d9G4dxynu/2qPVhAAUR
tCBNLiBXYXJuZXIgTG9zaCA8aW1wQHZpbGxhZ2Uub3JnPokAlQMFEDM/SK1VLh4u
c9KIpQEBFPsD/1n0YuuUPvD4CismZ9bx9M84y5sxLolgFEfP9Ux196ZSeaPpkA0g
C9YX/IyIy5VHh3372SDWN5iVSDYPwtCmZziwIV2YxzPtZw0nUu82P/Fn8ynlCSWB
5povLZmgrWijTJdnUWI0ApVBUTQoiW5MyrNN51H3HLWXGoXMgQFZXKWYiQCVAwUQ
MzmhkfUVW/uOVC1dAQG3+AP/T1HL/5EYF0ij0yQmNTzt1cLt0b1e3N3zN/wPFFWs
BfrQ+nsv1zw7cEgxLtktk73wBGM9jUIdJu8phgLtl5a0m9UjBq5oxrJaNJr6UTxN
a+sFkapTLT1g84UFUO/+8qRB12v+hZr2WeXMYjHAFUT18mp3xwjW9DUV+2fW1Wag
YDKJAJUDBRAzOYK1s1pi61mfMj0BARBbA/930CHswOF0HIr+4YYUs1ejDnZ2J3zn
icTZhl9uAfEQq++Xor1x476j67Z9fESxyHltUxCmwxsJ1uOJRwzjyEoMlyFrIN4C
dE0C8g8BF+sRTt7VLURLERvlBvFrVZueXSnXvmMoWFnqpSpt3EmN6TNaLe8Cm87a
k6EvQy0dpnkPKokAlQMFEDD9Lorccp7v9qj1YQEBrRUD/3N4cCMWjzsIFp2Vh9y+
RzUrblyF84tJyA7Rr1p+A7dxf7je3Zx5QMEXosWL1WGnS5vC9YH2WZwv6sCU61gU
rSy9z8KHlBEHh+Z6fdRMrjd9byPf+n3cktT0NhS23oXB1ZhNZcB2KKhVPlNctMqO
3gTYx+Nlo6xqjR+J2NnBYU8p =7fQV
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	  
	</sect2>
      </sect1>
      
      <sect1>
	<title>Core Team members</title>
	
	
	<sect2>
	  <title>&a.asami;</title>
	  
	  <programlisting>
Satoshi Asami &lt;asami@cs.berkeley.edu&gt;
          aka &lt;asami@FreeBSD.ORG&gt;
Fingerprint = EB 3C 68 9E FB 6C EB 3F  DB 2E 0F 10 8F CE 79 CA

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzPVyoQAAAEEAL7W+kipxB171Z4SVyyL9skaA7hG3eRsSOWk7lfvfUBLtPog
f3OKwrApoc/jwLf4+Qpdzv5DLEt/6Hd/clskhJ+q1gMNHyZ5ABmUxrTRRNvJMTrb
3fPU3oZj7sL/MyiFaT1zF8EaMP/iS2ZtcFsbYOqGeA8E/58uk4NA0SoeCNiJAAUR
tCVTYXRvc2hpIEFzYW1pIDxhc2FtaUBjcy5iZXJrZWxleS5lZHU+iQCVAwUQM/AT
+EqGN2HYnOMZAQF11QP/eSXb2FuTb1yX5yoo1Im8YnIk1SEgCGbyEbOMMBznVNDy
5g2TAD0ofLxPxy5Vodjg8rf+lfMVtO5amUH6aNcORXRncE83T10JmeM6JEp0T6jw
zOHKz8jRzygYLBayGsNIJ4BGxa4LeaGxJpO1ZEvRlNkPH/YEXK5oQmq9/DlrtYOJ
AEUDBRAz42JT8ng6GBbVvu0BAU8nAYCsJ8PiJpRUGlrz6rxjX8hqM1v3vqFHLcG+
G52nVMBSy+RZBgzsYIPwI5EZtWAKb22JAJUDBRAz4QBWdbtuOHaj97EBAaQPA/46
+NLUp+Wubl90JoonoXocwAg88tvAUVSzsxPXj0lvypAiSI2AJKsmn+5PuQ+/IoQy
lywRsxiQ5GD7C72SZ1yw2WI9DWFeAi+qa4b8n9fcLYrnHpyCY+zxEpu4pam8FJ7H
JocEUZz5HRoKKOLHErzXDiuTkkm72b1glmCqAQvnB4kAlQMFEDPZ3gyDQNEqHgjY
iQEBFfUEALu2C0uo+1Z7C5+xshWRYY5xNCzK20O6bANVJ+CO2fih96KhwsMof3lw
fDso5HJSwgFd8WT/sR+Wwzz6BAE5UtgsQq5GcsdYQuGI1yIlCYUpDp5sgswNm+OA
bX5a+r4F/ZJqrqT1J56Mer0VVsNfe5nIRsjd/rnFAFVfjcQtaQmjiQCVAwUQM9uV
mcdm8Q+/vPRJAQELHgP9GqNiMpLQlZig17fDnCJ73P0e5t/hRLFehZDlmEI2TK7j
Yeqbw078nZgyyuljZ7YsbstRIsWVCxobX5eH1kX+hIxuUqCAkCsWUY4abG89kHJr
XGQn6X1CX7xbZ+b6b9jLK+bJKFcLSfyqR3M2eCyscSiZYkWKQ5l3FYvbUzkeb6K0
IVNhdG9zaGkgQXNhbWkgPGFzYW1pQEZyZWVCU0QuT1JHPg==
=39SC
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.jmb;</title>
	  
	  <programlisting>
Jonathan M. Bresler &lt;jmb@FreeBSD.org&gt;
Key fingerprint =  31 57 41 56 06 C1 40 13  C5 1C E3 E5 DC 62 0E FB

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzG2GToAAAEEANI6+4SJAAgBpl53XcfEr1M9wZyBqC0tzpie7Zm4vhv3hO8s
o5BizSbcJheQimQiZAY4OnlrCpPxijMFSaihshs/VMAz1qbisUYAMqwGEO/T4QIB
nWNo0Q/qOniLMxUrxS1RpeW5vbghErHBKUX9GVhxbiVfbwc4wAHbXdKX5jjdAAUR
tCVKb25hdGhhbiBNLiBCcmVzbGVyIDxqbWJARnJlZUJTRC5PUkc+iQCVAwUQNA3x
ffUVW/uOVC1dAQHGdAQAgsnYklBtVUdGuQwXB3bYp9omTD7CVD0aibVrz+lXiPDh
aTVkOC1uhEwL59+R8VdpAnEDMobdZDA/ihCc+6/FW/eE0uyrWZzb5Ng9V1MfC6HI
+sXpeXPy585Z56ewadV2yY9rvzcwmmUNHmAXT/5O0S2AWB0EJZ+cewTrokSTVVOJ
AJUDBRA0C3EoVS4eLnPSiKUBASb+A/95g6w9DDPRGDlbsl4pN1BlSPKrmDQPRK1X
C3bddDY2HNelSNhzp2FYD0WoN1re1vMJV0oaaJHwv7wjbe3+SYEX/IdmtfzI0MbZ
Q/uPybPJOxi2ud6C6J+mEGJN9iBCnsaCz8CETuC9gR1mtxsxySUj9mk0fxKfdP6S
3QDrv6CQ1IkAlQMFEDKsi9CzWmLrWZ8yPQEBduUD/RhV4Qa89rYls9vtIFm6XBjZ
8mW37FYxeqIxg3ZrIyTMlghsOPV0f7zymCCWPRGKOLePRiGo0ZCEkDTYiM9tnwQI
09rmPWJb50yfTSZXjHx6+Hcm6O6BCmDFloo0Mxo6n9pvMH/TmmqHxCsAV+p8XEWy
rMZvwVSynMxmJd17Y5HLtBNKb25hdGhhbiBNLiBCcmVzbGVyiQCVAwUQMbYtYQHb
XdKX5jjdAQHEHwP/fEaQoTi7zKD1U/5kW2YPIBUyMTpLiO9QOr4stYjJvhHh4Ejw
fGvMIhbFrPKtxSNH1s3m4jAXKXiQBDCz17IIzL4n8dlunxNGE5MHcsmpWzggyIg4
zbPqPOcg4gLFEWsEkr2o0akwzIGa3tbCvC+ITaX/rdlWV1jaQjTqSNyPZBM=
=RV56
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.ache;</title>
	  
	  <programlisting>
Andrey A. Chernov &lt;ache@FreeBSD.org&gt;
       aka &lt;ache@nagual.pp.ru&gt;
Key fingerprint = 33 03 9F 48 33 7B 4A 15  63 48 88 0A C4 97 FD 49

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAiqUMGQAAAEEAPGhcD6A2Buey5LYz0sphDLpVgOZc/bb9UHAbaGKUAGXmafs
Dcb2HnsuYGgX/zrQXuCi/wIGtXcZWB97APtKOhFsZnPinDR5n/dde/mw9FnuhwqD
m+rKSL1HlN0z/Msa5y7g16760wHhSR6NoBSEG5wQAHIMMq7Q0uJgpPLZnQjrAAUT
tCVBbmRyZXkgQS4gQ2hlcm5vdiA8YWNoZUBuYWd1YWwucHAucnU+iQCVAwUQM2Ez
u+JgpPLZnQjrAQEyugP8DPnS8ixJ5OeuYgPFQf5sy6l+LrB6hyaS+lgsUPahWjNY
cnaDmfda/q/BV5d4+y5rlQe/pjnYG7/yQuAR3jhlXz8XDrqlBOnW9AtYjDt5rMfJ
aGFTGXAPGZ6k6zQZE0/YurT8ia3qjvuZm3Fw4NJrHRx7ETHRvVJDvxA6Ggsvmr20
JEFuZHJleSBBLiBDaGVybm92IDxhY2hlQEZyZWVCU0Qub3JnPokAlQMFEDR5uVbi
YKTy2Z0I6wEBLgED/2mn+hw4/3peLx0Sb9LNx//NfCCkVefSf2G9Qwhx6dvwbX7h
mFca97h7BQN4GubU1Z5Ffs6TeamSBrotBYGmOCwvJ6S9WigF9YHQIQ3B4LEjskAt
pcjU583y42zM11kkvEuQU2Gde61daIylJyOxsgpjSWpkxq50fgY2kLMfgl/ftCZB
bmRyZXkgQS4gQ2hlcm5vdiA8YWNoZUBuaWV0enNjaGUubmV0PokAlQMFEDR5svDi
YKTy2Z0I6wEBOTQD/0OTCAXIjuak363mjERvzSkVsNtIH9hA1l0w6Z95+iH0fHrW
xXKT0vBZE0y0Em+S3cotLL0bMmVE3F3D3GyxhBVmgzjyx0NYNoiQjYdi+6g/PV30
Cn4vOO6hBBpSyI6vY6qGNqcsawuRtHNvK/53MpOfKwSlICEBYQimcZhkci+EtCJB
bmRyZXkgQS4gQ2hlcm5vdiA8YWNoZUBuYWd1YWwucnU+iQCVAwUQMcm5HeJgpPLZ
nQjrAQHwvQP9GdmAf1gdcuayHEgNkc11macPH11cwWjYjzA2YoecFMGV7iqKK8QY
rr1MjbGXf8DAG8Ubfm0QbI8Lj8iG3NgqIru0c72UuHGSn/APfGGG0AtPX5UK/k7B
gI0Ca2po6NA5nrSp8tDsdEz/4gyea84RXl2prtTf5Jj07hflbRstGXK0MkFuZHJl
eSBBLiBDaGVybm92LCBCbGFjayBNYWdlIDxhY2hlQGFzdHJhbC5tc2suc3U+iQCV
AwUQMCsAo5/rGryoL8h3AQHq1QQAidyNFqA9hvrmMcjpY7csJVFlGvj574Wj4GPa
o3pZeuQaMBmsWqaXLYnWU/Aldb6kTz6+nRcQX50zFH0THSPfApwEW7yybSTI5apJ
mWT3qhKN2vmLNg2yNzhqLTzHLD1lH3i1pfQq8WevrNfjLUco5S/VuekTma/osnzC
Cw7fQzCJAJUDBRAwKvwoa1pnjYGyp3kBARihBACoXr3qfG65hFCyKJISmjOvaoGr
anxUIkeDS0yQdTHzhQ+dwB1OhhK15E0Nwr0MKajLMm90n6+Zdb5y/FIjpPriu8dI
rlHrWZlewa88eEDM+Q/NxT1iYg+HaKDAE171jmLpSpCL0MiJtO0i36L3ekVD7Hv8
vffOZHPSHirIzJOZTYkAlQMFEDAau6zFLUdtDb+QbQEBQX8D/AxwkYeFaYxZYMFO
DHIvSk23hAsjCmUA2Uil1FeWAusb+o8xRfPDc7TnosrIifJqbF5+fcHCG5VSTGlh
Bhd18YWUeabf/h9O2BsQX55yWRuB2x3diJ1xI/VVdG+rxlMCmE4ZR1Tl9x+Mtun9
KqKVpB39VlkCBYQ3hlgNt/TJUY4riQCVAwUQMBHMmyJRltlmbQBRAQFQkwP/YC3a
hs3ZMMoriOlt3ZxGNUUPTF7rIER3j+c7mqGG46dEnDB5sUrkzacpoLX5sj1tGR3b
vz9a4vmk1Av3KFNNvrZZ3/BZFGpq3mCTiAC9zsyNYQ8L0AfGIUO5goCIjqwOTNQI
AOpNsJ5S+nMAkQB4YmmNlI6GTb3D18zfhPZ6uciJAJUCBRAwD0sl4uW74fteFRkB
AWsAA/9NYqBRBKbmltQDpyK4+jBAYjkXBJmARFXKJYTlnTgOHMpZqoVyW96xnaa5
MzxEiu7ZWm5oL10QDIp1krkBP2KcmvfSMMHb5aGCCQc2/P8NlfXAuHtNGzYiI0UA
Iwi8ih/S1liVfvnqF9uV3d3koE7VsQ9OA4Qo0ZL2ggW+/gEaYIkAlQMFEDAOz6qx
/IyHe3rl4QEBIvYD/jIr8Xqo/2I5gncghSeFR01n0vELFIvaF4cHofGzyzBpYsfA
+6pgFI1IM+LUF3kbUkAY/2uSf9U5ECcaMCTWCwVgJVO+oG075SHEM4buhrzutZiM
1dTyTaepaPpTyRMUUx9ZMMYJs7sbqLId1eDwrJxUPhrBNvf/w2W2sYHSY8cdiQCV
AwUQMAzqgHcdkq6JcsfBAQGTxwQAtgeLFi2rhSOdllpDXUwz+SS6bEjFTWgRsWFM
y9QnOcqryw7LyuFmWein4jasjY033JsODfWQPiPVNA3UEnXVg9+n8AvNMPO8JkRv
Cn1eNg0VaJy9J368uArio93agd2Yf/R5r+QEuPjIssVk8hdcy/luEhSiXWf6bLMV
HEA0J+OJAJUDBRAwDUi+4mCk8tmdCOsBAatBBACHB+qtW880seRCDZLjl/bT1b14
5po60U7u6a3PEBkY0NA72tWDQuRPF/Cn/0+VdFNxQUsgkrbwaJWOoi0KQsvlOm3R
rsxKbn9uvEKLxExyKH3pxp76kvz/lEWwEeKvBK+84Pb1lzpG3W7u2XDfi3VQPTi3
5SZMAHc6C0Ct/mjNlYkAlQMFEDAMrPD7wj+NsTMUOQEBJckD/ik4WsZzm2qOx9Fw
erGq7Zwchc+Jq1YeN5PxpzqSf4AG7+7dFIn+oe6X2FcIzgbYY+IfmgJIHEVjDHH5
+uAXyb6l4iKc89eQawO3t88pfHLJWbTzmnvgz2cMrxt94HRvgkHfvcpGEgbyldq6
EB33OunazFcfZFRIcXk1sfyLDvYE
=1ahV
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.jkh;</title>
	  
	  <programlisting>
Jordan K. Hubbard &lt;jkh@FreeBSD.org&gt;
Fingerprint = 3C F2 27 7E 4A 6C 09 0A  4B C9 47 CD 4F 4D 0B 20

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2i

mQCNAzFjX0IAAAEEAML+nm9/kDNPp43ZUZGjYkm2QLtoC1Wxr8JulZXqk7qmhYcQ
jvX+fyoriJ6/7ZlnLe2oG5j9tZOnRLPvMaz0g9CpW6Dz3nkXrNPkmOFV9B8D94Mk
tyFeRJFqnkCuqBj6D+H8FtBwEeeTecSh2tJ0bZZTXnAMhxeOdvUVW/uOVC1dAAUR
tCNKb3JkYW4gSy4gSHViYmFyZCA8amtoQEZyZWVCU0Qub3JnPokAlQMFEDF75D1r
WmeNgbKneQEBXtcD+gJIv8JzZRKlDZyTCQanK8iRgE+zMhxptI0kDObaGxT1BrpY
4/EPyiUN10G4k2Jb+DOc8Lg2xDQ3xmvgipFf9NMNV/ThaEuZ3wA31I6tW/arQEqB
Tp8u6T3v20m62t7Afo9HaoE6MBpHQUk2TilxgAd5P57sporL3pgW9YojIO9ziQCV
AwUQMXyV2h9/qQgDWPy9AQEMfgP/RmbSg2WlesATUQ4WuanjcdREduKPyfQatrXD
2xt+jg9X78dTyiNN1YvLqvT6msfs04MKSC0hA2mou6ozw8Xak+1QmP0fBOZKp9pP
8szO188Do9ByzJPvHF1eXT7jFMOXVq8ZIl9iwjxcIDLzlxOz49DC7LO6AT+LKQk7
UGeP+lqJAJUDBRAxe+UG9RVb+45ULV0BAXZ9A/9F9gLpGukVNkeOjaqxQdJGTS+a
xh/Abk0c/nKhAEyxpAl5JyQ3ifYk6BHhPvlTi9LrZoXGA8sk/eU4eRTZVzvGEC4G
+xsavlE/xzku8855QTLPpkCunUpQeu1wzaIrUUE6Zjh05imFbJYyQOBgTFpuqWsC
rsUpl+2mr8IGIxG5rA==
=LW9i
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.phk;</title>
	  
	  <programlisting>
Poul-Henning Kamp &lt;phk@FreeBSD.org&gt;
Fingerprint = A3 F3 88 28 2F 9B 99 A2  49 F4 E2 FA 5A 78 8B 3E

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAzAdpMIAAAEEALHDgrFUwhZtb7PbXg3upELoDVEUPFRwnmpJH1rRqyROUGcI
ooVe7u+FQlIs5OsXK8ECs/5Wpe2UrZSzHvjwBYOND5H42YtI5UULZLRCo5bFfTVA
K9Rpo5icfTsYihrzU2nmnycwFMk+jYXyT/ZDYWDP/BM9iLjj0x9/qQgDWPy9AAUR
tCNQb3VsLUhlbm5pbmcgS2FtcCA8cGhrQEZyZWVCU0Qub3JnPokAlQMFEDMGK9qz
WmLrWZ8yPQEB4iED/18bQVhV2gUYFSxIUTaUtO2HVPi7GRpSzmXoTfS+FJyRR0ED
zTqTHstoBe2PeWgTsOf9cUub5UKcJkRQp7VrJv4Kncyuq7pX69a+QMveCzuUwAur
nDbt/emOL6NU8g9Uk50QuOuipb5rULQLRRoF5TkViy/VES83ERXdYQ9Ml3fWiQCV
AwUQMX6NfWtaZ42Bsqd5AQEKsgP+L+uLz95dRdEmnZ+omrO+tYZM/0jHU7i8yC5q
H0gguKOCljI4liR7NkqKONUJWYtfsTB81d9iSosBZRrTx6i/hB8l8kOB975n/f9S
hftFwmjLYCNMFlDM4j0kySvMV20UZjAyv9BeE51VWlIZ5n/oeSuzul3Znow02tF/
zVnInJiJAJUDBRAxfJXn9RVb+45ULV0BAXJ8A/9K6NT6VLZZC5q3g7bBk5DWuzBS
3oK2Ebww6xzsD2R9edltoz1J3GPngK0CWpHh4kw5iTaRWoC2YJYRNG6icnGvlMAl
1/urqQHJVhxATINm8oljDKsj1RBJ6VKBzNbCJIHTVpX0AJoqUQX2Idi8goFr0fAm
7cD2CBb1JhoAdzEfO4kAlQMFEDFLHlwff6kIA1j8vQEBj5MD/1hA8hJdhpL7mvQj
rTAIn6Ldr08Lr1lqTaKSBMdCL3suGlW0Sw/dIBgicPDhgxLahT3DVfGiIst32FSl
xmWY7wine80X4TZkJ9Hiw3Mpqtjl92j6zHNq0ZZE+CceNubpEdYLDqokAIMPdWlo
WPHZcPxCs5PKI5udseFYF2gQAjI2iQCVAwUQMTlDoO9huekR1Y7VAQGy+AP/Rzp+
UGtJavbSiPx5EnXOXxkA/+ulXQgQG9vdkWwewkvxDNOzHW3KkUWCGtPtIMENznbF
j3QlYB+USIaf1ogvlD5EdXGPDfTINpE8CX2WXzajfgYFpYETDzduwjoWDZfEN9zZ
fQqQS62VgAReOIz3k9BL708z/+WUO0++RLGCmImJAJUDBRAw5q8kAPLZCeu7G0EB
AT3bBACwo+r9TgbiSyyU5cZpq5KgGT1c7eUHXjtxKmtrXD1nFNJ6j7x2DM2XGe6B
YOfDWbFq4UkEAyAeXviuuUP4enQu1v2g7JGXeuI8bRM519pLdPzDq/DnbA4rNStn
/SkH7awMfNSplcFuE6rc5ezVkw17eOHzDrYmwsFavL9gxZEycg==
=Q45T
-----END PGP PUBLIC KEY BLOCK-----
	  </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.rich;</title>
	  
	  <programlisting>
Rich Murphey &lt;rich@FreeBSD.org&gt;
fingerprint = AF A0 60 C4 84 D6 0C 73  D1 EF C0 E9 9D 21 DB E4

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAy97V+MAAAEEALiNM3FCwm3qrCe81E20UOSlNclOWfZHNAyOyj1ahHeINvo1
FBF2Gd5Lbj0y8SLMno5yJ6P4F4r+x3jwHZrzAIwMs/lxDXRtB0VeVWnlj6a3Rezs
wbfaTeSVyh5JohEcKdoYiMG5wjATOwK/NAwIPthB1RzRjnEeer3HI3ZYNEOpAAUR
tCRSaWNoIE11cnBoZXkgPHJpY2hAbGFtcHJleS51dG1iLmVkdT6JAJUDBRAve15W
vccjdlg0Q6kBAZTZBACcNd/LiVnMFURPrO4pVRn1sVQeokVX7izeWQ7siE31Iy7g
Sb97WRLEYDi686osaGfsuKNA87Rm+q5F+jxeUV4w4szoqp60gGvCbD0KCB2hWraP
/2s2qdVAxhfcoTin/Qp1ZWvXxFF7imGA/IjYIfB42VkaRYu6BwLEm3YAGfGcSw==
=QoiM
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>	  
	</sect2>
	
	<sect2>
	  <title>&a.jdp;</title>
	  
	  <programlisting>
John D. Polstra &lt;jdp@polstra.com&gt;
Fingerprint = 54 3A 90 59 6B A4 9D 61  BF 1D 03 09 35 8D F6 0D

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzMElMEAAAEEALizp6ZW9QifQgWoFmG3cXhzQ1+Gt+a4S1adC/TdHdBvw1M/
I6Ok7TC0dKF8blW3VRgeHo4F3XhGn+n9MqIdboh4HJC5Iiy63m98sVLJSwyGO4oM
dkEGyyCLxqP6h/DU/tzNBdqFzetGtYvU4ftt3RO0a506cr2CHcdm8Q+/vPRJAAUR
tCFKb2huIEQuIFBvbHN0cmEgPGpkcEBwb2xzdHJhLmNvbT6JAJUDBRAzBNBE9RVb
+45ULV0BAWgiA/0WWO3+c3qlptPCHJ3DFm6gG/qNKsY94agL/mHOr0fxMP5l2qKX
O6a1bWkvGoYq0EwoKGFfn0QeHiCl6jVi3CdBX+W7bObMcoi+foqZ6zluOWBC1Jdk
WQ5/DeqQGYXqbYjqO8voCScTAPge3XlMwVpMZTv24u+nYxtLkE0ZcwtY9IkAlQMF
EDMEt/DHZvEPv7z0SQEBXh8D/2egM5ckIRpGz9kcFTDClgdWWtlgwC1iI2p9gEhq
aufy+FUJlZS4GSQLWB0BlrTmDC9HuyQ+KZqKFRbVZLyzkH7WFs4zDmwQryLV5wkN
C4BRRBXZfWy8s4+zT2WQD1aPO+ZsgRauYLkJgTvXTPU2JCN62Nsd8R7bJS5tuHEm
7HGmiQCVAwUQMwSvHB9/qQgDWPy9AQFAhAQAgJ1AlbKITrEoJ0+pLIsov3eQ348m
SVHEBGIkU3Xznjr8NzT9aYtq4TIzt8jplqP3QoV1ka1yYpZf0NjvfZ+ffYp/sIaU
wPbEpgtmHnVWJAebMbNs/Ad1w8GDvxEt9IaCbMJGZnHmfnEqOBIxF7VBDPHHoJxM
V31K/PIoYsHAy5w=
=cHFa
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>
	</sect2>
	
	<sect2>
	  <title>&a.guido;</title>
	  
	  <programlisting>
Guido van Rooij &lt;guido@gvr.win.tue.nl&gt;
Fingerprint = 16 79 09 F3 C0 E4 28 A7  32 62 FA F6 60 31 C0 ED

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzGeO84AAAEEAKKAY91Na//DXwlUusr9GVESSlVwVP6DyH1wcZXhfN1fyZHq
SwhMCEdHYoojQds+VqD1iiZQvv1RLByBgj622PDAPN4+Z49HjGs7YbZsUNuQqPPU
wRPpP6ty69x1hPKq1sQIB5MS4radpCM+4wbZbhxv7l4rP3RWUbNaYutZnzI9AAUR
tCZHdWlkbyB2YW4gUm9vaWogPGd1aWRvQGd2ci53aW4udHVlLm5sPokAlQMFEDMG
Hcgff6kIA1j8vQEBbYgD/jm9xHuUuY+iXDkOzpCXBYACYEZDV913MjtyBAmaVqYo
Rh5HFimkGXe+rCo78Aau0hc57fFMTsJqnuWEqVt3GRq28hSK1FOZ7ni9/XibHcmN
rt2yugl3hYpClijo4nrDL1NxibbamkGW/vFGcljS0jqXz6NDVbGx5Oo7HBByxByz
iQCVAwUQMhmtVjt/x7zOdmsfAQFuVQQApsVUTigT5YWjQA9Nd5Z0+a/oVtZpyw5Z
OljLJP3vqJdMa6TidhfcatjHbFTve5x1dmjFgMX/MQTd8zf/+Xccy/PX4+lnKNpP
eSf1Y4aK+E8KHmBGd6GzX6CIboyGYLS9e3kGnN06F2AQtaLyJFgQ71wRaGuyKmQG
FwTn7jiKb1aJAJUDBRAyEOLXPt3iN6QQUSEBATwQA/9jqu0Nbk154+Pn+9mJX/YT
fYR2UqK/5FKCqgL5Nt/Deg2re0zMD1f8F9Dj6vuAAxq8hnOkIHKlWolMjkRKkzJi
mSPEWl3AuHJ31k948J8it4f8kq/o44usIA2KKVMlI63Q/rmNdfWCyiYQEVGcRbTm
GTdZIHYCOgV5dOo4ebFqgYkAlQMFEDIE1nMEJn15jgpJ0QEBW6kEAKqN8XSgzTqf
CrxFXT07MlHhfdbKUTNUoboxCGCLNW05vf1A8F5fdE5i14LiwkldWIzPxWD+Sa3L
fNPCfCZTaCiyGcLyTzVfBHA18MBAOOX6JiTpdcm22jLGUWBf/aJK3yz/nfbWntd/
LRHysIdVp29lP5BF+J9/Lzbb/9LxP1taiQCVAwUQMgRXZ44CzbsJWQz9AQFf7gP/
Qa2FS5S6RYKG3rYanWADVe/ikFV2lxuM1azlWbsmljXvKVWGe6cV693nS5lGGAjx
lbd2ADwXjlkNhv45HLWFm9PEveO9Jjr6tMuXVt8N2pxiX+1PLUN9CtphTIU7Yfjn
s6ryZZfwGHSfIxNGi5ua2SoXhg0svaYnxHxXmOtH24iJAJUDBRAyAkpV8qaAEa3W
TBkBARfQBAC+S3kbulEAN3SI7/A+A/dtl9DfZezT9C4SRBGsl2clQFMGIXmMQ/7v
7lLXrKQ7U2zVbgNfU8smw5h2vBIL6f1PyexSmc3mz9JY4er8KeZpcf6H0rSkHl+i
d7TF0GvuTdNPFO8hc9En+GG6QHOqbkB4NRZ6cwtfwUMhk2FHXBnjF4kAlQMFEDH5
FFukUJAsCdPmTQEBe74EAMBsxDnbD9cuI5MfF/QeTNEG4BIVUZtAkDme4Eg7zvsP
d3DeJKCGeNjiCWYrRTCGwaCWzMQk+/+MOmdkI6Oml+AIurJLoHceHS9jP1izdP7f
N2jkdeJSBsixunbQWtUElSgOQQ4iF5kqwBhxtOfEP/L9QsoydRMR1yB6WPD75H7V
iQCVAwUQMZ9YNGtaZ42Bsqd5AQH0PAQAhpVlAc3ZM/KOTywBSh8zWKVlSk3q/zGn
k7hJmFThnlhH1723+WmXE8aAPJi+VXOWJUFQgwELJ6R8jSU2qvk2m1VWyYSqRKvc
VRQMqT2wjss0GE1Ngg7tMrkRHT0il7E2xxIb8vMrIwmdkbTfYqBUhhGnsWPHZHq7
MoA1/b+rK7CJAJUDBRAxnvXh3IDyptUyfLkBAYTDA/4mEKlIP/EUX2Zmxgrd/JQB
hqcQlkTrBAaDOnOqe/4oewMKR7yaMpztYhJs97i03Vu3fgoLhDspE55ooEeHj0r4
cOdiWfYDsjSFUYSPNVhW4OSruMA3c29ynMqNHD7hpr3rcCPUi7J2RncocOcCjjK2
BQb/9IAUNeK4C9gPxMEZLokAlQMFEDGeO86zWmLrWZ8yPQEBEEID/2fPEUrSX3Yk
j5TJPFZ9MNX0lEo7AHYjnJgEbNI4pYm6C3PnMlsYfCSQDHuXmRQHAOWSdwOLvCkN
F8eDaF3M6u0urgeVJ+KVUnTz2+LZoZs12XSZKCte0HxjbvPpWMTTrYyimGezH79C
mgDVjsHaYOx3EXF0nnDmtXurGioEmW1J
=mSvM
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>	  
	</sect2>
	
	<sect2>
	  <title>&a.peter;</title>
	  
	  <programlisting>
Peter Wemm &lt;peter@FreeBSD.org&gt;
       aka &lt;peter@spinner.dialix.com&gt;
       aka &lt;peter@haywire.dialix.com&gt;
       aka &lt;peter@perth.dialix.oz.au&gt;
Key fingerprint = 47 05 04 CA 4C EE F8 93  F6 DB 02 92 6D F5 58 8A

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAy9/FJwAAAEEALxs9dE9tFd0Ru1TXdq301KfEoe5uYKKuldHRBOacG2Wny6/
W3Ill57hOi2+xmq5X/mHkapywxvy4cyLdt31i4GEKDvxpDvEzAYcy2n9dIup/eg2
kEhRBX9G5k/LKM4NQsRIieaIEGGgCZRm0lINqw495aZYrPpO4EqGN2HYnOMZAAUT
tCVQZXRlciBXZW1tIDxwZXRlckBoYXl3aXJlLmRpYWxpeC5jb20+iQCVAwUQMwWT
cXW7bjh2o/exAQEFkQP+LIx5zKlYp1uR24xGApMFNrNtjh+iDIWnxxb2M2Kb6x4G
9z6OmbUCoDTGrX9SSL2Usm2RD0BZfyv9D9QRWC2TSOPkPRqQgIycc11vgbLolJJN
eixqsxlFeKLGEx9eRQCCbo3dQIUjc2yaOe484QamhsK1nL5xpoNWI1P9zIOpDiGJ
AJUDBRAxsRPqSoY3Ydic4xkBAbWLA/9q1Fdnnk4unpGQsG31Qbtr4AzaQD5m/JHI
4gRmSmbj6luJMgNG3fpO06Gd/Z7uxyCJB8pTst2a8C/ljOYZxWT+5uSzkQXeMi5c
YcI1sZbUpkHtmqPW623hr1PB3ZLA1TIcTbQW+NzJsxQ1Pc6XG9fGkT9WXQW3Xhet
AP+juVTAhLQlUGV0ZXIgV2VtbSA8cGV0ZXJAcGVydGguZGlhbGl4Lm96LmF1PokA
lQMFEDGxFCFKhjdh2JzjGQEB6XkD/2HOwfuFrnQUtdwFPUkgtEqNeSr64jQ3Maz8
xgEtbaw/ym1PbhbCk311UWQq4+izZE2xktHTFClJfaMnxVIfboPyuiSF99KHiWnf
/Gspet0S7m/+RXIwZi1qSqvAanxMiA7kKgFSCmchzas8TQcyyXHtn/gl9v0khJkb
/fv3R20btB5QZXRlciBXZW1tIDxwZXRlckBGcmVlQlNELm9yZz6JAJUDBRAxsRJd
SoY3Ydic4xkBAZJUA/4i/NWHz5LIH/R4IF/3V3LleFyMFr5EPFY0/4mcv2v+ju9g
brOEM/xd4LlPrx1XqPeZ74JQ6K9mHR64RhKR7ZJJ9A+12yr5dVqihe911KyLKab9
4qZUHYi36WQu2VtLGnw/t8Jg44fQSzbBF5q9iTzcfNOYhRkSD3BdDrC3llywO7Ql
UGV0ZXIgV2VtbSA8cGV0ZXJAc3Bpbm5lci5kaWFsaXguY29tPokAlQMFEDGxEi1K
hjdh2JzjGQEBdA4EAKmNFlj8RF9HQsoI3UabnvYqAWN5wCwEB4u+Zf8zq6OHic23
TzoK1SPlmSdBE1dXXQGS6aiDkLT+xOdeewNs7nfUIcH/DBjSuklAOJzKliXPQW7E
kuKNwy4eq5bl+j3HB27i+WBXhn6OaNNQY674LGaR41EGq44Wo5ATcIicig/z
=gv+h
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>	  
	</sect2>
	
	<sect2>
	  <title>&a.joerg;</title>
	  
	  <programlisting>
Type Bits/KeyID    Date       User ID
pub  1024/76A3F7B1 1996/04/27 Joerg Wunsch &lt;joerg_wunsch@uriah.heep.sax.de&gt;
            Key fingerprint = DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
                              Joerg Wunsch &lt;joerg_wunsch@interface-business.de&gt;
                              Joerg Wunsch &lt;j@uriah.heep.sax.de&gt;
                              Joerg Wunsch &lt;j@interface-business.de&gt;

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAzGCFeAAAAEEAKmRBU2Nvc7nZy1Ouid61HunA/5hF4O91cXm71/KPaT7dskz
q5sFXvPJPpawwvqHPHfEbAK42ZaywyFp59L1GaYj87Pda+PlAYRJyY2DJl5/7JPe
ziq+7B8MdvbX6D526sdmcR+jPXPbHznASjkx9DPmK+7TgFujyXW7bjh2o/exAAUR
tC1Kb2VyZyBXdW5zY2ggPGpvZXJnX3d1bnNjaEB1cmlhaC5oZWVwLnNheC5kZT6J
AJUDBRA0FFkBs1pi61mfMj0BAfDCA/oCfkjrhvRwRCpSL8klJ1YDoUJdmw+v4nJc
pw3OpYXbwKOPLClsE7K3KCQscHel7auf91nrekAwbrXv9Clp0TegYeAQNjw5vZ9f
L6UZ5l3fH8E2GGA7+kqgNWs1KxAnG5GdUvJ9viyrWm8dqWRGo+loDWlZ12L2OgAD
fp7jVZTI1okAlQMFEDQPrLoff6kIA1j8vQEB2XQEAK/+SsQPCT/X4RB/PBbxUr28
GpGJMn3AafAaA3plYw3nb4ONbqEw9tJtofAn4UeGraiWw8nHYR2DAzoAjR6OzuX3
TtUV+57BIzrTPHcNkb6h8fPuHU+dFzR+LNoPaGJsFeov6w+Ug6qS9wa5FGDAgaRo
LHSyBxcRVoCbOEaS5S5EiQCVAwUQM5BktWVgqaw0+fnVAQGKPwP+OiWho3Zm2GKp
lEjiZ5zx3y8upzb+r1Qutb08jr2Ewja04hLg0fCrt6Ad3DoVqxe4POghIpmHM4O4
tcW92THQil70CLzfCxtfUc6eDzoP3krD1/Gwpm2hGrmYA9b/ez9+r2vKBbnUhPmC
glx5pf1IzHU9R2XyQz9Xu7FI2baOSZqJAJUDBRAyCIWZdbtuOHaj97EBAVMzA/41
VIph36l+yO9WGKkEB+NYbYOz2W/kyi74kXLvLdTXcRYFaCSZORSsQKPGNMrPZUoL
oAKxE25AoCgl5towqr/sCcu0A0MMvJddUvlQ2T+ylSpGmWchqoXCN7FdGyxrZ5zz
xzLIvtcio6kaHd76XxyJpltCASupdD53nEtxnu8sRrQxSm9lcmcgV3Vuc2NoIDxq
b2VyZ193dW5zY2hAaW50ZXJmYWNlLWJ1c2luZXNzLmRlPokAlQMFEDIIhfR1u244
dqP3sQEBWoID/RhBm+qtW+hu2fqAj9d8CVgEKJugrxZIpXuCKFvO+bCgQtogt9EX
+TJh4s8UUdcFkyEIu8CT2C3Rrr1grvckfxvrTgzSzvtYyv1072X3GkVY+SlUMBMA
rdl1qNW23oT7Q558ajnsaL065XJ5m7HacgTTikiofYG8i1s7TrsEeq6PtCJKb2Vy
ZyBXdW5zY2ggPGpAdXJpYWguaGVlcC5zYXguZGU+iQCVAwUQMaS91D4gHQUlG9CZ
AQGYOwQAhPpiobK3d/fz+jWrbQgjkoO+j39glYGXb22+6iuEprFRs/ufKYtjljNT
NK3B4DWSkyIPawcuO4Lotijp6jke2bsjFSSashGWcsJlpnwsv7EeFItT3oWTTTQQ
ItPbtNyLW6M6xB+jLGtaAvJqfOlzgO9BLfHuA2LY+WvbVW447SWJAJUDBRAxqWRs
dbtuOHaj97EBAXDBA/49rzZB5akkTSbt/gNd38OJgC+H8N5da25vV9dD3KoAvXfW
fw7OxIsxvQ/Ab+rJmukrrWxPdsC+1WU1+1rGa4PvJp/VJRDes2awGrn+iO7/cQoS
IVziC27JpcbvjLvLVcBIiy1yT/RvJ+87a3jPRHt3VFGcpFh4KykxxSNiyGygl4kA
lQMFEDGCUB31FVv7jlQtXQEB5KgD/iIJZe5lFkPr2B/Cr7BKMVBot1/JSu05NsHg
JZ3uK15w4mVtNPZcFi/dKbn+qRM6LKDFe/GF0HZD/ZD1FJt8yQjzF2w340B+F2GG
EOwnClqZDtEAqnIBzM/ECQQqH+6Bi8gpkFZrFgg5eON7ikqmusDnOlYStM/CBfgp
SbR8kDmFtCZKb2VyZyBXdW5zY2ggPGpAaW50ZXJmYWNlLWJ1c2luZXNzLmRlPokA
lQMFEDHioSdlYKmsNPn51QEByz8D/10uMrwP7MdaXnptd1XNFhpaAPYTVAOcaKlY
OGI/LLR9PiU3FbqXO+7INhaxFjBxa0Tw/p4au5Lq1+Mx81edHniJZNS8tz3I3goi
jIC3+jn2gnVAWnK5UZUTUVUn/JLVk/oSaIJNIMMDaw4J9xPVVkb+Fh1A+XqtPsVa
YESrNp0+iQCVAwUQMwXkzcdm8Q+/vPRJAQEA4QQAgNNX1HFgXrMetDb+w6yEGQDk
JCDAY9b6mA2HNeKLQAhsoZl4HwA1+iuQaCgo3lyFC+1Sf097OUTs74z5X1vCedqV
oFw9CxI3xuctt3pJCbbN68flOlnq0WdYouWWGlFwLlh5PEy//VtwX9lqgsizlhzi
t+fX6BT4BgKi5baDhrWJAJUDBRAyCKveD9eCJxX4hUkBAebMA/9mRPy6K6i7TX2R
jUKSl2p5oYrXPk12Zsw4ijuktslxzQhOCyMSCGK2UEC4UM9MXp1H1JZQxN/DcfnM
7VaUt+Ve0wZ6DC9gBSHJ1hKVxHe5XTj26mIr4rcXNy2XEDMK9QsnBxIAZnBVTjSO
LdhqqSMp3ULLOpBlRL2RYrqi27IXr4kAlQMFEDGpbnd1u244dqP3sQEBJnQD/RVS
Azgf4uorv3fpbosI0LE3LUufAYGBSJNJnskeKyudZkNkI5zGGDwVneH/cSkKT4OR
ooeqcTBxKeMaMuXPVl30QahgNwWjfuTvl5OZ8orsQGGWIn5FhqYXsKkjEGxIOBOf
vvlVQ0UbcR0N2+5F6Mb5GqrXZpIesn7jFJpkQKPU
=97h7
-----END PGP PUBLIC KEY BLOCK-----
          </programlisting>
	</sect2>
      </sect1>
    </chapter>
  </part>
</book>