Вы находитесь на странице: 1из 234

FreeBSD

Chapter 1.
Table of Contents
1.1.
1.2. FreeBSD!
1.3. FreeBSD
, Jim Mock <jim@FreeBSD.org>, 17
2000.

1.1.
FreeBSD!
FreeBSD, , , ,
.
FreeBSD, 4.4BSD-Lite2,
Intel (x86), DEC Alpha.
. FreeBSD, .
FreeBSD, . (, , - ) ,
FreeBSD.

1.2. FreeBSD!
, FreeBSD
. FreeBSD,
.

1.2.1. FreeBSD?
, FreeBSD - , 4.4BSD-Lite2.
Intel (x86) DEC Alpha.
FreeBSD Internet, :

Yahoo!
Hotmail

Apache

Be, Inc.

Blue Mountain Arts

Pair Networks

Whistle Communications
2

Walnut Creek CDROM

1.2.2. FreeBSD?
FreeBSD . :



, .

FreeBSD . , ,
,


.

TCP/IP , SLIP,
PPP, NFS, DHCP NIS. , FreeBSD
,
, NFS ( )
Internet WWW,
FTP, ( ).

, ( )
.
.

FreeBSD 32- (64 Alpha)


.

X Window System (X11R6)


(GUI) VGA
.

, Linux, SCO,
SVR4, BSDI NetBSD.

FreeBSD
. - ,
?

- Internet. FreeBSD
Unix
, ,
, , .


" VM/ " ,
,
, .
3

(SMP)
( Intel).

: C, C++, Fortran Perl.



.

,
.
, -
?

on-line .

- !

FreeBSD 4.4BSD-Lite2 Computer Systems Research Group (CSRG)


, ,
BSD-. CSRG,
FreeBSD
.

PC, FreeBSD ,
!
FreeBSD .
,
;
UNIX-,
FreeBSD! FreeBSD ,

, .

.
, FreeBSD ,
,
, ,
. ,
FreeBSD:

Internet : TCP/IP FreeBSD


Internet :
o FTP
o

World Wide Web ( , [SSL])

- NAT ("IP
").

USENET BBS

...

FreeBSD,
386 PC,
Xeon RAID .

:
? ,
, , FreeBSD.
CAD,

.
: , , FreeBSD
,
.
FreeBSD ,

,
.

: ? (DNS)? ,
? FreeBSD
386 486 PC
.

X Window: FreeBSD ,
X-. XFree86
, X Inside. X
, FreeBSD ,
, . FreeBSD
" ",
.

: FreeBSD
,
GNU C/C++ .

FreeBSD , CDROM
FTP. FreeBSD .

1.3. FreeBSD
, ,
, .

1.3.1. FreeBSD
Jordan K. Hubbard <jkh@FreeBSD.org>.
5

FreeBSD 1993 ,
" 386BSD (patchkit) ", 3-
: Nate Williams, Rod Grimes .
386BSD ,
, patchkit .
: "386BSD 0.5" "386BSD Interim".
386BSD ,
, . patchkit
,
-
"" . ,
,
.
,
, , "FreeBSD"
.
, ,
, Walnut Creek CDROM
FreeBSD
Internet. Walnut Creek CDROM
FreeBSD CD,
Internet. Walnut Creek
CDROM, , FreeBSD
, .
, CDROM, , FreeBSD
1.0, 1993 .
4.3BSD-Lite ("Net/2") ,
386BSD .
,
FreeBSD 1.1 RELEASE 1994 .
, Novell
, . -
Net/2 .
, Net/2 "" ,
Novell, , ( )
AT&T. Novell, 4.4BSDLite, ""
Net/2 .
FreeBSD, 1994
Net/2.
, FreeBSD 1.1.5.1.
FreeBSD
4.4BSD-Lite. "Lite"
light () , CSRG
( )
4.4BSD Intel .
6

1994
FreeBSD 2.0 CDROM ( ).

FreeBSD 2.0.5
1995 .
FreeBSD 2.1.5 1996,
ISP ,
2.1-STABLE . FreeBSD 2.1.7.1,
1997 2.1-STABLE. ,

(RELENG_2_1_0).
FreeBSD 2.2 ("-CURRENT") 1996
RELENG_2_2, (2.2.1) 1997.
2.2 '97, (2.2.8)
1998. 3.0 1998,
2.2
20 1999 , 4.0-CURRENT 3.XSTABLE. 3.X-STABLE : 3.1 - 15 1999, 3.2 - 15 1999,
3.3 - 16 1999, 3.4 - 20 1999, 3.5 - 24 2000,
3.5.1,
Kerberos. 3.x.
13 , 2000
4.X-STABLE 5.0-CURRENT.
- 4.2-RELEASE.
5.0-CURRENT,
- 5.0 CDROM (, , ).

1.3.2. FreeBSD
Jordan K. Hubbard <jkh@FreeBSD.org>.
FreeBSD ,
.
( )
,
. , ""
, ,
. ,
,
.
,
GNU (GPL) GNU (LGPL)
,
, .
, GPL ,
7

BSD,
.

1.3.3. FreeBSD
Satoshi Asami <asami@FreeBSD.org>.
FreeBSD , FreeBSD
,
.
,

FreeBSD <freebsd-hackers@FreeBSD.org>.
FreeBSD
FreeBSD <freebsd-announce@FreeBSD.org>.
, , FreeBSD
, , :
CVS
FreeBSD CVS
(Concurrent Version System),
, FreeBSD. CVS
, ()
. CVS,
-CURRENT -STABLE, ,
.

.

, CVS,
FreeBSD
( "" cvs(1) commit,
CVS ).
-
send-pr(1), - ,
<cvs-committers@FreeBSD.org>.
CORE FreeBSD
CORE FreeBSD ,
FreeBSD . CORE
,
.
CORE ,
CORE , .
CORE
.
8

CORE ,
, ,
.
Note: CORE
,
" ". "
" ,
FreeBSD ! ;-)

, ,
,
.
FreeBSD
<freebsd-hackers@FreeBSD.org> (
), .
, - ,
,
- FreeBSD ?:-)
; -
,
.
,
.
FreeBSD,
,
!
,
,
.
, FreeBSD
FreeBSD!

1.3.4. FreeBSD
FreeBSD - , 4.4BSD-Lite
Intel i386, i486, Pentium, Pentium Pro, Celeron,
Pentium II, Pentium III ( ) DEC Alpha.
CSRG, U.C. Berkley,
NetBSD, OpenBSD, 386BSD Free Software Foundation.
FreeBSD 2.0 94, , ,
FreeBSD .
VM/
, ,
, 5MB
9

. NIS (
), TCP, "--" PPP,
DHCP, SCSI, ISDN, ATM, FDDI, Fast
Gigabit Ethernet (1000Mbit) ,
Adaptec .

,
. (
) !
, FreeBSD
. 2000
3000 ! http
(WWW) , , ,
. 50
, ""
. ,
1.0 .
,
, make install
. ,
CDROM'a FTP ,

. - "",
(pkg_add)
.

FreeBSD
/usr/share/doc FreeBSD 2.1 .

HTML URL:
FreeBSD
file:/usr/share/doc/handbook/index.html
FreeBSD ( )
file:/usr/share/doc/faq/index.html
( )
http://www.FreeBSD.org/.

10

Chapter 2. FreeBSD
Table of Contents
2.1.
2.2.
2.3.
2.4.
, Jim Mock <jim@FreeBSD.org>,
2000 .

2.1.
, FreeBSD .
, ,
FreeBSD, ( FTP, NFS), -, ,
, MS-DOS .
, ,
. FreeBSD,
,
, ,
11

. ,
.
FreeBSD FTP,
. .
FreeBSD
.
, , , . ,
.

2.2.
FreeBSD.
, - , , email
FreeBSD <freebsd-doc@FreeBSD.org>.

2.2.1.
, (
).
,
FreeBSD. .
- "" , SCSI ,
.., (IRQ
-).

2.2.1.1.
, .
, :
, ,
, .

MS-DOS ,
fdimage.exe ( - tools\)
:
E:\> tools\fdimage floppies\kern.flp a:

fdimage A:
kern.flp (,
FreeBSD floppies). ,
kern.flp
DOS,
FAT.

12

UNIX-
, :
# dd if=kern.flp of=disk_device bs=1k

/dev .
FreeBSD, /dev/rfd0 A: /dev/rfd1 B:.
disk_device

, kern.flp .
mfsroot.flp,
.

2.2.1.2. -
CDROM ( ),
- MS-DOS.
FreeBSD -, Walnut Creek
CDROM's,
( ,
, ,
). - - MS-DOS,
install.bat, makeflp.bat.
-, -
El Torito ( ,
CDROM),
FreeBSD CDROM .
-.
MS-DOS ,
CDROM, install.bat
-, - DOS.
Note: , - ""
DOS; DOS- Windows .
view ( DOS).
.
UNIX- ,
.
, , , - DOS,
CDROM .
.
, (
, FreeBSD),
CDROM, :
# mount /cdrom

13

- CDROM, .
:
# umount /cdrom

!
Note: , , - ,
CDROM,
FreeBSD , , CDROM
.
, , FreeBSD
FTP -, ( ,
)
( vipw):
ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent

, , FTP
ftp:// , " (Other)" FTP .

2.2.1.3.
FreeBSD (
), , , ,
,
.
, 1.44MB 1.2MB ,
bin.
DOS FORMAT. Windows,
format Windows File Manager.
. ,
, . ,
, - .
FreeBSD,
. , FAT
( DOS). UFS (
FreeBSD) disklabel newfs, , ( 3.5" 1.44MB
):
# fdformat -f 1440 fd0.1440
# disklabel -w -r fd0.1440 floppy3
# newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0

Note: 5.25" 1.2MB , fd0.1440 fd0.1200 floppy3


floppy5 .
.
14

, ,
. , ,
,
1.44MB . ,
, a:\bin\bin.aa,
a:\bin\bin.ab .
Media "Floppy".

2.2.1.4. - MS-DOS
MS-DOS (
c:\FreeBSD) ( ), ,
DOS xcopy. FreeBSD -:
C:\> md c:\FreeBSD
C:\> xcopy /s e:\bin c:\FreeBSD\bin\
C:\> xcopy /s e:\manpages c:\FreeBSD\manpages\

C: , E:
CDROM.
,
;
BIN.

2.2.1.5. QIC/SCSI

FreeBSD. , 'tar' ,
, :
# cd /freebsd/distdir
# tar cvf /dev/rwt0 dist1 ... dist2

,
- ( ),
.
, ,
.
Note: , , ,
.

2.2.1.6.
: (
SLIP PPP), (PLIP (laplink )), Ethernet (
ethernet ( PCMCIA )).
SLIP
, . ,
15

PPP, ( , SLIP
).
, PPP. ,
, ,
. ,
"AT-",
, PPP .
PAP CHAP, set
authname set authkey, term.
ppp FAQ .
, set log local ....
FreeBSD (2.0-R
), "laplink"
. ,
, 50 ,
.
, ethernet . FreeBSD
PC ethernet , (
) .
PCMCIA ethernet , FreeBSD,
, .
, FreeBSD PCMCIA "
".
IP ,
. PPP-, , IP
.
. IP
, DNS (
).
,
.

2.2.1.6.1. NFS
NFS .
FreeBSD , NFS ,
NFS, , FreeBSD.
NFS " " (
Sun),
, .
,
, .
, NFS ,
, , FreeBSD
16

:ziggy:/usr/archive/stuff/FreeBSD, ziggy
/usr/archive/stuff/FreeBSD, /usr /usr/archive/stuff.
FreeBSD -alldirs
/etc/exports, .
"permission denied", NFS
.

2.2.1.6.2. FTP
FTP ,
FreeBSD. ,
.
FreeBSD ,
, DNS ,
( " (Other)") IP (
DNS ) FTP , FreeBSD:
ftp://165.113.121.81/pub/FreeBSD/4.2-RELEASE

FTP, :
FTP.
FTP
FTP "" .
, FTP
, .
( ),
!
FTP
FTP "" .
,
.
Note: , ,
"proxy", FTP !
, FTP ,
, "@". FTP
, "" . , FreeBSD
ftp.FreeBSD.org, foo.bar.com, 1024.
, FTP ftp@ftp.FreeBSD.org
email . : FTP ( FTP,
)
ftp://foo.bar.com:1234/pub/FreeBSD.

17

/pub/FreeBSD ftp.FreeBSD.org foo.bar.com,


foo.bar.com, ,
ftp.FreeBSD.org.

2.2.2. FreeBSD
, , FreeBSD!
, - ,
.
(,
). , FreeBSD
, .
FreeBSD ,
. , - ,
, .
FreeBSD <freebsddoc@FreeBSD.org>. ( /stand/sysinstall)
, -
"" , ,
, ,
:-)
, " ":
1. kern.flp ,
mfsroot.flp, "".
( 30 3- ,
) . -
, " ".
2. F1.
.
FreeBSD, , .
3. (Options)
.
4. (Novice), (Custom) (Express)
, ,
, ,
. FreeBSD,
.
5. ,
,
FreeBSD. ,
FreeBSD -, ,
.
, FreeBSD c
.
18

2.3.
FreeBSD ISA, VLB, EISA PCI
, 386SX PentiumPro ( 386SX
). IDE ESDI ,
SCSI , .
FreeBSD 8
, 16
.
, FreeBSD.
, , , ;
"", .

2.3.1.

WD1003 ( MFM/RLL)
WD1007 ( IDE/ESDI)

IDE

ATA

Adaptec 1535 ISA SCSI

Adaptec 154X ISA SCSI

Adaptec 174X EISA SCSI

Adaptec 274X/284X/2920C/294X/2950/3940/3950 (Narrow/Wide/Twin) EISA/VLB/PCI


SCSI

Adaptec AIC-7850, AIC-7860, AIC-7880, AIC-789X on-board SCSI

Adaptec 1510 ISA SCSI ( , )

Adaptec 152X ISA SCSI

Adaptec AIC-6260 AIC-6360 , AHA-152X SoundBlaster SCSI

AdvanSys SCSI ( )

BusLogic MultiMaster - "W" BT-948, BT-958, BT-9580

BusLogic MultiMaster - "C" BT-946C, BT-956C, BT956CD, BT-445C, BT-747C, BT-757C, BT-757CD, BT-545C, BT-540CF

19

BusLogic MultiMaster - "S" BT-445S, BT-747S, BT747D, BT-757S, BT-757D, BT-545S, BT-542D, BT-742A, BT-542B

BusLogic MultiMaster - "A" BT-742A, BT-542B

AMI FastDisk , BusLogic


MultiMaster .
Note: BusLogic/Mylex "Flashpoint" .

DPT SmartCACHE Plus, SmartCACHE III, SmartRAID III, SmartCACHE IV


SmartRAID IV SCSI/RAID . DPT SmartRAID/CACHE V
.
Compaq Intelligent : IDA, IDA-2, IAES, SMART,
SMART-2/E, Smart-2/P, SMART-2SL, Integrated Array Smart Arrays 3200, 3100ES,
221, 4200, 4200, 4250ES.

SymBios ( NCR) 53C810, 53C810a, 53C815, 53C820, 53C825a, 53C860,


53C875, 53C875j, 53C885 53C896 PCI SCSI ASUS SC-200,
Data Technology DTC3130 ( ), Diamond FirePort (all), NCR
(), SymBios (), Tekram DC390W, 390U 390F, Tyan S1365

QLogic 1020, 1040, 1040B 2100 SCSI Fibre Channel Adapters

DTC 3290 EISA SCSI 1542

SCSI , SCSI-I
SCSI-II , , ,
(DAT 8mm Exabyte), , CDROM .
WORM , CDROM,
" " CDROM.
WORM/CD-R/CD-RW cdrecord,
.
CD-ROM :

cd - SCSI ( ProAudio Spectrum SoundBlaster SCSI)


matcd - Matsushita/Panasonic (Creative Soundblaster, 562/563)

scd

- Sony ( )

wcd

- ATAPI IDE

SCSI ,
CAM SCSI :

NCR5380/NCR53400 ("ProAudio Spectrum") SCSI


UltraStor 14F, 24F 34F SCSI

Seagate ST01/02 SCSI

Future Domain 8XX/950 SCSI


20

WD7000 SCSI
Note: UltraStor SCSI
CAM, , .

; :

(Colorado/Mountain/Insight)

mcd

- CD-ROM Mitsumi ( )

2.3.2.

Adaptec Duralink PCI fast ethernet , Adaptec AIC-6195 fast


ethernet (), :
o ANA-62011 64- 10/100baseTX
o

ANA-62022 64- 10/100baseTX

ANA-62044 64- 10/100baseTX

ANA-69011 32- 10/100baseTX

ANA-62020 64- 100baseFX

Allied-Telesyn AT1700 RE2000

Alteon Networks PCI ethernet , Tigon 1


Tigon 2 , Alteon AceNIC (Tigon 1 2), 3Com 3c985-SX (Tigon 1
2), Netgear GA620 (Tigon 2), Silicon Graphics Gigabit Ethernet, DEC/Compaq
EtherWORKS 1000, NEC Gigabit Ethernet

AMD PCnet/PCI (79c970 53c974 79c974)

RealTek 8129/8139 fast ethernet , :


o

Allied-Telesyn AT2550

Allied-Telesyn AT2500TX

Genius GF100TXR (RTL8139)

NDC Communications NE100TX-E

OvisLink LEF-8129TX

OvisLink LEF-8139TX

Netronix Inc. EA-1210 NetEther 10/100

KTX-9130TX 10/100 Fast Ethernet


21

Accton "Cheetah" EN1027D (MPX 5030/5038; RealTek 8139 ?)

SMC EZ Card 10/100 PCI 1211-TX

Lite-On 98713, 98713A, 98715 98725 fast ethernet , LinkSys


EtherFast LNE100TX, NetGear FA310-TX Rev. D1, Matrox FastNIC 10/100, Kingston
KNE110TX

Macronix 98713, 98713A, 98715, 98715A 98725 fast ethernet ,


NDC Communications SFA100A (98713A), CNet Pro120A (98713 98713A), CNet
Pro120B (98715), SVEC PN102TX (98713)

Macronix/Lite-On PNIC II LC82C115 fast ethernet , LinkSys


EtherFast LNE100TX 2

Winbond W89C840F fast ethernet , Trendware TE100-PCIE

VIA Technologies VT3043 "Rhine I" VT86C100A "Rhine II" fast ethernet ,
Hawking Technologies PN102TX D-Link DFE-530TX

Silicon Integrated Systems SiS 900 SiS 7016 PCI fast ethernet

Sundance Technologies ST201 PCI fast ethernet , D-Link DFE550TX

SysKonnect SK-984x PCI ethernet , SK-9841


1000baseLX ( , ), SK-9842 1000baseSX
( , ), SK-9843 1000baseLX (
, ) SK-9844 1000baseSX ( ,
).

Texas Instruments ThunderLAN PCI , Compaq Netelligent


10, 10/100, 10/100 Proliant, 10/100 Dual-Port, 10/100 TX Embedded UTP, 10 T PCI
UTP/Coax 10/100 TX UTP, Compaq NetFlex 3P, 3P Integrated 3P w/BNC, Olicom
OC-2135/2138, OC-2325, OC-2326 10/100 TX UTP Racore 8165 10/100baseTX
8148 10baseT/100baseTX/100baseFX -personality

ADMtek AL981 AN985 PCI fast ethernet

ASIX Electronics AX88140A PCI , Alfa Inc. GFC2204


CNet Pro110B

DEC EtherWORKS III (DE203, DE204 DE205)

DEC EtherWORKS II (DE200, DE201, DE202 DE422)

DEC DC21040, DC21041 DC21140 (SMC Etherpower 8432T,


DE245 .)

DEC FDDI (DEFPA/DEFEA)

Efficient ENI-155p ATM PCI


22

FORE PCA-200E ATM PCI

Fujitsu MB86960A/MB86965A

HP PC Lan+ ( 27247B 27252A)

Intel EtherExpress ( - )

Intel EtherExpress Pro/10

Intel EtherExpress Pro/100B PCI Fast Ethernet

Isolan AT 4141-0 (16 )

Isolink 4110 (8 )

Novell NE1000, NE2000, and NE2100 Ethernet

PCI , NE2000, RealTek 8029, NetVin 5000,


Winbond W89C940, Surecom NE-34, VIA VT86C926

3Com 3C501, 3C503 Etherlink II, 3C505 Etherlink/+, 3C507 Etherlink 16/TP, 3C509,
3C579, 3C589 (PCMCIA), 3C590/592/595/900/905/905B/905C PCI EISA (Fast)
Etherlink III / (Fast) Etherlink XL, 3C980/3C980B Fast Etherlink XL server ,
3CSOHO100-TX OfficeConnect

Toshiba ethernet

PCMCIA ethernet IBM National Semiconductor

2.3.3. USB
FreeBSD USB . (
) USB ,
, .

USB
USB

USB USB- -

USB

ALi Aladdin-V
Intel 82371SB (PIIX3) 82371AB EB (PIIX4)

NEC uPD 9210 -

VIA 83C572 USB -


23

UHCI OHCI ( ).
PCI plug-in USB -

ADS Electronics PCI plug-in (2 )

Entrega PCI plug-in (4 )

USB :

Agiler 29UO
Andromeda

Apple iMac

ATen

Belkin F4U002 Belkin

BTC BTC7935

Cherry G81-3504

Chic

Cypress

Entrega USB-to-parallel

Genius Niche

Iomega USB Zip 100 MB

Kensington Mouse-in-a-Box

Logitech M2452

Logictech wheel (3 )

Logitech PS/2 / USB (3 )

MacAlly mouse (3 buttons)

MacAlly ( , 4 )

Microsoft Intellimouse (3 )

Microsoft

NEC

24

Trust Ami (3 )

2.3.4. ISDN ( DSS1 [Q.921/Q.931])

Asuscom I-IN100-ST-DV (, )
Asuscom ISDNlink 128K

AVM A1

AVM Fritz!Card

AVM Fritz!Card PCI

AVM Fritz!Card PCMCIA

AVM Fritz!Card PnP

Creatix ISDN-S0/8

Creatix ISDN-S0/16

Creatix ISDN-S0 PnP

Dr.Neuhaus Niccy 1008

Dr.Neuhaus Niccy 1016

Dr.Neuhaus Niccy GO@ (ISA PnP)

Dynalink IS64PH ( )

ELSA 1000pro ISA

ELSA 1000pro PCI

ELSA PCC-16

ITK ix1 micro

ITK ix1 micro V.3

Sagem Cybermod (ISA PnP, )

Sedlbauer Win Speed

Siemens I-Surf 2.0

Stollman Tina-pp ( )

Teles S0/8

25

Teles S0/16

Teles S0/16.3 ("c" -- &16.3c mdash; !)

Teles S0 PnP (, )

3Com/USRobotics Sportster ISDN TA intern (-PnP )

2.3.5.

AST (4 ), IRQ
ARNET (8 ), IRQ

ARNET ( Digiboard) Sync 570/i

Boca BB1004 (4 , )

Boca IOAT66 (6 , )

Boca BB1008 (8 , )

Boca BB2016 (16 , )

Cyclades Cyclom-y

STB (4 ), IRQ

SDL Communications RISCom/8

SDL Communications RISCom/N2 N2pci


Specialix SI/XIO/SX ,
SIHOST2.x, "" ( ,
JET) -; ISA, EISA PCI

Stallion : EasyIO, EasyConnection 8/32


8/64, ONboard 4/16 Brumby

Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound Roland


MPU-401

Connectix QuickCam

Matrox Meteor Video

Creative Labs Video Spigot

Cortex1

Brooktree Bt848 Bt878


26

HP4020, HP6020, Philips CDD2000/CDD2660 Plasmon CD-R

Bus

PS/2

PC

X-10 power

GPIB Transputer

Genius Mustek

( ,
)

Lucent Technologies WaveLAN/IEEE 802.11 PCMCIA ISA


(2Mb/c) (6Mb/)
(NCR WaveLAN/IEEE 802.11, Cabletron RoamAbout 802.11 DS)
Note: ISA PCMCIA
ISA/PCMCIA ,
.

FreeBSD IBM microchannel (MCA).

2.4.
,
, . ,
, FreeBSD/MS-DOS.

2.4.1. - ...
- , PC,
100%. ,
,
.
,
"" FreeBSD.
,
, ,
.
. , IRQ, DMA
-. ,
.

27

, (
). ,
.
Warning ,
, , (sc0). (),
-
. .
, :

, .
, .

IRQ, DMA - .

, , Q
. ,
,
. , ,
.

2.4.2. MS-DOS
FreeBSD , MS-DOS.
,
.
2.4.2.1. , ! ?
2.4.2.2. MS-DOS FreeBSD?
2.4.2.3. MS-DOS?

2.4.2.1. , !
?
MS-DOS,
, ! , FIPS,
tools - FTP
FreeBSD.
FIPS MS-DOS ,
FreeBSD .
MS-DOS DOS 6.XX
DEFRAG Norton Disk Tools, FIPS
. FreeBSD
. (Distributions) ,
.

