Anda di halaman 1dari 4

Lab 6 Report

by Matthew Smith
ECEN 449-505
Introduction
In this lab, I created device drivers in an embedded in a Linux environment. These device
drivers serve as a bridge between the kernel space and the user space in a computer system. They
facilitate access and sharing of hardware.

Procedure
1. First, I created a new kernel module called multiply.c. It mapped the virtual address of
the multiply peripheral and wrote values to the registers.
2. I then complied the module, launched Linux on the Zybo board, mounted the SD card to
board, and ran the multiply program using insmod.
3. After I ran the module, I created another module named multiplier.c. This module did
the same tasks as the first module except, it used char devices to take a user input and
wrote those input to the registers in the multiply peripheral.
4. Next, I complied and ran this module on the Zybo board. After I ran it, I created the
device file using mknod.
5. I then created and ran a test program for the multiplier module called devtest.c. This
simply opened the device file and gave it an input and displayed the results.

Results
When I ran the multiply module, it displayed the values in each input register and the
result in the output register. The operation was 7*2=14. When I ran devtest on multiplier, it
looped through multiplying every number between 0 and 16 and displayed their results. The
images are displayed at the end of this report.

Conclusion
This lab was very useful because it gave me a better understanding how programs bridge
the gap between the user space and the kernel space in computers. This will be helpful later on as
I do more advanced kernel programming.

Questions
a) When ioremap is called, the kernel makes the mapped memory accessible to the driver.
If it is not called, then the memory cannot be used.
b) I expect the overall performance time to be better in lab 3 because nothing had to be
written to a file. It was written directly to the register.
c) Lab 3 Benefits: It has a faster performance time. Lab 3 Costs: Debugging a program like
this would be harder since you do not have to support of the Linux kernel. Lab 6
Benefits: Debugging a program like this is easier since you have the support of the Linux
kernel. Lab 6 Costs: It has a slower performance time.
d) Device registration comes last because the kernel need to make the memory accessible to
the driver first. Device un-registration comes first because the memory would be able to
be accessed otherwise and the files could possibly become corrupt.

Anda mungkin juga menyukai