Question: Step 1 : create an entry in proc file system named myproc when the kernel module is loaded; this entry myproc will be deleted when

Step 1: create an entry in proc file system named myproc when the kernel module is loaded; this entry myproc will be deleted when the kernel mode is deleted. You can use $ ls /proc/ to check whether it is existed. (Hint: proc_create() and remove_proc_entry() are needed.) Step 2: implement read_proc and write_proc function to read/write the proc file entry in Step 1. You need to add codes for allocating memory in init_module and releasing the memory in cleanup_module for the proc file entry. (Hint: copy_to_user() is needed for the read and copy_from_user() is needed for write.) To test your results, load the kernel module and there should be a new entry created under /proc. Use cat and echo to verify and change the content of the new entry.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!