2.4.2.2. MS-DOS FreeBSD?

28

. ,
Stacker(tm) DoubleSpace(tm), FreeBSD
, .
(
). ,
!
MS-DOS
MS-DOS FreeBSD.

2.4.2.3. MS-DOS?
. DOS FreeBSD ("slices")
, , D: /dev/sd0s5,
E: /dev/da0s6 . ,
SCSI . IDE , wd
da . ,
DOS, :
# mount -t msdos /dev/sd0s5 /dos_d

Chapter 3. Unix
Table of Contents
3.1.
3.2.
3.3.
3.4.
3.5.
3.6. ...

3.1.
Chris Shumway <cshumway@cdrom.com>, 10 2000.
c
FreeBSD. , ,
- .

29

3.2.
FreeBSD BSD UNIX,
UNIX. , , , FreeBSD . ,
,
.
, , .

. : ,
. , //
// . :

0
1
2
3
4
5
6
7



,
,
,
,
,
,


----x
-w-wx
r-r-x
rwrwx

, ls -l.
:
-rw-r--r--

: , ,
, . (
rw-) . ,
(r--). (r--) .
- (.. , ,
). ,
, . ,
644.
. FreeBSD
, , .
/dev.
,
, . , ``''
. ``'', ,
, ``'' .
, , ,
setuid- sticky- .

30


man (chmod(1)).

3.3.
FreeBSD
, .
hier(7) man,
.
, , ,
/.
, .
,
. - /usr,
/var, /mnt /cdrom. /etc/fstab,
. ,
/etc/fstab rc(8),
noauto. fstab(5)
/etc/fstab .

3.4.
FreeBSD,
( ``''),
, , .
, ,
, ,
. FreeBSD
, , sh, Bourne Shell, csh, C-shell. ,
, , tcsh bash, .
? .
C, , , tcsh, Linux,
bash, - .
, , ,
.
-
.
, (TAB),
, , foobar foo.bar. ,
foo.bar. , rm fo[TAB].[TAB].
: rm foo[BEEP].bar.

31

[BEEP] - , ,
,
. , foobar
foo.bar fo, TAB
foo. (.) TAB,
.
,
. ,
.
, ,
.

:

USER
.
PATH
, ,
.
DISPLAY
X11, .
SHELL
.
TERM
() . ,
.
TERMCAP
escape-
.
OSTYPE
() . , FreeBSD.
MACHTYPE
().
EDITOR
.
PAGER
.
MANPATH
, ,
.
,
. ,
csh tcsh setenv. sh bash set export. ,
EDITOR ( csh tcsh)
/usr/local/bin/emacs, :
setenv EDITOR /usr/local/bin/emacs

bash:
export EDITOR="/usr/local/bin/emacs"

, , ,
($) . , echo $TERM
$TERM.
,
, , .
- *,
32

, ?, .
, , echo * ,
ls, * ( ,
, , bash *
, . - ).
,
, . ,
(\). , echo $TERM
, echo \$TERM $TERM,
$TERM.

3.4.1.
, , chsh. EDITOR
, $EDITOR, vi.
``Shell:'' .
-s chsh. :
% chsh -s /usr/local/bin/bash

Note: ,
, /etc/shells. ,
, .
, .
, , bash ,
, /usr/local/bin. ,
:
# echo "/usr/local/bin/bash" >> /etc/shells

chsh.

3.5.
FreeBSD , ,
, -
. FreeBSD ;
.
, -, ee,
``easy editor'', .. `` ''.
- , ee filename, filename
. , /etc/rc.conf,
ee /etc/rc.conf. .
(^) Ctrl, , ^e
Ctrl e. , Esc, Enter.
- , ,
, .
33

FreeBSD vi, ,
emacs vim, .
, !

3.6. ...
3.6.1. (man)
, FreeBSD
(man).
( ), ,
. man:
% man command

command - , . ,
ls :
% man ls

:
1. .
2. .
3. .
4. .
5. .
6. .
7. .
8. .
9. .
( ), , ,
. , cdmod
chmod(). , ,
:
% man 1 chmod

chmod. ,
, , chmod(1)
chmod, chmod(2) - .

34

, , ,
.
, , -k man:
% man -k mail

, ``mail'' .
apropos.
, /usr/bin,
, ?
% cd /usr/bin; man -f * % cd /usr/bin; whatis *,
.

3.6.2. GNU Info Files


FreeBSD
, Free Software Foundation (FSF).

info , info,
, , emacs,
(info) .
info(1), :
% info

, h.
, ?.

Chapter 4. :

Table of Contents
4.1.
4.2.
4.3.
4.4.
Jim Mock <jim@FreeBSD.org>, 22 1999.
.

4.1.
FreeBSD
.
35

-, ,
,
FreeBSD.
,
UNIX- . ,
,
" ", .
, ,
. -
FreeBSD.

, , ,
.
, ,
, make install.

4.2.

.

4.2.1.
, ,
"".
,
FreeBSD. :

Makefile. Makefile

, ,


files. files md5.
,
. - ,
, . - ,

, , .
files , ,
-
.

patches. ,
FreeBSD. - ,
, , ,
- .
" 10" " 26
...". "diff-" "",
diff.
36

pkg. , , . ,
, .
. :
o

COMMENT.

DESCR.

PLIST.

, .

, .

.

, ,
, .
, .
, , .
,
FreeBSD .
. ,
,
.
whereis. ,
"whereis <,
>" , ,
:
# whereis xchat
xchat: /usr/ports/irc/xchat
#

, xchat ( irc)
/usr/ports/irc/xchat.

. ,
/usr/ports. , make
search key=program-name, "program-name" - ,
. , xchat:
# cd /usr/ports
# make search key=xchat
Port:
xchat-1.3.8
Path:
/usr/ports/irc/xchat
Info:
An X11 IRC client using the GTK+ toolkit, and optionally,
GNOME
Maint:
jim@FreeBSD.org
Index:
irc
B-deps: XFree86-3.3.5 bzip2-0.9.5d gettext-0.10.35 giflib-4.1.0 glib1.2.6 gmake-3.77 gtk-1.2.6
imlib-1.9.8 jpeg-6b png-1.0.3 tiff-3.5.1
R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6
imlib-1.9.8 jpeg-6b

37

png-1.0.3 tiff-3.5.1

"Path:", ,
.
, .
Note: root.
, , ,
.

4.2.1.1. -
, , , , ,
, , - FreeBSD.
, FreeBSD Mall.
, - FreeBSD ,
/cdrom ( /cdrom),
. , , ,
:
# cd /usr/ports/irc/xchat

xchat, .
( ) .
make .
, , :
# make
>> xchat-1.3.8.tar.bz2 doesn't seem to exist on this system.
>> Attempting to fetch from file:/cdrom/ports/distfiles/.
===> Extracting for xchat-1.3.8
>> Checksum OK for xchat-1.3.8.tar.bz2.
===>
xchat-1.3.8 depends on executable: bzip2 - found
===>
xchat-1.3.8 depends on executable: gmake - found
===>
xchat-1.3.8 depends on shared library: gtk12.2 - found
===>
xchat-1.3.8 depends on shared library: Imlib.5 - found
===>
xchat-1.3.8 depends on shared library: X11.6 - found
===> Patching for xchat-1.3.8
===> Applying FreeBSD patches for xchat-1.3.8
===> Configuring for xchat-1.3.8
...
[ ]
...
===> Building for xchat-1.3.8
...
[ ]
...
#

, , ,
. .
, make, install:
38

# make install
===> Installing for xchat-1.3.8
===>
xchat-1.3.8 depends on shared library: gtk12.2 - found
===>
xchat-1.3.8 depends on shared library: Imlib.5 - found
===>
xchat-1.3.8 depends on shared library: X11.6 - found
...
[ ]
...
===>
Generating temporary packing list
===>
Installing xchat docs in /usr/X11R6/share/doc/xchat
===>
Registering installation for xchat-1.3.8
#

,
, .
Note: , make install
make make install .
Note: , ,
-. , , -
,
, . ,
-, , (
).

4.2.1.2.
, ,
. ,
-.
, . ,
, -.
:
# make install
>> xchat-1.3.8.tar.bz2 doesn't seem to exist on this system.
>> Attempting to fetch from http://xchat.org/files/v1.3/.
Receiving xchat-1.3.8.tar.bz2 (305543 bytes): 100%
305543 bytes transferred in 2.9 seconds (102.81 Kbytes/s)
===> Extracting for xchat-1.3.8
>> Checksum OK for xchat-1.3.8.tar.bz2.
===>
xchat-1.3.8 depends on executable: bzip2 - found
===>
xchat-1.3.8 depends on executable: gmake - found
===>
xchat-1.3.8 depends on shared library: gtk12.2 - found
===>
xchat-1.3.8 depends on shared library: Imlib.5 - found
===>
xchat-1.3.8 depends on shared library: X11.6 - found
===> Patching for xchat-1.3.8
===> Applying FreeBSD patches for xchat-1.3.8
===> Configuring for xchat-1.3.8
...
[ ]
...
===> Building for xchat-1.3.8

39

...
[ ]
...
===> Installing for xchat-1.3.8
===>
xchat-1.3.8 depends on shared library: gtk12.2 - found
===>
xchat-1.3.8 depends on shared library: Imlib.5 - found
===>
xchat-1.3.8 depends on shared library: X11.6 - found
...
[ ]
...
===>
Generating temporary packing list
===>
Installing xchat docs in /usr/X11R6/share/doc/xchat
===>
Registering installation for xchat-1.3.8
#

, , ,
.
. ,
.

4.2.2.
, , , , ,
, , ,
, .
.
(
xchat, ). ,
, , ,
/usr/ports/irc/xchat. xchat.
make deinstall ( ?):
# cd /usr/ports/irc/xchat
# make deinstall
===> Deinstalling for xchat-1.3.8
#

. xchat .
, , make
reinstall /usr/ports/irc/xchat.

4.3.

, , ,
.

4.3.1.
4.3.1.1. , ??!
40

4.3.1.2. ,
?
4.3.1.3. , ?
4.3.1.4. ?
4.3.1.5. tar-?
4.3.1.6. ?
4.3.1.7. , , -
, kermit.
4.3.1.8. , ,
/usr/ports/distfiles, ,
.
4.3.1.9. , /usr/ports?
,
/u/people/guests/wurzburger, .
4.3.1.10. - FreeBSD, tar-
, ,
. ?
4.3.1.11. , , , tar-
FreeBSD. ,
, , MASTER_SITES?
4.3.1.12. , make
, .
4.3.1.13. ?
, ,
control-C.
4.3.1.14. ,
, . make extract,
?
4.3.1.15. ,
. ? ,
?
4.3.1.16. , , . ?
4.3.1.17. foo,
bar. , , ?
4.3.1.18. grizzle ,
. , ,
. ?
4.3.1.19. , .
, ??
4.3.1.20. , , ,
. -?
4.3.1.21. ,
, distfiles. ?
4.3.1.22. ,
. ?
4.3.1.23. OK, , ,
, , .
, . -
?
4.3.1.24. , . ?
41

4.3.1.25. frobble,
, , , .

?
4.3.1.26. - . , .
?

4.3.1.1. , ??!
, , ,
. "" ""
() UNIX .

4.3.1.2. ,
?
, .

4.3.1.3. , ?
:
1.
.
.
2. . ,
()
.
3. , ,
.
4. ,
,
, --
, ,
, strip
, .
5. . ,
. ,
,
, , ,
, .
.

, ,
.

42

6. ,
, , , - (,
), .
7. , ! ;-)

4.3.1.4. ?
- , ,
. , , ,
" 23", " 468" "
197 ". - ,
diff.

4.3.1.5. tar-?
, .tar , , .tar.gz, .tar.Z, .tar.bz2
.tgz.
,
(.tar) ( ) (.gz).
Tape ARchives (,
, tar),
.
, ,
UNIX tar,
FreeBSD, :
%
%
%
%

tar
tar
tar
tar

tvzf foobar.tar.gz
xzvf foobar.tar.gz
tvf foobar.tar
xvf foobar.tar

4.3.1.6. ?
, ,
. ,
, .

4.3.1.7. , , ,
kermit.
# make install
>> cku190.tar.gz doesn't seem to exist on this system.
>> Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.

? -?
-,
CDROM - . Kermit
43

.
tar- -, --!
, , ,
.
MASTER_SITES ( Makefile),
.

4.3.1.8. , ,
/usr/ports/distfiles, ,
.
tar- /usr/ports/distfiles,
,
-, .
, :
# make DISTDIR=/where/you/put/it install

4.3.1.9. ,
/usr/ports? ,
/u/people/guests/wurzburger, .
, ,
PORTSDIR PREFIX. ,
# make PORTSDIR=/u/people/guests/wurzburger/ports install

/u/people/guests/wurzburger/ports,
/usr/local.
# make PREFIX=/u/people/guests/wurzburger/local install

/usr/ports
/u/people/guests/wurzburger/local.
, ,
# make PORTSDIR=../ports PREFIX=../local install

(
, ).
, imake(1) ( X Windows System),
PREFIX, /usr/X11R6.
Perl PREFIX
Perl. PREFIX
.
44

,
.
, .

4.3.1.10. - FreeBSD,
tar- ,
, .
?
tar- , :
# cd /usr/ports
# make fetch

tar- - ,
:
# cd /usr/ports/directory
# make fetch

--, , ,
.

4.3.1.11. , , , tar-
FreeBSD.
, , ,
MASTER_SITES?
. , , , ftp.FreeBSD.org , ,
MASTER_SITES, :
# cd /usr/ports/directory
# make MASTER_SITE_OVERRIDE= \
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch

4.3.1.12. ,
make , .
make fetch-list , .

4.3.1.13. ?
,
,
control-C.
make extract ,
.

45

4.3.1.14.
, , .
make extract, ?
, make patch - , .
PATCH_DEBUG. , !

4.3.1.15. ,
. ? ,
?
, 2.6.3 gcc ( FreeBSD 2.1.0 2.1.5),
-O2 ,
-fno-strength-reduce. ( -O2).

:
# make CFLAGS='-O2 -fno-strength-reduce' install

/etc/make.conf, , ,
. - make configure,
Makefile ,
, ,
make-.
FreeBSD ,
, .

4.3.1.16. , ,
. - ?
INDEX /usr/ports.
, . ,
, LISP, :
% cd /usr/ports
% make search key=lisp

4.3.1.17. foo,
bar. , ,
?
foo -, bar -- , foo
, bar
. bar ,
foo.

46

4.3.1.18. grizzle ,
. , ,
. ?
, :
# pkg_delete grizzle-6.5

:
# cd /usr/ports/somewhere/grizzle
# make deinstall

4.3.1.19. ,
. , ??
, :
# pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em
up

arcade game.

4.3.1.20. , ,
, . ?
, ,
, . :
# cd /usr/ports
# make clean

,
.

4.3.1.21. ,
, distfiles.
?
, , , .
, make distclean.

4.3.1.22. ,
. ?
:
47

# cd /usr/ports
# make install

,
. ,
/usr/local/bin/plot,
.

4.3.1.23. OK, , ,
, , .
,
. - ?
, , ,
(, " A4 US letter?"),
- .

4.3.1.24. , .
?
OK, , / / , :
# cd /usr/ports
# make -DBATCH install

,
. , , :
# cd /usr/ports
# make -DIS_INTERACTIVE install

4.3.1.25. frobble,
, ,
, .
?
, , , :
# cd /usr/ports/somewhere/frobble
# make extract
# cd work/frobble-2.8
[Apply your patches]
# cd ../..
# make package

4.3.1.26. - . ,
. ?
48

, bsd.port.mk
bsd.port.subdir.mk make-.
(, ,
...)

4.3.2. ! !
, , ,
, :
1. ! " " .
2. -- ! ,
. make maintainer
Makefile, .
( $FreeBSD: Makefile)
, .
, send-pr
.
3. . --
" ".
,
.
4. . ""
ftp.FreeBSD.org ,
! , , , ,
, , .
pkg_add(1) .

4.4.
, ,
. , ,
.

II.
Table of Contents
5. FreeBSD
6.
7.
8.
9. X Window System
49

10.

Chapter 5. FreeBSD
Table of Contents
5.1.
5.2. :
5.3. :
5.4.
5.5. Init:
5.6.

5.1.
FreeBSD ,
, (
).
.
, .
,
init(8),
. init(8) ,
,
, FreeBSD
.

5.2. :

,
,
.

(), , ,
, ,

.
BIOS (
) CMOS ( ). BIOS
CMOS , ,
, .
.
, ,
.
50

( ) ,
, ,
.

5.2.1. boot0
boot0,
(Master Boot Record), ,
,
.
boot0 , MBR , 512
.
:
Example 5-1. boot0
F1
F2
F3
F4
F5

DOS
FreeBSD
Linux
??
Drive 1

Default: F2

5.2.2. boot1
boot1 , , boot0
MBR ,
.
boot1 , , 512 ,
FreeBSD, , ,
boot2.

5.2.3. boot2
boot2 , FreeBSD
,
.
,
, boot2 ,
.
Example 5-2. boot2
>> FreeBSD/i386 BOOT
Default: 0:wd(0,a)/kernel
boot:

51

5.3. :

,
, ,
/boot/loader.
Note: /boot/boot0, /boot/boot1 /boot/boot2 ,
MBR,
.

,
.

5.3.1.
,
, .
,
.
/boot/loader.rc,
/boot/defaults/loader.conf,
/boot/loader.conf .
loader.rc, .
, 10- ,
, , . ,
, ,
,
,
.

loader(8)

5.3.2.
:
autoboot
,
. ,
10 .
boot [-] [ ]

52

, ,
, .
boot-conf

, . ,
unload, , ,
kernel.
help []
/boot/loader.help.
index, .
include ...
.
.
include.
load [-t ]
, .
.
ls [-l] []
,
. -l,
.
lsdev [-v]
, .
-v, .
lsmod [-v]
. -v,
.
more
LINES.
reboot
.
set , set =
53

.
unload
.

5.3.3.
.

,
:
boot -s

, (
) :
unload
load kernel.old

kernel.GENERIC ,
, kernel.old
( , , ,
).
Note:
:
unload
set kernel="kernel.old"
boot-conf

( ,
, ):

load -t userconfig_script
/boot/kernel.conf

5.4.

( )
boot2 ( ), , ,
.

5.4.1.
:
54

-a


.
-C

-.
-c

UserConfig
-s


-v


Note: , boot(8)
.

5.5. Init:

, ,
init, /sbin/init ,
init_path .

5.5.1.

. , fsck , init
,
.

5.5.2.
,
-s boot_single .
shutdown
(-r) (-h) .

55

console /etc/ttys
insecure, root
.
Example 5-3. /etc/ttys
# name
getty
type
status
comments
#
# This entry needed for asking password when init goes to single-user

mode

# If you want to be asked for password, change "secure" to "insecure"

here

console none

unknown off insecure

Note: insecure ,
, , , root,
, ,
. ,
, insecure, secure.

5.5.3.
init , ,
, ,
,
.

5.5.3.1. (rc)
, ,
/etc/defaults/rc.conf, , ,
/etc/rc.conf, ,
/etc/fstab, ,
, ,
.
rc(8)
. , .

5.6.
shutdown,
init /etc/rc.shutdown,
,
, .

56

Chapter 6.
Table of Contents
6.1.
6.2.
6.3. FreeBSD
6.4. DES, MD5, and Crypt
6.5. S/Key
6.6. Kerberos
57

6.7. Firewalls
6.8. OpenSSL
6.9. IPsec
security(7)
, Matthew Dillon <dillon@FreeBSD.org>.

6.1.
, ,
, , ,
S/Key, OpenSSL, Kerberos .

6.2.
, -
. , BSD UNIX,
,
, ,
, .
. UNIX
,
, .
,

.
, "" .
, "", "" ,
. , ""
, .
, schg- (. chflags(1))
, , ,
, , ,
, .
,
:
1. " " (D.o.S.).
2. .
3. (root) .
4. (root) .
5. ( , " ").

.
58

" " (brute-force),


.
,
, .
"" .
,
(, -
). " ",
. , ""
, ,
, . ,
, .
, ,
.
, telnetd, rlogind, rshd ftpd. ,
,
. , ,
, - "" .

,
.
, ,
. , ,
,
, "" .

, , ,
, ,
, "" . ,
() , ,

,
.
,
, . ,
,
, , .
(
), "",
(
). (
- ). ,
,
, - ,
, , , .
, ,
"" . :

59

1. .
2. , ,
, SUID/SGID .
3. .
4. , .
5. , raw .
6. .
7. .
.

6.3. FreeBSD

FreeBSD, .

6.3.1.

,
.
. ,
,
. , ,
su(1). , , ,
/etc/ttys, insecure (),
telnet rlogin.
, , , sshd,
.
- FTP .
.
,
, . ,
. - wheel (
/etc/group). , , su
.
wheel, .
, staff, ,
, wheel,
/etc/group. ,
kerberos, .k5login ,
ksu(1)
- wheel. ,
60

,
. , , .
,

* (/etc/passwd). ,
, ,
.
, , kerberos(1) ssh(1),
(/).
kerberos, kerberos-
. / ,
, ssh, ,
( ),
,
(ssh-keygen(1)). *
( ,
)
, ,
. ,
- ("")
( ).
:
,
( ), , . ,
,
( ),
, ,
.
kerberos,
.
, - (, )
-
, . ,
N ! Kerberos
(
, ). BASTION ROUTER FREEBSD
FreeBSD,
firewall-a, arp- mac . FreeBSD - IPFW,
.
, c FreeBSD 4.0,

( pipe bw).
, ( vx0, IP 200.200.200.1) Internet-a,
( vx1, IP 200.200.200.2)
18 IP (subnet 200.200.200.0/28 netmask 255.255.255.240).
61

(vx2 IP 192.168.1.1 192.168.1.0/28) 10-


.)

:
135,137,139


WWW,FTP .

SYN Flood, ICMP Flood.

WWW/FTP (200.200.200.5),
WWW server
, IP 199.199.199.10

IP ,
, c www.playboy.com
.

64Kb
, 10Mb
.
.

1. .
:
options IPFIREWALL ( )
options IPFIREWALL_VERBOSE (
)
options IPFIREEWALL_VERBOSE_LIMIT=10 (
, syslog)
options TCP_DROP_SYNFIN ( TCP SYN FIN)
firewall,
IP (,
- ,
-
ttyvX, ttypX =).

62

, TCP UDP,
. - "
"
:
options IPFIREWALL_DEFAULT_TO_ACCEPT
/etc/defaults/rc.conf :
tcp_extensions="NO" ( "" RFC1323 TCP)
tcp_drop_synfin="YES" ( SYN + FIN)
icmp_drop_redirect="YES" ( ICMP )
icmp_log_redirect="YES" ( logging ICMP REDIRECT)
firewall_enable="YES" ( firewall)
firewall_type="Company" ( firewalla rc.firewall
"Company")
defaultrouter="199.199.199.1" ( ISP)
2. IPFW.
IPFW.
handbook man ipfw.
("Company") rc.firewall:
[Cc][Oo][Mm][Pp][Aa][Nn][Yy]
# fw="200.200.200.1" local="200.200.200.2"
client="192.168.1.1" net="200.200.200.0/28" mask="255.255.255.255.240"
# local
${fwcmd} add pass all from any to any via lo0
#
${fwcmd} add pass all from any to any via vx1
#
${fwcmd} add deny icmp from any to any frag
# ICMP
${fwcmd} add pass ICMP from any to any
# SMTP
${fwcmd} add pass tcp from any to any 25 out
${fwcmd} add pass tcp from any 25 to any out
# HTTPS
${fwcmd} add pass tcp from any to any 443 out
${fwcmd} add pass tcp from any 443 to any out
#
${fwcmd} add pass tcp from 199.199.199.10 to 200.200.200.5 80 via vx0
${fwcmd} add pass tcp from 200.200.200.5 80 to 199.199.199.10 via vx0
#
${fwcmd} add deny tcp from any to 200.200.200.5 80 in via vx0
# HTTP
${fwcmd} add pass tcp from any to any 80 out via vx1
${fwcmd} add pass tcp from any 80 to any out via vx1
#
#
${fwcmd} add allow all from any to any via vx1
63

