Home > Store

IA-64 Linux Kernel: Design and Implementation

Register your product to gain access to bonus material or receive a coupon.

IA-64 Linux Kernel: Design and Implementation

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2002
  • Dimensions: 7" x 9-1/4"
  • Pages: 560
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-061014-3
  • ISBN-13: 978-0-13-061014-0

The book starts with an overview of Linux and the IA-64 architecture and then discusses each major subsystem of the kernel in more detail. Among others, there are separate chapters on how multi-tasking maps onto the underlying hardware, on the virtual memory subsystem, device support (programemd I/O, DMA & interrupts), symmetric multi-processing (SMP), and on the bootstrap procedure needed to bring a computer to live. These chapters place great emphasis not just on the "what", but also on the "how" and "why" of how Linux accomplishes its tasks. Each chapter has two primary components: the first describes the interfaces that the Linux kernel uses to abstract platform differences, and the second describes how these interfaces have been realized for IA-64. This structure makes the book useful not just to those readers interested specifically in IA-64 Linux, but also to anyone who would like to gain a better understanding of how Linux works on other platform.

Sample Content

Online Sample Chapter

Virtual Memory in the IA-64 Linux Kernel

Table of Contents



List of Figures.


List of Tables.


Foreword.


Preface.


1. Introduction.

Microprocessors: From CISC to EPIC. Overview of the Linux Kernel. Summary.



2. IA-64 Architecture.

User-Level Instruction Set Architecture. Runtime and Software Conventions. System Instruction Set Architecture. The Register Stack Engine (RSE). Summary.



3. Processes, Tasks, and Threads.

Introduction to Linux Tasks. The Thread Interface. Thread Synchronization. Summary.



4. Virtual Memory.

Introduction to the Virtual Memory System. Address Space of a Linux Process. Page Tables. Translation Lookaside Buffer (TLB). Page Fault Handling. Memory Coherency. Switching Address Spaces. Discussion and Summary.



5. Kernel Entry and Exit.

Interruptions. System Calls. Signals. Kernel Access to User Memory. Summary.



6. Stack Unwinding.

IA-64 ELF Unwind Sections. The Kernel Unwind Interface. Embedding Unwind Information in Assembly Code. Implementation Aspects. Summary.



7. DEVICE I/O.

Introduction. Programmed I/O. Direct Memory Access (DMA). Device Interrupts. Summary.

8. Symmetric Multiprocessing. @@AHEADS = Introduction to Multiprocessing on Linux. Linux Locking Principles. Multiprocessor Support Interface. CPU-Specific Data Area. Tracking Wall-Clock Time with High Resolution. Summary.



9. Understanding System Performance.

IA-64 Performance Monitoring Unit Overview. Extending the PMU: The Itanium Example. Kernel Support for Performance Monitoring. Summary.



10. Booting.

IA-64 Firmware Overview. The Bootloader. Kernel Initialization. Summary.



11. IA-32 Compatibility.

Architectural Support for IA-32. Linux Support for IA-32 Applications. Summary.



Appendix A. IA-64 CPU Models.


Appendix B. Kernel Register Usage.


Appendix C. IA-64 Instructions.

Integer Instructions. Memory Instructions. Semaphore Instructions. Branch Instructions. Control Instructions. Multimedia Instructions. Floating-Point Instructions. Privileged Instructions.



Appendix D: Itanium PMU Events.


Glossary.


Bibliography.


Index.

Preface

PREFACE

This book grew out of the simple desire to describe exactly how Linux works on an IA-64 machine. By realizing that desire, we hope not only to shine a light on the inner workings of Linux, but also to share some of the excitement and the creative processes that are involved in solving the many technical challenges that arise when designing an operating system for a platform as radical and innovative as IA-64. Many of the innovations in IA-64 are targeted at increasing performance by giving a compiler more control over the CPU. However, as we see in this book, IA-64 also comes with a powerful system architecture which supports—indeed encourages—innovative solutions at the operating-system level.

Linux is a no-nonsense operating system, sticking to tried and true principles whenever possible. At the same time, Linux has always been able to adapt quickly to genuine advances in hardware and operating-system technology. Thus, while we believe that the design and implementation described in this book provide a solid foundation, we also believe that there is plenty of room for improvement. In this sense, we hope to encourage research and development around this platform. Of course, the fact that Linux is an Open Source operating system also helps make it an ideal test bed for exploring new ideas. Unlike more speculative operating systems, Linux offers the opportunity to turn truly inspired solutions into practice almost overnight.

Given that the Linux source code is freely available, some people may wonder whether it would not be possible to learn Linux and its IA-64 implementation directly from reading the source code. It is true that the source code contains the most precise description of how Linux works, but too much precision sometimes hurts: it can make us see all the trees but miss the forest. Source code also can explain only how things are done, not why they are done in a particular way. This book is designed to compensate for these shortcomings.

When introducing a new topic, we start at a high level, describing the ideas, principles, and motivations for the approaches taken by Linux. Then we describe the hardware abstraction interfaces used by Linux and, finally, their IA-64 implementations. Throughout these discussions, the focus is always on what needs to be accomplished. How they are accomplished is described also, but at a sufficiently high level that avoids drowning a reader in details. This implies that this book can be used in two primary ways: readers mainly interested in an overview of Linux/ia64 find a self-contained and authoritative description. Readers interested in gaining hands-on experience find a smooth introduction to the world of Linux/ia64 and the underlying source code. To assist with the latter, the descriptions in this book have embedded in them pointers to key pieces of the Linux source code. Those pointers tend to be most accurate for Linux kernel version v2.4.14, though they also apply to earlier and later versions.

