Chapter 25. FreeBSD ¤º³¡

Table of Contents
25.1. FreeBSD ¤§±Ò°Êµ{§Ç
25.2. DMA: What it is and How it Works
25.3. The FreeBSD VM System
25.4. IPv6/IPsec Implementation

25.1. FreeBSD ¤§±Ò°Êµ{§Ç

Contributed by Poul-Henning Kamp . v1.1, April 26th.

±Ò°Ê FreeBSD »Ý­n¤T­Ó¨BÆJ¡G ¸ü¤J kernel¡A ´ú©wroot©Ò¦bªºÀɮרt²Î¡A¥H¤Îªì©l¤Æ¤@¨ÇÃö©ó¨Ï¥ÎªÌ¤è­±ªºªF¦è¡C

25.1.1. ¸ü¤J kernel

§Ú­Ì²{¦b¤¶²Ð¥H¤U¤TºØ¸ü¤J kernel ªº°ò¥»¤èªk¡G ¥¦­Ì¥þ³¡³£·|µ¹ kernel ¤@¨Ç¸ê°T¡AÀ°§U kernel ¨M©w±µ¤U¨Ó­n°µ¤°»ò¡C

Biosboot

Biosboot ¬O§Ú­Ìªº ``bootblocks''¡C ¥¦¥Ñ¨â­ÓÀɮײզ¨¡C³o¨â­ÓÀÉ®×·|³Q¦w¸Ë¦b³nºÐ©ÎµwºÐ¤¤¥Î¨Ó±Ò°Êªº slice ¤§²Ä¤@­Ó 8K bytes ªº¦a¤è¡C

Biosboot ¥i¥H±q¤@­Ó FreeBSD ªºÀɮרt²Î¸ü¤J kernel¡C

±q Dos ±Ò°Ê(Dosboot)

Dosboot ¬O¥Ñ DI. Christian Gusenbauer ¼¶¼gªº¡A ¥i±¤²{¦b«Ü¤£©¯¦a¦³¤@¤p³¡¥÷ªºµ{¦¡½X»P FreeBSD¥»¨­¨Ã¤£¬Û®e¡A ¦]¬°³o¨Çµ{¦¡½X¬O¼gµ¹ Microsoft compilers ªº¡C

Dosboot ¥i¥H±q¤@­Ó MS-DOS ªºÀɮשάOºÏºÐ¤Wªº¤@­Ó FreeBSD file system partiton ¨Ó±Ò°ÊFreeBSD¡C ¥¦¹Á¸Õ¥h§JªAÁôÂæb MS/DOS ¨t²Îªº high memory ¤¤¦hºØ©_©Çªº memory manglers¡Aµ²ªG³q±`³£¯àÄF¹L¥¦­Ì¥HÄ~Äò°Ê§@¡C

ºô¸ô±Ò°Ê(Netboot)

Netboot ·|¹Á¸Õ¥h´M§ä©Ò¤ä´©ªº Ethernet ºô¸ô¥d¡A ¨Ã¥B¥Î BOOTP¡BTFTP ©M NFS ¥h§ä¨ì kernel ÀÉ®×¨Ó±Ò°Ê FreeBSD¡C

25.1.2. ¨M©w®Ú¥Ø¿ý©Ò¦bªºÀɮרt²Î

±q kernel ³Q¸ü¤J¡A±Ò°Êµ{¦¡¸õ¨ì kernel¡Akernel´N¶}©lªì©l¤Æ¡A ¹Á¸Õ§P©w²{¦b¦³¤°»ò¼ËªºµwÅéµ¥µ¥¡A ¤§«á¥¦»Ý­n§ä¨ì®Ú¥Ø¿ý©Ò¦bªºÀɮרt²Î¡C

§Ú­Ì²{¦³¤ä´©¥H¤U´XºØ root filesystems¡G

UFS

³o¬O³Ì´¶³qªº¤@ºØ root filesystem¡C¥¦¥i¥H¥Î¦b³nºÐ©ÎµwºÐ¤W¡C

MSDOS

³o¥u¬O§Þ³N¤W¥i¦æ¡A¹ê»Ú¤W¨Ã¤£¹ê¥Î¡A¦]¬° FAT ªºÀɮרt²Î¤£¯à²£¥Í links¡B device nodes ©M¤@¨Ç ``UNIXisms'' (Ķª`¡G»P UNIX ¬ÛÃöªº²£ª«)¡C

MFS

³o¬O¤@­Ó³Q½sĶ¦b kernel ¤º³¡ªº UFS Àɮרt²Î¡C¥Nªí¤F kernel ¤£¯u¥¿»Ý­n¥ô¦óªºµwºÐ/³nºÐ©Î¬O¨ä¥LªºµwÅé¨Ó°Ê§@¡C

CD9660

®³ CD-ROM ¨Ó·í§@ root filesystem ®É¥Î¡C

NFS

Root filesystem ©ñ¦bÀɮצøªA¾¹¤W¡A °ò¥»¤W¬O¥Î©ó¤@¥x¨S¦³µwºÐªº¾÷¾¹¡C

25.1.3. ªì©l¤Æ¨Ï¥ÎªÌ©ÒÄݪºªF¦è

­n¥O¨Ï¥ÎªÌ¤è­±ªºªF¦è°õ¦æ¡A¬O¦b kernel µ²§ôªì©l¤Æ«á¡A ¥¦±N·|²£¥Í¤@­Ó pid == 1 ªº process¡A ¦b root filesystem ¤W°õ¦æ¤@­Óµ{¦¡¡A¤@¯ë³o­Óµ{¦¡´N¬O /sbin/init¡C

§A¥i¥H¥H¥ô¦óµ{¦¡¨ú¥N /sbin/init¡A ¥u­n§A°O¦í¡G

³o¸Ì¨S¦³ stdin/out/err °£«D§A¦Û¤v¥´¶}¡C ¦pªG§AÂ÷¶}¡A¾÷¾¹·| panics¡C¨Ã·|¹ï pid == 1 ²£¥Íªº°T¸¹§@³B²z¡C

¦b¦w¸ËºÏºÐ¤Wªº /stand/sysinstall ´N¬O¤@­Ó¨Ò¤l¡C

25.1.4. ¦³½ìªº²Õ¦X½d¨Ò

±Ò°Ê kernel¡A¦b MFS ¸Ì¦³¤@­Ó¯S§Oªº /sbin/init ¥¦·|...

A -- ¨Ï¥Î DOS

  • §â±zªº C: ±¾¦b /C:

  • §â C:/freebsd.fs ³]©w¦¨ /dev/vn0

  • §â /dev/vn0 ±¾¨ì /rootfs

  • °µ¤@¨Ç symlinks /rootfs/bin -> /bin /rootfs/etc -> /etc /rootfs/sbin -> /sbin (etc...)

²{¦b§A¶] FreeBSD ¦Ó¤£¥Î­«·s¤À³Î§AªºµwºÐ...

B -- ¨Ï¥Î NFS

¥Î NFS §â server:~you/FreeBSD ±¾¦b /nfs¡A§â root ¦ì¸m§ïÅܦ¨ /nfs ¨Ã¦b¨ºùØ°õ¦æ /sbin/init

²{¦b§A¤£¥ÎºÏºÐ¦Ó¥i¥H¶] FreeBSD¡A ´Nºâ§A¨S¦³ NFS server ªº±±¨îÅv...

C -- °õ¦æ X-server

²{¦b§A¦³¤@­Ó X ²×ºÝ¾÷¡A³oÁ`¤ñ§A¦b windows ¤U¶] X µøµ¡¼ÒÀÀ¾¹¦n¡A¤£¦ý³t«×§Ö«Ü¦h¡A¤]¬Ù¤U¤£¤ÖµwÅ骺¿ú¡C

D -- ¨Ï¥Î tape

»s§@¤@¥÷ /dev/rwd0 ªº«þ¨©¨Ã¼g¨ì»·ºÝªººÏ±a¾÷©Î¬OÀɮצøªA¾¹¡C

³o¼Ë§A²×©ó¯à°÷°µ¤@¥÷§AÀ³¸Ó¦b¤@¦~¤§«e´N°µ¦nªº³Æ¥÷...

E -- ¥R·í firewall/web-server/ÀH«K§A¹À...

³o¬O¤Q¤À¦³½ìªº¡A·í§A±q¨¾¼gªº³nºÐ±Ò°Ê«á¡A ¤´µM¥i¥H¼g¤J§Aªº root filesystem...