# DNS
${fwcmd} add pass udp from any to any 53
${fwcmd} add pass udp from any 53 to any
# NEWS
${fwcmd} add pass tcp from any to any 119
${fwcmd} add pass tcp from any 119 to any
# POP3
${fwcmd} add pass tcp from any to any 110
${fwcmd} add pass tcp from any 110 to any
# FTP
# 20
# TCP
#
${fwcmd} add pass tcp form any 21 to any
${fwcmd} add pass tcp from any to any 21
${fwcmd} add pass tcp from any 20 to any
${fwcmd} add pass tcp from any to any 20
# ssh
# IP 200.200.200.15
${fwcmd} add pass tcp from 200.200.200.15 22 to {isp}
${fwcmd} add pass tcp from {isp} to 200.200.200.15 22
# vx2
#
${fwcmd} add deny all from 192.168.1.0/24 to
${net}:
${mask} via vx1
${fwcmd} add deny all from
${net}:
${mask} to 192.168.1.0/24 via vx1
# TCP vx2
${fwcmd} add pass tcp from 192.168.1.0/24 to any 25 via vx2
${fwcmd} add pass tcp from any 25 to 192.168.1.0/24 via vx2
${fwcmd} add pass tcp from 192.168.1.0/24 to any 110 via vx2
${fwcmd} add pass tcp from any 110 to 192.168.1.0/24 via vx2
${fwcmd} add pass udp from 192.168.1.0/24 to any 53 via vx2
${fwcmd} add pass udp from any 53 to 192.168.1.0/24 via vx2
${fwcmd} add pass tcp from 192.168.1.0/24 to any 80 via vx2
${fwcmd} add pass tcp from any 80 to 192.168.1.0/24 via vx2
# vx2 64 Kb.
#
${fwcmd} add pipe 1 ip from any to any in via vx0
${fwcmd} add pipe 1 config bw 64Kbit/s
# vx2 64 Kb.
#
${fwcmd} add pipe 2 ip from any to any out via vx0
${fwcmd} add pipe 2 config bw 64Kbit/s
TCP/IP
NMAP ( FreeBSD INSECURE.ORG), :
./nmap 200.200.200.1 ./nmap 200.200.200.2 ,
, ISP.

64

3. MAC-
IP
"" TCP/IP
, 200.200.200.0/28. ,
IP MAC
ISP. ,
, IP
, . ;)
MAC , :
petya 00:20:af:4a:3e:e3
vasya 00:20:fg:3a:3e:21
sasha 00:20:fg:3a:3e:21
markins 00:20:fg:3a:3e:21
... /etc/ethers.
Ethernet , arp -a.
arp -f /etc/ethers IP MAC
ARP /etc/ether
"".
arpwatch (
FreeBSD), /etc/hosts name_hosts IP_adress
/etc/ethers . IP ,
arpwatch root' arp
.
4. .
ipfm,
FreeBSD. /usr/local/etc/ ipfm.conf.
:
##### FIRST LOGGING CONFIGURATION #####
#
LOG 200.200.200.0/255.255.255.240 NOT WITH 200.200.0.0/255.255.0.0
#
FILENAME /var/log/ipfm/local_net-%d.%m-%H.%M.%S
#
#
TIME 7 day SORT IN RESOLVE
##### SECOND LOGGING CONFIGURATION #####
NEWLOG
# 192.168.1.0/24 subnet
192.168.1.0/255.255.255.0
NOT WITH 192.168.0.0/255.255.0.0
# 1 FILENAME /var/log/ipfm/ipfm-%d.
%m-%H.%M.%S
# Log on a period of one week TIME 1 day SORT IN RESOLVE

count ipfw:
# HTTP
65

ipfw add count tcp from any to any 80 in via vx0


ipfw add count tcp from any to any 80 out via vx0
# HTTP :
ipfw add count tcp from any to any 80 in via vx2
ipfw add count tcp from any to any 80 out via vx2
ipfw add count tcp from any to any 21 in via vx2
ipfw add count tcp from any to any 21 out via vx2
c IP :
ipfw add count tcp from any to 200.200.200.3 in via vx1
... 200.200.200.3 - IP ,
www.playboy.com .
:
ipfw add log deny all from any to www.playboy.com
... .
MRTG (Multi Router Transfeer
Grapheer) snmp, .
,

Chapter 7.
Table of Contents
7.1.
7.2. BIOS
7.3.
7.4.
66

7.5.
7.6. : ,
Network, Memory, and File-Based Filesystems
7.7.

7.1.
, ,
, FreeBSD.

7.2. BIOS
, FreeBSD
, .
PC DOS BIOS
(WINxxx), BIOS ,
. ,
" ". ,
,
, ,
Ghost XCOPY. ,
, -
, BIOS
. ,
.
SCSI BIOS,
SCSI.
, ,
FreeBSD. FreeBSD BIOS
" BIOS".
,
.
FreeBSD, BIOS
FreeBSD, .
, , ,
.
:
Wintel- FreeBSD .
SCSI SCSI FreeBSD.
, ,
SCSI , .
, ,

67

SCSI "" .
,
SCSI , .
, , , ,
, SCSI BIOS
SCSI . FreeBSD
.
, ,
-- FreeBSD. SCSI
, ,
"". FreeBSD SCSI
FTP . .
FreeBSD ,
...
. SCSI (
FreeBSD). ,
SCSI .
?
SCSI SCSI ,
" ". SCSI BIOS,
SCSI , . FreeBSD
SCSI . BIOS
,
BIOS, FreeBSD, BIOS
, FreeBSD .
SCSI ,
, SCSI . ,
SCSI , .
, .
SCSI (
, ).
SCSI, IDE.

7.3.
, IDE SCSI; ,
RAID-,
. ,
.
68

Table 7-1.

IDE

ad

IDE CDROM

acd,

SCSI

da,

SCSI CDROM

cd

4.0-RELEASE, wd 4.0-RELEASE.
3.1-RELEASE, wcd 4.0-RELEASE.

3.0-RELEASE, sd 3.0-RELEASE.

mcd Mitsumi CD-ROM, scd Sony CD-ROM, matcd


CDROM
Matsushita/Panasonic CD-ROM

fd


SCSI

sa,


IDE

ast,

fla

RAID

myxd

3.0-RELEASE, st 3.0-RELEASE.
4.0-RELEASE, wst 4.0-RELEASE.

- DiskOnChip, 3.3RELEASE.
Mylex amrd AMI MegaRAID, idad Compaq
Smart RAID, 4.0-RELEASE. id 3.2-RELEASE
4.0-RELEASE.

7.3.1.
, ,
"dangerously dedicated".
s: "da0s1".
, , "dangerously dedicated",
, a h. b
, c ,
. Section 7.5>.

7.4.

, , ,
/. /dev, /usr ,
, , /usr/local .

. /var , ,
.
, /var / .

69



, ,
CDROM.

7.4.1. fstab
, /etc/fstab,
( noauto).
/etc/fstab :
device /mount-point fstype

options

dumpfreq

passno

( ) ,
.
device

( ),
.
mount-point

mount(8).
FreeBSD ufs.
fstype

options rw ,
-, ro , ,
, .
noauto ,
.
mount(8).

, passno ,
.
dumpfreq

7.4.2. mount
mount(8) ,
.
:
# mount device mountpoint

mount(8), ,
:
mount
-a

70

, /etc/fstab,
-t, .
-d

, .
-f

.
-r

.
-t fstype


, ,
-a.
"ufs".
-u

.
-v

.
-w

,
.
-o , :
nodev
. ,
.
noexec
. ,
.
nosuid

. ,
.
71

7.4.3. umount
umount ,
, -a -A.
-f -v
.
-a -A
, , -t.
-A
.

7.5.
David O'Brien <obrien@FreeBSD.org> 26 1998

, SCSI ,
.
, . -

..
root. , ,
/var/run/dmesg.boot, , .
, da1
/1 ( IDE, wd1
, 4.0, ad1 4.X).
FreeBSD IBM-PC ,
PC BIOS.
BSD. PC BIOS.
FreeBSD,
dedicated. FreeBSD PC BIOS.
FreeBSD PC BIOS ,
BSD. ,
FreeBSD, ,
. ,
fdisk .
/dev/da1s1e.
: SCSI, 1 ( SCSI), 1 (
PC BIOS 1), BSD e.
/dev/da1e.

7.5.1. sysinstall
/stand/sysinstall
. root
72

su. /stand/sysinstall Configure.


FreeBSD Configuration Menu, Partition.
.
da1,
dmesg /var/run/dmesg.boot.
da1, FDISK. A ,
FreeBSD . ,
"
", YES. W.
FDISK q.
.
, None.
Disk Label Editor.
BSD. , a-h.
. a
(/). (, ,
), a. b ,
. c
FreeBSD
.
.
sysinstall e
.
C. ,
(FS) , FS
(, /mnt). ,
sysinstall /etc/fstab,
.
.
, W. sysinstall
.
sysinstall.
/etc/fstab
.

7.5.2.
7.5.2.1.

, ,
fdisk .
.
!
# dd if=/dev/zero of=/dev/rda1 bs=1k count=1
# fdisk -BI da1 # .

73

# disklabel -B -w -r da1s1 auto # .


# disklabel -e da1s1 #
.
# mkdir -p /1
# newfs /dev/da1s1e # .
# mount -t ufs /dev/da1s1e /1 # ()
# vi /etc/fstab # /
/etc/fstab.

IDE, ad da. 4.x


wd.

7.5.2.2.
,
. ,
Microsoft;
. OS/2 IBM " "
, .
#
#
#
#
#
#
#

dd if=/dev/zero of=/dev/rda1 bs=1k count=1


disklabel -Brw da1 auto
disklabel -e da1
# create the `e' partition
newfs -d0 /dev/rda1e
mkdir -p /1
vi /etc/fstab
# add an entry for /dev/da1e
mount /1

:
# dd if=/dev/zero of=/dev/rda1 count=2
# disklabel /dev/rda1 | disklabel -BrR da1 /dev/stdin
# newfs /dev/rda1e
# mkdir -p /1
# vi /etc/fstab
# add an entry for
/dev/da1e
# mount /1

7.6. : ,

Network, Memory, and File-Based
Filesystems
, ; , , , FreeBSD .

74

, , Network Filesystem
Coda, , , md
, vnconfig.

7.6.1. vnconfig:
vnconfig(8)
- vnode. vnode .
, vnconfig(8)
.
-, .
:
Example 7-1. vnconfig

# vnconfig vn0 diskimage
# mount /dev/vn0c /mnt

vnconfig:
Example 7-2. vnconfig
# dd if=/dev/zero of=newimage bs=1k count=5k
5120+0 records in
5120+0 records out
# vnconfig -s labels -c vn0 newimage
# disklabel -r -w vn0 auto
# newfs vn0c
Warning: 2048 sector(s) in last cylinder unallocated
/dev/rvn0c: 10240 sectors in 3 cylinders of 1 tracks, 4096 sectors
5.0MB in 1 cyl groups (16 c/g, 32.00MB/g, 1280 i/g)
super-block backups (for fsck -b #) at:
32
# mount /dev/vn0c /mnt
# df /mnt
Filesystem 1K-blocks
Used
Avail Capacity Mounted on
/dev/vn0c
4927
1
4532
0%
/mnt

7.6.2. md:
md .
, , ,
vnconfig(8) :
Example 7-3. md
# dd if=newimage of=/dev/md0
5120+0 records in
5120+0 records out
# mount /dev/md0c /mnt
# df /mnt

75

Filesystem
/dev/md0c

1K-blocks
4927

Used
4532

Avail Capacity
0%
/mnt

Mounted on

7.7.
- ,
/
.
,
,
. ,
.

7.7.1.

, , ,
.
:
options QUOTA

GENERIC ,
,
. , FreeBSD
.
/etc/rc.conf.
:
enable_quotas="YES"


. ,
quotacheck. quotacheck
.
, .
, :
check_quotas="NO"

FreeBSD 3.2-RELEASE, ,
. /etc/rc.conf:
check_quotas="YES"

76

, /etc/fstab
. ,
, .
,
userquota ,
, /etc/fstab. :
/dev/da1s2g

/home

ufs rw,userquota 1 2

,
groupquota userquota.
, ,
:
/dev/da1s2g

/home

ufs rw,userquota,groupquota 1 2


quota.user quota.group
. man fstab.
,
, ,
.
. /etc/rc

, /etc/fstab,
.
quotacheck,
quotaon quotaoff.
.

7.7.2.
, ,
.
:
# quota -v

,
, .
edquota.
,
, ,
, .
( ),
77

( inode) . ,
, ; .
.
,
. , 500
490 ,
10 . 11 .
,
. ,
.
, ,
.
, , ,
.
, edquota.
edquota, ,
EDITOR, vi, EDITOR ,
.
# edquota -u test
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)

, ,
. ,
inode. ,
50 75, 500
600, :
/usr: blocks in use: 65, limits (soft = 50, hard = 75)

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

.

. -p edquota. , ,
edquota -p protouser startuid-enduid. , test
,
10000 19999 :

78

# edquota -p test 10000-19999

man edquota .

7.7.3.
quota
repquota. quota
, , .
.
repquota
.
quota -v ,
.
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

/usr
50 15 5 .
*, .
, ,
, quota,
. -v
, , , /usr/var .

7.7.4. NFS NFS


NFS. rpc.rquotad(8)
quota(1) NFS,
.
rpc.rquotad /etc/inetd.conf :
rquotad/1
rpc.rquotad

dgram rpc/udp wait root /usr/libexec/rpc.rquotad

inetd:
# kill -HUP `cat /var/run/inetd.pid`

79

Chapter 8.
Table of Contents
8.1.
8.2.
8.3.
8.4. ?

80

8.1.

. - ,
FreeBSD <freebsddoc@FreeBSD.org>.

8.2.

4 8, QIC, - DLT.

8.2.1. 4 (DDS: Digital Data Storage)


4 QIC
.
Conner Archive, QIC
. 4 ,
, 8.
(3 x 2 x 0.5 , 76 x 51 x 12 ), 8. 4, 8,
,
(helical scan).
~150kB/s,
~500kB/s. 1.3 GB 2.0 GB.
, ,
. 6
.
240 GB.
DDS-3 12GB ( 24GB
).
4, 8,
. 4, 8
.
, 2000 ,
100 .

8.2.2. 8 (Exabyte)
8 SCSI;
. , 8.
, . (4.8 x 3.3 x
0.6 ; 122 x 84 x 15 ). 8
-
.
81

~250kB/s ~500kB/s.
300 7. ,
, .
, 6
120 . .
, 840 .
Exabyte "Mammoth" 12 (25 )
, .
,
( 6 ).
270 , .
.
,
.

8.2.3. QIC
QIC-150, ,
. QIC ""
. .
QIC 8 4 ,
.
, QIC . QIC
. QIC -
. QIC (
) . QIC .
,
, . QIC (6 x 4 x 0.7 ; 15.2 x 10.2 x
1.7 ). -, 1/4",
. .
~150kB/s ~500kB/s.
40 15 .
QIC. QIC ;
DAT.
.
. , , , ,
. ,
(
). QIC
( , ,
).
5,000 .

82

8.2.4. * -
8.2.5. DLT
DLT
. 1/2" (12.5)
(4 x 4 x 1 ; 100 x 100 x 25 ).
.
, . ,
"" .
. , ( 9 ), ,
.
1.5MB/s,
4, 8 QIC.
10 20 .
, , ,
5 900 1 20 , 50 9.
DLT Type IV 70 .
,
( , QIC). .
/ ; ,
.

8.2.6. AIT
AIT - Sony, 50 ( )
. ,
.
, ,
, .
, SAMS:Alexandria,
AIT,
, , ,
, .
$20,000,
.

8.2.7.
, ,
, .
:
sa0(ncr1:4:0): NOT READY asc:4,1
sa0(ncr1:4:0):
Logical unit is in process of becoming ready

83

( 0).
QIC-525 QIC
(Identifier Block). :
mt fsf 1
.
.
dump(8) .
dump(8) DUMP: End of tape detected, :
HARDWARE FAILURE info:280 asc:80,96

: mt rewind
.

8.3.
dump(8), tar(1) cpio(1).

8.3.1. Dump Restore


dump(8) restore(8) Unix
. ,
, ,
. dump(8) ,
, ,

ln(1) . dump(8)
, ,
. dump(8) ,
Version 6 ATT Unix ( 1975).
, , 9- (6250 bpi),
( 62,182 ftpi).

.
rdump(8) rrestore(8)
, .
rcmd(3) ruserok(3)
. , ,
rhosts. rdump(8) rrestore(8)
. (,
rdump FreeBSD Exabyte,
Sun komodo, : /sbin/rdump
0dsbfu 54000 13000 126 komodo:/dev/nrsa8 /dev/rda0a 2>&1) :
rhosts.
.
84

8.3.2. Tar
tar(1) Version 6 ATT Unix ( 1975). tar(1)
; tar(1) . tar(1)
, cpio(1),
, cpio(1).
tar(1) .
GNU tar(1), FreeBSD,
, rdump(8).
Exabyte, Sun komodo,
: /usr/bin/tar cf komodo:/dev/nrsa8 . 2>&1.
,
rsh(1) .
# tar cf - . | rsh hostname dd of=tape-device obs=20b

, rsh(1)
ssh(1).

8.3.3. Cpio
cpio(1) Unix
. cpio(1) ( ),
,
.
cpio(1) . cpio(1)
, , stdin.
cpio(1) .
rsh(1)
. (XXX )

8.3.4. Pax
pax(1) IEEE/POSIX tar(1) cpio(1).
tar(1) cpio(1) .
, , POSIX
. pax(1)
cpio(1) tar(1), , , .
cpio(1), tar(1).

8.3.5. Amanda
Amanda (Advanced Maryland Network Disk Archiver) /
, . Amanda

, Amanda
Amanda.
, ,
, . Amanda . Amanda
85

" "
. Amanda " ": ,
,
Amanda. " "
( )
.
.

, Amanda. Amanda
.
Amanda , , .

8.3.6.
" " - ,
.
. , .
. - , !
, " "
. , Unix
, ,
, .
" " /usr/obj
,
. , -
SGML. HTML
. SGML .

8.3.7. ?
dump(8) . Elizabeth D. Zwicky
, .
Unix dump(8).
, (
) ,
.
: , ,
, , ,
, ,
.
LISA V 1991 . torture-testing Backup and
Archive Programs.

8.3.8.
8.3.8.1. ,
,
.
86

-, (, disklabel
da0 | lpr), (/etc/fstab) ,
, .
-, ,
(boot.flp fixit.flp).
,
.
, .

, ,
. : fdisk(8),
disklabel(8), newfs(8), mount(8) -
. .
dump(8), restore(8).
-, . ,
, .
.
-, ( boot.flp fixit.flp, ,
) .
. ,
. ,
, (
? tar xvf /dev/rsa0 tar cvf
/dev/rsa0 ).
,
. -
, .
.

.
:
#!/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
#

87

disklabel -w -B /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/rfd0a
#
# 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
mkdir /mnt/tmp
mkdir /mnt/var

# for the root partition

#
# populate the directories
#
if [ ! -x /sys/compile/MINI/kernel ]
then
cat << 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

options
options
options
options
options

FFS
FAT_CURSOR
SCSI_DELAY=15
NCONS=2
USERCONFIG

config

# needed for _tcp _icmpstat _ipstat


#
_udpstat _tcpstat _udb
#Berkeley Fast File System
#block cursor in syscons or pccons
#Be pessimistic about Joe SCSI device
#1 virtual consoles
#Allow user configuration with -c XXX

kernel root on da0 swap on da0 and da1 dumps on da0

controller isa0
controller pci0
controller fdc0
disk

at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr


fd0
at fdc0 drive 0

controller ncr0
controller scbus0
device
device

sc0
npx0

device

da0

at isa? port "IO_KBD" tty irq 1 vector scintr


at isa? port "IO_NPX" irq 13 vector npxintr

88

device
device

da1
da2

device

sa0

pseudo-device
pseudo-device
EOM
exit 1
fi

loop
gzip

# required by INET
# Exec gzipped a.out's

cp -f /sys/compile/MINI/kernel /mnt
gzip
gzip
gzip
gzip
gzip

-c
-c
-c
-c
-c

-best
-best
-best
-best
-best

/sbin/init > /mnt/sbin/init


/sbin/fsck > /mnt/sbin/fsck
/sbin/mount > /mnt/sbin/mount
/sbin/halt > /mnt/sbin/halt
/sbin/restore > /mnt/sbin/restore

gzip -c -best /bin/sh > /mnt/bin/sh


gzip -c -best /bin/sync > /mnt/bin/sync
cp /root/.profile /mnt/root
cp -f /dev/MAKEDEV /mnt/dev
chmod 755 /mnt/dev/MAKEDEV
chmod
chmod
chmod
chmod

500 /mnt/sbin/init
555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt
555 /mnt/bin/sh /mnt/bin/sync
6555 /mnt/sbin/restore

#
# create the devices nodes
#
cd /mnt/dev
./MAKEDEV std
./MAKEDEV da0
./MAKEDEV da1
./MAKEDEV da2
./MAKEDEV sa0
./MAKEDEV pty0
cd /
#
# create minimum filesystem table
#
cat > /mnt/etc/fstab <<EOM
/dev/fd0a /
ufs
rw 1 1
EOM
#
# create minimum passwd file
#
cat > /mnt/etc/passwd <<EOM
root:*:0:0:Charlie &:/root:/bin/sh
EOM
cat > /mnt/etc/master.passwd <<EOM
root::0:0::0:0:Charlie &:/root:/bin/sh
EOM
chmod 600 /mnt/etc/master.passwd
chmod 644 /mnt/etc/passwd

89

/usr/sbin/pwd_mkdb -d/mnt/etc /mnt/etc/master.passwd


#
# umount the floppy and inform the user
#
/sbin/umount /mnt
echo "The floppy has been unmounted and is now ready."

8.3.8.2.
: ? ,
.
, .
, .
,
( -s boot:). .
boot.flp fixit.flp, .
boot.flp .
. Fixit--Repair mode with CDROM or
floppy. fixit.flp. restore
/mnt2/stand.
.
mount(8) (, mount /dev/da0a /mnt)
. ,
disklabel(8)
, , .
newfs(8).
- (mount -u -o rw /mnt).

(. restore
vrf /dev/sa0). (, umount /mnt).
, .
, .
, . ,
, .

8.3.8.3. * , ?

8.4.
?
90

8.4.1.
?
, :

(,
, ).

,
, , .
, , .
, , .
.

8.4.2. ,
?

tar(1) -M ( ),
.

( root):
# tar Mcvf /dev/rfd0 *

, tar(1)
( tar(1) ,
. )
Prepare volume #2 for /dev/rfd0 and hit return:

( ) ,
.

8.4.3. ?
, tar(1)
-z. , gzip(1),
tar(1) , gunzip(1)!

8.4.4. ?
:
# tar Mxvf /dev/rfd0

91


:
# tar Mxvf /dev/rfd0 filename

tar(1) ,
.
, , ,
, . ,
, tar(1)
, , !

Chapter 9. X Window System


Table of Contents
9.1.
9.2.
9.3. XFree86
9.4. XFree86
Greg Lehey <grog@FreeBSD.org>,
The Complete FreeBSD, , . ,
, Jim Mock <jim@FreeBSD.org>.
XFree86 Murray Stokely <murray@FreeBSD.org>.
92

9.1.
X11 .
X11, , ,
XFree86.

9.2.
FreeBSD XFree86, X11R6,
UNIX Intel. ,
XFree86. ,
FreeBSD, , README.FreeBSD README.Config
/usr/X11R6/lib/X11/doc. - ,
. ,
/usr/X11R6/lib/X11/doc/RELNOTES
.
X . , X,
8 ,
.
16 , ,
. X ,
128 .
, ,
, , - X . , :
Warning .
, , Super VGA
, , ,
.

9.3. XFree86
XFree86
sysinstall , , /stand/sysinstall.
,
, , X11.

9.3.1. XFree86
XFree86 .
, .
; , 200
, .
93

, ,
, VGA.
10 1.7
3 .
.

Xbin.tgz

X-
.

Xfnts.tgz

misc 75 dpi.

Xlib.tgz

, .

9.3.2. X-
, ,
3 .
.
/usr/X11R6/bin/X,
/usr/X11R6/bin/XF86_xxxx. PC
/cdrom/XF86336/Servers, PC98,
, /cdrom/XF86336/PC98-Servers,
-. , FTP-
ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/4.2-RELEASE/XF86336/Servers/
ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/4.2-RELEASE/XF86336/PC98-Servers/
X- PC:

X8514.tgz

8- IBM 8514 .

XAGX.tgz

8 16- AGX XGA.

XI128.tgz

8 16- I128.

XMa32.tgz

8 16- ATI Mach32.

XMa64.tgz

8, 16 32- ATI Mach64.

XMa8.tgz

8- ATI Mach8.

XMono.tgz

1- VGA, Super-VGA, Hercules .

XP9K.tgz

8, 16 32- Weitek P9000 (Diamond Viper).

XS3.tgz

8, 16 32- S3.

XS3V.tgz

8 16- S3 ViRGE.

XSVGA.tgz

>=8- Super-VGA.

XVG16.tgz

4- VGA Super-VGA.

XW32.tgz

8- ET4000/W32, /W32i, /W32p ET6000.

X- PC98 ():

94

X9GAN.tgz

8- PC98 GA-98NB/WAP.

X9GA9.tgz

8, 16 32- PC98 S3 GA-968.

X9480.tgz

8- PC98 PEGC

X9NKV.tgz

8- PC98 NEC-CIRRUS/EPSON NKV/NKV2.

