FreeBSD Device Drivers: A Guide for the Intrepid [NOOK Book]

Overview

FreeBSD Device Drivers is the first and only book to teach readers how to develop device drivers for the FreeBSD operating system. A one-stop reference for FreeBSD device driver writers of all levels of expertise, FreeBSD Device Drivers begins with the nuts and bolts of device drivers, including explanations of the different driver components and building blocks. You will then learn how to build and run modules, allocate memory, control device communication, deal with concurrency issues, manage hardware ...
See more details below
FreeBSD Device Drivers: A Guide for the Intrepid

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$22.99
BN.com price
(Save 42%)$39.95 List Price

Overview

FreeBSD Device Drivers is the first and only book to teach readers how to develop device drivers for the FreeBSD operating system. A one-stop reference for FreeBSD device driver writers of all levels of expertise, FreeBSD Device Drivers begins with the nuts and bolts of device drivers, including explanations of the different driver components and building blocks. You will then learn how to build and run modules, allocate memory, control device communication, deal with concurrency issues, manage hardware resources, handle interrupts, support direct memory access, write PCI, SCSI, and USB device drivers, and more. With case study chapters that dissect various drivers and a liberal use of examples-from simple "hello, world" drivers to full-blown, hardware-controlling drivers-you will walk away with a full understanding of how device drivers work on FreeBSD. This book is for anyone writing device drivers, but also for any FreeBSD enthusiast who would appreciate its hands-on approach to understanding the device driver subsystem, kernel internals, and key design choices made by the FreeBSD developers.
Read More Show Less

Product Details

  • ISBN-13: 9781593274368
  • Publisher: No Starch Press San Francisco, CA
  • Publication date: 5/15/2012
  • Sold by: Barnes & Noble
  • Format: eBook
  • File size: 5 MB

Meet the Author

Tinkering with computers has always been a passion of author Joseph Kong. He is a self-taught programmer who dabbles in information security, operating system theory, reverse engineering, and vulnerability assessment. The author of Designing BSD Rootkits (No Starch Press), he has written for Phrack Magazine and was previously a system administrator for the City of Toronto.
Read More Show Less

Table of Contents

Dedication;
About the Technical Reviewer;
Foreword;
Acknowledgments;
Introduction;
Who Is This Book For?;
Prerequisites;
Contents at a Glance;
Welcome Aboard!;
Chapter 1: Building and Running Modules;
1.1 Types of Device Drivers;
1.2 Loadable Kernel Modules;
1.3 Hello, world!;
1.4 Compiling and Loading;
1.5 Character Drivers;
1.6 Mostly Harmless;
1.7 Block Drivers Are Gone;
1.8 Conclusion;
Chapter 2: Allocating Memory;
2.1 Memory Management Routines;
2.2 malloc_type Structures;
2.3 Tying Everything Together;
2.4 Contiguous Physical Memory Management Routines;
2.5 A Straightforward Example;
2.6 Conclusion;
Chapter 3: Device Communication and Control;
3.1 ioctl;
3.2 Defining ioctl Commands;
3.3 Implementing ioctl;
3.4 Invoking ioctl;
3.5 sysctl;
3.6 Implementing sysctls, Part 1;
3.7 sysctl Context Management Routines;
3.8 Creating Dynamic sysctls;
3.9 Implementing sysctls, Part 2;
3.10 Conclusion;
Chapter 4: Thread Synchronization;
4.1 A Simple Synchronization Problem;
4.2 A More Complex Synchronization Problem;
4.3 Preventing Race Conditions;
4.4 Mutexes;
4.5 Mutex Management Routines;
4.6 Implementing Mutexes;
4.7 Shared/Exclusive Locks;
4.8 Shared/Exclusive Lock Management Routines;
4.9 Implementing Shared/Exclusive Locks;
4.10 Reader/Writer Locks;
4.11 Reader/Writer Lock Management Routines;
4.12 Condition Variables;
4.13 Condition Variable Management Routines;
4.14 General Guidelines;
4.15 Conclusion;
Chapter 5: Delaying Execution;
5.1 Voluntary Context Switching, or Sleeping;
5.2 Implementing Sleeps and Condition Variables;
5.3 Kernel Event Handlers;
5.4 Callouts;
5.5 Callouts and Race Conditions;
5.6 Taskqueues;
5.7 Conclusion;
Chapter 6: Case Study: Virtual Null Modem;
6.1 Prerequisites;
6.2 Code Analysis;
6.3 Conclusion;
Chapter 7: Newbus and Resource Allocation;
7.1 Autoconfiguration and Newbus Drivers;
7.2 Tying Everything Together;
7.3 Hardware Resource Management;
7.4 Conclusion;
Chapter 8: Interrupt Handling;
8.1 Registering an Interrupt Handler;
8.2 Interrupt Handlers in FreeBSD;
8.3 Implementing an Interrupt Handler;
8.4 Generating Interrupts on the Parallel Port;
8.5 Conclusion;
Chapter 9: Case Study: Parallel Port Printer Driver;
9.1 Code Analysis;
9.2 Conclusion;
Chapter 10: Managing and Using Resources;
10.1 I/O Ports and I/O Memory;
10.2 Memory Barriers;
10.3 Tying Everything Together;
10.4 Conclusion;
Chapter 11: Case Study: Intelligent Platform Management Interface Driver;
11.1 Code Analysis;
11.2 Conclusion;
Chapter 12: Direct Memory Access;
12.1 Implementing DMA;
12.2 Creating DMA Tags;
12.3 Tearing Down DMA Tags;
12.4 DMA Map Management Routines, Part 1;
12.5 Loading (DMA) Buffers into DMA Maps;
12.6 DMA Map Management Routines, Part 2;
12.7 A Straightforward Example;
12.8 Synchronizing DMA Buffers;
12.9 Conclusion;
Chapter 13: Storage Drivers;
13.1 disk Structures;
13.2 disk Structure Management Routines;
13.3 Block I/O Structures;
13.4 Block I/O Queues;
13.5 Tying Everything Together;
13.6 Block I/O Completion Routines;
13.7 Conclusion;
Chapter 14: Common Access Method;
14.1 How CAM Works;
14.2 A (Somewhat) Simple Example;
14.3 SIM Registration Routines;
14.4 Action Routines;
14.5 Conclusion;
Chapter 15: USB Drivers;
15.1 About USB Devices;
15.2 More About USB Devices;
15.3 USB Configuration Structures;
15.4 USB Transfers (in FreeBSD);
15.5 USB Configuration Structure Management Routines;
15.6 USB Methods Structure;
15.7 Tying Everything Together;
15.8 Conclusion;
Chapter 16: Network Drivers, Part 1: Data Structures;
16.1 Network Interface Structures;
16.2 Network Interface Structure Management Routines;
16.3 Network Interface Media Structures;
16.4 Network Interface Media Structure Management Routines;
16.5 Hello, world!;
16.6 mbuf Structures;
16.7 Message Signaled Interrupts;
16.8 Implementing MSI;
16.9 MSI Management Routines;
16.10 Conclusion;
Chapter 17: Network Drivers, Part 2: Packet Reception and Transmission;
17.1 Packet Reception;
17.2 Packet Transmission;
17.3 Post Packet Transmission;
17.4 Conclusion;
References;
Colophon;
UPDATES;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)