没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
632页
This is, on the surface, a book about writing device drivers for the Linux system. That is a worthy goal, of course; the flow of new hardware products is not likely to slow down anytime soon, and somebody is going to have to make all those new gadgets work with Linux. But this book is also about how the Linux kernel works and how to adapt its workings to your needs or interests. Linux is an open system; with this book, we hope, it is more open and accessible to a larger community of developers
资源推荐
资源详情
资源评论
About the Authors
Jonathan Corbet got his first look at the BSD Unix source back in 1981, when an
instructor at the University of Colorado let him “fix” the paging algorithm. He has
been digging around inside every system he could get his hands on ever since,
working on drivers for VAX, Sun, Ardent, and x86 systems. He got his first Linux
system in 1993 and has never looked back. Jonathan is currently the cofounder and
executive editor of Linux Weekly News (http://www.LWN.net). He lives in Boulder,
Colorado with his wife and two children.
Alessandro Rubini installed Linux 0.99.14 soon after getting his degree as an elec-
tronic engineer. He then received a Ph.D. in computer science at the University of
Pavia despite his aversion toward modern technology. He left the University after
getting his Ph.D. because he didn’t want to write articles. He now works as a
freelancer, writing device drivers and articles. He used to be a young hacker before
his babies were born; now he’s an old advocate of free software who developed a bias
for non-PC computer platforms.
Greg Kroah-Hartman has been writing Linux kernel drivers since 1999 and is
currently the maintainer for the USB, PCI, I2C, driver core, and sysfs kernel
subsystems. He is also the maintainer of the udev and hotplug userspace programs,
as well as a Gentoo kernel maintainer, ensuring that his inbox is never empty. He is a
contributing editor to Linux Journal magazine.
Colophon
Our look is the result of reader comments, our own experimentation, and feedback
from distribution channels. Distinctive covers complement our distinctive approach
to technical topics, breathing personality and life into potentially dry subjects.
The image on the cover of Linux Device Drivers, Third Edition is a bucking bronco.
A colorful description of this animal appears in Marvels of the New West: A Vivid
Portrayal of the Stupendous Marvels in the Vast Wonderland West of the Missouri
River, by William Thayer (The Henry Bill Publishing Co., Norwich, CT, 1888).
Thayer quotes a stockman, who gives this description of a bucking horse: “When a
horse bucks he puts his head down between his legs, arches his back like an angry
cat, and springs into the air with all his legs at once, coming down again with a
frightful jar, and he sometimes keeps on repeating the performance until he is
completely worn out with the excursion. The rider is apt to feel rather worn out too
by that time, if he has kept his seat, which is not a very easy matter, especially if the
horse is a real scientific bucker, and puts a kind of side action into every jump. The
double girth commonly attached to these Mexican saddles is useful for keeping the
saddle in its place during one of those bouts, but there is no doubt that they
frequently make a horse buck who would not do so with a single girth. With some
animals you can never draw up the flank girth without setting them bucking.”
,AUTHOR.COLO.15565 Page 617 Thursday, January 27, 2005 12:32 PM
Matt Hutchinson was the production editor for Linux Device Drivers, Third Edition.
Octal Publishing, Inc. provided production services. Genevieve d’Entremont,
Sanders Kleinfeld, and Claire Cloutier provided quality control.
Edie Freedman designed the cover of this book, based on a series design by herself
and Hanna Dyer. The cover image is a 19th-century engraving from the Dover Picto-
rial Archive. Emma Colby produced the cover layout with Adobe InDesign CS using
Adobe’s ITC Garamond font.
Melanie Wang designed the interior layout, based on a series design by David
Futato. The chapter opening images are from the Dover Pictorial Archive, Marvels of
the New West, and The Pioneer History of America: A Popular Account of the Heroes
and Adventures, by Augustus Lynch Mason, A.M. (The Jones Brothers Publishing
Company, 1884). This book was converted by Julie Hawks to FrameMaker 5.5.6
with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and
Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the
heading font is Adobe Myriad Condensed; and the code font is LucasFont’s TheSans
Mono Condensed. The illustrations that appear in the book were produced by
Robert Romano, Jessamyn Read, and Lesley Borash using Macromedia FreeHand
MX and Adobe Photoshop CS. The tip and warning icons were drawn by Christo-
pher Bing.
,AUTHOR.COLO.15565 Page 618 Thursday, January 27, 2005 12:32 PM
This is the Title of the Book, eMatter Edition
Copyright © 2005 O’Reilly & Associates, Inc. All rights reserved.
xi
Preface
This is, on the surface, a book about writing device drivers for the Linux system.
That is a worthy goal, of course; the flow of new hardware products is not likely to
slow down anytime soon, and somebody is going to have to make all those new gad-
gets work with Linux. But this book is also about how the Linux kernel works and
how to adapt its workings to your needs or interests. Linux is an open system; with
this book, we hope, it is more open and accessible to a larger community of developers.
This is the third edition of Linux Device Drivers. The kernel has changed greatly
since this book was first published, and we have tried to evolve the text to match.
This edition covers the 2.6.10 kernel as completely as we are able. We have, this time
around, elected to omit the discussion of backward compatibility with previous ker-
nel versions. The changes from 2.4 are simply too large, and the 2.4 interface
remains well documented in the (freely available) second edition.
This edition contains quite a bit of new material relevant to the 2.6 kernel. The dis-
cussion of locking and concurrency has been expanded and moved into its own
chapter. The Linux device model, which is new in 2.6, is covered in detail. There are
new chapters on the USB bus and the serial driver subsystem; the chapter on PCI has
also been enhanced. While the organization of the rest of the book resembles that of
the earlier editions, every chapter has been thoroughly updated.
We hope you enjoy reading this book as much as we have enjoyed writing it.
Jon’s Introduction
The publication of this edition coincides with my twelth year of working with Linux
and, shockingly, my twenty-fifth year in the computing field. Computing seemed like
a fast-moving field back in 1980, but things have sped up a lot since then. Keeping
Linux Device Drivers up to date is increasingly a challenge; the Linux kernel hackers
continue to improve their code, and they have little patience for documentation that
fails to keep up.
,ch00.11770 Page xi Thursday, January 27, 2005 12:11 PM
This is the Title of the Book, eMatter Edition
Copyright © 2005 O’Reilly & Associates, Inc. All rights reserved.
xii
|
Preface
Linux continues to succeed in the market and, more importantly, in the hearts and
minds of developers worldwide. The success of Linux is clearly a testament to its
technical quality and to the numerous benefits of free software in general. But the
true key to its success, in my opinion, lies in the fact that it has brought the fun back
to computing. With Linux, anybody can get their hands into the system and play in a
sandbox where contributions from any direction are welcome, but where technical
excellence is valued above all else. Linux not only provides us with a top-quality
operating system; it gives us the opportunity to be part of its future development and
to have fun while we’re at it.
In my 25 years in the field, I have had many interesting opportunities, from program-
ming the first Cray computers (in Fortran, on punch cards) to seeing the minicom-
puter and Unix workstation waves, through to the current, microprocessor-
dominated era. Never, though, have I seen the field more full of life, opportunity,
and fun. Never have we had such control over our own tools and their evolution.
Linux, and free software in general, is clearly the driving force behind those changes.
My hope is that this edition helps to bring that fun and opportunity to a new set of
Linux developers. Whether your interests are in the kernel or in user space, I hope
you find this book to be a useful and interesting guide to just how the kernel works
with the hardware. I hope it helps and inspires you to fire up your editor and to
make our shared, free operating system even better. Linux has come a long way, but
it is also just beginning; it will be more than interesting to watch—and participate
in—what happens from here.
Alessandro’s Introduction
I’ve always enjoyed computers because they can talk to external hardware. So, after
soldering my devices for the Apple II and the ZX Spectrum, backed with the Unix
and free software expertise the university gave me, I could escape the DOS trap by
installing GNU/Linux on a fresh new 386 and by turning on the soldering iron once
again.
Back then, the community was a small one, and there wasn’t much documentation
about writing drivers around, so I started writing for Linux Journal. That’s how
things started: when I later discovered I didn’t like writing papers, I left the univer-
isty and found myself with an O’Reilly contract in my hands.
That was in 1996. Ages ago.
The computing world is different now: free software looks like a viable solution,
both technically and politically, but there’s a lot of work to do in both realms. I hope
this book furthers two aims: spreading technical knowledge and raising awareness
about the need to spread knowledge. That’s why, after the first edition proved inter-
esting to the public, the two authors of the second edition switched to a free license,
,ch00.11770 Page xii Thursday, January 27, 2005 12:11 PM
This is the Title of the Book, eMatter Edition
Copyright © 2005 O’Reilly & Associates, Inc. All rights reserved.
Preface
|
xiii
supported by our editor and our publisher. I’m betting this is the right approach to
information, and it’s great to team up with other people sharing this vision.
I’m excited by what I witness in the embedded arena, and I hope this text helps by
doing more; but ideas are moving fast these days, and it’s already time to plan for the
fourth edition, and look for a fourth author to help.
Greg’s Introduction
It seems like a long time ago that I picked up the first edition of this Linux Device
Drivers book in order to figure out how to write a real Linux driver. That first edi-
tion was a great guide to helping me understand the internals of this operating sys-
tem that I had already been using for a number of years but whose kernel had never
taken the time to look into. With the knowledge gained from that book, and by read-
ing other programmers’ code already present in the kernel, my first horribly buggy,
broken, and very SMP-unsafe driver was accepted by the kernel community into the
main kernel tree. Despite receiving my first bug report five minutes later, I was
hooked on wanting to do as much as I could to make this operating system the best
it could possibly be.
I am honored that I’ve had the ability to contribute to this book. I hope that it
enables others to learn the details about the kernel, discover that driver development
is not a scary or forbidding place, and possibly encourage others to join in and help
in the collective effort of making this operating system work on every computing
platform with every type of device available. The development procedure is fun, the
community is rewarding, and everyone benefits from the effort involved.
Now it’s back to making this edition obsolete by fixing current bugs, changing APIs
to work better and be simpler to understand for everyone, and adding new features.
Come along; we can always use the help.
Audience for This Book
This book should be an interesting source of information both for people who want
to experiment with their computer and for technical programmers who face the need
to deal with the inner levels of a Linux box. Note that “a Linux box” is a wider con-
cept than “a PC running Linux,” as many platforms are supported by our operating
system, and kernel programming is by no means bound to a specific platform. We
hope this book is useful as a starting point for people who want to become kernel
hackers but don’t know where to start.
On the technical side, this text should offer a hands-on approach to understanding
the kernel internals and some of the design choices made by the Linux developers.
Although the main, official target of the book is teaching how to write device drivers,
the material should give an interesting overview of the kernel implementation as well.
,ch00.11770 Page xiii Thursday, January 27, 2005 12:11 PM
剩余631页未读,继续阅读
资源评论
boer001217
- 粉丝: 3
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功