Linux Device Drivers (3rd Edition) [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Linux Device Drivers (3rd Edition) [Electronic resources] - نسخه متنی

Jonathan Corbet, Greg Kroah-Hartman, Alessandro Rubini

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








Chapter 6. Advanced Char Driver Operations


In Chapter 3, we built a
complete device driver that the user can write to and read from. But
a real device usually offers more functionality than synchronous
read and write. Now that
we're equipped with debugging tools should something
go awryand a firm understanding of concurrency issues to help
keep things from going awrywe can safely go ahead and create a
more advanced driver.

This chapter examines a few concepts that you need to understand to
write fully featured char device drivers. We start with implementing
the ioctl system call, which is a common
interface used for device control. Then we proceed to various ways of
synchronizing with user space; by the end of this chapter you have a
good idea of how to put processes to sleep (and wake them up),
implement nonblocking I/O, and inform user space when your devices
are available for reading or writing. We finish with a look at how to
implement a few different device access policies within drivers.

The ideas discussed here are demonstrated by way of a couple of
modified versions of the scull driver. Once
again, everything is implemented using in-memory virtual devices, so
you can try out the code yourself without needing to have any
particular hardware. By now, you may be wanting to get your hands
dirty with real hardware, but that will have to wait until Chapter 9.


    / 202