2.2. Kernel Organization
In this section, we view the organization of the FreeBSD kernel in two ways.
The largest part of the kernel implements the system services that applications access through system calls. In FreeBSD, this software has been organized according to the following:
-
Basic kernel facilities: timer and system-clock handling, descriptor management, and process management
-
Memory-management support: paging and swapping
-
Generic system interfaces: the I/O, control, and multiplexing operations performed on descriptors
-
The filesystem: files, directories, pathname translation, file locking, and I/O buffer management
-
Terminal-handling support: the pseudo-terminal interface and terminal line disciplines
-
Interprocess-communication facilities: sockets
-
Support for network communication: communication protocols and generic network facilities, such as routing
Most of the software in these categories is machine independent and is portable across different hardware architectures.
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 architectures. 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 the following.
-
Low-level system-startup actions
-
Trap and fault handling
-
Low-level manipulation of the run-time context of a process
-
Configuration and initialization of hardware devices
-
Run-time support for I/O devices
Table 2.1 summarizes the machine-independent software that constitutes the FreeBSD kernel for the PC. 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; a mere 0.6 percent is written in assembly language. As the statistics in Table 2.2 show, the machine-dependent software, excluding device support, accounts for a minuscule 6.9 percent of the kernel. Not shown are the 846,525 lines of code for the hundreds of supported devices, only a few of which will be loaded into any particular kernel.
| Category | Lines of Code | Percentage of Kernel |
|---|---|---|
| machine dependent headers | 16,115 | 2.0% |
| ISA bus | 50,882 | 6.4% |
| PCI bus | 2,266 | 0.3% |
| virtual memory | 3,118 | 0.4% |
| other machine dependent | 26,708 | 3.3% |
| routines in assembly language | 4,400 | 0.6% |
| Linux compatibility | 4,857 | 0.6% |
| _______ | ____ | |
| Total machine dependent | 108,346 | 13.6% |
| Key: ISA—Industry Standard Architecture; PCI—Peripheral Component Interconnect. | ||
Only a small part of the kernel is devoted to initializing the system. This code is used when the system is bootstrapped 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 overlay the software that performs these functions after that software has been executed. The FreeBSD kernel does not reclaim the memory used by the startup code because that memory space is barely 0.2 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.
-
|220.250.58.xxx |2011-07-06 04:11:51 awfawf
-
|220.250.58.xxx |2011-07-06 04:12:11 awfawfThere is a huge
amount of player
customization, both
in their item
optimization as well
as their cosmetic
appearance."
Back inside the
playable game, while
I was getting my
face handed to me on
a silver (yet
bloody) platter, I
of course didn‘t see
any of these
MMO-esque runescape momenyaspects of player
customization, but
what I did get to
see were solid
shooter mechanics
inside a slick,Powered by !JoomlaComment 4.0 beta2
< Prev Next > -




amount of player
customization, both
in their item
optimization as well
as their cosmetic
appearance."
Back inside the
playable game, while
I was getting my
face handed to me on
a silver (yet
bloody) platter, I
of course didn‘t see
any of these
MMO-esque runescape momenyaspects of player
customization, but
what I did get to
see were solid
shooter mechanics
inside a slick,