Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sesiuni:kernel:day-5 [2013/07/04 00:29]
alexj [Tasks]
sesiuni:kernel:day-5 [2013/07/05 08:12] (current)
alexj [Tasks]
Line 28: Line 28:
 #** Most code can be reused (such as the file operations),​ but each device needs it's own instance of the struct my_device_data and each cdev structure needs to be initiated. #** Most code can be reused (such as the file operations),​ but each device needs it's own instance of the struct my_device_data and each cdev structure needs to be initiated.
 #** Use a static array of my_device_data[NUM_MINORS]. Iterate from 0 to NUM_MINORS and initiate all needed structures. #** Use a static array of my_device_data[NUM_MINORS]. Iterate from 0 to NUM_MINORS and initiate all needed structures.
 +# Unique access
 +#* Create a new character device that prints out the string "​42"​ forever (sort of like /dev/zero).
 +#* Implement only the open, read, and release file operation (make mocks for the rest).
 +#* Try to access the device driver with two cat processes (in two terminals, for example).
 +#* Attach an atomic variable to the char_device structure that keeps track of how many processes access the device
 +#* In the open handler, set the variable to 1 if is set to 0; if it's already set to 1, return -EBUSY
 +#* Try to access the device driver again with two cat processes.
sesiuni/kernel/day-5.txt · Last modified: 2013/07/05 08:12 by alexj