X9WBS.tgz

8- PC98 WAB-S.

X9WEP.tgz

8- PC98 WAB-EP.

X9WSN.tgz

8- PC98 WSN-A2F.

X9EGC.tgz

4- PC98 EGC.

X9TGU.tgz

8 16- PC98 Trident Cyber9320/9680.

X9NS3.tgz

8 16- PC98 NEC S3.

X9SPW.tgz

8 16- PC98 S3 PW/PCSKB.

X9LPW.tgz

8 16- PC98 S3 PW/LB.

,
,
.
, X:

Xprog.tgz

config, lib*.a *.h, .

Xctrb.tgz

Xlk98.tgz

" " , PC98 ().

Xlkit.tgz

" " , PC.

Xsrc-1.tgz

1 .

Xsrc-2.tgz

2 .

Xsrc-3.tgz

3 .

Note: X ,
Xprog.tgz.
XFree86 ,
, .

Xdoc.tgz

README

Xjdoc.tgz

README .

Xps.tgz

README PostScript.

Xhtml.tgz

README HTML.

Xman.tgz

.
95

Xcfg.tgz

xinit xdm.

Xset.tgz

X86Setup; xf86config.

Xjset.tgz

XF86Setup, , PC.

XFree86, ,
xf86config. xf86config
; Xbin.tgz.
XF86Setup


Xcfg.tgz. ;
.
XFree86 :

Xf100.tgz

100 dpi.

Xfscl.tgz

Speedo Type1.

Xfnon.tgz

, .

Xfcyr.tgz

X-, ,
.

Xfsrv.tgz

Xnest.tgz

, - .

Xprt.tgz

Xvfb.tgz

Virtual Framebuffer, mmap-.

9.3.3. XFree86
X sysinstall,
:
1. .
2. X-.
3. X.
4. X.
5. X .
,
, .
.
96

9.3.3.1.
, root,
set-user-id (
root ).
, ,
. umask 022 ( rwxr-xrx), X- .
% su
Password:
# umask 022

/usr ,
/usr. ,
/home , :
# cd /home
# mkdir X11R6
# ln -s /home/X11R6 /usr/X11R6

, .
Xbin.tgz, Xfnts.tgz, Xlib.tgz Xcfg.tgz. X
, Xcfg.tgz.
sh, :
#
#
#
#
#

mkdir -p /usr/X11R6
cd /usr/X11R6
for i in bin fnts lib cfg; do
tar xzf X$i.tgz
done

csh, :
#
#
#
?
?

mkdir -p /usr/X11R6
cd /usr/X11R6
foreach i (bin fnts lib cfg)
tar xzf X$i.tgz
end

9.3.3.2.
, VGA.
, ,
, ,
/usr/X11R6/man/man1/XF86_*, VGA,
. ,
ET4000, XF86_SVGA.
:
# cd /usr/X11R6

97

# tar xzf XSVGA.tgz [ ]

9.3.3.3.
/usr/X11/bin/X,
, .
XF86_SVGA:
# cd /usr/X11R6/bin
# rm X
# ln -s XF86_SVGA X

X , ,
xf86config - .
, /usr/X11R6/bin
/etc/profile sh /etc/csh.login
csh, , .
, , :
# echo 'PATH=$PATH:/usr/X11R6/bin' >>/etc/profile

:
# echo 'set path = ($path /usr/X11R6/bin)' >>/etc/csh.login

, X, /usr/X11R6/bin
PATH .
ldconfig
ld.so:
# ldconfig -m /usr/X11R6/lib

ldconfig,
X.
, ,
mkfontdir ,
, "could not open default font `fixed'".

9.3.3.4. X
,
getty. ,
:
# dmesg | grep virtual
sc0: VGA color <16 virtual consoles, flags=0x0>

98

/etc/ttys ,
( ttyvxx), getty.
off:
# grep
ttyv0
ttyv1
ttyv2
ttyv3

ttyv /etc/ttys
"/usr/libexec/getty
"/usr/libexec/getty
"/usr/libexec/getty
"/usr/libexec/getty

Pc"
Pc"
Pc"
Pc"

cons25
cons25
cons25
cons25

on secure
on secure
on secure
off secure

, 4 VT,
/dev/ttyv3. , getty /etc/ttys,
on off,
.

9.3.3.5. X
X
XF86Config, X-
.
XF86Config,
:

, ,
, , .
, /dev/ttyd0 /dev/ttyd1 ,
, /dev/psm0 PS/2
/dev/mse0, bus mouse.
. ,
, VGA .
; .

9.3.3.6.
, ?
, ,
; "Super VGA board with 76 Hz refresh rate and 16,777,216
colors". (24 - -
2 , ), .
,
, dot clock range, .
,
SuperProbe.
.

99

SuperProbe .
. SuperProbe
:
# SuperProbe
( )
First video: Super-VGA
Chipset: Tseng ET4000 (Port Probed)
Memory: 1024 Kbytes
RAMDAC: Generic 8-bit pseudo-color DAC
(with 6-bit wide lookup tables (or in 6-bit mode))

SuperProbe ,
, :
SuperProbe: Cannot be run while an X server is running
SuperProbe: If an X server is not running, unset $DISPLAY and try again
SuperProbe: Cannot open video

, X- , SuperProbe ,
DISPLAY. ?
Bourne, :
# unset DISPLAY

C shell, :
# unsetenv DISPLAY

9.3.3.7. xf86config
,
xf86config ( ) XF86Setup.
. xf86config ,
XF86Setup - . XF86Setup
, xf86config.
sysinstall, ;
sysinstall xf86config, .
xf86config.
X Diamond SpeedStar 1 ,
Logitech MouseMan ADI MicroScan 5AP.
, /dev/ttyd0.
xf86config . /usr/X11R6/bin
PATH, xf86config. ,
xf86config, , :
# /usr/X11R6/bin/xf86config

100

XF86Config ,
.
XF86Config /usr/X11R6/lib/X11 /etc.
XF86Config XFree86;
VGA 640x480. ,
.
XF86Config
,
XF86Config .
/usr/X11R6/lib/X11/doc/README.Config.
( SVGA)
.
.
. README,
.
, , ,
.
SuperProbe. , , .
Press enter to continue, or ctrl-c to abort. ENTER
First specify a mouse protocol type. Choose one from the following list:
1.
2.
3.
4.
5.
6.
7.
8.
9.

Microsoft compatible (2-button protocol)


Mouse Systems (3-button protocol)
Bus Mouse
PS/2 Mouse
Logitech Mouse (serial, old type, Logitech protocol)
Logitech MouseMan (Microsoft compatible)
MM Series
MM HitTablet
Microsoft IntelliMouse

, , 1, ,
, , , 1, 2.
; ,
1,
2.
2 (
ClearDTR/ClearRTS).
Enter a protocol number: 6

Logitech MouseMan

You have selected a Logitech MouseMan type mouse. You might want to
enable
ChordMiddle which could cause the third button to work.
Please answer the following question with either 'y' or 'n'.
Do you want to enable ChordMiddle? n

101

, X-
. , Logitech,
ChordMiddle . ,
X, ChordMiddle,
-
, XF86Setup.
:
If your mouse has only two buttons, it is recommended that you enable
Emulate3Buttons.
Please answer the following question with either 'y' or 'n'.
Do you want to enable Emulate3Buttons? n
Now give the full device name that the mouse is connected to, for example
/dev/tty00. Just pressing enter will use the default, /dev/mouse.
Mouse device: /dev/ttyd1

.
, . xf86config
FreeBSD, FreeBSD.
/dev/ttyd0 /dev/ttyd3 ,
/dev/psm0 PS/2 /dev/mse0 bus mouse.
, :

the

Beginning with XFree86 3.1.2D, you can use the new X11R6.1
XKEYBOARD extension to manage the keyboard layout. If you answer 'n' to
following question, the server will use the old method, and you have to
adjust your keyboard layout with xmodmap.
Please answer the following question with either 'y' or 'n'.
Do you want to use XKB? y
The following dialogue will allow you to select from a list of already
preconfigured keymaps. If you don't find a suitable keymap in the list,
the program will try to combine a keymap from additional information you
are asked then. Such a keymap is by default untested and may require
manual tuning. Please report success or required changes for such a
keymap to XFREE86@XFREE86.ORG for addition to the list of preconfigured
keymaps in the future.
Press enter to continue, or ctrl-c to abort.
List of preconfigured keymaps:
1
2
3
4
5
6
7
8
9
10

Standard 101-key, US encoding


Microsoft Natural, US encoding
KeyTronic FlexPro, US encoding
Standard 101-key, US encoding with ISO9995-3 extensions
Standard 101-key, German encoding
Standard 101-key, French encoding
Standard 101-key, Thai encoding
Standard 101-key, Swiss/German encoding
Standard 101-key, Swiss/French encoding
None of the above

102

Enter a number to choose the keymap.


1

Choose the standard US keyboard

.
,
, ,
.

. ,
/usr/X11R6/lib/X11/doc/Monitors
.
Press enter to continue, or ctrl-c to abort. ENTER
You must indicate the horizontal sync range of your monitor. You can
either
select one of the predefined ranges below that correspond to industrystandard monitor types, or give a specific range.
It is VERY IMPORTANT that you do not specify a monitor type with a
horizontal
sync range that is beyond the capabilities of your monitor. If in doubt,
choose a conservative setting.
hsync in kHz; monitor type with characteristic modes
1 31.5; Standard VGA, 640x480 @@ 60 Hz
2 31.5 - 35.1; Super VGA, 800x600 @@ 56 Hz
3 31.5, 35.5; 8514 Compatible, 1024x768 @@ 87 Hz interlaced (no
800x600)
4 31.5, 35.15, 35.5; Super VGA, 1024x768 @@ 87 Hz interlaced, 800x600
@@ 56 Hz
5 31.5 - 37.9; Extended Super VGA, 800x600 @@ 60 Hz, 640x480 @@ 72 Hz
6 31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @@ 60 Hz, 800x600 @@ 72 Hz
7 31.5 - 57.0; High Frequency SVGA, 1024x768 @@ 70 Hz
8 31.5 - 64.3; Monitor that can do 1280x1024 @@ 60 Hz
9 31.5 - 79.0; Monitor that can do 1280x1024 @@ 74 Hz
10 31.5 - 82.0; Monitor that can do 1280x1024 @@ 76 Hz
11 Enter your own horizontal sync range
Enter your choice (1-11):

, /usr/X11R6/lib/X11/doc/Monitors,
, ,
.
30 64 , - 50 100 .
8,
0.3 , .
? ,

, XF86Config
64.0 64.3 kHz.
. :

103

Enter your choice (1-11): 11


Please enter the horizontal sync range of your monitor, in the format

used

in the table of monitor types above. You can either specify one or more
continuous ranges (e.g. 15-25, 30-50), or one or more fixed sync
frequencies.
Horizontal sync range: 30-64

:
You must indicate the vertical sync range of your monitor.
You can either select one of the predefined ranges below that correspond
to industry-standard monitor types, or give a specific range. For
interlaced modes, the number that counts is the high one (e.g., 87 Hz
rather than 43 Hz).
1
2
3
4
5

50-70
50-90
50-100
40-150
Enter your own vertical sync range

Enter your choice: 3


monitor

exactly the range of the

.
, ,
, xf86config :
You must now enter a few identification/description strings,
namely an identifier, a vendor name, and a model name. Just pressing
enter
will fill in default names.
The strings are free-form, spaces are allowed.
Enter an identifier for your monitor definition: ENTER
Enter the vendor name of your monitor:
ENTER
Enter the model name of your monitor: ENTER

. Diamond
SpeedStar Plus ET4000 Ramdac
. , :
Now we must configure video card specific settings. At
this point you can choose to make a selection out of a database of video
card definitions. Because there can be variation in Ramdacs and clock
generators even between cards of the same model, it is not sensible to
blindly copy the settings (e.g., a Device section). For this reason,
after you make a selection, you will still be asked about the components
of the card, with the settings from the chosen database entry presented
as

a strong hint.
The database entries include information about the chipset, what server

to

run, the Ramdac and ClockChip, and comments that will be included in the

104

Device section. However, a lot of definitions only hint about what server
to run (based on the chipset the card uses) and are untested.
If you can't find your card in the database, there's nothing to worry
about.
You should only choose a database entry that is exactly the same model as
your card; choosing one that looks similar is just a bad idea (e.g. a
GemStone Snail 64 may be as different from a GemStone Snail 64+ in terms
of
hardware as can be).
Do you want to look at the card database? y
0 2 the Max MAXColor S3 Trio64V+
1 928Movie
2 AGX (generic)
3 ALG-5434(E)
4 ASUS 3Dexplorer
5 ASUS PCI-AV264CT
6 ASUS PCI-V264CT
7 ASUS Video Magic PCI V864
8 ASUS Video Magic PCI VT64
9 AT25
10 AT3D
11 ATI 3D Pro Turbo
12 ATI 3D Xpression
13 ATI 3D Xpression+ PC2TV
14 ATI 8514 Ultra (no VGA)
15 ATI All-in-Wonder
16 ATI Graphics Pro Turbo
17 ATI Graphics Pro Turbo 1600

S3 Trio64V+
S3 928
AGX-014/15/16
CL-GD5434
RIVA128
ATI-Mach64
ATI-Mach64
S3 864
S3 Trio64
Alliance AT3D
Alliance AT3D
ATI-Mach64
ATI-Mach64
ATI-Mach64
ATI-Mach8
ATI-Mach64
ATI-Mach64
ATI-Mach64

Enter a number to choose the corresponding card definition.


Press enter for the next page, q to continue configuration.
ENTER

- .
:
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

DSV3325
DSV3326
DataExpert DSV3325
DataExpert DSV3365
Dell S3 805
Dell onboard ET4000
Diamond Edge 3D
Diamond Multimedia Stealth 3D 2000
Diamond Multimedia Stealth 3D 2000 PRO
Diamond SpeedStar (Plus)
Diamond SpeedStar 24
Diamond SpeedStar 24X (not fully supported)
Diamond SpeedStar 64
Diamond SpeedStar HiColor
Diamond SpeedStar Pro (not SE)
Diamond SpeedStar Pro 1100
Diamond SpeedStar Pro SE (CL-GD5430/5434)
Diamond SpeedStar64 Graphics 2000/2200

S3 ViRGE
S3 Trio64V+
S3 ViRGE
S3 Trio64V+
S3 801/805
ET4000
nv1
S3 ViRGE
S3 ViRGE/DX
ET4000
ET4000
WD90C31
CL-GD5434
ET4000
CL-GD5426/28
CL-GD5420/2/4/6/8/9
CL-GD5430/5434
CL-GD5434

Enter a number to choose the corresponding card definition.


Press enter for the next page, q to continue configuration.
117

105

Your selected card definition:


Identifier: Diamond SpeedStar (Plus)
Chipset:
ET4000
Server:
XF86_SVGA
Press enter to continue, or ctrl-c to abort.ENTER
Now you must determine which server to run. Refer to the man pages and
other documentation. The following servers are available (they may not
all be installed on your system):
any

The XF86_Mono server. This a monochrome server that should work on

VGA-compatible card, in 640x480 (more on some SVGA chipsets).


The XF86_VGA16 server. This is a 16-color VGA server that should work

on

any VGA-compatible card.


The XF86_SVGA server. This is a 256 color SVGA server that supports
a number of SVGA chipsets. On some chipsets it is accelerated or
supports higher color depths.
4 The accelerated servers. These include XF86_S3, XF86_Mach32,
XF86_Mach8,
XF86_8514, XF86_P9000, XF86_AGX, XF86_W32, XF86_Mach64, XF86_I128 and
XF86_S3V.
3

These four server types correspond to the four different "Screen"


sections in
XF86Config (vga2, vga16, svga, accel).
5

Choose the server from the card definition, XF86_SVGA.

Which one of these screen types do you intend to run by default (1-5)?

XF86_SVGA. ?
. , ,
:
Which one of these screen types do you intend to run by default (1-5)? 5
The server to run is selected by changing the symbolic link 'X'. For
example,
the SVGA server.
Please answer the following question with either 'y' or 'n'.
Do you want me to set the symbolic link? y

, X (xinit, startx xdm),


/usr/X11R6/bin/X. /usr/X11R6/bin/X,
. , X.
Now you must give information about your video card. This
will be used for the "Device" section of your video card in XF86Config.
You must indicate how much video memory you have. It is probably a good
idea to use the same approximate amount as that detected by the server
you

intend to use. If you encounter problems that are due to the used server
not supporting the amount memory you have (e.g. ATI Mach64 is limited to

106

1024K with the SVGA server), specify the maximum amount supported by the
server.
How much video memory do you have on your video card:
1
2
3
4
5
6

256K
512K
1024K
2048K
4096K
Other

Enter your choice: 3


You must now enter a few identification/description strings, namely an
identifier, a vendor name, and a model name. Just pressing enter will
fill

in default names (possibly from a card definition).


Your card definition is Diamond SpeedStar (Plus).
The strings are free-form, spaces are allowed.
Enter an identifier for your video card definition: ENTER
You can simply press enter here if you have a generic card, or want to
describe your card with one string.
Enter the vendor name of your video card: ENTER
Enter the model (board) name of your video card: ENTER

Especially for accelerated servers, Ramdac, Dacspeed and ClockChip


settings
or special options may be required in the Device section.
The RAMDAC setting only applies to the S3, AGX, W32 servers, and some
drivers in the SVGA servers. Some RAMDAC's are auto-detected by the
server.
The detection of a RAMDAC is forced by using a Ramdac "identifier" line
in
the Device section. The identifiers are shown at the right of the
following
table of RAMDAC types:
1 AT&T 20C490 (S3 and AGX servers, ARK driver)
2 AT&T 20C498/21C498/22C498 (S3, autodetected)
3 AT&T 20C409/20C499 (S3, autodetected)
att20c409
4 AT&T 20C505 (S3)
5 BrookTree BT481 (AGX)
6 BrookTree BT482 (AGX)
7 BrookTree BT485/9485 (S3)
8 Sierra SC15025 (S3, AGX)
9 S3 GenDAC (86C708) (autodetected)
10 S3 SDAC (86C716) (autodetected)
11 STG-1700 (S3, autodetected)
12 STG-1703 (S3, autodetected)

att20c490
att20c498
att20c505
bt481
bt482
bt485
sc15025
s3gendac
s3_sdac
stg1700
stg1703

Enter a number to choose the corresponding RAMDAC.


Press enter for the next page, q to quit without selection of a RAMDAC.
q

A Clockchip line in the Device section forces the detection of a

107

programmable clock device. With a clockchip enabled, any required


clock can be programmed without requiring probing of clocks or a
Clocks line. Most cards don't have a programmable clock chip.
Choose from the following list:
1
2
3
4
5
6
7
8
9
10
11
12

Chrontel 8391
ch8391
ICD2061A and compatibles (ICS9161A, DCS2824)
icd2061a
ICS2595
ics2595
ICS5342 (similar to SDAC, but not completely compatible)
ics5342
ICS5341
ics5341
S3 GenDAC (86C708) and ICS5300 (autodetected)
s3gendac
S3 SDAC (86C716)
s3_sdac
STG 1703 (autodetected)
stg1703
Sierra SC11412
sc11412
TI 3025 (autodetected)
ti3025
TI 3026 (autodetected)
ti3026
IBM RGB 51x/52x (autodetected)
ibm_rgb5xx

Just press enter if you don't want a Clockchip setting.


What Clockchip setting do you want (1-12)? ENTER
For most configurations, a Clocks line is useful since it prevents the
slow

and nasty sounding clock probing at server start-up. Probed clocks are
displayed at server startup, along with other server and hardware
configuration info. You can save this information in a file by running
imprecise; some clocks may be slightly too high (varies per run).

At this point I can run X -probeonly, and try to extract the clock
information
from the output. It is recommended that you do this yourself and add a
clocks
line (note that the list of clocks may be split over multiple Clocks
lines) to
your Device section afterwards. Be aware that a clocks line is not
appropriate for drivers that have a fixed set of clocks and don't probe
by
default (e.g. Cirrus). Also, for the P9000 server you must simply specify
clocks line that matches the modes you want to use. For the S3 server
with
a programmable clock chip you need a 'ClockChip' line and no Clocks line.
You must be root to be able to run X -probeonly now.
Do you want me to run 'X -probeonly' now?

. - X
-probeonly, - .
.
Do you want me to run 'X -probeonly' now? n
For each depth, a list of modes (resolutions) is defined. The default
resolution that the server will start-up with will be the first listed
mode that can be supported by the monitor and card.
Currently it is set to:
"640x480"
"640x480"
"640x480"
"640x400"

"800x600" "1024x768" for 8bpp


"800x600" for 16bpp
for 24bpp
for 32bpp

108

Note that 16, 24 and 32bpp are only supported on a few configurations.
Modes that cannot be supported due to monitor or clock constraints will
be automatically skipped by the server.
1
2
3
4
5

Change the modes for 8pp (256 colors)


Change the modes for 16bpp (32K/64K colors)
Change the modes for 24bpp (24-bit color, packed pixel)
Change the modes for 32bpp (24-bit color)
The modes are OK, continue.

Enter your choice: 5

You can have a virtual screen (desktop), which is screen area that is
larger
than the physical screen and which is panned by moving the mouse to the
edge
of the screen. If you don't want virtual desktop at a certain resolution,
you cannot have modes listed that are larger. Each color depth can have a
differently-sized virtual screen
Please answer the following question with either 'y' or 'n'.
Do you want a virtual screen that is larger than the physical screen? n

, ,
. , n.
,
.
, sysinstall
:
I am going to write the XF86Config file now. Make sure
you don't accidently overwrite a previously configured one.
Shall I write it to /etc/XF86Config? y
File has been written. Take a look at it before running 'startx'. Note

that

the XF86Config file must be in one of the directories searched by the


