From owner-doc-jp@jp.freebsd.org  Tue May 22 21:08:28 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id VAA03767;
	Tue, 22 May 2001 21:08:28 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from catv00.kitanet.ne.jp (catv00.kitanet.ne.jp [210.146.3.11])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with SMTP id VAA03760
	for <doc-jp@jp.freebsd.org>; Tue, 22 May 2001 21:08:27 +0900 (JST)
	(envelope-from sugimura@YasudaKei.org)
Received: (qmail 7538 invoked by uid 0); 22 May 2001 12:08:20 -0000
Received: from proxy01.kitanet.ne.jp (HELO localhost) (210.146.3.4)
  by catv00.kitanet.ne.jp with SMTP; 22 May 2001 12:08:20 -0000
To: doc-jp@jp.freebsd.org
From: SUGIMURA Takashi =?iso-2022-jp?B?GyRCP3lCPBsoQiAbJEI1LjtOGyhC?=
 <sugimura@YasudaKei.org>
In-Reply-To: <20010519131703D.sugimura@YasudaKei.org>
References: <200105150952.SAA33948@bach.cc.musashi.ac.jp>
	<20010519131703D.sugimura@YasudaKei.org>
X-Mailer: Mew version 1.94.1 on XEmacs 21.1 (Cuyahoga Valley)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Tue_May_22_21:20:33_2001_886)--"
Content-Transfer-Encoding: 7bit
Message-Id: <20010522212039Y.sugimura@YasudaKei.org>
Date: Tue, 22 May 2001 21:20:39 +0900
X-Dispatcher: imput version 20000228(IM140)
Lines: 463
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: doc-jp 8238
Subject: [doc-jp 8238] Re: book.2.sgml
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: sugimura@YasudaKei.org

