Linux World
Pages
Home
Programming
Computer Architecture
Tit Bits
Trouble Shoot
Kernel Related
Quizzes
Linux Tips
Follow @Linux_world
Search
Quiz on chapter-3 of book Linux Device Drivers- 3rd Edition
Quiz on chapter-3 of book
ldd3
In the output of "ls -l /dev" a character driver is identified by
Letter c in the second column
Letters ch in the second column
Letter c in the third column
Letter p in the first column
The argument macro MAJOR is of type
int
char
dev
dev_t
Which of the following function is used for static allocation of major number to character driver
register_char
register_chrdev_region
alloc_chrdev_region
alloc_region
The structure file_operations is a
Collection of structure pointers
Collection of function pointers
Collection of macro pointers
Collection of string pointers
The structure "file" is defined in the header file
linux/file.h
linux/filesys.h
linux/fs.h
linux/sys.h
cdev_alloc returns a pointer to
struct cdev
struct chardev
struct dev
struct device
If the file_operation implementation of read returns 0 it signifies
Empty file
End of file
No data in file
Error in reading file
The arguments passed to "open" method in a device driver are
inode pointer and file pointer
inode pointer and file_operations pointer
file_operation pointer and file_pointer
only file pointer
inode structure is used by the kernel internally to represent
Only open files
Only closed files
All files
Running Processes
We can find out the major number of a driver by looking at the file
/proc/major
/proc/devices
/proc/modules
/proc/numbers
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment