Teach my daughter (5th year CS student) to build a Linux system character driver(repost)
$100-500 USD
Đã hoàn thành
Đã đăng vào hơn 17 năm trước
$100-500 USD
Thanh toán khi bàn giao
My daughter is a 5th year computer science student and is about to graduate. She is having an issue with understanding Linux system programming as it pertains to character drivers. I am looking for someone to get her up to speed so that she can complete her assignment. I am not neccesarily looking for someone to give her the answer to her assignment - she needs to know the topic. This needs to be tackled ASAP as her assignment is due soon.
Please let me know how much time this will take you and how much money you request for this task.
## Deliverables
(I am sorry to have to keep re-posting this - trying to get RAC satisfied with the deliverables) The data below can also be viewed here in the actual project site (section number 2): [login to view URL]~cs153a/projects/[login to view URL] While I don't really want you to build the required project below (just tutor my daughter through the project via email or phone) - the required end product that is built between you and my daughter should follow the specifications that are spelled out below. # Character device driver * Character drivers are common and useful. Here is an overview of character drivers in Linux 2.6. You will be writing a similar driver to the SCULL driver presented in this chapter. Please note, that the file_operations data structure described in the document is not what is currently available to us in linux/fs.h. Our file_operations data structure is defined here. * Your driver will manipulate a piece of memory as if it were a device. The goal of this part of the project is to get you comfortable writing character drivers and to help familiarize yourself with the Linux 2.6 interface to do so. You can start with this file, rename the methods as you wish, but be sure to update the file_operations structure if you do so. Build the driver using this Makefile (replace MNAME (if needed) and KDIR). This module compiles and loads in UML. Check that this works before proceeding. * Once you load the module with insmod, use dmesg: UML# dmesg|tail, to see the system messages. You should see something like init cs153a major#: 254 The major number may be different. Use this number to make a node through which users can access your device: UML# mknod /dev/cs153a c 254 0 Look up what this command does to make sure that you understand what is going on above. E.g. what does the 0 mean? Now you can access you char driver. Char drivers are accessed on a per-process basis -- different from block devices that we can mount for all to use. A sample file is here that accesses the device. Notice that the functions used are the same ones that we use to manipulate files. This universal file-based interface is a key to the success of UNIX in general and Linux in particular. Code exercise 3 Extend the driver and the test program to do something interesting. Have the driver access memory instead of a real device. Your driver should operate as a loop-back network interface. Data written (string of chars for simplicity) should be queued in memory until a read operation occurs at which strings are fetched from the queue to the user. Note that your queue may overflow, in which case your driver should log an error with the kernel. A device write/read should insert/remove one string into/from the queue. Use your ioctl call to provide users a way to debug your driver. Use different ioctl commands to report different status information about the various calls. In your [login to view URL], state in details what you did for this extension. Your test.c should test your routines, so if you add any functions, extend the test.c program to make use of them.
## Platform
This project requires Linux system programming knowledge in a current version of Linux. That I am aware of, the exact OS should not really matter for this task.