----Next_Part(Tue_May_22_21:20:33_2001_886)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B$9$.$`$i$G$9!#(B

>>$B$=$N$?$a!"(Bbook.2.sgml$B$r$d$C$F2<$5$kJ}$rJg=8$7$^$9!#(B
>
>$B$I$J$?$b$$$i$C$7$c$i$J$$$h$&$G$9$N$G!"$d$j$^$9!#(B
>

$BCY$/$J$j$^$7$?$,!"Lu$7$F$_$^$7$?!#(B
$B$h$m$7$/$*4j$$$7$^$9!#(B


----Next_Part(Tue_May_22_21:20:33_2001_886)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="book.2j.sgml"

    <sect1>
      <title>Kernel Organization</title>
      <title>$B%+!<%M%k$N9=@.(B</title>

      <para>In this section, we view the organization of the 4.4BSD
	kernel in two ways:</para>
      <para>$B$3$N%;%/%7%g%s$G$O(B, 2 $B$D$NJ}K!$G(B 4.4BSD $B%+!<%M%k$N9=@.$r(B
            $B8+$F$$$-$^$9(B.</para>
      
      <orderedlist>
	<listitem>
	  <para>As a static body of software,
	    categorized by the functionality offered by the modules
	    that make up the kernel</para>
	  <para>$B%=%U%H%&%'%"$N@EE*B&LL(B, $B$D$^$j%+!<%M%k$r9=C[$9$k$?$a$N%b%8%e!<%k(B
	    $B$K$h$C$FDs6!$5$l$?5!G=@-$K$h$kJ,N`(B</para>
	</listitem>
	
	<listitem>
	  <para>By its dynamic operation,
	    categorized according to the services provided to users</para>
	  <para>$B$=$NF0E*$J5!G=(B, $B$D$^$j%f!<%6$KDs6!$5$l$k%5!<%S%9$K$h$kJ,N`(B</para>
	</listitem>
      </orderedlist>
      
      <para>The largest part of the kernel implements
	the system services that applications access through system calls.
	In 4.4BSD, this software has been organized according to the following:</para>
      <para>$B%+!<%M%k$NBgItJ,$O(B, $B%7%9%F%`%3!<%k$rDL$7$F%"%W%j%1!<%7%g%s$,(B
        $B%"%/%;%9$9$k$?$a$N%7%9%F%`%5!<%S%9$r<BAu$7$F$$$^$9(B.
	4.4BSD $B$G$O(B, $B$3$N%=%U%H%&%'%"$O<!$N$h$&$J9=@.$K$J$C$F$$$^$9(B:</para>
      
      <itemizedlist>
	<listitem>
	  <para>Basic kernel facilities:
	    timer and system-clock handling,
	    descriptor management, and process management</para>
	  <para>$B4pACE*$J%+!<%M%k5!G=(B:
	    $B%?%$%^!<$*$h$S%7%9%F%`;~7W$N<h$j07$$(B,
	    $B%G%#%9%/%j%W%?4IM}(B, $B$=$7$F%W%m%;%94IM}(B</para>
	</listitem>
	
	<listitem>
	  <para>Memory-management support:
	    paging and swapping</para>
	  <para>$B%a%b%j4IM}$N%5%]!<%H(B:
	    $B%Z!<%8%s%0$H%9%o%C%T%s%0(B</para>
	</listitem>
	
	<listitem>
	  <para>Generic system interfaces:
	    the I/O,
	    control, and multiplexing operations performed on descriptors</para>
	  <para>$BE}3gE*$J%7%9%F%`%$%s%?%U%'!<%9(B:
	    I/O, $B%3%s%H%m!<%k(B, $B$=$7$F%G%#%9%/%j%W%?>e$G<B9T$5$l$k(B
	    $BB?=E2=%*%Z%l!<%7%g%s(B</para>
	</listitem>
	
	<listitem>
	  <para>The filesystem:
	    files, directories, pathname translation, file locking,
	    and I/O buffer management</para>
	  <para>$B%U%!%$%k%7%9%F%`(B:
	    $B%U%!%$%k(B, $B%G%#%l%/%H%j(B, $B%Q%9L>$N2r<a(B, $B%U%!%$%k%m%C%/(B,
	    $B$=$7$F(B I/O $B%P%C%U%!4IM}(B</para>
	</listitem>
	
	<listitem>
	  <para>Terminal-handling support:
	    the terminal-interface driver and terminal
	    line disciplines</para>
	  <para>$BC<Kv$N<h$j07$$$N%5%]!<%H(B:
	    $BC<Kv$N%$%s%?%U%'!<%9%I%i%$%P$H9T@)8f(B</para>
	</listitem>
	
	<listitem>
	  <para>Interprocess-communication facilities:
	    sockets</para>
	  <para>$B%W%m%;%94VDL?.5!G=(B:
	    $B%=%1%C%H(B</para>
	</listitem>
	
	<listitem>
	  <para>Support for network communication:
	    communication protocols and
	    generic network facilities, such as routing</para>
	  <para>$B%M%C%H%o!<%/%3%_%e%K%1!<%7%g%s$N;Y1g(B:
	    $B%k!<%F%#%s%0$N$h$&$J(B, $B%3%_%e%K%1!<%7%g%s%W%m%H%3%k$d(B
	    $BE}3gE*$J%M%C%H%o!<%/5!G=(B</para>
	</listitem>
      </itemizedlist>

      <table frame="none" id="table-mach-indep">
	<title>Machine-independent software in the 4.4BSD kernel</title>
	<title>4.4BSD $B%+!<%M%k$K$*$1$k5!<oHs0MB8$J%=%U%H%&%'%"(B</title>
	<tgroup cols="3">
	  <thead>
	    <row>
	      <entry>Category</entry>
	      <entry>$BJ,N`(B</entry>
	      <entry>Lines of code</entry>
	      <entry>$B9T?t(B</entry>
	      <entry>Percentage of kernel</entry>
	      <entry>$B%+!<%M%kFb$G$N3d9g(B</entry>
	    </row>
	  </thead>
	  
	  <tfoot>
	    <row>
	      <entry>total machine independent</entry>
	      <entry>$B5!<oHs0MB8ItJ,$NAm7W(B</entry>
	      <entry>162,617</entry>
	      <entry>80.4</entry>
	    </row>
	  </tfoot>
	  
	  <tbody>
	    <row>
	      <entry>headers</entry>
	      <entry>$B%X%C%@(B</entry>
	      <entry>9,393</entry>
	      <entry>4.6</entry>
	    </row>
	    
	    <row>
	      <entry>initialization</entry>
	      <entry>$B=i4|2=ItJ,(B</entry>
	      <entry>1,107</entry>
	      <entry>0.6</entry>
	    </row>
	    
	    <row>
	      <entry>kernel facilities</entry>
	      <entry>$B%+!<%M%k$N5!G=(B</entry>
	      <entry>8,793</entry>
	      <entry>4.4</entry>
	    </row>
	    
	    <row>
	      <entry>generic interfaces</entry>
	      <entry>$BE}3gE*$J%$%s%?%U%'!<%9(B</entry>
	      <entry>4,782</entry>
	      <entry>2.4</entry>
	    </row>
	    
	    <row>
	      <entry>interprocess communication</entry>
	      <entry>$B%W%m%;%94VDL?.(B</entry>
	      <entry>4,540</entry>
	      <entry>2.2</entry>
	    </row>
	    
	    <row>
	      <entry>terminal handling</entry>
	      <entry>$BC<Kv$N<h$j07$$(B</entry>
	      <entry>3,911</entry>
	      <entry>1.9</entry>
	    </row>
	    
	    <row>
	      <entry>virtual memory</entry>
	      <entry>$B2>A[%a%b%j(B</entry>
	      <entry>11,813</entry>
	      <entry>5.8</entry>
	    </row>
	    
	    <row>
	      <entry>vnode management</entry>
	      <entry>vnode $B$N4IM}(B</entry>
	      <entry>7,954</entry>
	      <entry>3.9</entry>
	    </row>

	    <row>
	      <entry>filesystem naming</entry>
	      <entry>$B%U%!%$%k%7%9%F%`$NL?L>(B</entry>
	      <entry>6,550</entry>
	      <entry>3.2</entry>
	    </row>
	    
	    <row>
	      <entry>fast filestore</entry>
	      <entry>$B9bB.$J%U%!%$%k3JG<(B</entry>
	      <entry>4,365</entry>
	      <entry>2.2</entry>
	    </row>
	    
	    <row>
	      <entry>log-structure filestore</entry>
	      <entry>$B%m%09=B$$N%U%!%$%k3JG<(B</entry>
	      <entry>4,337</entry>
	      <entry>2.1</entry>
	    </row>
	    
	    <row>
	      <entry>memory-based filestore</entry>
	      <entry>$B%a%b%j$K4p$E$$$?%U%!%$%k3JG<(B</entry>
	      <entry>645</entry>
	      <entry>0.3</entry>
	    </row>
	    
	    <row>
	      <entry>cd9660 filesystem</entry>
	      <entry>cd9660 $B%U%!%$%k%7%9%F%`(B</entry>
	      <entry>4,177</entry>
	      <entry>2.1</entry>
	    </row>
	    
	    <row>
	      <entry>miscellaneous filesystems (10)</entry>
	      <entry>$BMM!9$J%U%!%$%k%7%9%F%`(B (10)</entry>
	      <entry>12,695</entry>
	      <entry>6.3</entry>
	    </row>
	    
	    <row>
	      <entry>network filesystem</entry>
	      <entry>$B%M%C%H%o!<%/%U%!%$%k%7%9%F%`(B</entry>
	      <entry>17,199</entry>
	      <entry>8.5</entry>
	    </row>
	    
	    <row>
	      <entry>network communication</entry>
	      <entry>$B%M%C%H%o!<%/%3%_%e%K%1!<%7%g%s(B</entry>
	      <entry>8,630</entry>
	      <entry>4.3</entry>
	    </row>
	    
	    <row>
	      <entry>internet protocols</entry>
	      <entry>$B%$%s%?!<%M%C%H%W%m%H%3%k(B</entry>
	      <entry>11,984</entry>
	      <entry>5.9</entry>
	    </row>
	    
	    <row>
	      <entry>ISO protocols</entry>
	      <entry>ISO $B%W%m%H%3%k(B</entry>
	      <entry>23,924</entry>
	      <entry>11.8</entry>
	    </row>
	    
	    <row>
	      <entry>X.25 protocols</entry>
	      <entry>X.25 $B%W%m%H%3%k(B</entry>
	      <entry>10,626</entry>
	      <entry>5.3</entry>
	    </row>
	    
	    <row>
	      <entry>XNS protocols</entry>
	      <entry>XNS $B%W%m%H%3%k(B</entry>
	      <entry>5,192</entry>
	      <entry>2.6</entry>
	    </row>
	  </tbody>
	</tgroup>
      </table>
      
      <para>Most of the software in these categories is machine independent
	and is portable across different hardware architectures.</para>
      <para>$B$3$l$i$N%+%F%4%j$N%=%U%H%&%'%"$N$[$H$s$I$O5!<oHs0MB8$G$"$j(B, $B$7$+$b(B
	$B0[$J$k%O!<%I%&%'%"%"!<%-%F%/%A%c$K0\?"$G$-$k$b$N$G$9(B.</para>
      
      <para>The machine-dependent aspects of the kernel
	are isolated from the mainstream code.
	In particular, none of the machine-independent code contains
	conditional code for specific architecture.
	When an architecture-dependent action is needed,
	the machine-independent code calls an architecture-dependent
	function that is located in the machine-dependent code.
	The software that is machine dependent includes</para>
      <para>$B%+!<%M%k$N5!<o0MB8ItJ,$OK\N.$N%3!<%I$+$iJ,N%$5$l$F$$$^$9(B.
	$BFC$K(B, $B5!<o0MB8$7$F$$$k%3!<%I$N$I$l$r<h$C$F$b(B, 
	$BFCDj$N%"!<%-%F%/%A%c$N$?$a$N%3!<%I$r4^$s$G$$$^$;$s(B.
	$B5!<o$K0MB8$9$k5!G=$,I,MW$J$H$-$K$O(B, $B5!<o$K0MB8$7$J$$%3!<%I$O(B
	$B5!<o0MB8$N%3!<%IFb$K$"$k%"!<%-%F%/%A%c0MB8$N4X?t$r8F$S=P$7$^$9(B.
	$B5!<o0MB8$G$"$k%=%U%H%&%'%"$O<!$N$b$N$r4^$s$G$$$^$9(B.</para>
      
      <itemizedlist>
	<listitem>
	  <para>Low-level system-startup actions</para>
	  <para>$BDc%l%Y%k$J%7%9%F%`5/F0$N$?$a$NF0:n(B</para>
	</listitem>

	<listitem>
	  <para>Trap and fault handling</para>
	  <para>$B%H%i%C%W$*$h$S%U%)!<%k%H$N07$$(B</para>
	</listitem>
	
	<listitem>
	  <para>Low-level manipulation of the run-time context of a
	    process</para>
	  <para>$B%W%m%;%9$NF0:n>uBV$K4X$9$kDc%l%Y%k$JA`:n(B</para>
	</listitem>

	<listitem>
	  <para>Configuration and initialization of hardware devices</para>
	  <para>$B%O!<%I%&%'%"%G%P%$%9$N@_Dj$H=i4|2=(B</para>
	</listitem>
	
	<listitem>
	  <para>Run-time support for I/O devices</para>
	  <para>I/O $B%G%P%$%9$N%i%s%?%$%`%5%]!<%H(B</para>
	</listitem>
      </itemizedlist>
      
      <table frame="none" id="table-mach-dep">
	<title>Machine-dependent software for the HP300 in the 4.4BSD
	  kernel</title>
	<title>4.4BSD $B%+!<%M%k$K$*$1$k(B HP300 $B$N$?$a$N5!<o0MB8$N%=%U%H%&%'%"(B</title>
	
	<tgroup cols="3">
	  <thead>
	    <row>
	      <entry>Category</entry>
	      <entry>$BJ,N`(B</entry>
	      <entry>Lines of code</entry>
	      <entry>$B9T?t(B</entry>
	      <entry>Percentage of kernel</entry>
	      <entry>$B%+!<%M%kFb$G$N3d9g(B</entry>
	    </row>
	  </thead>

	  <tfoot>
	    <row>
	      <entry>total machine dependent</entry>
	      <entry>$B5!<o0MB8ItJ,$NAm7W(B</entry>
	      <entry>39,634</entry>
	      <entry>19.6</entry>
	    </row>
	  </tfoot>

	  <tbody>
	    <row>
	      <entry>machine dependent headers</entry>
	      <entry>$B5!<o0MB8ItJ,$N%X%C%@(B</entry>
	      <entry>1,562</entry>
	      <entry>0.8</entry>
	    </row>
	    
	    <row>
	      <entry>device driver headers</entry>
	      <entry>$B%G%P%$%9%I%i%$%P$N%X%C%@(B</entry>
	      <entry>3,495</entry>
	      <entry>1.7</entry>
	    </row>

	    <row>
	      <entry>device driver source</entry>
	      <entry>$B%G%P%$%9%I%i%$%P$N%=!<%9%3!<%I(B</entry>
	      <entry>17,506</entry>
	      <entry>8.7</entry>
	    </row>
	    
	    <row>
	      <entry>virtual memory</entry>
	      <entry>$B2>A[%a%b%j(B</entry>
	      <entry>3,087</entry>
	      <entry>1.5</entry>
	    </row>
	    
	    <row>
	      <entry>other machine dependent</entry>
	      <entry>$BB>$N5!<o0MB8ItJ,(B</entry>
	      <entry>6,287</entry>
	      <entry>3.1</entry>
	    </row>
	    
	    <row>
	      <entry>routines in assembly language</entry>
	      <entry>$B%"%;%s%V%j8@8l$K$h$k=hM}(B</entry>
	      <entry>3,014</entry>
	      <entry>1.5</entry>
	    </row>
	    
	    <row>
	      <entry>HP/UX compatibility</entry>
	      <entry>HP/UX $B$H$N8_49@-(B</entry>
	      <entry>4,683</entry>
	      <entry>2.3</entry>
	    </row>
	  </tbody>
	</tgroup>
      </table>
      
      <para><xref linkend="table-mach-indep"> summarizes the machine-independent software that constitutes the
	4.4BSD kernel for the HP300.
	The numbers in column 2 are for lines of C source code,
	header files, and assembly language.
	Virtually all the software in the kernel is written in the C
	programming language;
	less than 2 percent is written in
	assembly language.
	As the statistics in <xref linkend="table-mach-dep"> show,
	the machine-dependent software, excluding
	HP/UX
	and device support,
	accounts for a minuscule 6.9 percent of the kernel.</para>
      <para><xref linkend="table-mach-indep"> $B$O(B HP300 $B$N$?$a$N(B
	4.4BSD $B%+!<%M%k$r9=@.$9$k5!<oHs0MB8$N%=%U%H%&%'%"$rMWLs$7$F$$$^$9(B.
	2 $BNsL\$N?tCM$O(B C $B8@8l$N%=!<%9%3!<%I(B, $B%X%C%@%U%!%$%k(B, $B$=$7$F(B
	$B%"%;%s%V%j8@8l$N$b$N$rI=$7$F$$$^$9(B. $B%"%;%s%V%j8@8l$N$b$N$O(B
	2% $B0J2<$7$+$"$j$^$;$s$,(B. 
	$B$^$?(B, <xref linkend="table-mach-dep"> $B$NE}7W$,<($7$F$$$k$h$&$K(B,
	$B5!<o0MB8$N%=%U%H%&%'%"$O(B, HP/UX $B$d%G%P%$%9%5%]!<%H$r=|$$$F(B,
	$B%+!<%M%k$N$&$A$o$:$+$K(B 6.9% $B$7$+$"$j$^$;$s(B.</para>
      
      <para>Only a small part of the kernel is devoted to
	initializing the system.
	This code is used when the system is
	<emphasis>bootstrapped</emphasis>
	into operation and is responsible for setting up the kernel hardware
	and software environment
	(see
	Chapter 14).
	Some operating systems (especially those with limited physical memory)
	discard or
	<emphasis>overlay</emphasis>
	the software that performs these functions after that software has
	been executed.
	The 4.4BSD kernel does not reclaim the memory used by the
	startup code because that memory space is barely 0.5 percent
	of the kernel resources used on a typical machine.
	Also, the startup code does not appear in one place in the kernel -- it is
	scattered throughout, and it usually appears
	in places logically associated with what is being initialized.</para>
      <para>$B%+!<%M%k$N$4$/>.$5$JItJ,$@$1$,%7%9%F%`$N=i4|2=$K@lG0$7$^$9(B.
	$B$3$N%3!<%I$O%7%9%F%`$,(B <emphasis>$B5/F0$9$k(B</emphasis> $B$H$-$KMQ$$$i$l(B,
	$B%+!<%M%k$,%O!<%I%&%'%"$d%=%U%H%&%'%"$N4D6-9=C[$r$9$k$?$a$N4pK\ItJ,$H(B
	$B$J$j$^$9(B. (14 $B>O$r$4Mw$/$@$5$$(B)
	($B@)8B$5$l$?J*M}%a%b%j$r;}$D$b$N$K$OFC$K(B) $B%*%Z%l!<%F%#%s%0%7%9%F%`$NCf$K$O(B
	$B$3$l$i$N5!G=$,<B9T$5$l$?8e$K$=$N%=%U%H%&%'%"$rGQ4~$7$F$7$^$&$+(B,
	<emphasis>$B>e$+$iJ$$C$F$7$^$&(B</emphasis> $B$b$N$b$"$j$^$9(B.
	4.4BSD $B%+!<%M%k$O(B, $B5/F0$9$k$?$a$KMW$7$?%3!<%I$N$?$a$N%a%b%j$r:FMxMQ$7$^$;$s(B.
	$B$=$l$ODL>o$N5!<o$G$O%+!<%M%k$N%j%=!<%9$N$&$A(B 0.5% $B$K2a$.$J$$$+$i$G$9(B.
	$B$=$7$F(B, $B5/F0$N$?$a$N%3!<%I$O%+!<%M%k$NCf$N0lItJ,$K8G$^$C$F$O$$$^$;$s(B.
	$B$=$l$OA4BN$K$o$?$C$F;6:_$7$F$*$j(B, $B=i4|2=$5$l$?$H$-$KO@M}E*$K4XO"$7$F$$$?(B
	$B>l=j$KB8:_$7$^$9(B.</para>
    </sect1>

----Next_Part(Tue_May_22_21:20:33_2001_886)----
