esd528 assignmnet-pt08-1

Upload: nyjilgeorge1

Post on 09-Apr-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 ESD528 Assignmnet-PT08-1

    1/5

    PT 2008 ESD519

    M.S RAMAIAH SCHOOL OF ADVANCED STUDIES

    POSTGRADUATE ENGINEERING AND MANAGEMENT PROGRAMME (PEMP)

    Department: Computer EngineeringCourse: Real-Time Embedded Systems

    Module Code: ESD519Module Title: Device Driver Development

    Module Leader: Shilpa Chaudhari

    INSTRUCTIONS TO CANDIDATES:

    1. The assignment has three parts Part A (30 marks), Part B (30 marks) and Part C (40 marks)2. It is required to submit word processed assignment report to ARO3. Maximum length of the report should not exceed 35 pages .4. The last date for submission 21 st February 2011 .5. You are required to implement the assignment using Linux PC which is available in computer

    laboratory of the center.6. You may have to demonstrate any parts designed, and should answer queries made by the

    module leader. Finally the evaluation will be based on your work and report.7. Feel free to discuss ideas with others in the class; however, your solutions should be your

    own work. However the report submitted by each individual must be unique and you should be in a position to answer any queries.

    8. No group work is permitted. If plagiarism or collusion of any kind is found, the candidatesresult will be declared as Fail

    9. References - In the reference list, provide all information of literature, which you used for thereport, including books, articles, research papers etc. Use reference style as instructed duringthe foundation course.

    10. At the end of the Assignment, the student would be required to assess the Assignment itself with respect to its utility and Module Learning Outcomes.

    February 2011

    Form 43 Ver: 1 Date: 01-11-2007

    Page 1 of 5

    Assignment

  • 8/7/2019 ESD528 Assignmnet-PT08-1

    2/5

    PT 2008 ESD519

    Introduction:Device driver takes the special role in Linux kernel. They are distinct black coxes that

    make a particular piece of hardware respond to a well defined internal programminginterface. They completely hide the details of how the device works. User activities are

    performed by mean of a set of standardized calls that are independent of the specific driver.

    The role of the device driver is to map those calls to device specific operations which act onreal hardware. This programming interface is such that drivers can be built separately fromthe rest of the kernel and plugged in at runtime when needed. This modularity make Linuxdriver easy to write and there are now hundreds of them available.

    Device driver is a software layer that lies between the applications and the actualdevice. These drivers can be for virtual devices or software drivers. This privileged role of the driver allows the driver programmer to choose exactly how the device should appear.Different drivers can offer different capabilities for the same device. The actual driver designshould be a balance between many different considerations. For instance, a single device may

    be used concurrently by different programs and the driver programmer has complete freedomto determine how to handle concurrency.

    Part A of the assignment make student to study common bugs occurred during thedevelopment of device driver and usage of formal verification techniques to avoid those bugs.Part B and Part C involves evaluation of cmosram device driver to avoid race condition.

    Part-AIntroduction:

    Device drivers are part of the Linux kernel and are responsible for the communication between hardware and other parts of the kernel and user software, respectively. Devicedrivers are the biggest part of the Linux kernel. Driver code accounts for about 70% of thecode size of the Linux kernel. Bugs in device driver code are the main reason for errors inoperating systems. A bug in a device driver can crash the whole system because it runs inkernel mode with exclusive access to the hardware, memory and CPU. Hence it is hard todetect and fix a bug in driver code. There is need to verify Linux device drivers for correctusage of the Linux kernel API before actually using it on device. In this part of theassignment, the student is required to build an essay based on study and research related toCan formal methods and formal verification techniques be applied to Linux Device Driver?

    Problem statement:Write an essay on Can formal methods and formal verification techniques be applied

    to Linux Device Driver? The essay must include1. Brief explanation about formal methods and formal verification techniques applicable

    to real world software2. Linux kernel API which are widely used in device drivers and most critical with

    respect to bug occurrence3. Overview of the most common bugs in device driver code4. Possibility of applying formal verification methods for fixing bugs in Linux device

    drivers5. Conclude by providing a technical summary of the developed essay

    Form 43 Ver: 1 Date: 01-11-2007

    Page 2 of 5

  • 8/7/2019 ESD528 Assignmnet-PT08-1

    3/5

    PT 2008 ESD519

    Guidelines for Submission: You are advised to use only simple sentences, but quotes and figures can be

    reproduced from literature with citation Expression of your own views through discussions on topics you come across while

    developing the essay will be appreciated

    The word processed essay should not exceed more than three A4 size pages

    Introduction Part B and CYou have studied original 'cmosram.c' driver-code during classroom sessions. In this part of the assignment, you need to modify it to avoid race conditions with it.

    Part BProblem Statement:

    Modify the cmosram.c device driver to avoid race conditions.Students are required to perform the following steps:1. Identify all possible race conditions that are present in the given cmosram device

    driver code2. Design test cases to demonstrate at least three of the identified race conditions3. Generate test results by executing the designed test cases on the given cmosram

    device driver code4. Design logic to eliminate the identified race conditions from the given cmosram

    device driver code (Hint: Use the 'rtc_cmos_read()' and 'rtc_cmos_write()' functions(prototyped in the header-file).

    Part CProblem Statement:

    1. Modify the given cmosram device driver code according the designed logic2. Compile the modified cmosram device driver code3. Add the modified cmosram device driver code in the running kernel4. Accommodate the user interface so that user can access the modified cmosram device

    driver code5. Generate test results by executing the designed test cases on modified cmosram

    device driver code6. Discuss the obtained results

    Following are the extra information you need to consider while making the report: Assessment of Utility and Learning Outcomes: Please go through the ModuleLearning Outcomes (refer Session-0 of Day 1 or the MID) and answer the followingquestions in short paragraphs after you have completed the rest of this Assignment.

    1. What are the benefits you have derived by solving this Assignment?2. How is the Assignment able to asses Module Learning Outcomes?

    Please include this as a separate Chapter in your Assignment book. The student needs to write proper abstract which contain the motivation, area of work,solution, result & conclusion

    Form 43 Ver: 1 Date: 01-11-2007

    Page 3 of 5

  • 8/7/2019 ESD528 Assignmnet-PT08-1

    4/5

    PT 2008 ESD519

    The student needs to write proper conclusion at the end on the work done The student needs to cite the references given in the list at the end and the referencelist should have some research document usage

    Guidelines for Submission Part B and C: You need to submit code : submit a tar ball with the following:

    README file with (1) your names, (2) a description of how to run your test programs (show example command lines).

    copies of all .c and .h files you added or modified in the kernel toimplement system call

    copies of all your test programs used In particular, your report should have the following:1. Essay on Topic given in Part A2. Main part:

    1. Design for the modification asked2. Code description3. Present your Results.4. Explain your results!

    3. Conclusion. It should include a statement of the major result(s) of your test cases.Also, describe what you found to be the most difficult part during testing phase of thisassignment.

    Form 43 Ver: 1 Date: 01-11-2007

    Page 4 of 5

  • 8/7/2019 ESD528 Assignmnet-PT08-1

    5/5

    PT 2008 ESD519

    Marking Scheme:Task Marks

    Part A 301. Explaining formal methods and formal verification techniques

    applicable to real world software2. Describing Linux kernel API

    3. Describing the most common bugs in device driver code4. Possibility of applying formal verification methods for Linuxdevice driver

    5. Citation of references given in the list and research documentusage in the list

    6. Concluding remark

    5

    55

    8

    2

    5

    Part B 30

    1. Identify all possible race conditions2. Designing test cases to identify race conditions3. Generating test results by executing the designed test cases4. Designing logic to eliminate the identified race conditions

    6969

    Part C 40

    1. Modifying the given cmosram device driver code2. Compiling the modified cmosram device driver code3. Adding the modified cmosram device driver code in the running

    kernel4. Accommodating the user interface5. Generating test results on modified cmosram device driver code6. Discussing the obtained results

    922

    2

    99

    Assessing Module learning objective Writing proper abstract which contents the motivation, area of

    work, solution, result and conclusion Writing proper conclusion on the work done

    32

    2

    Total 100

    Form 43 Ver: 1 Date: 01-11-2007

    P 5 f 5