INTENDED AUDIENCE

This book is primarily targeted at professionals interested in learning more about how the Linux kernel works on IA-64. In addition, hardware architects may find the book useful as a case study of how one particular operating system takes advantage of IA-64. Similarly, software architects interested in designing other operating systems for IA-64 will find many tips on how to handle some of the more advanced features of IA-64. For example, the book discusses the operating-system impact of speculative execution, the register stack, and the virtual hash page table walker. Finally, students in the area of Computer Science and Engineering may find the book interesting as a description of how a real, general-purpose operating system works on real hardware.

Among the Linux professionals, the book should be of most direct value to general kernel programmers, authors of device drivers, and application programmers interested in tuning performance for IA-64. Beyond that, the descriptions of the Linux hardware abstraction interfaces are valid independently of the target platform. We believe that the interface descriptions in this book are among the most accurate and most comprehensive descriptions in existence. But we should caution that these interfaces were developed by a large group of developers over a long period of time and, to some degree, they continue to evolve. For that reason, we cannot claim that the descriptions are authoritative beyond the IA-64 platform, though we did try to make them as inclusive as possible.

Knowledge of the C programming language is a prerequisite for this book. Familiarity with basic operating-system concepts, assembly programming, and the machine organization of computers are also helpful, though not strictly required. No prior knowledge of IA-64 is needed.

ORGANIZATION

The first two chapters of this book contain introductory material. Chapter 1, Introduction, provides background information on the evolution of both microprocessor architectures and Linux. The second half of the chapter is dedicated to an overview of the Linux kernel. As part of this overview, we also establish the terminology used throughout the remainder of the book.

Chapter 2, IA-64 Architecture, introduces the IA-64 architecture and software conventions. IA-64 is a rich architecture that cannot be learned overnight. Because of this, we recommend that this chapter first be read in a fluid fashion, without undue attention to details. Once a basic familiarity has been established, the reader may then want to revisit the chapter from time to time and study specific aspects in more detail.

The next three chapters describe the most fundamental components of Linux and how they work on IA-64: Chapter 3, Processes, Tasks, and Threads, describes aspects related to scheduling and execution. It starts with an overview of key data structures, then moves on to describe the Linux thread interface and the various synchronization primitives that Linux supports. Chapter 4, Virtual Memory, describes the virtual memory system of Linux. A brief introduction is followed by detailed descriptions of all hardware abstraction interfaces and their IA-64 implementations. Topics covered include the Linux page tables, linearly-mapped virtual page tables, TLB (translation lookaside buffer) management, page fault handling, and memory coherency. Chapter 5, Kernel Entry and Exit, describes all aspects related to entering and exiting the kernel. In particular, it explains how system calls and signals work, as well as how data is passed across the user/kernel boundary. Like the preceding two chapters, this one starts by describing the Linux aspects that apply to all platforms and completes the discussion with descriptions of the IA-64 implementations.

The next three chapters are fairly independent of each other. Chapter 6, Stack Unwinding, discusses the general topic of stack unwinding. While the topic is not really IA-64 specific, it does play a more important role on this platform. Indeed, anyone wishing to write IA-64 assembly code needs to be familiar with the material presented in the third section of this chapter. The other sections describe the IA-64 kernel unwinder and its implementation. Chapter 7, Device I/O, describes aspects related to device input/output (I/O). Specifically, it covers the hardware abstraction interfaces for programmed I/O (both memory-mapped and port-based), DMA (direct memory access), and device interrupts. The interface descriptions are followed by descriptions of their IA-64 realizations. Chapter 8, Symmetric Multiprocessing, discusses aspects specific to multiprocessor (MP) machines. Where appropriate, the other chapters cover MP aspects in the course of normal discussion, but this chapter covers all remaining issues. In particular, the first section provides an overview of the Linux locking principles and the MP support interface. The remaining two sections cover the handling of CPU-specific data areas and the issue of maintaining high-resolution timestamps on MP machines.

The final three chapters are mostly IA-64 specific. Chapter 9, Understanding System Performance, introduces the IA-64 performance monitoring support, its Itanium implementation, and the associated perfmon kernel subsystem. This chapter should be of great value to anyone interested in characterizing and tuning the performance of IA-64 programs, whether the programs are normal applications or part of the Linux kernel. Chapter 10, Booting, covers all aspects related to booting a machine. The first two sections contain an overview of the IA-64 firmware and the IA-64 bootloader. The third section covers the Linux bootstrap interface and its implementation on IA-64. Chapter 11, IA-32 Compatibility, describes how Linux/ia64 manages to provide backward compatibility with IA-32. By its very nature, this discussion is IA-64 specific. However, most 64-bit Linux platforms provide backward compatibility with some 32-bit platform. For this reason, many of the topics and solutions discussed here apply to other platforms as well.

A glossary of terms and abbreviations used in this book is provided in Appendix E. We would like to encourage the reader to refer to it whenever encountering an acronym that may seem unfamiliar.

PROVIDING FEEDBACK

While we strived to make this book as interesting, useful, and accurate as possible, we encourage our readers to provide feedback on how to improve future editions. For this purpose, we set up a web site at the following address (URL):

http://www.lia64.org/book/

Please visit this site to report errors or to make suggestions for improvements. The web site also contains an up-to-date errata, links to related software and tools, and a summary of the evolution of Linux as it pertains to this book.

David Mosberger and Stéphane Eranian
Palo Alto, California
November, 2001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020