server
(e.g. /usr/X11R6/lib/X11) in order to be used. Within the server press
ctrl, alt and '+' simultaneously to cycle video resolutions. Pressing
ctrl,
alt and backspace simultaneously immediately exits the server (use if
the monitor doesn't sync for a particular mode).
For further configuration, refer to /usr/X11R6/lib/X11/doc/README.Config.

, , X.

9.4. XFree86
9.4.1. TrueType
, XFree86,

109

. ,
Netscape . , XFree86
TrueType.
XFree86 4.0 TrueType. ,
.
"freetype",
. freetype
/etc/X11/XF86Config .
Load

"freetype"

XFree86 3.3.X TrueType.


Xfstt. Xfstt FreeBSD
/usr/ports/x11-servers/Xfstt
TrueType (,
/usr/X11R6/lib/X11/fonts/TrueType) TrueType
. , TrueType
Macintosh; XFree86 Unix/DOS/Windows.
, ,
ttmkfdir fonts.dir,
X . ttmkfdir FreeBSD
/usr/ports/x11-fonts/ttmkfdir.
# cd /usr/X11R6/lib/X11/fonts/TrueType
# ttmkfdir > fonts.dir

TrueType
. , ~/.xinitrc.
% xset fp+ /usr/X11R6/lib/X11/fonts/TrueType
% xset fp rehash

. Netscape, Gimp, StarOffice X-


TrueType. ( -
) ( StarOffice)
.
: XFree86
. ,
MacOS Microsoft Windows.

110

Chapter 10.
Table of Contents
10.1.
10.2.
10.3.
10.4.
10.5.
Moses Moore <jm-moses@home.com>, 20 2000.

10.1.
FreeBSD.
111

10.2.
, , ,
, : PCI ISA. FreeBSD
PCI ISA . ,
pcm(4). , , -,
.

Crystal 4237, 4236, 4232, 4231


Yamaha OPL-SAx

OPTi931

Ensoniq AudioPCI 1370/1371

ESS Solo-1/1E

NeoMagic 256AV/ZX

Sound Blaster Pro, 16, 32, AWE64, AWE128, Live

Creative ViBRA16

Advanced Asound 100, 110, and Logic ALS120

ES 1868, 1869, 1879, 1888

Gravis UltraSound

Aureal Vortex 1 or 2

, , ,
. ,
.

10.2.1. Creative, Advance, ESS Sound


,
device pcm

. PnP ISA ,
device sbc

. -PnP ISA ,
device pcm

112

device sbc0 at isa? port0x220 irq 5 drq 1 flags 0x15

. -.
IRQ, . sbc(4) .
Note: Sound Blaster Live FreeBSD 4.0 ,
.
-STABLE .

10.2.2. Gravis UltraSound


PnP ISA card,
device pcm

device gusc

. -PnP ISA ,
device pcm

device gus0 at isa? port 0x220 irq 5 drq 1 flags 0x13

. IRQ, . sbc(4)
.

10.2.3. Crystal Sound


Crystal,
device pcm

device csa

10.2.4.
PnP ISA PCI ,
device pcm

. -PnP ISA , bridge driver,

device pcm0 at isa? irq 10 drq 1 flags 0x0

113

. IRQ, .,
.

10.3.
/ ,
. ,
.

10.4.
, cat /dev/sndstat.
:
FreeBSD Audio Driver (newpcm) Sep 21 2000 18:29:53
Installed devices:
pcm0: <Aureal Vortex 8830> at memory 0xfeb40000 irq 5 (4p/1r +channels
duplex)

, - .
, ,
.
pcm0, su
root :
# cd /dev
# sh MAKEDEV snd0

pcm1, su
<root :
# cd /dev
# sh MAKEDEV snd1

, /dev/snd! ,
, :

SPARC-
/dev/dsp
-
/dev/dspW
, /dev/dsp, 16
/dev/midi
MIDI
/dev/mixer

/dev/music

/dev/sequencer
/dev/pss

/dev/audio

, . - ,
.
114

10.5.
10.5.1. "unsupported subdevice XX"!
10.5.2. "sb_dspwr(XX) timed out"!
10.5.3. "bad irq XX"!
10.5.4. "xxx: gus pcm not attached, out of memory". ?

10.5.1. "unsupported subdevice XX"!


. .

10.5.2. "sb_dspwr(XX) timed out"!


/ .

10.5.3. "bad irq XX"!


(IRQ) . , IRQ
IRQ .

10.5.4. "xxx: gus pcm not attached, out of memory".


?
, ,
.

III.
Table of Contents
11.
12.

115

Chapter 11.

Table of Contents
11.1.
11.2.
11.3.
11.4. NFS
11.5.
11.6. ISDN
11.7. NIS/YP
11.8. DHCP

11.1.

UNIX-. , ,
FreeBSD.

11.2.
Coranth Gryphon <gryphon@healer.com>, 6 1995.
, ,
. .
"" : " " (destination) "
" (gateway). , ,
, " ".
: , " " (default).
" " (default route) ,
. .
: , (
"" (links)) ethernet.

11.2.1.

, netstat -r:
Destination Gateway

77

default
localhost
test0

Flags

outside-gw
UGSc
localhost
UH
0:e0:b5:36:cf:4f

10.20.30.255
link#1
foobar.com link#1
UC
host1
0:e0:a8:37:8:1e

116

Refs
37
0
UHLW
UHLW
0
UHLW

Use
418
181
5

Netif Expire
ppp0
lo0
63288

2421

4601

ed0

lo0

host2
0:e0:a8:37:8:1e
host2.foobar.com link#1
UC
224
link#1
UC

UHLW
0
0

0
0

lo0 =>

(
) localhost.
( Netif), localhost,
lo0, , loopback.
, ,
, .
0:e0:....
ethernet. FreeBSD (
test0) ethernet ,
ethernet, ed0.
( Expire),
.
. ,
RIP (Routing Information Protocol),
.
FreeBSD (10.20.30.255
10.20.30, foobar.com
, ). link#1
.
.
( )
, routed. ,
( ) .
host1 , ethernet.
, FreeBSD , loopback (lo0) , ethernet.
host2 ,
ifconfig ( ethernet ,
). => lo0 ,
loopback ( , ),
. , ;

link#1.
( 224) ,
.
, , Flags.
, .
:

117

U Up: .
H Host: .
G Gateway: ,
.
S Static: , .
C Clone: ,
. .
W WasCloned: ,
(Clone).
L Link: ethernet.

11.2.2.
,
, ,
. ,
( Cloned),
.
, :
"default". ( ,
), c.
,
(, PPP ,
).
,
,
(ISP).
. :
[Local2] <--ether--> [Local1] <--PPP--> [ISP-Serv] <--ether--> [T1-GW]
Local1 Local2 ,
PPP ISP.
, , , , ,
(T1-GW) .
:

Local2 Local1
ethernet
Local1 T1-GW
PPP
" ( )
Local1 T1-GW, ,
?".

118

, - PPP-
,
. , ,
T1-GW,
ISP.
, ...1
. ( )
C 10.20.30,
10.9.9, :
Local2 (10.20.30.2) --> Local1 (10.20.30.1)
Local1 (10.20.30.1, 10.9.9.30) --> T1-GW (10.9.9.1)

11.2.3.
, , ,
. , ,
( PPP-),
. ,
.
ethernet,
. ethernet ifconfig.
ethernet,
, .
,
( ) . ,
, ,

.

11.2.4.
, ,
, .
, ,
( C)
,
.
, ,
,
PPP- . ,
ISP?
( DNS),

119

. "" ,
.
,
, , ,
.
,
( ) .
.

11.2.5.
,
. ,
traceroute(8).
( ping(8) ).
traceroute(8) ,
, .
,
- .

HTTP-Proxy Squid
FreeBSD

HTTP-Proxy ( HTTP-) :

( )
Web- ( HTTP FTP);
Internet ,
Internet,
.
Proxy- , (transparent)
Squid , .
Internet
/ ,
Web-:
o ,
, Internet - ,
..
o , ;
o , ..
,
( , ).
.

120

WWW Intranet- ,
IP- (,
NAT/Masquerading,
).
WWW-, ,
WWW-.


( ,
- ),
Squid packages;
. Squid :
pkg_add squid-2.4_6.tgz
/usr/local/etc/rc.d

squid.sh,
Squid .
Squid - " ".
Squid , ,
-z ,
( Web-, ),
- , Squid /usr/local/squid/cache,
100 . FreeBSD,
/cache.

#cache_dir ufs /usr/local/squid/cache 100 16 256

cache_dir ufs /cache 16 256


(
, ).
16 256 , /cache 16 ,
- 256 (-
, ).
'squid -z',
.
store_avg_object_size 13 KB. ,
, Squid .
URL ,
URL hash-. ,
,
. URL Web-
( /cache/swap.state),

. ( 5%),
( ) hash-
,
121

. ( ,
" ", "", 1989)
, .
, store_avg_object_size,
;
store_avg_object_size 8 KB


( );
.
,
. , ,
200
cache_mem N MB

N
( 'top' 'ps').
Squid , -
. , SendMail ralaying
( ) -
, . ,
,
, ;
, -
( - ).
Squid :
acl
acl
acl
acl
acl
acl
acl
acl
acl
acl

all src 0.0.0.0/0.0.0.0


manager proto cache_object
localhost src 127.0.0.1/255.255.255.255
SSL_ports port 443 563
Safe_ports port 80 21 443 563 70 210 1025-65535
Safe_ports port 280
# http-mgmt
Safe_ports port 488
# gss-http
Safe_ports port 591
# filemaker
Safe_ports port 777
# multiling http
CONNECT method CONNECT

http_access
http_access
http_access
http_access

allow manager localhost


deny manager
deny !Safe_ports
deny CONNECT !SSL_ports

http_access deny all

( acl http_access squid.conf).


Squid , IP- - ACL
.
, Intranet-;
acl
acl
acl
acl

all src 0.0.0.0/0.0.0.0


manager proto cache_object
localhost src 127.0.0.1/255.255.255.255
SSL_ports port 443 563

122

acl
acl
acl
acl
acl
acl

Safe_ports port 80 21 443


Safe_ports port 280
Safe_ports port 488
Safe_ports port 591
Safe_ports port 777
CONNECT method CONNECT

acl intranet src


acl intranet src
acl intranet src
http_access
http_access
http_access
http_access

563 70 210 1025-65535


# http-mgmt
# gss-http
# filemaker
# multiling http

10.0.0.0/255.0.0.0
172.16.0.0/255.240.0.0
192.168.0.0/255.255.0.0

allow manager localhost


deny manager
deny !Safe_ports
deny CONNECT !SSL_ports

http_access allow intranet


http_access deny all

( ). (
) .


: acl (. squid.conf
) http_access.

acl _

:

,
.
, (
).
(regexp) "-i",
( ).
- , Sed/Grep/AWK.
IP- ReverceDNS;
- URL, , IP-,
URL IP-.
:
http_access __ _

:
1. allow - ;
2. deny - .
: ipfw ; ,
(- GOTO ).

, ,
, :
123

,
- ( );
( ), . ,
, : ,
, ,
" ", " ".
- ACL,
ACL. ,
acl net1 src 192.168.1.0/255.255.255.0
acl net2 src 192.168.2.0/255.255.255.0
http_access net1 net2

, .. IP-, ,
IP- (
, ).

"!", , ..
.


, wildchars :

"*" (
- );
"?" .

Unix "" , , .,
,
...
.:
"." - (,
"?").
"[...]" - , ,
( ); (),
, .
,
. "^",
, .
"\" - , -
. , -
"" .
"^" - ;
.
"$" - .
"(...)" - .
"(...|...)" - ,
( .. ). ,
.
124

:
o "{M,N}" - ,
M N . M , M=0; N ,
N=.
o "*" - ,
("{0,}").
o "+" - ,
("{1,}").
o "?" - . ,
(.. "{0,1}").

URL
, URL.
(, ):

:// - http:// ftp://.


@ :@ - .
_ - , .

DNS; :
( ), .
: - ( ).
/__ - ; OS,
Unix, Web- __
OS, FTP ( )
'cd '.
? - CGI- GET.
=, "&" ().
# - () "<A NAME="">".


IP- C 192.168.1.*,
WWW. squid.conf ,
,
acl intranet src
192.168.1.0/255.255.255.0
acl denylist url_regex "/etc/squid/denylist"
http_access deny denylist
http_access allow intranet
( - http_access

).

denylist
. :-) , - :

:
^http://[^/]*chat(\.[^./]+){2,}/.*
^http://[^/]*citychat\.ru/.*

125

WebChat-: chat.chat.ru, chat.rambler.ru ..;


URL "chat"
(, "chat" .. "www",
). , ,
, "([^/]+[.@])?" - " , - (..
__)"; " -
"; , ( - " ").

:
/
- "porno", "udult", "xxx" ... ,
, .. .
:

,
(.. "www.porno.com" ,
"www.antiporno.com" - );
, "best", "cool", "free", "hot", "lady"
"top".
GIF JPEG,
/ .
,
.


, .

:
, .
.

11.3.
(Steve Peterson) <steve@zpfe.com>.

11.3.1.
( , Ethernet)
IP
. ,

126

, , FreeBSD
.
MAC ( Ethernet)
.
, .
, Ethernet
.

11.3.2. ,
, .

11.3.2.1.
, ,
-
.
,
.
A ,
B.
Ethernet, .
,
,
. , ""
, ,
.

11.3.2.2. /


IP- (NAT).
,
DSL ISDN. 13 IP-
10 .
= .

DSL/ISDN - IP-.

127

11.3.3.
11.3.3.1.
. ,
FreeBSD 4.0 .
bridge(4) .
, , .

11.3.3.2.
,
options BRIDGE

, .

11.3.3.3.
,
IPFIREWALL. Section 6.7,
.
-IP (, ARP) ,
, .
IPFIREWALL_DEFAULT_TO_ACCEPT. , ,
, .
, , , .

11.3.3.4.
,
, DUMMYNET.
dummynet(4).

11.3.4.

net.link.ether.bridge=1

/etc/sysctl.conf .
, , , ipfw,

net.link.ether.bridge_ipfw=1

11.3.5.
/ Pentium 90
: 3Com 3C900B 3C905B.
128

10/, (Cisco
675) 100/ .
0.4
ping , 10 ,
Cisco 675.

11.3.6.
telnet ,
IP-. ,
.
,
.
spanning tree.

11.4. NFS
Bill Swingle <unfurl@FreeBSD.org>, 4 2000.
, FreeBSD,
Network File System, NFS. NFS
, ,
, . NFS

, .
NFS :


,
.

. , NFS,
.
, , -,
,
.

11.4.1.
NFS - . /.
, .
. , ,
.
:

nfsd

- NFS Daemon, NFS.


129

mountd

- NFS Mount Daemon, ,

nfsd.
- :

- NFS async I/O Daemon ( /),


NFS-.
nfsiod

11.4.2. NFS
, FreeBSD . ,
,
/etc/rc.conf.
, NFS- :
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"

mountd , NFS. -u -t
nfsd , UDP TCP.
-n 4 nfsd 4 .

:
nfs_client_enable="YES"
nfs_client_flags="-n 4"

nfsd, -n 4 nfsiod 4 .
/etc/exports.
,
( ""),
. ,
. ,
, .
exports(5).
/etc/exports:
/cdrom ,
, (- )
/etc/hosts. -ro
.
.
/cdrom -ro moe larry curly

/home,
, IP-. ,
130

, DNS . -alldirs
, .
/home

-alldirs

10.0.0.2 10.0.0.3 10.0.0.4

, , /a ,
, , . -maproot=0
root
root. -maproot=0
- root ,
.
/a

-maproot=0

host.domain.com box.example.com

, ,
. ,
/etc/exports.
, , , ,
FreeBSD ,
, root:
NFS:
# nfsd -u -t -n 4
# mountd -r

NFS:
# nfsiod -n 4

.
. server,
client.
, ,
, , root
:
# mount server:/home /mnt

/home /mnt
. , /mnt
, .
(
), /etc/fstab. :
server:/home

/mnt

nfs

rw

131

Read the fstab(5) man page for more options.

11.4.3.
NFS .
, .
.
,
-. ?
NFS.
.

. NFS,

, ,
, .
FreeBSD ,
NFS. - .
/usr/ports/distfiles . ,
, ,
.

11.4.4.
John Lind <john@starfire.MN.ORG>.
PC ISA ,
, , NFS.
FreeBSD, .
, PC (FreeBSD)
,
, Silicon Graphics, Inc. Sun Microsystems, Inc.
NFS ,
, ,
.
, , FreeBSD
.
.
, NFS .
""
FreeBSD, ,
. FreeBSD ,
-w=1024 . FreeBSD
, NFS -r=1024.
fstab
132

, -o mount
.
, ,
, NFS .
, ,
UDP, , .
fastws ()
, freebox ()
FreeBSD . , /sharedfs
NFS ( man exports), /project
.
, ,
, , hard, soft bg.
FreeBSD (freebox) : /etc/fstab
freebox:
fastws:/sharedfs /project nfs rw,-r=1024 0 0

, freebox:
# mount -t nfs -o -r=1024 fastws:/sharedfs /project

FreeBSD : /etc/fstab
fastws:
freebox:/sharedfs /project nfs rw,-w=1024 0 0

, fastws:
# mount -t nfs -o -w=1024 freebox:/sharedfs /project

16-
.
, , ,
, , . , NFS
"" 8 (
). Ethernet 1500 , "" NFS
Ethernet,
, , .
,
NFS, ,
. , , ,
,

.
133

, 8, ,
.
Ethernet, ,
Ethernet ,
.
,
PC-,
"" NFS.
, , , ,
.

11.5.
Martin Renters <martin@FreeBSD.org>.
netboot.com/netboot.rom

FreeBSD
FreeBSD . 2.0
. NFS.
Ethernet : Western Digital/SMC 8003, 8013,
8216 ; NE1000/NE2000 (
)

11.5.1.
1. , .
,
FreeBSD 2.0,
bootp, tftp NFS. :
o HP9000/8xx HP-UX 9.04 ( 9.04
)
Sun/Solaris 2.3. ( bootp)

2. bootp, IP,
.
3.
4.
5.
6.
7.
8.
9.
10.
11.

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:

134

12. TFTP ( , bootp) ,


.
cfg.X.X.X.X ( /tftpboot/cfg.X.X.X.X, ), X.X.X.X IP- .
netboot. 2.0 netboot :
help

ip X.X.X.X
/ IP-
server X.X.X.X / bootp/tftp
netmask X.X.X.X /
hostname name /
kernel name
/
rootfs ip:/fs
/
swapfs ip:/fs /
swapsize size

diskboot

autoboot

trans on|off
/
flags bcdhsv

13. cfg- :
14.
15.
16.
17.
18.

rootfs 192.1.2.3:/rootfs/myclient
swapfs 192.1.2.3:/swapfs
swapsize 20000
hostname myclient.mydomain

19. cfg-
:
20.
21.
22.

rootfs 192.1.2.3:/rootfs/myclient
hostname myclient.mydomain

23. , NFS (,
, ) ,
. /etc/exports
FreeBSD :
24.
25.

/rootfs/myclient -maproot=0:0 myclient.mydomain


/swapfs -maproot=0:0 myclient.mydomain

HP-UX:
/rootfs/myclient -root=myclient.mydomain
/swapfs -root=myclient.mydomain

26. NFS (
),
dd. swapfs /swapfs 20000,
, myclient
/swapfs/swap.X.X.X.X, X.X.X.X IP- , :
27.

# dd if=/dev/zero of=/swapfs/swap.192.1.2.4 bs=1k count=20000

135

,
,
:
# chmod 0600 /swapfs/swap.192.1.2.4

28. ,
(/rootfs/myclient
).
o HP-UX: HP-UX
9.04 HP9000/800.
NFS.
o

/dev /rootfs/myclient ,
(HPUX) ,
FreeBSD.
( control-c ),
/dev sh ./MAKEDEV all
, .

29. netboot.com
netboot.rom

11.5.2.

/usr

,
/usr /. , , ,
/ FreeBSD core team <freebsd-core@FreeBSD.org>.

11.5.3. netboot
Netboot NE1000/2000
/sys/i386/boot/netboot/Makefile.
.

11.6. ISDN
Bill Lloyd <wlloyd@mpd.ca>.
ISDN
(Dan Kegel) ISDN.
ISDN:

, ISDN-.
ISDN
, ,
136

.
.


ISDN-,
/.

.
.

11.6.1. ISDN
Hellmuth Michaelis <hm@FreeBSD.org>.
ISDN ,
DSS1/Q.931.
ISDN- PC
FreeBSD 2.2.x isdn4bsd. ,
, .
isdn4bsd ftp://isdn4bsd@ftp.consol.de/pub/,
ftp- isdn4bsd ( isdn4bsd,
, pub.
ftp ftp anonymous ).
Isdn4bsd ISDN
IP HDLC, PPP . .
ISDN- PC, ISDN-
Siemens (ISAC/HSCX), ( Motorola, Cologne Chip Designs)
.
README.
ISDN,
-
isdn4bsd, <hm@kts.org>.
, majordomo.
, <majordomo@FreeBSD.org> :
subscribe freebsd-isdn

11.6.2. ISDN
(TA) ISDN ,
.
137

TA AT-,
.
TA , ,
, , .
PPP , . ,
.
TA
PPP. IP
,
IP-.
IP-.
TA PPP, -
. FreeBSD
ISDN, PPP. ,
, PPP, .
, PPP,
iijPPP.
, TA FreeBSD.

Motorola BitSurfer Bitsurfer Pro

Adtran

TA, , , TA

AT- .
TA
.
,
,
.
TA, () PC,
115.2, 128.
128, ISDN, ,
TA .
, , TA
/. TA
PC. , -
.
TA , ,
386 FreeBSD,
.
138

sync/TA
. .
.

11.6.3. / ISDN
ISDN FreeBSD
.
, ,
.

.
/ ISDN,
. ISDN ,
( ) Ethernet,
/.
PPP , .
,
TA, ISDN.
ISDN ,
.
, , .
,
, .
,
, .
,
, .
Example 11-1.
10 Base T Ethernet.
AUI/10BT, .
--- Sun
|
--- FreeBSD
|
---Windows 95 (Do not admit to owning it)
|

|
ISDN BRI

,

.
139

Example 11-2.
Ethernet .
------- Novell
| H |
|
---Sun
|
|
| U ---FreeBSD
|
|
|
---Windows 95
| B |
|___---
|
ISDN BRI

/ ,
2 PPP 2
. TA, ()
, .
, MPP .
, ,
ISDN- , ,
ISDN . ,
, B (64)
, B
. B ,
(MPP ) B
.
Ethernet , IP,
IPX/SPX , .

11.7. NIS/YP
Bill Swingle <unfurl@FreeBSD.org> 21 2000,
(Eric Ogren) <eogren@earthlink.net>
(Udo Erdelhoff) <ue@nathan.ruhr.de> 2000.

11.7.1. ?
NIS, Network Information Services (
), Sun Microsystems
Unix ( SunOS).
;
Unix (Solaris, HP-UX, AIX, Linux, NetBSD, OpenBSD, FreeBSD, )
NIS.

140

NIS Yellow Pages ( yp), -


, Sun .
/ RPC,
NIS .
NIS
, ,
.
Windows NT;
, .

11.7.2. /,
,
, NIS FreeBSD,
, NIS:

NIS. NIS (
), NIS. NT,
NIS DNS.
portmap. RPC (Remote Procedure Call,
, , NIS),
portmap. portmap ,
NIS, NIS-.

ypbind. ypbind ``'' NIS- NIS-.


NIS- , RPC . ypbind
- NIS;
ypbind ,
NIS.

ypserv. ypserv, NIS,


NIS. ypserv ,
NIS ( ,
).
Note: NIS ( FreeBSD ),
,
. ,
, ( )
ypbind .

rpc.yppasswdd. rpc.yppasswdd, ,
NIS-, , NIS
NIS. ,
NIS .

11.7.3. ?
NIS ; (master) , (slave)
.
141

.
,
. ,
.
.
master.passwd, group, hosts NIS. ,
, , ,
, , ,
.

11.7.3.1.

NIS. ,
Windows NT, , NIS. passwd,
group , NIS,
.
Note:
NIS. , ,
NIS.

NIS. NT,
NIS NIS.
NIS ,
. :
NIS NIS, ,
.

NIS. NIS, NT Workstation,


NIS ( NT
Workstation) .

11.7.4. NIS/YP
NIS.
Note: , FreeBSD 3.3 .
, , , FreeBSD,
, 3.0, , .

11.7.4.1.
,
. 15
; /etc/passwd
/etc/master.passwd. ;
, ,
adduser 15 . , ,
NIS,
.
142

, :
IP-

ellington

10.0.0.2

NIS

coltrane

10.0.0.3

NIS

basie

10.0.0.4

bird

10.0.0.5

cli[1-11]

10.0.0.[6-17]

NIS , .
, ,
.

11.7.4.1.1. NIS
" ", .
" NIS".
, NIS, .
,
. NIS , -
.
NIS .
,
. NIS ,
, . ,
Acme Inc. NIS "acme-art".
, test-domain.
, ( , SunOS)
NIS .
,
NIS.

11.7.4.1.2.
,
NIS. ,
NIS, .
NIS,
.
. , ,
. NIS
,
NIS. ,
, NIS ,
, , NIS ,
NIS.

143

11.7.4.2. NIS
NIS ,
NIS. ,
, NIS. FreeBSD /var/yp/
[domainname], [domainname] NIS.
NIS ,
,
. .
NIS
ypserv. Ypserv NIS,

, .

11.7.4.2.1. NIS
NIS ,
. FreeBSD NIS. ,
, /etc/rc.conf, FreeBSD
..

nisdomainname="test-domain"

NIS, test-domain,
(, ).

nis_server_enable="YES"

FreeBSD NIS,
.

nis_yppasswdd_enable="YES"

rpc.yppasswdd, ,
, NIS .
, , /etc/netstart,
. ,
, /etc/rc.conf.

11.7.4.2.2. NIS
NIS , /var/yp.
, /etc
NIS, : /etc/master.passwd.
; root
NIS. ,
NIS, :
# cp /etc/master.passwd /var/yp/master.passwd
# cd /var/yp

144

# vi master.passwd

, (bin, tty, kmem,


games ), , NIS
(, root UID, 0 ()).
Note: , /var/yp/master.passwd
, ( 600)!
chmod, .
, NIS!
FreeBSD ypinit, (
). ,
UNIX, . Digital Unix/Compaq Tru64
Unix ypsetup. NIS,
ypinit -m. NIS
, , , :
ellington# ypinit -m test-domain
Server Type: MASTER Domain: test-domain
Creating an YP server will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.
Do you want this procedure to quit on non-fatal errors? [y/n: n] n
Ok, please remember to go back and redo manually whatever fails.
If you don't, something might not work.
At this point, we have to construct a list of this domains YP servers.
rod.darktech.org is already known as master server.
Please continue to add any slave servers, one per line. When you are
done with the list, type a <control D>.
master server
: ellington
next host to add: coltrane
next host to add: ^D
The current list of NIS servers looks like this:
ellington
coltrane
Is this correct? [y/n: y] y
[.. ..]
NIS Map update completed.
ellington has been setup as an YP master server without any errors.

ypinit /var/yp/Makefile
/var/yp/Makefile.dist. ,
NIS FreeBSD.
test-domain ,
/var/yp/Makefile:
ellington# vi /var/yp/Makefile

