proing 发表于 2014-11-21 14:36

The Design and Implementation of the FreeBSD Operating System 第2版

本帖最后由 proing 于 2014-11-24 15:37 编辑

我有第二版的英文电子书

proing 发表于 2014-11-21 14:50

This book follows the earlier authoritative and full-length descriptions of the
design and implementation of the 4.3BSD and 4.4BSD versions of the UNIX system
developed at the University of California at Berkeley. Since the final
Berkeley release in 1994, several groups have continued development of BSD.
This book details FreeBSD, the system with the largest set of developers and the
most widely distributed releases. Although the FreeBSD distribution includes
nearly 1000 utility programs in its base system and nearly 25,000 optional utilities
in its ports collection, this book concentrates almost exclusively on the kernel.
UNIX-like Systems
UNIX-like systems include the traditional vendor systems such as Solaris and
HP-UX; the Linux-based distributions such as Red Hat, Debian, Suse, and
Slackware; and the BSD-based distributions such as FreeBSD, NetBSD, OpenBSD,
and Darwin. They run on computers ranging from smart phones to the largest
supercomputers. They are the operating system of choice for most multiprocessor,
graphics, and vector-processing systems, and are widely used for the original purpose
of timesharing. The most common platform for providing network services
(from FTP to WWW) on the Internet, they are collectively the most portable operating
system ever developed. This portability is due partly to their implementation
language, C (which is itself a widely ported language),
and partly to the elegant design of the system.
Since its inception in 1969 , the UNIX system
has developed in several divergent and rejoining streams. The original developers
continued to advance the state of the art with their Ninth and Tenth Edition UNIX
inside AT&T Bell Laboratories, and then their Plan 9 successor to UNIX. Meanwhile,
AT&T licensed UNIX System V as a product before merging it with Sun
Microsystem’s BSD-based SunOS to produce Solaris. Ninth Edition UNIX, System
V, and Solaris were all strongly influenced by the Berkeley Software
Distributions produced by the Computer Systems Research Group (CSRG) of the
University of California at Berkeley. The Linux operating system, although developed
independently of the other UNIX variants, implements the UNIX interface.
Thus, applications developed to run on other UNIX-based platforms can be easily
ported to run on Linux.
Berkeley Software Distributions
The distributions from Berkeley were the first UNIX-based systems to introduce
many important features including the following:
• Demand-paged virtual-memory support
• Automatic configuration of the hardware and I/O system
• A fast and recoverable filesystem
• The socket-based interprocess-communication (IPC) primitives
• The reference implementation of TCP/IP
The Berkeley releases found their way into the UNIX systems of many vendors
and were used internally by the development groups of many other vendors. The
implementation of the TCP/IP networking protocol suite in 4.2BSD and 4.3BSD,
and the availability of those systems, played a key role in making the TCP/IP networking
protocol suite a world standard. Even the non-UNIX vendors such as
Microsoft have adopted the Berkeley socket design in their Winsock IPC interface.
The BSD releases have also been a strong influence on the POSIX (IEEE Std
1003.1) operating-system interface standard, and on related standards. Several
features—such as reliable signals, job control, multiple access groups per process,
and the routines for directory operations—have been adapted from BSD for
POSIX.
Early BSD releases contained licensed UNIX code, thus requiring recipients to
have an AT&T source license to be able to obtain and use BSD. In 1988, Berkeley
separated its distribution into AT&T-licensed and freely redistributable code. The
freely redistributable code was licensed separately and could be obtained, used,
and redistributed by anyone. The final freely redistributable 4.4BSD-Lite2 release
from Berkeley in 1994 contained nearly the entire kernel and all the important
libraries and utilities.
Two groups, NetBSD and FreeBSD, sprang up in 1993 to begin supporting and
distributing systems built from the freely redistributable releases being done by
Berkeley. The NetBSD group emphasized portability and the minimalist approach,
porting the systems to nearly 60 platforms and they were determined to keep the
system lean to aid embedded applications. The FreeBSD group emphasized maximal
support for the PC architecture and pushed to ease installation for, and market
their system to, as wide an audience as possible.
In 1995, the OpenBSD group split from the NetBSD group to develop a distribution
that emphasized security. In 2003, the Dragonfly group split from the
FreeBSD group to develop a distribution that used a significantly lighter-weight
mechanism to support multiprocessing. Over the years, there has been a healthy
to the hardware itself. The kernel includes system facilities,
such as process management, security, virtual memory, the I/O system, filesystems,
the socket IPC mechanism, and network protocol implementations. Material
above the system-call level—such as libraries, shells, commands, programming
languages, and other user interfaces—is excluded, except for some material
related to the terminal interface and to system startup. Following the organization
first established by Organick’s book about Multics , this book is
an in-depth study of a contemporary operating system.
Where particular hardware is relevant, the book refers to the Intel 32-bit
architecture and the similar AMD 64-bit architecture. Because FreeBSD has
emphasized development on these architectures, they are the architectures with the
most complete support and so provide a convenient point of reference.
Use by Computer Professionals
FreeBSD is widely used to support the core infrastructure of many companies
worldwide. Because it can be built with a small footprint, it is also seeing
increased use in embedded applications. The licensing terms of FreeBSD do not
require the distribution of changes and enhancements to the system. The licensing
terms of Linux require that all changes and enhancements to the kernel be made
available in source form at minimal cost. Thus, companies that need to control the
distribution of their intellectual property build their products using FreeBSD.
This book is of direct use to the professionals who work with FreeBSD systems.
Individuals involved in technical and sales support can learn the capabilities
and limitations of the system; applications developers can learn how to interface
with the system effectively and efficiently; system administrators without direct
experience with the FreeBSD kernel can learn how to maintain, tune, and configure
the system; and systems programmers can learn how to extend, enhance, and
interface with the system.
Readers who will benefit from this book include operating-system implementors,
system programmers, UNIX application developers, administrators, and curious
users. The book can be read as a companion to the source code of the system,
falling as it does between the manual pages and the code in its level of detail. But
this book is neither exclusively a UNIX programming manual nor a user tutorial.
Familiarity with the use of some version of the UNIX system (see, for example,
Stevens ) and with the C programming language (see, for example,
Kernighan & Ritchie ) would be extremely useful. The FreeBSD Handbook
gives a comprehensive introduction to the setting up, operation, and programming
of FreeBSD . FreeBSD packaging,
designed to be easy to install and use for both desktop and laptop users, is
available in the PC-BSD distribution .
Use in Courses on Operating Systems
This book is suitable for use as a reference text to provide background for a primary
textbook in a first-level course on operating systems. It is not intended for
use as an introductory operating-system textbook; the reader should have already
encountered terminology such as ‘‘memory management,’’ ‘‘process scheduling,’’
and ‘‘I/O systems’’ . Familiarity with the concepts of
network protocols will be useful
for understanding some of the later chapters.
This book can be used in combination with a copy of the FreeBSD system for
more advanced operating-systems courses. Students’ assignments can include
changes to, or replacements of, key system components such as the scheduler, the
paging daemon, the filesystems, thread signalling, various networking layers, and
I/O management. The ability to load, replace, and unload modules from a running
kernel allows students to experiment without the need to compile and reboot the
system. By working with a real operating system, students can directly measure
and experience the effects of their changes. Because of the intense peer review and
insistence on well-defined coding standards throughout its 35-year lifetime, the
FreeBSD kernel is considerably cleaner, more modular, and thus easier to understand
and modify than most software projects of its size and age. Sample course
material is available at www.teachbsd.com (see description following the index).
Exercises are provided at the end of each chapter. The exercises are graded
into three categories indicated by zero, one, or two asterisks. The answers to
exercises that carry no asterisks can be found in the text. Exercises with a single
asterisk require a step of reasoning, critical thinking, or intuition beyond a concept
presented in the text. Exercises with two asterisks present major design
projects or open research questions.
Organization
This text discusses both philosophical and design issues, as well as details of the
system’s actual implementation. Often, the discussion starts at the system-call
level and descends into the kernel. Tables and figures are used to clarify data
structures and control flow. Pseudocode similar to the C language displays algorithms.
A bold font identifies program names and filesystem pathnames. A bold
and italic font introduces glossary terms. An italic font identifies the names of
system calls, variables, routines, and structure names. Routine names (other than
system calls) are further identified by the name followed by parentheses (e.g., malloc()
is the name of a routine, whereas argv is the name of a variable).
The book is divided into five parts, organized as follows:
• Part I, Overview Three introductory chapters provide the context for the
complete operating system and for the rest of the book. Chapter 1, History and
Goals, sketches the historical development of the system, emphasizing the
system’s research orientation. Chapter 2, Design Overview of FreeBSD,
describes the services offered by the system and outlines the internal organization
of the kernel. It also discusses the design decisions that were made as the system
was developed. Sections 2.3 through 2.15 in Chapter 2 give an overview of their
corresponding chapters. Chapter 3, Kernel Services, explains how system calls
are performed and describes in detail several of the basic services of the kernel.
• Part II, Processes The first chapter in this part—Chapter 4, Process Management—
lays the foundation for later chapters by describing the structure of a
process, the algorithms used for scheduling the execution of the threads that
make up a process, and the synchronization mechanisms used by the system to
ensure consistent access to kernel-resident data structures. Chapter 5, Security,
explains the security framework used throughout the kernel. It also details the
security facilities that are available to control process access to the resources on
the system and to each other. In Chapter 6, Memory Management, the virtualmemory-
management system is discussed in detail.
• Part III, I/O System First, Chapter 7, I/O System Overview, explains the system
interface to I/O and describes the structure of the facilities that support this
interface. Following this introduction are four chapters that give the details of the
main parts of the I/O system. Chapter 8, Devices, gives a description of the I/O
architecture of the Intel and AMD systems, and describes how the I/O subsystem
is managed and how the kernel initially maps out and later manages the arrival and
departure of connected devices. Chapter 9, The Fast Filesystem, details the data
structures and algorithms that implement the original local filesystem as seen by
application programs, as well as how local filesystems are interfaced with the device
interface described in Chapter 8. Chapter 10, The Zettabyte Filesystem,
describes the filesystem most recently added to FreeBSD from the OpenSolaris
operating system. Chapter 11, The Network Filesystem, explains the latest version
4.2 network filesystem from both the server and client perspectives.
• Part IV, Interprocess Communication Chapter 12, Interprocess Communication,
describes the mechanism for providing communication between related
or unrelated processes. Chapters 13 and 14, Network-Layer Protocols and
Transport-Layer Protocols, are closely related because the facilities explained in
the former are used by the protocols, such as the UDP, TCP, and SCTP, explained
in the latter.
• Part V, System Operation Chapter 15, System Startup and Shutdown,
explains system initialization at the process level from kernel initialization to
user login.
The book is intended to be read in the order that the chapters are presented,
but the parts other than Part I are independent of one another and can be read separately.
Chapter 15 should be read after all the others, but knowledgeable readers
may find it useful independently.
At the end of the book are a glossary with brief definitions of major terms and
an index. Each chapter contains a Reference section with citations of related
material.Getting BSD
All the BSD distributions are available either for downloading from the net or on
removable media such as CD-ROM or DVD. Information on obtaining source and
binaries for FreeBSD can be obtained from http://www.FreeBSD.org. The NetBSD
distribution is compiled and ready to run on most workstation architectures. For
more information, contact the NetBSD Project at http://www.NetBSD.org/.
The OpenBSD distribution is compiled and ready to run on a wide variety of
workstation architectures and has been extensively vetted for security and reliability.
For more information, visit the OpenBSD project’s Web site at
http://www.OpenBSD.org/.
You diehards that read to the end of the preface are rewarded by finding out
that you can get a 32-hour introductory video course based on this book, a 40-hour
advanced video course based on the FreeBSD 5 source code, a 2.5-hour video lecture
on the history of BSD, and a 4-CD set containing all the releases and the
source-control history of BSD from Berkeley. These items are described in the
advertisements that follow the index.
Acknowledgments
We extend special thanks to Matt Ahrens (Delphix) who provided invaluable
insight on the workings of the ZFS filesystem including countless e-mails answering
our questions about how it works and why specific design decisions were made.
We also thank the following people who provided extensive review of areas of
the kernel in which they have deep knowledge: John Baldwin (The FreeBSD
Project) on locking, scheduling, and virtual memory; Alan Cox (Rice University)
on virtual memory; Jeffrey Roberson (EMC) on the ULE scheduler; and Randall
Stewart (Adara Networks) on the SCTP implementation.
We thank the following people, all of whom read and commented on early
drafts of various chapters of the book: Jonathan Anderson (Memorial University
of Newfoundland); David Chisnall (University of Cambridge); Paul Dagnelie
(Delphix); Brooks Davis (SRI International); Paweł Jakub Dawidek (Wheel
Systems); Peter Grehan (The FreeBSD Project); Scott Long (Netflix); Jake Luck;
Rick Macklem (The FreeBSD Project); Ilias Marinos (University of Cambridge);
Roger Pau Monne′ (Citrex); Mark Robert Vaughan Murray; Edward Tomasz
Napierała (The FreeBSD Project); Peter G. Neumann (SRI International); Rui
Paolo; Luigi Rizzo (Universita′ di Pisa, Italy); Margo Seltzer (Harvard University);
Keith Sklower (University of California, Berkeley); Lawrence Stewart (Swinburne
University of Technology); Michael Tuexen (Muenster University of Applied
Sciences); Bryan Venteicher (NetApp); Erez Zadok (Stony Brook University); and
Bjoern A. Zeeb (The FreeBSD Project).
We are grateful to our now-retired editor of 25 years, Peter Gordon, who had
faith in our ability to get the book written despite several years of delays on our
part. We are equally grateful to our new editor, Debra Williams, who saw this
project to completion and who accelerated the production when we finally had a
completed manuscript. We thank all the professional people at Addison-Wesley
and Pearson Education who helped us bring the book to completion: managingeditor John Fuller; production editor Mary Kesel Wilson; cover designer Chuti
Prasertsith; copy editor Deborah Thompson; and proofreader Melissa Panagos.
Finally we acknowledge the contributions of Jaap Akkerhuis, who designed the
troff macros for the BSD books.
This book was produced using James Clark’s implementations of pic, tbl,
eqn, and groff. The index was generated by awk scripts derived from indexing
programs written by Jon Bentley and Brian Kernighan [Bentley & Kernighan,
1986]. Most of the art was created with xfig. Figure placement and widow elimination
were handled by the groff macros, but orphan elimination and production
of even page bottoms had to be done by hand.
We encourage readers to send us suggested improvements or comments about
typographical or other errors found in the book; please send electronic mail to
FreeBSDbook-bugs@McKusick.COM.

wait_rabbit 发表于 2014-11-21 15:35

还以为可以下载呢。

楼主注册7年,就发了今天这两个帖子。。。

proing 发表于 2014-11-21 15:48

回复 3# wait_rabbit
账号为了该书而生

   

wait_rabbit 发表于 2014-11-21 18:33

回复 4# proing


   
不能压缩一下,打个包传到论坛上吗?

rtm009 发表于 2014-11-21 20:37

:lol有能力的都去看e文原版了 没能力的也不看这东西

abutter 发表于 2014-11-21 21:43

直接帖不就好了?

holylw2010 发表于 2014-11-21 23:37

不知道你的是什么版本?
页: [1]
查看完整版本: The Design and Implementation of the FreeBSD Operating System 第2版