professional_linux_kernel_architecture.pdf

(10689 KB) Pobierz
\Vrox Progrdmml'r to Progrdmml'r
Linux· Kernel
Architecture
Wolfgang Mauerer
Professional
wrox·
Updates, source code, and Wrox technical support at
www.wrox.com
Professional Linux
®
Kernel Architecture
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxvii
Chapter 1: Introduction and Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
Chapter 2: Process Management and Scheduling
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
Chapter 3: Memory Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
133
Chapter 4: Virtual Process Memory
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
289
Chapter 5: Locking and Interprocess Communication
. . . . . . . . . . . . . . . . . . . . . . .
347
Chapter 6: Device Drivers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
391
Chapter 7: Modules
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
473
Chapter 8: The Virtual Filesystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
519
Chapter 9: The Extended Filesystem Family
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
583
Chapter 10: Filesystems without Persistent Storage
. . . . . . . . . . . . . . . . . . . . . . .
643
Chapter 11: Extended Attributes and Access Control Lists
. . . . . . . . . . . . . . . . .
707
Chapter 12: Networks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
733
Chapter 13: System Calls
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
819
Chapter 14: Kernel Activities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
847
Chapter 15: Time management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
893
Chapter 16: Page and Buffer Cache
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
949
Chapter 17: Data Synchronization
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
989
Chapter 18: Page Reclaim and Swapping
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1023
Chapter 19: Auditing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1097
Appendix A: Architecture Specifics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1117
Appendix B: Working with the Source Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1141
Appendix C: Notes on C
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1175
Appendix D: System Startup
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1223
Appendix E: The ELF Binary Format
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1241
Appendix F: The Kernel Development Process
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1267
Bibliography
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1289
Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1293
Professional
Linux
®
Kernel Architecture
Wolfgang Mauerer
Wiley Publishing, Inc.
Professional Linux
®
Kernel Architecture
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright
©
2008 by Wolfgang Mauerer
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-34343-2
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data:
Mauerer, Wolfgang, 1978-
Professional Linux kernel architecture / Wolfgang Mauerer.
p. cm.
Includes index.
ISBN 978-0-470-34343-2 (pbk.)
1. Linux. 2. Computer architecture. 3. Application software.
QA76.9.A73M38 2008
005.4’32--dc22
2008028067
I. Title.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be
addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317)
572-3447, fax (317) 572-4355, or online at
http://www.wiley.com/go/permissions
.
Limit of Liability/Disclaimer of Warranty:
The publisher and the author make no representations or warranties
with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties,
including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended
by sales or promotional materials. The advice and strategies contained herein may not be suitable for every
situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting,
or other professional services. If professional assistance is required, the services of a competent professional person
should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an
organization or Website is referred to in this work as a citation and/or a potential source of further information
does not mean that the author or the publisher endorses the information the organization or Website may provide
or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may
have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks:
Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress
are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and
other countries, and may not be used without written permission. All other trademarks are the property of their
respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be
available in electronic books.
Zgłoś jeśli naruszono regulamin