FreeBSD Device Drivers by Joseph Kong at Bookstore UAE
close menu
Bookswagon
search
My Account
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Book 1
Book 2
Book 3
Home > Computing and Information Technology Books > Operating systems > Open source and other operating systems > FreeBSD Device Drivers
FreeBSD Device Drivers

FreeBSD Device Drivers


     0     
5
4
3
2
1



Available


X
About the Book

Device drivers make it possible for your software to communicate with your hardware, and because every operating system has specific requirements, driver writing is nontrivial. When developing for FreeBSD, you've probably had to scour the Internet and dig through the kernel sources to figure out how to write the drivers you need. Thankfully, that stops now. In FreeBSD Device Drivers, Joseph Kong will teach you how to master everything from the basics of building and running loadable kernel modules to more complicated topics like thread synchronization. After a crash course in the different FreeBSD driver frameworks, extensive tutorial sections dissect real-world drivers like the parallel port printer driver. You'll learn- -All about Newbus, the infrastructure used by FreeBSD to manage the hardware devices on your system -How to work with ISA, PCI, USB, and other buses -The best ways to control and communicate with the hardware devices from user space -How to use Direct Memory Access (DMA) for maximum system performance -The inner workings of the virtual null modem terminal driver, the USB printer driver, the Intel PCI Gigabit Ethernet adapter driver, and other important drivers -How to use Common Access Method (CAM) to manage host bus adapters (HBAs) Concise descriptions and extensive annotations walk you through the many code examples. Don't waste time searching man pages or digging through the kernel sources to figure out how to make that arcane bit of hardware work with your system. FreeBSD Device Drivers gives you the framework that you need to write any driver you want, now. Device drivers make it possible for your software to communicate with your hardware, and because every operating system has specific requirements, driver writing is nontrivial. When developing for FreeBSD, you've probably had to scour the Internet and dig through the kernel sources to figure out how to write the drivers you need. Thankfully, that stops now. In FreeBSD Device Drivers, Joseph Kong will teach you how to master everything from the basics of building and running loadable kernel modules to more complicated topics like thread synchronization. After a crash course in the different FreeBSD driver frameworks, extensive tutorial sections dissect real-world drivers like the parallel port printer driver. You'll learn- -All about Newbus, the infrastructure used by FreeBSD to manage the hardware devices on your system -How to work with ISA, PCI, USB, and other buses -The best ways to control and communicate with the hardware devices from user space -How to use Direct Memory Access (DMA) for maximum system performance -The inner workings of the virtual null modem terminal driver, the USB printer driver, the Intel PCI Gigabit Ethernet adapter driver, and other important drivers -How to use Common Access Method (CAM) to manage host bus adapters (HBAs) Concise descriptions and extensive annotations walk you through the many code examples. Don't waste time searching man pages or digging through the kernel sources to figure out how to make that arcane bit of hardware work with your system. FreeBSD Device Drivers gives you the framework that you need to write any driver you want, now.

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;

About the Author :
The author of Designing BSD Rootkits (No Starch Press), Joseph Kong works on information security, operating system theory, reverse code engineering, and vulnerability assessment. Kong is a former system administrator for the City of Toronto.

Review :
"At last, a definitive and authoritative book on FreeBSD device drivers! Kong's clear mastery of his subject shines through every page."
—Michael Lucas, FreeBSD committer and author of Absolute FreeBSD

"FreeBSD Device Drivers is an excellent guide to the APIs used to write a device driver for FreeBSD."
—John Baldwin, Kernel Developer, FreeBSD

"I'd recommend the book for anybody that needs an introduction to drivers. The walk throughs will get people up to speed, as well as introduce many of the uniquely FreeBSD quirks one needs to know to integrate with FreeBSD."
—Warner Losh, FreeBSD core team 

"I am pleased to see No Starch provide a forum for books like this. They continue to produce high-quality works that read well and address subjects seldom found elsewhere."
—Richard Bejtlich, CSO of Mandiant & Founder of TaoSecurity

"I like this book. It fills a definite need, and does it well."
—Warren Block, FreeBSD committer 

"This book is definitely a must have for anybody interested in how FreeBSD device drivers are designed, not to mention those who are interested in writing their very own ones for the FreeBSD operating system!"
—Romain Tartière, FreeBSD ports committer

"This book is a no nonsense, straight to the point document that helps you get to the content quickly."
—BeginLinux.com 

"Definitely an excellent book with all the information you’ll need to start developing your own FreeBSD device drivers."
—xorl 

"Strikes a pretty good balance for its stated purpose. Its mostly 'just the facts ma’am' style works well, but it provides plenty of references for those wanting more detail or background. This is definitely worth a read if device drivers in FreeBSD are something you need or want to know about."
—Simon Gerraty, FreeBSD Journal


Best Sellers


Product Details
  • ISBN-13: 9781593272043
  • Publisher: No Starch Press,US
  • Publisher Imprint: No Starch Press,US
  • Height: 234 mm
  • No of Pages: 352
  • Width: 178 mm
  • ISBN-10: 1593272049
  • Publisher Date: 12 May 2012
  • Binding: Paperback
  • Language: English
  • Returnable: Y


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
FreeBSD Device Drivers
No Starch Press,US -
FreeBSD Device Drivers
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

FreeBSD Device Drivers

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!