Ingen lysbildetittel - Department of Computer and Information Science
Ingen lysbildetittel - Department of Computer and Information Science Ingen lysbildetittel - Department of Computer and Information Science
20 Register file functions • Create a struct file_operations which has links to functions: static struct file_operations foobar_fops = { } .owner = THIS_MODULE, .open = foobar_open, .release = foobar_release, .read = foobar_read, // etc. • Call cdev_init with the structure as argument (to tell the kernel how to use those functions)
21 Use of hardware (I/O ports) • Need to request for access to hardware with request_region • Otherwise, use the I/O ports in the same way as in exercise 2 • release_region when done
- Page 1 and 2: 1 Tutorial Lecture for Exercise 3 T
- Page 3 and 4: 3 Exercise 3 • Deadline: Friday 2
- Page 5 and 6: 5 The Scorched Land Defence Use you
- Page 7 and 8: 7 LINUX on STK1000 • Use SD card
- Page 9 and 10: 9 IO devices in Linux • IO device
- Page 11 and 12: 11 Compiling new kernel • Source
- Page 13 and 14: 13 Audio • Write audio data to /d
- Page 15 and 16: 15 Creating drivers • 1st source
- Page 17 and 18: 17 Startup and shutdown of the modu
- Page 19: 19 File functions • The driver co
- Page 23 and 24: 23 Loading and removal of the modul
- Page 25 and 26: 25 Tips • Start early. Biggest ex
20<br />
Register file functions<br />
• Create a struct file_operations which has links to<br />
functions:<br />
static struct file_operations foobar_fops = {<br />
}<br />
.owner = THIS_MODULE,<br />
.open = foobar_open,<br />
.release = foobar_release,<br />
.read = foobar_read, // etc.<br />
• Call cdev_init with the structure as argument (to tell<br />
the kernel how to use those functions)