Display Panel Device Driver
In this lab, you will extend the
Virtual LED Display Panel

LED Panel has 10 virtual pins
- Pins 1 to 6 set the colour of the display.
Pins 1, 2 set the red colour in four levels
Pins 3, 4 set the green colour in four levels
Pins 5, 6 set the blue colour in four levels - Pins 7, 8 control the speed of the display in four speeds
- Pin 9 controls the direction of movement: 0 for R-L and 1 for L-R
- Pin 10 indicates if the message has changed and needs updating the display
The device also has
Device Driver
The device driver for the Virtual LED Panel (VLED Panel) follows
the same lines as the memory driver done
in class. After downloading this file, rename it
as
Use this excellent link on
Writing device drivers in Lunux: A brief
tutorial along with the code given for you to write the
necessary driver for the VLED Panel.
- Write the driver functions
panel_init() panel_release() panel_open() panel_close() panel_read() panel_write()
- Link these functions correctly to the Linux kernel interfaces
as discussed in the class using the
file_operations structure.
Compiling and Creating the Device Driver
Follow the steps below to compile your device driver. Once you get it compiled without any errors, please call your TAs or the instructor for testing your device driver.- Open a
new terminal . - Login to your file server by typing
ssh -X 10.5.0.90 - List the devices in the
/dev directory. You will see theled_panel device. - Use the
/dev/led_panel device already created for you. You don't need to use themknod command to create a new device. - Set the device
major number correctly in your device driver code. - Download this Makefile and compile
your code typing
make . Make sure there are no errors and that a.ko file has been created.
Testing the Device Driver
Do the following to test the device driver.
- Launch the VLED Panel device by typing
to run it in the background.python led_panel.py /dev/led_panel & - Set the VLED Panel to display messages in light PINK colour, (i.e. bright Red + slightly less blue and green colours), at a speed of 2 and from Right-to-Left.
- Display the Message
Advanced Operating Systems on the VLED Panel.
You are free to try the different options and messages to see how long a message may be displayed or any other tests you can think of.