, `NOPUSH = "True"' (
).

145

11.7.4.2.3. NIS
NIS ,
. /etc/rc.conf ,
. ,
ypinit -s. -s
NIS, :
coltrane# ypinit -s ellington test-domain
Server Type: SLAVE Domain: test-domain Master: ellington
Creating an YP server will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.
Do you want this procedure to quit on non-fatal errors? [y/n: n]
Ok, please remember to go back and redo manually whatever fails.
If you don't, something might not work.
There will be no further questions. The remainder of the procedure
should take a few minutes, to copy the databases from ellington.
Transferring netgroup...
ypxfr: Exiting: Map successfully transferred
Transferring netgroup.byuser...
ypxfr: Exiting: Map successfully transferred
Transferring netgroup.byhost...
ypxfr: Exiting: Map successfully transferred
Transferring master.passwd.byuid...
ypxfr: Exiting: Map successfully transferred
Transferring passwd.byuid...
ypxfr: Exiting: Map successfully transferred
Transferring passwd.byname...
ypxfr: Exiting: Map successfully transferred
Transferring group.bygid...
ypxfr: Exiting: Map successfully transferred
Transferring group.byname...
ypxfr: Exiting: Map successfully transferred
Transferring services.byname...
ypxfr: Exiting: Map successfully transferred
Transferring rpc.bynumber...
ypxfr: Exiting: Map successfully transferred
Transferring rpc.byname...
ypxfr: Exiting: Map successfully transferred
Transferring protocols.byname...
ypxfr: Exiting: Map successfully transferred
Transferring master.passwd.byname...
ypxfr: Exiting: Map successfully transferred
Transferring networks.byname...
ypxfr: Exiting: Map successfully transferred
Transferring networks.byaddr...
ypxfr: Exiting: Map successfully transferred
Transferring netid.byname...
ypxfr: Exiting: Map successfully transferred
Transferring hosts.byaddr...
ypxfr: Exiting: Map successfully transferred
Transferring protocols.bynumber...
ypxfr: Exiting: Map successfully transferred
Transferring ypservers...
ypxfr: Exiting: Map successfully transferred
Transferring hosts.byname...
ypxfr: Exiting: Map successfully transferred

146

coltrane has been setup as an YP slave server without any errors.


Don't forget to update map ypservers on ellington.

/var/yp/test-domain.
NIS . ,
. /etc/crontab
:
20 *
21 *

*
*

*
*

*
*

root
root

/usr/libexec/ypxfr passwd.byname
/usr/libexec/ypxfr passwd.byuid


. ,
NIS ,
,
, .
,
.
/etc/netstart ,
NIS.

11.7.4.3. NIS
NIS NIS
ypbind. ypbind , (,
domainname),
RPC . ,
ypbind . ,
, ,
ypbind, , .
(, ), ypbind
.
NIS . ypbind "ping"
.
, ypbind ,
,
.

11.7.4.3.1. NIS
FreeBSD NIS .

/etc/rc.conf, ,
NIS ypbind :
nisdomainname="test-domain"
nis_client_enable="YES"

NIS
vipw /etc/master.passwd :
147

+:::::::::

Note:
.
NIS, . ,
, .
O'Reilly
Managing NFS and NIS.

NIS,
/etc/group :
+:*::


ypcat passwd NIS.

11.7.5. NIS
- , , RPC
ypserv NIS.
ypserv securenets,
.
ypserv , securenets,
/var/yp/securenets.
Note: , -p.
, , .
, "#", .
securenets :
# allow connections from local host -- mandatory
127.0.0.1
255.255.255.255
# allow connections from any host
# on the 192.168.128.0 network
192.168.128.0 255.255.255.0
# allow connections from any host
# between 10.0.0.0 to 10.0.15.255
# this includes the machines in the testlab
10.0.0.0
255.255.240.0

ypserv , ,
.
,
. /var/yp/securenets , ypserv
.
ypserv tcpwrapper Wietse Venema.
/var/yp/securenets
tcpwrapper.

148

Note: ,
, ,
"IP spoofing". , NIS,
.
, /var/yp/securenets,
NIS TCP/IP.

/
.
,
/var/yp/securenets.
/var/yp/securenets TCP/IP
, NIS
.
tcpwrapper NIS.

, NIS.
,
NIS
.

11.7.6.
basie, ,
.
NIS, passwd NIS
, . ?
,
NIS. , -username
/etc/master.passwd , username
, .
vipw, vipw /etc/master.passwd,
. ,
bill basie,
:
basie# vipw
[add -bill to the end, exit]
vipw: rebuilding the database...
vipw: done
basie# cat /etc/master.passwd
root:[password]:0:0::0:0:The super-user:/root:/bin/csh
toor:[password]:0:0::0:0:The other super-user:/root:/bin/sh
daemon:*:1:1::0:0:Owner of many system processes:/root:/sbin/nologin
operator:*:2:5::0:0:System &:/:/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin

149

games:*:7:13::0:0:Games pseudo-user:/usr/games:/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
uucp:*:66:66::0:0:UUCP pseudouser:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin
+:::::::::
-bill
basie#

11.7.7.
(Udo
Erdelhoff) <ue@nathan.ruhr.de> 2000 .
, , ,
.

,
NIS, .
NIS .
, Unix.

, .
,
. , ,
. ,
. , ,
.
, NIS
.
NIS .
, .

alpha, beta

IT-

charlie, delta

IT-

echo, foxtrott, golf, ...

able, baker, ...

war, death, famine,


polution

. IT
.

pride, greed, envy, wraith, . IT


lust, sloth
.
150

alpha, beta

IT-

one, two, three, four, ...

.
.

trashcan

- .
.

,
,
-user , .
, .
,
.
, .
.
;

. ,
.
, .
; "
". NIS ,

.
NIS netgroup. ypinit
FreeBSD , NIS ,
. ,
ellington# vi /var/yp/netgroup

. ,
: IT, IT, .
IT_EMP
(,alpha,test-domain)
IT_APP
(,charlie,test-domain)
USERS
(,echo,test-domain)
(,golf,test-domain)
INTERNS (,able,test-domain)

(,beta,test-domain)
(,delta,test-domain)
(,foxtrott,test-domain) \
(,baker,test-domain)

IT_EMP, IT_APP

.
.
:
1. , .
, . ,
, .
2. , .
151

3. NIS .
NIS, ,
NIS.
,
netgroup(5).
Note: 8 ,
NIS ,
. ;
, .
NIS ( FreeBSD) ,
. ,
SunOS , 15 .
, 15
, :
BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...]
BIGGRP2 (,joe16,domain) (,joe17,domain) [...]
BIGGRP3 (,joe32,domain) (,joe33,domain)
BIGGROUP BIGGRP1 BIGGRP2 BIGGRP3

, 225
.
NIS :
ellington# cd /var/yp
ellington# make

NIS netgroup, netgroup.byhost netgroup.byuser.


ypcat(1) NIS:
ellington% ypcat -k netgroup
ellington% ypcat -k netgroup.byhost
ellington% ypcat -k netgroup.byuser

/var/yp/netgroup.
, ,
.
.
. war,
vipw(8)
+:::::::::

+@IT_EMP:::::::::

152

, ,
IT_EMP, war
.
, ~
,
. , cd ~user ,
ls -l ,
find . -user joe -print , "No such user".
,
.
, /etc/master.passwd.
+:::::::::/sbin/nologin, "
/sbin/nologin
". ,
/etc/master.passwd.
Warning, +:::::::::/sbin/nologin
+@IT_EMP:::::::::. ,
NIS, /sbin/nologin .
IT
NIS.
, +::::::::: /etc/master.passwd ,
:
+@IT_EMP:::::::::
+@IT_APP:::::::::
+:::::::::/sbin/nologin

:
+@IT_EMP:::::::::
+@USERS:::::::::
+:::::::::/sbin/nologin

,
: IT . IT
;
. IT_INTERN,
...
: "
".
NIS
.
. ,
BIGSRV ,
153

SMALLSRV
USERBOX .
, .
NIS :
BIGSRV
SMALLSRV
USERBOX

IT_EMP IT_APP
IT_EMP IT_APP ITINTERN
IT_EMP ITINTERN USERS

,
. ,
, .
.
,
, .
/etc/master.passwd ,
``+''. ,
,
/sbin/nologin .
.
, :
+@BOXNAME:::::::::
+:::::::::/sbin/nologin

,
/etc/master.passwd.
NIS.
.
#
IT_EMP
(,alpha,test-domain)
(,beta,test-domain)
IT_APP
(,charlie,test-domain) (,delta,test-domain)
DEPT1
(,echo,test-domain)
(,foxtrott,test-domain)
DEPT2
(,golf,test-domain)
(,hotel,test-domain)
DEPT3
(,india,test-domain)
(,juliet,test-domain)
ITINTERN (,kilo,test-domain)
(,lima,test-domain)
D_INTERNS (,able,test-domain)
(,baker,test-domain)
#
#
USERS
DEPT1
DEPT2
DEPT3
BIGSRV
IT_EMP IT_APP
SMALLSRV IT_EMP IT_APP
ITINTERN
USERBOX
IT_EMP ITINTERN USERS
#
#
# echo golf
SECURITY IT_EMP (,echo,test-domain) (,golf,test-domain)
#
# ,
#
WAR
BIGSRV
FAMINE
BIGSRV
# india
POLUTION BIGSRV (,india,test-domain)

154

#
#
DEATH
IT_EMP
#
# ,
ONE
SECURITY
#
#
TWO
(,hotel,test-domain)
# [... ]

-
,
.
.
:
.
, ,
, , NIS .

11.7.8.
, -,
NIS.

, ,
NIS
NIS. ,
, NIS. ,
``jsmith'', :
# pw useradd jsmith
# cd /var/yp
# make test-domain

pw useradd jsmith adduser jsmith.

NIS.
,
.
NIS
. - , ,
.

, . NIS,
!

11.7.9. NIS v1
ypserv FreeBSD
NIS v1. NIS FreeBSD NIS v2,
155

v1 .
ypbind, ,
NIS v1, (

v2). , ,
ypserv v1; ,

NIS, v1. , ,
.

11.7.10. NIS, NIS


ypserv ,
NIS.
, ,
. ,
, .
,
, ,
.
,
ypbind -S.

11.7.11. libscrypt libdescrypt


, NIS,
crypt. NIS
DES, ,
DES. , ,
/usr/lib.
DES, :
% ls -l /usr/lib/*crypt*
lrwxrwxrwx 1 root wheel
libdescrypt.a
lrwxrwxrwx 1 root wheel
libdescrypt.so
lrwxrwxrwx 1 root wheel
libdescrypt.so.2
lrwxrwxrwx 1 root wheel
libdescrypt_p.a
-r--r--r-- 1 root wheel
lrwxr-xr-x 1 root wheel
libdescrypt.so.2
-r--r--r-- 1 root wheel
-r--r--r-- 1 root wheel

13 Jul 15 08:55 /usr/lib/libcrypt.a@ ->


14 Jul 15 08:55 /usr/lib/libcrypt.so@ ->
16 Jul 15 08:55 /usr/lib/libcrypt.so.2@ ->
15 Jul 15 08:55 /usr/lib/libcrypt_p.a@ ->
13018 Nov
16 Nov

8 14:27 /usr/lib/libdescrypt.a
8 14:27 /usr/lib/libdescrypt.so@ ->

12965 Nov
14750 Nov

8 14:27 /usr/lib/libdescrypt.so.2
8 14:27 /usr/lib/libdescrypt_p.a

FreeBSD
MD5, :
% ls -l /usr/lib/*crypt*
lrwxrwxrwx 1 root wheel
libscrypt.a

13 Jul 15 08:55 /usr/lib/libcrypt.a@ ->

156

lrwxrwxrwx
libscrypt.so
lrwxrwxrwx
libscrypt.so.2
lrwxrwxrwx
libscrypt_p.a
-r--r--r-lrwxr-xr-x
libscrypt.so.2
-r--r--r--r--r--r--

1 root

wheel

14 Jul 15 08:55 /usr/lib/libcrypt.so@ ->

1 root

wheel

16 Jul 15 08:55 /usr/lib/libcrypt.so.2@ ->

1 root

wheel

15 Jul 15 08:55 /usr/lib/libcrypt_p.a@ ->

1 root
1 root

wheel
wheel

6194 Nov
14 Nov

8 14:27 /usr/lib/libscrypt.a
8 14:27 /usr/lib/libscrypt.so@ ->

1 root
1 root

wheel
wheel

7579 Nov
6684 Nov

8 14:27 /usr/lib/libscrypt.so.2
8 14:27 /usr/lib/libscrypt_p.a

NIS,
. NIS ,
, , DES ,
.

11.8. DHCP
Gregory Sutter <gsutter@FreeBSD.org>, 2000.

11.8.1. DHCP?
DHCP, Dynamic Host Configuration Protocol (
), ,
. FreeBSD DHCP
ISC (Internet Software Consortium), , ,
, ISC.

11.8.2.
DHCP,
FreeBSD; , .
DHCP, , ,
.

11.8.3.
dhclient,
DHCP,
. 68 UDP.
UDP 67, IP , ,
, DNS.
"" DHCP (
DHCP). IP ,
, .
DHCP .
dhcp-options(5).

157

11.8.4. FreeBSD
DHCP ISC, dhclient, FreeBSD.
DHCP , ,
,
DHCP. dhclient FreeBSD, 3.2.
DHCP sysinstall.
sysinstall , , "Do you want to try dhcp
configuration of this interface?" ("
dhcp?"). dhclient,
.
, ,
DHCP :

, bpf .
, pseudo-device bpf
.
.
bpf GENERIC,
FreeBSD, , ,
, DHCP.
Note: , , ,
bpf ,
- (
root). bpf DHCP,
,
bpf , DHCP.

/etc/rc.conf, :
ifconfig_fxp0="DHCP"

Note: fxp0 ,
.
dhclient
dhclient, ( ,
):
dhcp_program="/sbin/dhclient"
dhcp_flags=""

DHCP, dhcpd, isc-dhcp2 .


ISC DHCP, , ,
.

158

11.8.5.

/etc/dhclient.conf

, /etc/dhclient.conf.
, ,
.
dhclient.conf(5).
dhclient

/sbin/dhclient

/sbin.
dhclient(8) dhclient.
dhclient

/sbin/dhclient-script

FreeBSD
DHCP. dhclient-script(8),
.
dhclient-script

/var/db/dhclient.leases

DHCP
. dhclient.leases(5)
.

11.8.6.
DHCP RFC 2131. ,
dhcp.org.

159

Chapter 12.
Table of Contents
12.1.
12.2.
12.3.
12.4.
Jim Mock <jim@FreeBSD.org>, 2 1999 . : Bill
Lloyd <wlloyd@mpd.ca>.

12.1.

. , .
, , , ,
.

, .
,
(Domain Name Server, DNS). ,
/etc/namedb named(8).

12.2.
/ ():
, (), DNS, POP IMAP .

12.2.1.
, mutt, pine, elm, mail,
, , balsa xfmail, (,
- WWW Netscape).
, - , TCP.

12.2.2.
sendmail ( FreeBSD), ,
: qmail, postfix exim.
.
:
. / POP IMAP,
.
160

, sendmail ,
. , ,
.

12.2.3. Email DNS


(Domain Name System, DNS) named
. DNS
IP , . IP
A. MX (Mail eXchanger) ,
. MX
, .

12.2.4.
.
, POP
IMAP.
POP IMAP , :
1. POP IMAP .
2. /etc/inetd.conf POP IMAP .

12.3.
, , , FAQ.
12.3.1. FQDN ?
12.3.2. Sendmail ``mail loops back to myself''
12.3.3. ?

12.3.1. FQDN ?
, , , , ,
; , foo.bar.edu
mumble bar.edu, ,
mumble.bar.edu, mumble.
, () BSD BIND . ,
BIND, FreeBSD, ,
, ,
. , mumble mumble.foo.bar.edu
.

161

,
mumble.bar.edu mumble.edu.
, RFC 1535.

search foo.bar.edu bar.edu

:
domain foo.bar.edu
/etc/resolv.conf.

,
" ",
RFC 1535.

12.3.2. Sendmail ``mail

loops back to myself''

FAQ sendmail :
* "Local configuration error", :
553 relay.domain.net config error: mail loops back to myself
554 <user@domain.net>... Local configuration error
?
MX, domain.net
relay.domain.net,
domain.net. domain.net
/etc/sendmail.cw (
FETURE(use_cw_file)) "Cw domain.net"
/etc/sendmail.cf.

FAQ sendmail. ,
comp.mail.sendmail, comp.mail.misc,
comp.mail.smail, comp.answers news.answers.
, , "send usenet/news.answers/mail/sendmail-faq"
, <mail-server@rtfm.mit.edu>.

12.3.3.
?
FreeBSD ,
" " .
. , , UUCP.
, ,
MX- , :
bigco.com.

MX
MX

10
20

bigco.com.
smalliap.com.

(
Cw bigco.com /etc/sendmail.cf bigco.com).
sendmail ( ) "" ,
- . ,
162

( , , ),
, .. ,
, ,
(sendmail_flags = -bd -q15m /etc/rc.conf) 15 ,
.
, ,
.
#!/bin/sh
# Put me in /usr/local/bin/pppbigco
( sleep 60 ; /usr/sbin/sendmail -q ) &
/usr/sbin/ppp -direct pppbigco

,
sendmail -qRbigco.com ,
bigco.com .
.
FreeBSD ISP <freebsdisp@FreeBSD.org>.
>
>
>
>
>
>
>
>
>
>
>
>

MX .

() MX ( ,
). , sendmail
, 30 ,
30 , ,
"" MX-.
, - , sendmail
, ? ,
-
.

"privacy flags"
sendmail.cf,
Opgoaway,restrictqrun
restrictqrun,
.

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

. ,
,
. , DNS
"customer.com" "hostname.customer.com".
A DNS "customer.com".

163

12.4.

12.4.1.
, " "
/etc/resolv.conf . ,
, , ,
:

DNS,
, , FreeBSD.org

, , .
, . ,
example.FreeBSD.org.

, ,
() IP ( , , PPP-).
, SMTP-.
, :

, MX DNS IP .

MX-.


.
:
# hostname
example.FreeBSD.org
# host example.FreeBSD.org
example.FreeBSD.org has address 204.216.27.XX

,
<yourlogin@example.FreeBSD.org>.
, :
# host example.FreeBSD.org
example.FreeBSD.org has address 204.216.27.XX
example.FreeBSD.org mail is handled (pri=10) by hub.FreeBSD.org

, example.FreeBSD.org hub (
), , .
DNS . DNS,
, , MX ( . Mail
164

eXchanger). ,
.
, MX freefall.FreeBSD.org -
:
freefall
freefall
freefall
freefall

MX
MX
MX
MX

30
40
10
20

mail.crl.net
agora.rdrop.com
freefall.FreeBSD.org
who.cdrom.com

, freefall MX-.
, -
freefall; freefall, -
.
MX- ,
. ( )
.

12.4.2.
, "" ,
.
, POP IMAP.
( ) ,
, , adduser.
, ,
. :
example.FreeBSD.org

MX

204.216.27.XX

10 hub.FreeBSD.org

;
;

, , ,
, , A-.
, DNS.
-
,
DNS .
,
. , ,
, customer1.org, , ,
customer1.org , , mail.myhost.com. , DNS
:
customer1.org

MX

10

165

mail.myhost.com

, , A .
Note: , -
customer1.org, - , A- .
, - sendmail,
/ . :

/etc/sendmail.cw,
FEATURE(use_cw_file). sendmail 8.10 ,
/etc/mail/local-host-names.

Cwyour.host.com /etc/sendmail.cf
/etc/mail/sendmail.cf ( sendmail 8.10 ).

166

IV.
Table of Contents
13.
14.
15.
16.
17. , Linux

Chapter 13.
Table of Contents
13.1.
13.2. -CURRENT -STABLE
13.3.
13.4. make world
, Jim Mock
<jim@FreeBSD.org> 2000. Jordan K. Hubbard
<jkh@FreeBSD.org>, Poul-Henning Kamp <phk@FreeBSD.org>, John Polstra
<jdp@FreeBSD.org> Nik Clayton <nik@FreeBSD.org> .

13.1.
FreeBSD . ,
,
. -- !
,
.

13.2. -CURRENT -STABLE


FreeBSD ; -CURRENT -STABLE.
,
. -CURRENT, -STABLE.

167

13.2.1. FreeBSD
, , -CURRENT " "
FreeBSD, FreeBSD ,
, .

13.2.1.1. FreeBSD-CURRENT?
FreeBSD-CURRENT , ,
FreeBSD, . ,
,
,
. FreeBSDCURRENT , ,
. ,
, FreeBSD-CURRENT
,
, 24- !

13.2.1.2. FreeBSD-CURRENT?
FreeBSD-CURRENT
:
1. FreeBSD,
"current"
.
2. FreeBSD, ,
, , FreeBSDCURRENT , , .
,
FreeBSD.
3. FreeBSD ( ),

( , , ).
.

13.2.1.3. FreeBSD-CURRENT ?
1. , ,

, .
2. .
3. " " .
, ,
"" FreeBSD-CURRENT,
. , ,
( ,
FreeBSD), , 400
- FreeBSD! ,
168

, FreeBSD,
.

13.2.1.4. FreeBSD-CURRENT
1.
FreeBSD-CURRENT <freebsd-current@FreeBSD.org> CVS FreeBSD <cvs-all@FreeBSD.org>. ,
. FreeBSDCURRENT, ,
,
. , ,
.
CVS- FreeBSD <cvsall@FreeBSD.org>
,
.
,
<majordomo@FreeBSD.org> :
subscribe freebsd-current
subscribe cvs-all

help, Majordomo
,
, .
2. ftp.FreeBSD.org.
:
a. CTM. TCP/IP
, , .
b. cvsup sup-.
,
,
. cvsup cron
.
:
c.
# pkg_add -f \
d. ftp://ftp.FreeBSD.org/pub/FreeBSD/development/CVSup/cvsupit
.tgz

e. ftp. FreeBSD-CURRENT
"" : ftp://ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-current/.
wu-ftpd,
/ tar, ,
:
169

usr.bin/lex

tar-,
:
ftp> cd usr.bin
ftp> get lex.tar

3. ,
, cvsup
ftp. CTM.
,
, current ,
. ,
- ,
.
, current, Makefile
/usr/src.
make world. FreeBSDCURRENT <freebsd-current@FreeBSD.org>
,
.
4. ! FreeBSD-CURRENT,
, ,
. , ,
!!

13.2.2. stable FreeBSD


FreeBSD ,
-CURRENT, -STABLE.
, -RELEASE . ,
3.4-RELEASE, "" -STABLE,
-. , , -STABLE
-RELEASE, "" -STABLE.

13.2.2.1. FreeBSD-STABLE?
FreeBSD-STABLE
, .

( FreeBSD-CURRENT).

13.2.2.2. FreeBSD-STABLE?
,
FreeBSD ,
stable. , ( 4.2170

RELEASE ), stable
.
Warning . stable
, ( ,
). ,
current , stable,
. -
stable , , , ! ( ).

13.2.2.3. FreeBSD-STABLE
1.
FreeBSD-STABLE <freebsd-stable@FreeBSD.org>.
,
stable , .
,
,
, , .
CVS- FreeBSD <cvsall@FreeBSD.org>
,
.
,
<majordomo@FreeBSD.org> :
subscribe freebsd-stable
subscribe cvs-all

help, Majordomo
,
, .
2. ,
,
ftp://releng4.FreeBSD.org/pub/FreeBSD/ ,
.
FreeBSD
, ftp.FreeBSD.org.
:
a. CTM. TCP/IP
, , .
b. cvsup sup-.
,
,
. cvsup cron

171

.
:
c.
# pkg_add -f \
d. ftp://ftp.FreeBSD.org/pub/FreeBSD/development/CVSup/cvsupit
.tgz

e. ftp. FreeBSD-STABLE
"" : ftp://ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-stable/.
wu-ftpd,
/ tar, ,
:
usr.bin/lex

tar-,
:
ftp> cd usr.bin
ftp> get lex.tar

3. ,
, cvsup
ftp. CTM.
4. , stable, Makefile
/usr/src.
make world. FreeBSDSTABLE <freebsd-stable@FreeBSD.org>
,
.

13.3.

( )
, FreeBSD,
, , . ,
, CVS, CVSup CTM.
CVS CVSup pull .
CVSup ( cron) cvsup,
- cvsupd, . ,
,
, .
, .
,
. CVS , CVSup ,
CVS,
172

CVS. CVSup ,
CVS .
CTM, , ,
, , -
.. CTM ,
,
,
(
ASCII). "- CTM"
ctm.rmail(1), ,
.
, CVSup ,
push, pull.
, . ,
CVSup . CTM ,
- (
), ( " " CVS), CTM, , anoncvs,
.
CVS, CTM CVSup
.

13.4. make world


,
FreeBSD (stable, current ),
.
,
, .
( ) ,
, ,
, .
. .
, , ,
, .
-STABLE -CURRENT
FreeBSD . FreeBSD
, .

. , ,
( ).

173

,
"heads up",
. , "all clear".
-STABLE -CURRENT
<stable@FreeBSD.org> <current@FreeBSD.org>,
.

13.4.1. /usr/src/UPDATING
, -, /usr/src/UPDATING (
, ).
, , ,
. UPDATING
, , ,
UPDATING.
Important: UPDATING ,
. ,
.

13.4.2. /etc/make.conf
/etc/defaults/make.conf /etc/make.conf.
-
.
, /etc/make.conf. , ,
/etc/make.conf, make,
, .
( FreeBSD),
CFLAGS NOPROFILE, /etc/defaults/make.conf,
/etc/make.conf .
2.1.7 :
( 386DX, 486DX, Pentium ),
HAVE_FPU.
FreeBSD 2.2.2 .
(COPTFLAGS, NOPORTDOCS ) ,
.

13.4.3. /etc/group
/etc ,
, .
FreeBSD.
.
, /etc/group.
174

, "make world"
. , .
.
"ppp" (
"network").
, ppp
( ) .
/usr/src/etc/group
. , ,
. /etc/group,
GID, /usr/src/etc/group.
Tip: ,
, ,
.
# find / -group GID -print

, GID (
ID).

13.4.4.
.
,
,
, , include- . (
, ) .
, .
2.2.5 : , FreeBSD 2.2.5
. ,
,
.
,
# shutdown now

, .
-s.
.
:
# fsck -p
# mount -u /
# mount -a -t ufs

175

# swapon -a

, /
/, UFS,
/etc/fstab .

13.4.5. /usr/obj
, ( )
/usr/obj. /usr/src.
"make world" , ,
, , .
/usr/obj (
chflags(1) ), .
# cd /usr/obj
# chflags -R noschg *
# rm -rf *

13.4.6.

13.4.6.1.
/usr/src...
# cd /usr/src

(, , - ,
).
make(1).
Makefile, , ,
FreeBSD,
.
, , :
# make -x -DVARIABLE target

-x , make(1).
make(1), ,
.
Makefile. Makefile
. , /etc/make.conf,
.
-DVARIABLE

176

# make -DNOPROFILE=true target

,
,
NOPROFILE=
true
#
Avoid compiling profiled libraries

/etc/make.conf.
make(1) , . Makefile
"", ,
.
target

Makefile, .
,
, -.
make(1),
:
# make target

13.4.6.2.
, make(1), .
- ,
, .
, ,
FreeBSD.
script(1) ,
, .
, , exit.
# script /var/tmp/mw.out
Script started, output file is /var/tmp/mw.out
# make world
... compile, compile, compile ...
# exit
Script done, ...

, /tmp.
. /var/tmp ( )
root.

13.4.6.3. 2.2.2
world,
.
/usr/src/Makefile

177

:
# make world

13.4.6.4. 2.2.5
FreeBSD 2.2.5 (
-CURRENT, -STABLE - 2.2.2 2.2.5) world
. buildworld installworld.
, buildworld
/usr/obj, installworld .
. -,
, , .
"". buildworld
, -
. installworld
.
-, NFS
. , A, B C, ,
make buildworld make installworld A. B C
NFS /usr/src /usr/obj A,
make installworld B C.
world , ,
2.2.2. make world make buildworld,
make installworld.
Note: make buildworld make installworld ,
make(1) .
:
# make -DNOPROFILE=true buildworld

:
# make -DNOPROFILE=true installworld

,
make buildworld.

13.4.6.5. -CURRENT
-CURRENT, make -j.
make .

178

. - ,
/, ,
.
CPU :
# make -j4 target

make(1) 4 . ,
, ,
.
SMP,
6 10 ,
.
, ( )
, .
,
, .

13.4.6.6.
, ,
.
, P6 200 32
SCSI make world .
P133 32 5 6 . ,
...

13.4.7. ,

make world

( , /etc,
/var /usr) .
mergemaster(8),
, .
mergemaster(8), ,
, mergemaster(8)
.
/etc , - .
,
/usr/src/etc /etc .
"". , /usr/src/etc
, /etc. , ,
/etc, /usr/src/etc.
, ,
, .
179

/etc, ,
, .
/etc - . :
# cp -Rp /etc /etc.old

, -p ,
.
-R

/etc
. /var/tmp/root,
.
# mkdir /var/tmp/root
# cd /usr/src/etc
# make DESTDIR=/var/tmp/root distrib-dirs distribution

.
, /var/tmp/root,
. :
# cd /var/tmp/root
# find -d . -type d | xargs rmdir 2>/dev/null

. (
/dev/null
.)
/var/tmp/root ,
/. ,
.
, , /var/tmp/root,
".".
/var/tmp/root/
/var/tmp/root/root/, ( , .
ls -a, .
diff(1) .
# diff /etc/shells /var/tmp/root/etc/shells

/etc/shells
/etc/shells. ,
.
(/var/tmp/root) ,
:
/etc, .
180

,
, /etc. ,
.
1. .
/etc ,
. 14 1998 ,
.
2.
3.
4.
5.

# mkdir /var/tmp/root-19980214
# cd /usr/src/etc
# make DESTDIR=/var/tmp/root-19980214 \
distrib-dirs distribution

6. , .
/var/tmp/root-19980214 .
7.
, 1. ,
/var/tmp/root-19980221 (
).
8. ,
, diff(1)
.
9.
10.

# cd /var/tmp
# diff -r root-19980214 root-19980221

, ,
/var/tmp/root-19980221/etc /etc. ,
/etc.
11. /var/tmp/root-*.
12.

# rm -rf /var/tmp/root-19980214

13. ,
/etc.
date(1).
# mkdir /var/tmp/root-`date "+%Y%m%d"`

13.4.8. /dev
DEVFS: DEVFS, , , .
.
1. /var/tmp/root/dev/MAKEDEV /dev.
2.

# cp /var/tmp/root/dev/MAKEDEV /dev

181

mergemaster(8) /etc, MAKEDEV


, ( diff(1))
.
3. /dev.
, , ,
. ,
awk(1) .
4.
5.

# cd /dev
# ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' >
/var/tmp/dev.out

6. .
# sh MAKEDEV all

7. , /var/tmp/dev2.out.
,
. , .
8.

# diff /var/tmp/dev.out /var/tmp/dev2.out

, ,
,
# sh MAKEDEV sd0s1

.
.

13.4.9. /stand
Note: . .

/stand.
/stand/sysinstall. ,
( ,
/usr).
# cd /usr/src/release/sysinstall
# make all install

, , 2 1998: , 2
1998 Makefile 1.68 (
FreeBSD 3.X) 1.48.2.21 ( 2.2.X),
NOSHARED=yes, ;
# make NOSHARED=yes all install

182

13.4.10.
,
. ,
, ps(1) top(1) ,
.
.
, LINT
, .
,
. , :

, ps(1), ifconfig(8) sysctl(8) .


.
, , mount(8),
/, /usr . , ,
-STABLE,
-CURRENT .
(LKM 3.X, KLD 3.X )
"", .

.
, make world (
make installworld). ( ,
), .
- , config(8) ,
.
config(8)
# /usr/obj/usr/src/usr.sbin/config/config KERNELNAME

. ,
make world ( make installworld) .

13.4.11.
. , , ,
. fastboot(8) .
# fastboot

13.4.12.
FreeBSD. .
183

- , - . ,
/etc/magic , /etc, file
. ,
# cd /usr/src/usr.bin/file
# make all install

13.4.13. ?
13.4.13.1. ?
13.4.13.2. 11 (
). ?
13.4.13.3. /usr/obj ?
13.4.13.4. ?
13.4.13.5.
(NFS)?
13.4.13.6. ?

13.4.13.1.
?
, .
, CVSup, ,
;
src/games/cribbage/instr.c
src/games/sail/pl_main.c
src/release/sysinstall/config.c
src/release/sysinstall/media.c
src/share/mk/bsd.port.mk

, .
make all install, . ,
- , , src/lib/libc/stdlib,
, ( ,
).
, . ,
, , .
, , ,
.
, , , ,
-STABLE -CURRENT.

13.4.13.2.
11 ( ). ?
, . ()
-
184

.
.
,
.
,
.

13.4.13.3. /usr/obj ?
, .
/usr/obj ,
. "make world"
. /usr/obj
, (
150).
, , "make world"
.
, .

,
. FreeBSD, -
, ,
.
, , NOCLEAN
make, :
# make -DNOCLEAN world

13.4.13.4. ?
, ,
.
( ) "make world"
(, gcc(1) make(1)>)
. .
,
. (
, , ls(1) grep(1))
.
, ( ,
), ( )
... ...
# cd /usr/src
# make -DNOCLEAN all

185

"make world" .

-------------------------------------------------------------Building everything..
--------------------------------------------------------------

"make world", .
, ,
, .

13.4.13.5.
(NFS)?
FreeBSD ,
,
make install .
,
make-.
FreeBSD
/etc /dev
.
2.1.7 , Antonio Bemfica :
Date: Thu, 20 Feb 1997 14:05:01 -0400 (AST)
From: Antonio Bemfica <bemfica@militzer.me.tuns.ca>
To: freebsd-questions@FreeBSD.org
Message-ID: <Pine.BSI.3.94.970220135725.245C-100000@militzer.me.tuns.ca>
Josef Karthauser :
> -
-, make world

-, / /usr :
main_machine% mount remote_machine:/
/mnt
main_machine% mount remote_machine:/usr /mnt/usr
-, 'make install' /mnt:
main_machine% make install DESTDIR=/mnt
.
.
Antonio

186

, ( )
/usr/src NFS, install 2.1.7 .
2.1.7 2.2.0 "reinstall". ,
2.1.7, "install" "reinstall".
/usr/src NFS.
1.68 1.107 Makefile ,
, NFS- .
FreeBSD 2.2.0,
, , -STABLE .
2.2.5 "buildworld" "installworld".
,
NFS /usr/src /usr/obj
.

13.4.13.6. ?

.
/usr/src /usr/obj ,
. ,
.


"ccd" ( ).

( "NOPROFILE=true"
/etc/make.conf). .

/etc/make.conf "CFLAGS" - "-O -pipe".


"-O2" , "-O" "-O2"
. "-pipe"
,
( ).

make -j<n> (
FreeBSD) .
, .

, /usr/src,
( ) "noatime".
. ,
.
Note: "noatime" 2.2.0 .
# mount -u -o noatime /usr/src

187

Warning , /usr/src
. ( , , /usr),
, /usr/src.

, /usr/obj,
( ) "async". ,
. ,
,
.
.
Warning ,
. ,

.
/usr/obj - , ,
. -
,
.
# mount -u -o async /usr/obj

Warning , /usr/obj
,
.

188

Chapter 14.

Table of Contents
14.1. MAINTAINER make-
14.2.
14.3.
14.4.
Poul-Henning Kamp <phk@FreeBSD.org>.
,
FreeBSD.

14.1. MAINTAINER make-


1996.
FreeBSD
, ,
MAINTAINER= email-addresses

Makefile, .
:
. ,
,
, ,
, .
, ,
, .

, .
, -
, .
189

, ,
. ,
, .

14.2.

Poul-Henning Kamp <phk@FreeBSD.org> David O'Brien


<obrien@FreeBSD.org>.
1996.
FreeBSD ,
FreeBSD.
(contributed), .
perl, gcc patch.

, .
.
""
,
. ,
,
,
diff- ""
( cvs).

.
, , , .
, ,

.
.
Note: - RCS
CVS, , /
, .
" "
"" 1.1.x.x. ,
, .
, ,
TCL:
src/contrib/tcl ,
. , FreeBSD,
190

. Tcl mac, win compat



src/lib/libtcl Makefile " bmake",
bsd.lib.mk make-
.
src/usr.bin/tclsh make- bmake,
tclsh
bsd.prog.mk.
src/tools/tools/tcl_bmake shell-,
tcl.
.
, src/contrib/tcl :
, ,
( CVS
RCS) ,
FreeBSD. 'easy-import' freefall ,
,
, " ". CVS

.
- CVS ,
""
, .
,
FreeBSD, "",
,
.
,
, FreeBSD ,
,
FreeBSD . ,
,
, .
, Makefile bmake
, -,
. ,
( ) src/tools ,
.
src/contrib/tcl FREEBSD-upgrade,
:


/
.
191

, , FreeBSD.

, , FREEBSD-upgrade
. cvs add
FREEBSD-upgrade ; cvs ci .
src/contrib/cpio:
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
Makefile.in

cpio.info
cpio.texi

mkdir.c
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<version>' \
src/contrib/cpio GNU cpio_<version>
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

14.3.

FreeBSD. ,
, ,
, , .
192

FreeBSD
.
1. , () CPU,
, .
2. , , BSD GNU,
.
3. , ,
, ,
(1) (2).
ASCII ( file2c uuencode).
4.
, CVS.
5. src/contrib src/sys/contrib.
6. . ,
,
.
7. arch/filename.o.uu>.
8. ;
a. conf/files.* ( ).
b. LINT,
,
. ,
.
c. ,
.
9. ;
a. ,
make world.
b. - , .

14.4.
Satoshi Asami <asami@FreeBSD.org>, Peter Wemm
<peter@FreeBSD.org>, David O'Brien <obrien@FreeBSD.org> 9 1996.

, ,
193

. ,
.
:

1.0
, ,
(, ELF )

, ,

,
, ,
.
. (x.y).
a.out x.y.z.
y ( )
,
. ,
""- , ld.so
. : libfoo.so.3.3.3,
3.3
, libfoo.so.3.(, >= 3).(
).
Note: ld.so "" . :
libc.so.2.2, libc.so.2.0,
libc.so.2.0.
ELF
. ,
Makefile " " .
,
. ,

. : X.0 (X+1).0.
, ,
Makefile. ,

Makefile,
.

194

Chapter 15.

Table of Contents
15.1. , ?
15.2. ?
Jrg Wunsch <joerg@FreeBSD.org>
Note: , ,
.

15.1. ,
?
.
"" " ".
,
, make depend
config(8),
,
. config(8),
, .
195


C .
, ( .h
) , ,
, .
:
#ifndef THIS_OPTION
#define THIS_OPTION ( )
#endif /* THIS_OPTION */

,
,
. ,
, C
.
, ,
,
#ifdef THAT_OPTION
[ ]
#endif

THAT_OPTION ( )
.
, C, , "config option",
#ifdef...
options

notyet,notdef

,
. :-)
,
.
,
.h ,
opt_foo.h. ,
Makefile, make ,
.

,
: #ifdef ,
. ,
,
( , ).
196

, config(8)
,
, Makefile .

15.2. ?
-, sys/conf/options (
sys/<arch>/conf/options.<arch>, sys/i386/conf/options.i386),
opt_foo.h, .
-, , .
, , SCSI,
opt_scsi.h.
, , FOO, ,
opt_foo.h.
.
opt_foo.h , .
options[.<arch>].
config(8)
. ..
opt_foo.h

.
, , .
,
% find /usr/src/sys -type f | xargs fgrep NEW_OPTION

. ,
#include "opt_foo.h"

#include <xxx.h>. ,
,

#ifndef NEW_OPTION #define NEW_OPTION (-)
#endif

.
, - (
, /usr/include/sys/), .
opt_foo.h ,
, ,
. , ,
.

197

Chapter 16.
Table of Contents
16.1. kgdb
16.2. DDD
16.3.
16.4. DDB
16.5. GDB
16.6.
Paul Richards <paul@FreeBSD.org> Jrg Wunsch
<joerg@FreeBSD.org>

16.1.
kgdb
.
,
.
,
( config kernel
dumpon(8). dumpon(8),
dumpdev /etc/rc.conf. ,
, /etc/fstab. ,
, , ,
. config -g.
FreeBSD.

198

dumpon(8) ,
(,
swapon(8)). /etc/rc.conf /etc/rc.
dump
config .
,
, .
Note: kgdb gdb, "
". gdb -k,
kgdb. , , ,
-, , GNU ,
-, .
.
Tip: FreeBSD 3 ,
strip, :
# cp kernel kernel.debug
# strip -g kernel

, . ( FreeBSD 4
make.)
, ,
, make install.
, FreeBSD ( 3.1, ),
a.out, .
.
FreeBSD ELF,
.
, ,
, ,
,
-s, , :
#
#
#
#

fsck -p
mount -a -t ufs
# so your file system for /var/crash is writable
savecore -N /kernel.panicked /var/crash
exit
# ...to multi-user

savecore(8)
. ,
, , ,
.
, , /sys/compile/WHATEVER
kgdb. kgdb :
symbol-file kernel.debug
exec-file /var/crash/kernel.0

199

core-file /var/crash/vmcore.0

- ,
, .
kgdb, .

. ,
pcvt.
1:Script started on Fri Dec 30 23:15:22 1994
2:# cd /sys/compile/URIAH
3:# kgdb kernel /var/crash/vmcore.1
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:(kgdb) where
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:(kgdb) up 10
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:(kgdb) frame frame->tf_ebp frame->tf_eip
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->t_line].l_open)(dev, tp));
41:(kgdb) list
42:398
43:399
tp->t_state |= TS_CARR_ON;
44:400
tp->t_cflag |= CLOCAL; /* cannot be a modem (:-) */
45:401
46:402
#if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
47:403
return ((*linesw[tp->t_line].l_open)(dev, tp));
48:404
#else
49:405
return ((*linesw[tp->t_line].l_open)(dev, tp,
flag));
50:406
#endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */

200

51:407
}
52:(kgdb) print tp
53:Reading in symbols for ../../i386/i386/cons.c...done.
54:$1 = (struct tty *) 0x1bae
55:(kgdb) print tp->t_line
56:$2 = 1767990816
57:(kgdb) up
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:(kgdb) up
62:#2 0xf0132c34 in spec_open ()
63:(kgdb) up
64:#3 0xf012d014 in vn_open ()
65:(kgdb) up
66:#4 0xf012a183 in open ()
67:(kgdb) up
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->sy_call)(p, args, rval);
74:(kgdb) up
75:Initial frame selected; you cannot go up.
76:(kgdb) quit
77:# exit
78:exit
79:
80:Script done on Fri Dec 30 23:18:04 1994

:
6:
, DDB ( ),
"because you said to!"
; DDB
.
20:
trap() .
36:
; .
, ,
. ( <g>,
.)
403, , ,
"tp", .
52:
, , .
201

56:
, , , !
( , : tp->t_line
,
.)

16.2.
DDD

, ddd. -k ddd,
. ;
# ddd -k /var/crash/kernel.0 /var/crash/vmcore.0


ddd.

16.3.
, ,
config -g ? . !
, . ,
.
(/usr/src/sys/arch/conf)
. ( , )

makeoptions

DEBUG=-g

#Build kernel with gdb(1) debug symbols

. - Makefile
, , trap.o. ,
-g ,
, ,
. ,
size(1). , .
, .
, ,
.
,
kgdb, .
202

, ,
.

16.4.
DDB
kgdb
, , .
.
,
, DDB.
, ,
.
,
, kgdb.
DDB,
options DDB

, . (
FreeBSD.
Note: , , ,
. ;
DDB .)
, DDB , DDB. ,
, -d
. DDB
.
/ .
- , , Ctrl-Alt-ESC.
syscon ;
, .
, BREAK
DDB (options BREAK_TO_DEBUGGER
). ,
, BREAK,
, .
DDB
, .
DDB , .
DDB gdb. ,
, :
b function-name

203

b address

,
; , a-f,
0x ( ).
, : function-name + 0x103.
, :
c

, :
trace

Note: , DDB ,
, .
,
del
del address-expression

,
.
, ; :
show b

, :
s

,
DDB,
:
n

Note: next gdb; gdb finish.


, , ( ):
x/wx 0xf0133fe0,40
x/hd db_symtab_space
x/bc termbuf,10
x/s stringbuf

//
// .
. 0x10 , :
x ,10

204


x/ia foofunc,10

0x10 foofunc
foofunc.
, write:
w/b termbuf 0xa 0xb 0
w/w 0xf0010030 0 0

(b/h/w) ,
,
.
, :
show reg

, ,
p $eax

:
set $eax new-value

DDB, :
call func(arg1, arg2, ...)

.
ps(1)
:
ps

, .
, ,
, .
:
panic

,
kgdb. ,
continue.
call boot(0)

,
sync() .
,
.
205

call cpu_reset()

,
.
, :
help

ddb(4)
. ,
.

16.5.
GDB
FreeBSD 2.2,
.
GDB .
. ,
, .
, ,
, ,
( ).
config -g, DDB
.
- .
, strip -x
-d.
, "flags 080"
sio .
gdb:
% gdb -k kernel
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...
(kgdb)

(,
) :
(kgdb) target remote /dev/cuaa0

206

(, DDB
) :
Debugger("Boot flags requested debugger")
Stopped at Debugger+0x35: movb
$0, edata+0x51bc
db> gdb

DDB :
Next trap will enter GDB remote protocol mode

, gdb, GDB
DDB. , s
(step). GDB :
Remote debugging using /dev/cuaa0
Debugger (msg=0xf01b0383 "Boot flags requested debugger")
at ../../i386/i386/db_interface.c:257
(kgdb)

, GDB,
, gud-mode
Emacs ( Emacs)
.
GDB LKM.
LKM :
# cd /usr/src/lkm/linux
# make clean; make COPTS=-g

,
modstat , :
# linux
# modstat
Type
EXEC

Id Off Loadaddr Size Info


Rev Module Name
0
4 f5109000 001c f510f010 1 linux_mod

0x20 ( a.out).
, . add-symbolfile GDB :
(kgdb) add-symbol-file /usr/src/lkm/linux/linux_mod.o 0xf5109020
add symbol table from file "/usr/src/lkm/linux/linux_mod.o" at
text_addr = 0xf5109020? (y or n) y
(kgdb)

LKM.

207

16.6.
DDB ,
.
( ,
-h Boot:)
. DDB
, , , .

Chapter 17. ,
Linux
Table of Contents
17.1.
17.2.
17.3. Mathematica
17.4. Oracle
17.5.
Jim Mock <jim@FreeBSD.org>, 22 2000.
Brian N. Handy <handy@sxt4.physics.montana.edu> Rich Murphey
<rich@FreeBSD.org>

17.1.
, ,
Linux, FreeBSD .
, , FreeBSD ,
Linux. :
Linux,

. FreeBSD
FreeBSD.
,
, , FreeBSD
208

Linux , Linux.
FreeBSD? Linux .
, FreeBSD 90% Linux -
. : Star Office, Linux Netscape, Adobe Acrobat,
RealPlayer 5 7, VMWare, Oracle, WordPerfect, Doom, Quake .
, Linux
FreeBSD, Linux.
, Linux, ()
FreeBSD. , Linux,
/proc,
FreeBSD (, : FreeBSDCURRENT Linux procfs ).
, i386, , , V86.
, Linux , .

17.2.
3.0-RELEASE, options LINUX
options COMPAT_LINUX .
Linux
(KLD , "Kernel LoaDable object"), / " ",
.
/etc/rc.conf:
linux_enable="YES"

, , /etc/rc.i386:
# Start the Linux binary compatibility if requested.
#
case ${linux_enable} in
[Yy][Ee][Ss])
echo -n ' linux';
linux > /dev/null 2>&1
;;
esac

, ,
kldstat:
% kldstat
Id Refs Address
Size
1
2 0xc0100000 16bdb8
7
1 0xc24db000 d000

Name
kernel
linux.ko

209

- KLD,
Linux options LINUX
. ,
, .

17.2.1. Linux
:
linux_base, .

17.2.1.1. linux_base
, .
.
:
# cd /usr/ports/emulators/linux_base
# make install distclean

Linux. , ,
. ,
, - .

17.2.1.2.
,
Linux,
, runtime-. " ":
/compat/linux, Linux .
- , FreeBSD
. , , , /lib/libc.so, FreeBSD
/compat/linux/lib/libc.so, ,
/lib/libc.so.
, , Linux ld.so.
Linux ,
,
Linux .

17.2.1.3.
, linux_base
? ,
? , .
.
, Linux, ,
Linux , . :
, FTP Linux Doom' ( Linux ). ,
Doom' ldd linuxdoom:
210

% ldd linuxdoom
libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0
libX11.so.3 (DLL Jump 3.1) => /usr/X11/lib/libX11.so.3.1.0
libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29

, .
/compat/linux ,
, .
:
/compat/linux/usr/X11/lib/libXt.so.3.1.0
/compat/linux/usr/X11/lib/libXt.so.3 -> libXt.so.3.1.0
/compat/linux/usr/X11/lib/libX11.so.3.1.0
/compat/linux/usr/X11/lib/libX11.so.3 -> libX11.so.3.1.0
/compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 ->
libc.so.4.6.29

Note: , - ,
. , . ,
- ,
. . ,
:
/compat/linux/lib/libc.so.4.6.27
/compat/linux/lib/libc.so.4 -> libc.so.4.6.27

- , ldd:
libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29

, /lib/libc.so.4.6.29 ,
, , .
, libc.so:
/compat/linux/lib/libc.so.4.6.29
/compat/linux/lib/libc.so.4 -> libc.so.4.6.29

Note: Linux . Runtime-


FreeBSD ,
.

17.2.2. Linux ELF-


ELF- "branding".
ELF-, :
% ./linux-elf-
ELF binary type not known
Abort

, FreeBSD ,
Linux . brandelf(1):
% brandelf -t Linux linux-elf-

211

, , "branding",
, .

17.2.3.
DNS , :
resolv+: "bind" is an invalid keyword resolv+:
"hosts" is an invalid keyword

() /compat/linux/etc/host.conf,
:
order hosts, bind
multi on

, , /etc/hosts,
DNS. /compat/linux/etc/host.conf ,
Linux /etc/host.conf FreeBSD
. (/etc/resolv.conf),
bind /compat/linux/etc/host.conf.

17.3. Mathematica
Mathematica 4.0 Murray Stokely <murray@cdrom.com>
Bojan Bistrovic <bojanb@physics.odu.edu>.
, Linux Mathematica 4.0 FreeBSD .
Linux Mathematica FreeBSD,
brandelf(1).
Linux Mathematica Mathematica
Wolfram http://www.wolfram.com/.

17.3.1.
Mathematica Unix
. ( )
, ( brandelf(1))
:
# mount /cdrom
# cp -rp /cdrom/Unix/ /localdir/
# brandelf -t Linux /localdir/Files/SystemFiles/Kernel/Binaries/Linux/*
# brandelf -t Linux /localdir/Files/SystemFiles/FrontEnd/Binaries/Linux/*
# brandelf -t Linux
/localdir/Files/SystemFiles/Installation/Binaries/Linux/*
# cd /localdir/Installers/Linux/
# ./MathInstaller

212

17.3.2. Mathematica
Mathematica Wolfram
, " ".
,
Mathematica, " ", mathinfo
. MAC-
ethernet-.
# cd /localdir/Files/SystemFiles/Installation/Binaries/Linux
# mathinfo
disco.example.com 7115-70839-20412

, , ,
" ", ,
. Mathematica.

17.3.3. Mathematica
Mathematica ,
( , ,
). X , .
,
. ,
/cdrom/Unix/Files/SystemFiles/Fonts
/usr/local/mathematica/SystemFiles/Fonts .
Type1 X. , , .

/usr/X11R6/lib/X11/fonts. ,
fonts.dir, .
mkfontdir, ,
.
:
/usr/X11R6/lib/X11/fonts:
#
#
#
#
#
#
#
#
#
#

cd /usr/X11R6/lib/X11/fonts
mkdir X
mkdir MathType1
cd /cdrom/Unix/Files/SystemFiles/Fonts
cp X/* /usr/X11R6/lib/X11/fonts/X
cp Type1/* /usr/X11R6/lib/X11/fonts/MathType1
cd /usr/X11R6/lib/X11/fonts/X
mkfontdir
cd ../MathType1
mkfontdir

:
# xset fp+ /usr/X11R6/lib/X11/fonts/X
# xset fp+ /usr/X11R6/lib/X11/fonts/MathType1
# xset fp rehash

213

XFree86,
XF86Config.
/usr/X11R6/lib/X11/fonts/Type1,
MathType1 Type1 .

17.4. Oracle
Marcel Moolenaar <marcel@cup.hp.com>

17.4.1.
Oracle 8.0.5 Oracle 8.0.5.1 Enterprise Edition Linux
FreeBSD.

17.4.2. Linux
, linux_base linux_devtools .
FreeBSD 3.2.
FreeBSD 3.2 , .
FreeBSD. linux_base-6.1
linux_devtools-6.1, 5.2 .
intelligent agent, TCL Red
Hat: tcl-8.0.3-20.i386.rpm. :
# rpm -i --ignoreos --root /compat/linux --dbpath /var/lib/rpm package

- .

17.4.3. Oracle
Oracle,
. , ,
Oracle Linux FreeBSD.
Oracle.

17.4.3.1.
,
. SHMMAX FreeBSD. SHMMAX ,
SHMMAXPGS PGSIZE. , SHMMAXPGS.
:
options
options
options
options
options

SHMMAXPGS=10000
SHMMNI=100
SHMSEG=10
SEMMNS=200
SEMMNI=70

214

options SEMMSL=61

,
Oracle.
:
options SYSVSHM # SysV
options SYSVSEM # SysV
options SYSVMSG # SysV

17.4.3.2. Oracle
Oracle , .
,
Linux: /compat/linux/bin/bash. /compat/linux/bin/bash
/etc/shells.

17.4.3.3.
, ORACLE_HOME ORACLE_SID,
:

LD_LIBRARY_PATH $ORACLE_HOME/lib
CLASSPATH
$ORACLE_HOME/jdbc/lib/classes111.zip
PATH
/compat/linux/bin /compat/linux/sbin /compat/linux/usr/bin
/compat/linux/usr/sbin /bin /sbin /usr/bin /usr/sbin
/usr/local/bin $ORACLE_HOME/bin

.profile. :
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=/oracle; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
ORACLE_SID=ORCL; export ORACLE_SID
ORACLE_TERM=386x; export ORACLE_TERM
CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip
export CLASSPATH
PATH=/compat/linux/bin:/compat/linux/sbin:/compat/linux/usr/bin:/compat/linux
/usr/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$ORACLE_HOME/bin
export PATH

17.4.4. Oracle
- Linux ,
.oracle /var/tmp .
oracle,
. , .
- ,
. , (
).

215

-- TCP .
, TCP . :
#
#
#
#
#
#

cd $ORACLE_HOME/network/lib
make -f ins_network.mk ntcontab.o
cd $ORACLE_HOME/lib
ar r libnetwork.a ntcontab.o
cd $ORACLE_HOME/network/lib
make -f ins_network.mk install

root.sh!

17.4.4.1. root.sh
Oracle, (
). root.sh,
orainst. ,
( chown),
Linux.
*** orainst/root.sh.orig Tue Oct 6 21:57:33 1998
--- orainst/root.sh Mon Dec 28 15:58:53 1998
***************
*** 31,37 ****
# This is the default value for CHOWN
# It will redefined later in this script for those ports
# which have it conditionally defined in ss_install.h
! CHOWN=/bin/chown
#
# Define variables to be used in this script
--- 31,37 ---# This is the default value for CHOWN
# It will redefined later in this script for those ports
# which have it conditionally defined in ss_install.h
! CHOWN=/usr/sbin/chown
#
# Define variables to be used in this script

Oracle ,
rthd.sh, orainst.

17.4.4.2. genclntsh
genclntsh ,
. ,
PATH:
*** bin/genclntsh.orig Wed Sep 30 07:37:19 1998
--- bin/genclntsh Tue Dec 22 15:36:49 1998
***************
*** 32,38 ****
#
# Explicit path to ensure that we're using the correct commands
#PATH=/usr/bin:/usr/ccs/bin export PATH
! PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin export PATH
#
# each product MUST provide a $PRODUCT/admin/shrept.lst
--- 32,38 ----

216

#
# Explicit path to ensure that we're using the correct commands
#PATH=/usr/bin:/usr/ccs/bin export PATH
! #PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin export PATH
#
# each product MUST provide a $PRODUCT/admin/shrept.lst

17.4.5. Oracle
, , Oracle ,
Linux .

17.5.
, Linux , .
,
FreeBSD <freebsd-chat@FreeBSD.org> by Terry Lambert <tlambert@primenet.com>
(ID : <199906020108.SAA07001@usr09.primenet.com>).

17.5.1. ?
FreeBSD , " ",
execve(2).
, FreeBSD , ,
, ().
, UNIX
" " ( 4 8 ), ,
, , .
, execve(2) ,
.
, sh(1) , , ,
:\n, csh(1) (,
SCO , ).
FreeBSD -: ,
#! , /bin/sh,
.
FreeBSD " ".
, (Linux, Solaris,
, ELF- ).

217

, ELF- "" ( ;
SVR4/Solaris) ,
.
, Linux "" Linux (,
brandelf(1)):
# brandelf -t Linux file

ELF- "" Linux,


proc. (
UNIX , sysent[], ).

Linux.
, Linux " "
( , union
( unionfs!)). ,
/compat/linux/original-path , , /original-path.
Linux FreeBSD ,
Linux . , FreeBSD uname(1)
/compat/linux/bin/, "" Linux ,
FreeBSD.
, FreeBSD Linux : ,
, ,
. , FreeBSD
FreeBSD, Linux Linux.

sysent[], proc,
, ,
.
Linux FreeBSD? .
( , , , ),
, , FreeBSD , Linux
, .
? . , ( )
. , "Linux "? ""
FreeBSD?! 8-). , : ,
. , FreeBSD
Linux ( ).
"Linux ".

218

V.
Table of Contents
A. FreeBSD
B.
C. FreeBSD
D. PGP

Appendix A. FreeBSD
Table of Contents
A.1. CD-ROM
A.2. FTP
A.3. CTM
A.4. CVSup
A.5. AFS

A.1. CD-ROM
FreeBSD CD-ROM Walnut Creek CDROM:
Walnut Creek CDROM
4041 Pike Lane, Suite F
Concord
CA, 94520
USA
: +1 925 674-0783
: +1 925 674-0821
Email: <info@cdrom.com>
WWW: http://www.cdrom.com/

219

A.2. FTP
FTP c:
ftp://ftp.FreeBSD.org/pub/FreeBSD/.
FreeBSD , ,
DNS,
.
, FreeBSD FTP .
FreeBSD FTP,
.
, c, , , , , , ,
, , Germany, , , , , ,
, , , , , ,
, , , , , , , ,
, .

,
<hostmaster@ar.FreeBSD.org> .

ftp://ftp.ar.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@au.FreeBSD.org> .

ftp://ftp.au.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.au.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.au.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.au.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@br.FreeBSD.org> .

ftp://ftp.br.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.br.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.br.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.br.FreeBSD.org/pub/FreeBSD/
220

ftp://ftp5.br.FreeBSD.org/pub/FreeBSD/

ftp://ftp6.br.FreeBSD.org/pub/FreeBSD/

ftp://ftp7.br.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@ca.FreeBSD.org> .

ftp://ftp.ca.FreeBSD.org/pub/FreeBSD/

, <phj@cn.FreeBSD.org>
.

ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/


,
<hostmaster@cz.FreeBSD.org> .

ftp://ftp.cz.FreeBSD.org/pub/FreeBSD/ Contact:
<calda@dzungle.ms.mff.cuni.cz>

,
<hostmaster@dk.FreeBSD.org> .

ftp://ftp.dk.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@ee.FreeBSD.org> .

ftp://ftp.ee.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@fi.FreeBSD.org> .

ftp://ftp.fi.FreeBSD.org/pub/FreeBSD/

221

,
<hostmaster@fr.FreeBSD.org> .

ftp://ftp.fr.FreeBSD.org/pub/FreeBSD/

ftp://ftp2.fr.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.fr.FreeBSD.org/pub/FreeBSD/

, <de-bsdhubs@de.FreeBSD.org> .

ftp://ftp.de.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp5.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp6.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp7.de.FreeBSD.org/pub/FreeBSD/

ftp://ftp.hk.super.net/pub/FreeBSD/ : <ftpadmin@HK.Super.NET>.

,
<hostmaster@ie.FreeBSD.org> .

ftp://ftp.ie.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@il.FreeBSD.org> .

ftp://ftp.il.FreeBSD.org/pub/FreeBSD/

ftp://ftp2.il.FreeBSD.org/pub/FreeBSD/

222

,
<hostmaster@jp.FreeBSD.org> .

ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.jp.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.jp.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.jp.FreeBSD.org/pub/FreeBSD/

ftp://ftp5.jp.FreeBSD.org/pub/FreeBSD/

ftp://ftp6.jp.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@kr.FreeBSD.org> .

ftp://ftp.kr.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.kr.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.kr.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.kr.FreeBSD.org/pub/FreeBSD/

ftp://ftp5.kr.FreeBSD.org/pub/FreeBSD/

ftp://ftp6.kr.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@nl.FreeBSD.org> .

ftp://ftp.nl.FreeBSD.org/pub/FreeBSD/


,
<hostmaster@nz.FreeBSD.org> .

ftp://ftp.nz.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@pl.FreeBSD.org> .

ftp://ftp.pl.FreeBSD.org/pub/FreeBSD/

223


,
<hostmaster@pt.FreeBSD.org> .

ftp://ftp.pt.FreeBSD.org/pub/FreeBSD/

ftp://ftp2.pt.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@ru.FreeBSD.org> .

ftp://ftp.ru.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.ru.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.ru.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.ru.FreeBSD.org/pub/FreeBSD/


, <ftpadmin@isu.net.sa>

ftp://ftp.isu.net.sa/pub/mirrors/ftp.freebsd.org/


,
<hostmaster@za.FreeBSD.org> .
In case of problems, please contact the hostmaster <hostmaster@za.FreeBSD.org> for
this domain.

ftp://ftp.za.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.za.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.za.FreeBSD.org/FreeBSD/


,
<hostmaster@sk.FreeBSD.org> .

ftp://ftp.sk.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@si.FreeBSD.org> .
224

ftp://ftp.si.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@es.FreeBSD.org> .

ftp://ftp.es.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@se.FreeBSD.org> .

ftp://ftp.se.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.se.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.se.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@tw.FreeBSD.org> .

ftp://ftp.tw.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.tw.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.tw.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.tw.FreeBSD.org/pub/FreeBSD/

ftp://ftp.nectec.or.th/pub/FreeBSD/ :
<ftpadmin@ftp.nectec.or.th>.

ftp://ftp.ua.FreeBSD.org/pub/FreeBSD/ : <freebsdmnt@lucky.net>.

,
<hostmaster@uk.FreeBSD.org> .

ftp://ftp.uk.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.uk.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.uk.FreeBSD.org/pub/FreeBSD/

225

ftp://ftp4.uk.FreeBSD.org/pub/FreeBSD/

ftp://ftp5.uk.FreeBSD.org/pub/FreeBSD/

,
<hostmaster@FreeBSD.org> .

ftp://ftp.FreeBSD.org/pub/FreeBSD/
ftp://ftp2.FreeBSD.org/pub/FreeBSD/

ftp://ftp3.FreeBSD.org/pub/FreeBSD/

ftp://ftp4.FreeBSD.org/pub/FreeBSD/

ftp://ftp5.FreeBSD.org/pub/FreeBSD/

ftp://ftp6.FreeBSD.org/pub/FreeBSD/

FreeBSD (2.0
) (eBones secure) .
, secure (DES) eBones (Kerberos)
:

<hostmaster@internat.FreeBSD.org>.

ftp://ftp.internat.FreeBSD.org/pub/FreeBSD/

ftp://ftp2.internat.FreeBSD.org/pub/FreeBSD/

<hostmaster@br.FreeBSD.org>.

ftp://ftp.br.FreeBSD.org/pub/FreeBSD/

ftp://nic.funet.fi/pub/unix/FreeBSD/eurocrypt/ :
<count@nic.funet.fi>.

A.3. CTM
CTM/FreeBSD FTP .
CTM FTP,
.
, Poul-Henning Kamp <phk@FreeBSD.org>
226

, Bay Area,

ftp://ftp.FreeBSD.org/pub/FreeBSD/development/CTM/

ftp://ftp.uni-trier.de/pub/unix/systems/BSD/FreeBSD/CTM/

ftp://ftp.internat.FreeBSD.org/pub/FreeBSD/CTM/

ftp://ctm.tw.FreeBSD.org/pub/FreeBSD/CTM/
ftp://ctm2.tw.FreeBSD.org/pub/FreeBSD/CTM/

ftp://ctm3.tw.FreeBSD.org/pub/freebsd/CTM/

,
FTP http://ftpsearch.ntnu.no/ftpsearch. FTP -- ,
archie , .

A.4. CVSup
CVSup FreeBSD :

cvsup.ar.FreeBSD.org ( <msagre@cactus.fi.uba.ar>)

cvsup.au.FreeBSD.org ( <dawes@xfree86.org>)

cvsup.at.FreeBSD.org ( <postmaster@wu-wien.ac.at>)

cvsup.br.FreeBSD.org ( <cvsup@cvsup.br.FreeBSD.org>)
cvsup2.br.FreeBSD.org ( <tps@ti.sk>)

cvsup3.br.FreeBSD.org ( <camposr@matrix.com.br>)

cvsup.ca.FreeBSD.org ( <dan@jaded.net>)

227

cvsup.cn.FreeBSD.org ( <phj@cn.FreeBSD.org>)

cvsup.cz.FreeBSD.org ( <cejkar@dcse.fee.vutbr.cz>)

cvsup.dk.FreeBSD.org ( <jesper@skriver.dk>)

cvsup.ee.FreeBSD.org ( <taavi@uninet.ee>)

cvsup.fi.FreeBSD.org ( <count@key.sms.fi>)

cvsup2.fi.FreeBSD.org ( <count@key.sms.fi>)

cvsup.fr.FreeBSD.org ( <hostmaster@fr.FreeBSD.org>)

cvsup.de.FreeBSD.org ( <wosch@FreeBSD.org>)
cvsup2.de.FreeBSD.org ( <petzi@FreeBSD.org>)

cvsup3.de.FreeBSD.org ( <ag@leo.org>)

cvsup.is.FreeBSD.org ( <adam@veda.is>)

cvsup.jp.FreeBSD.org ( <cvsupadm@jp.FreeBSD.org>)
cvsup2.jp.FreeBSD.org ( <max@FreeBSD.org>)

cvsup3.jp.FreeBSD.org ( <shige@cin.nihon-u.ac.jp>)

cvsup4.jp.FreeBSD.org ( <cvsup-admin@ftp.media.kyotou.ac.jp>)

cvsup5.jp.FreeBSD.org ( <cvsup@imasy.or.jp>)

cvsup6.jp.FreeBSD.org ( <cvsupadm@jp.FreeBSD.org>)

228

cvsup.kr.FreeBSD.org ( <cjh@kr.FreeBSD.org>)

cvsup.nl.FreeBSD.org ( <xaa@xaa.iae.nl>)

cvsup2.nl.FreeBSD.org ( <cvsup@nl.uu.net>)

cvsup.no.FreeBSD.org ( <Per.Hove@math.ntnu.no>)

cvsup.pl.FreeBSD.org ( <Mariusz@kam.pl>)

cvsup.pt.FreeBSD.org ( <jpedras@webvolution.net>)

cvsup.ru.FreeBSD.org ( <ache@nagual.pp.ru>)
cvsup2.ru.FreeBSD.org ( <dv@dv.ru>)

cvsup3.ru.FreeBSD.org ( <fjoe@iclub.nsu.ru>)

cvsup.sk.FreeBSD.org ( <tps@tps.sk>)

cvsup2.sk.FreeBSD.org ( <tps@tps.sk>)

cvsup.si.FreeBSD.org ( <blaz@si.FreeBSD.org>)

cvsup.za.FreeBSD.org ( <markm@FreeBSD.org>)

cvsup2.za.FreeBSD.org ( <markm@FreeBSD.org>)

cvsup.es.FreeBSD.org ( <jesusr@FreeBSD.org>)

229

cvsup.se.FreeBSD.org ( <pantzer@ludd.luth.se>)

cvsup.tw.FreeBSD.org ( <jdli@freebsd.csie.nctu.edu.tw>)
cvsup2.tw.FreeBSD.org ( <ycheng@sinica.edu.tw>)

cvsup3.tw.FreeBSD.org ( <foxfair@FreeBSD.org>)

cvsup2.ua.FreeBSD.org ( <freebsd-mnt@lucky.net>)
cvsup3.ua.FreeBSD.org ( <ftpmaster@ukr.net>), Kiev

cvsup4.ua.FreeBSD.org ( <phantom@cris.net>)

cvsup.uk.FreeBSD.org ( <joe@pavilion.net>)
cvsup2.uk.FreeBSD.org ( <brian@FreeBSD.org>)

cvsup3.uk.FreeBSD.org ( <ftp-admin@plig.net>)

cvsup1.FreeBSD.org ( <skynyrd@opus.cts.cwu.edu>),

cvsup2.FreeBSD.org ( <jdp@FreeBSD.org>),

cvsup3.FreeBSD.org ( <wollman@FreeBSD.org>),

cvsup4.FreeBSD.org ( <rgrimes@FreeBSD.org>),

cvsup5.FreeBSD.org ( <mjr@blackened.com>),

cvsup6.FreeBSD.org ( <jdp@FreeBSD.org>),

cvsup7.FreeBSD.org ( <jdp@FreeBSD.org>),

cvsup8.FreeBSD.org (maintainer <hostmaster@bigmirror.com>), Washington


state

FreeBSD (eBones secure)


CVSup .
,
.

cvsup.internat.FreeBSD.org ( <markm@FreeBSD.org>)

230

, ,
.

cvsup.dk.FreeBSD.org ( <jesper@skriver.dk>)

cvsup.de.FreeBSD.org ( <wosch@FreeBSD.org>)

cvsup3.de.FreeBSD.org ( <ag@leo.org>)

United Kingdom

cvsup.uk.FreeBSD.org (maintainer <joe@pavilion.net>)


cvsup2.uk.FreeBSD.org (maintainer <brian@FreeBSD.org>)

cvsup3.uk.FreeBSD.org (maintainer <ftp-admin@plig.net>)

CVSup CTM.
CVSup , CTM.
, CVSup release=cvs
, ( .ctm_status),
CTM cvs-cur .
, cvs-all CVSup CTM

CTM.
Note: cvs-all
cvs. CVSup /
, CTM.
Note: , CTM (timestamps),
.
.
, .

ctm.FreeBSD.org ( <blank@fox.uni-trier.de>)

A.5. AFS
AFS FreeBSD :

: /afs/stacken.kth.se/ftp/pub/FreeBSD/
stacken.kth.se

# Stacken Computer Club, KTH, Sweden

231

130.237.234.43
130.237.237.230
130.237.234.3

#hot.stacken.kth.se
#fishburger.stacken.kth.se
#milko.stacken.kth.se

<ftp@stacken.kth.se>

Appendix B.
Table of Contents
B.1. , FreeBSD
B.2.
B.3.
B.4.
B.5.
B.6.
B.7.
B.8. UNIX
B.9.
FreeBSD
FreeBSD,
, ,
.
.

B.1. ,
FreeBSD
:

Using FreeBSD ( ).
FreeBSD for PC 98'ers ( ), SHUWA System Co, LTD. ISBN 487966-468-5 C3055 P2900E.

FreeBSD ( ), CUTT. ISBN 4-906391-22-2 C3055 P2400E.

Complete Introduction to FreeBSD ( ), Shoeisha Co., Ltd. ISBN


4-88135-473-6 P3600E.

Personal UNIX Starter Kit FreeBSD ( ), ASCII. ISBN 4-75611733-3 P3000E.

FreeBSD Handbook ( ), ASCII. ISBN 4-7561-1580-2


P3800E.

FreeBSD mit Methode ( ), Computer und Literatur


Verlag/Vertrieb Hanser, 1998. ISBN 3-932311-31-0.

232

FreeBSD Install and Utilization Manual ( ), Mainichi


Communications Inc..

The Complete FreeBSD, Walnut Creek CDROM.

B.2.

Computer Systems Research Group, UC Berkeley. 4.4BSD User's Reference Manual.


O'Reilly & Associates, Inc., 1994. ISBN 1-56592-075-9
Computer Systems Research Group, UC Berkeley. 4.4BSD User's Supplementary
Documents. O'Reilly & Associates, Inc., 1994. ISBN 1-56592-076-7

UNIX in a Nutshell. O'Reilly & Associates, Inc., 1990. ISBN 093717520X

Mui, Linda. What You Need To Know When You Can't Find Your UNIX System
Administrator. O'Reilly & Associates, Inc., 1995. ISBN 1-56592-104-6

Ohio State University has written a UNIX Introductory Course which is available online
in HTML and postscript format.

Jpman Project, Japan FreeBSD Users Group. FreeBSD User's Reference Manual
(Japanese translation). Mainichi Communications Inc., 1998. ISBN4-8399-0088-4
P3800E.

B.3.

Albitz, Paul and Liu, Cricket. DNS and BIND, 2nd Ed. O'Reilly & Associates, Inc., 1997.
ISBN 1-56592-236-0
Computer Systems Research Group, UC Berkeley. 4.4BSD System Manager's Manual.
O'Reilly & Associates, Inc., 1994. ISBN 1-56592-080-5

Costales, Brian, et al. Sendmail, 2nd Ed. O'Reilly & Associates, Inc., 1997. ISBN 156592-222-0

Frisch, leen. Essential System Administration, 2nd Ed. O'Reilly & Associates, Inc.,
1995. ISBN 1-56592-127-5

Hunt, Craig. TCP/IP Network Administration. O'Reilly & Associates, Inc., 1992. ISBN 0937175-82-X

Nemeth, Evi. UNIX System Administration Handbook. 2nd Ed. Prentice Hall, 1995. ISBN
0131510517

Stern, Hal Managing NFS and NIS O'Reilly & Associates, Inc., 1991. ISBN 0-93717575-7

233

Jpman Project, Japan FreeBSD Users Group. FreeBSD System Administrator's Manual
(Japanese translation). Mainichi Communications Inc., 1998. ISBN4-8399-0109-0
P3300E.

C.5.
FreeBSD
,
FreeBSD .
( , ):

<danfe@FreeBSD.org.ua>
<ru@FreeBSD.org.ua>

<andy@FreeBSD.org.ua>

<phantom@FreeBSD.org.ua>

234

Вам также может понравиться