You are on page 1of 5

PT 2008 ESD519

M.S RAMAIAH SCHOOL OF ADVANCED STUDIES

POSTGRADUATE ENGINEERING AND MANAGEMENT PROGRAMME (PEMP)

Department: Computer Engineering


Course: Real-Time Embedded Systems
Module Code: ESD519
Module Title: Device Driver Development
Module Leader: Shilpa Chaudhari
Assignmen
t

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 ARO
3. Maximum length of the report should not exceed 35 pages.
4. The last date for submission 21st 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 candidate’s
result will be declared as Fail
9. References - In the reference list, provide all information of literature, which you used for the
report, including books, articles, research papers etc. Use reference style as instructed during
the 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
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 programming
interface. 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 on
real hardware. This programming interface is such that drivers can be built separately from
the rest of the kernel and plugged in at runtime when needed. This modularity make Linux
driver easy to write and there are now hundreds of them available.
Device driver is a software layer that lies between the applications and the actual
device. 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 design
should 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 freedom
to determine how to handle concurrency.
Part A of the assignment make student to study common bugs occurred during the
development 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-A
Introduction:
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. Device
drivers are the biggest part of the Linux kernel. Driver code accounts for about 70% of the
code size of the Linux kernel. Bugs in device driver code are the main reason for errors in
operating systems. A bug in a device driver can crash the whole system because it runs in
kernel mode with exclusive access to the hardware, memory and CPU. Hence it is hard to
detect and fix a bug in driver code. There is need to verify Linux device drivers for correct
usage of the Linux kernel API before actually using it on device. In this part of the
assignment, the student is required to build an essay based on study and research related to
“Can 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 include
1. Brief explanation about formal methods and formal verification techniques applicable
to real world software
2. Linux kernel API which are widely used in device drivers and most critical with
respect to bug occurrence
3. Overview of the most common bugs in device driver code
4. Possibility of applying formal verification methods for fixing bugs in Linux device
drivers
5. Conclude by providing a technical summary of the developed essay

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


Page 2 of 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 C


You 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 B
Problem 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 code
2. Design test cases to demonstrate at least three of the identified race conditions
3. Generate test results by executing the designed test cases on the given cmosram
device driver code
4. 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 <asm/mc146818rtc.h> header-file).

Part C
Problem Statement:
1. Modify the given cmosram device driver code according the designed logic
2. Compile the modified cmosram device driver code
3. Add the modified cmosram device driver code in the running kernel
4. Accommodate the user interface so that user can access the modified cmosram device
driver code
5. Generate test results by executing the designed test cases on modified cmosram
device driver code
6. 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 Module
Learning Outcomes (refer Session-0 of Day 1 or the MID) and answer the following
questions 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
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 reference
list 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 to
implement system call
• copies of all your test programs used
• In particular, your report should have the following:
1. Essay on Topic given in Part A
2. Main part:
1. Design for the modification asked
2. Code description
3. 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 this
assignment.

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


Page 4 of 5
PT 2008 ESD519

Marking Scheme:
Task Marks
Part A 30
1. Explaining formal methods and formal verification techniques 5
applicable to real world software
2. Describing Linux kernel API 5
5
3. Describing the most common bugs in device driver code
4. Possibility of applying formal verification methods for Linux 8
device driver
5. Citation of references given in the list and research document 2
usage in the list
6. Concluding remark 5
Part B 30
1. Identify all possible race conditions 6
2. Designing test cases to identify race conditions 9
3. Generating test results by executing the designed test cases 6
4. Designing logic to eliminate the identified race conditions 9

Part C 40
1. Modifying the given cmosram device driver code 9
2. Compiling the modified cmosram device driver code 2
3. Adding the modified cmosram device driver code in the running 2
kernel 2
4. Accommodating the user interface
5. Generating test results on modified cmosram device driver code 9
6. Discussing the obtained results 9
• Assessing Module learning objective 3
2
• Writing proper abstract which contents the motivation, area of
work, solution, result and conclusion
2
• Writing proper conclusion on the work done
Total 100

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


Page 5 of 5

You might also like