120 likes | 213 Views
A new device driver for a video frame grabber. Binh Tran – Lucie Ngnepieba . Term Project – Kernel Device – Summer 2006. Outline. Overview Our goals Our achievement 4. Difficulties and our solutions 5. Discovered facts and our learns 6. Future works 7. Conclusion. Overview.
E N D
A new device driver for a video frame grabber Binh Tran – Lucie Ngnepieba Term Project – Kernel Device – Summer 2006
Outline Overview Our goals Our achievement 4. Difficulties and our solutions 5. Discovered facts and our learns 6. Future works 7. Conclusion
Overview ISA greyscale card PCI color card
Goals To compile correctly on the Linux distribution 2.6.16 To improve the previous Video frame grabber device driver to support Video4Linux. To integrate the previous driver and make it work on both grayscale and color support. To work on the low-level operation of the frame grabber to support the new interrupt-driven I/O feature (if time permits).
Previous student’s works Taken from the previous student’s journal (Atulya Mahajan, Huan Keat ("Sean") Toh): The device driver ran on Linux distribution 2.6.10 and 2.6.11 The greyscale part was running good, but the color part was not working correctly The cleanup function was inconsistent Kernel panic when unload the module
Our achievements • Our HRT Frame grabber driver works well and stable with the 2.6.16.14 kernel (goal #1) • Our driver supports Video4linux (goal #2) • Our driver had improved the previous driver to work with both greyscale and color cards (goal #3) • We made our driver work properly, consistently, and non-errors for actions: load module, unload module , auto-detect different devices, no kernel panic.
Difficulties encountered and our solution 1. The HRT module is loaded, but no devices are registered, no major number shows up Sol: we generated a series of debugging messages to test, and we did fix the hrt_init_module, hrt_cleanup_module, hrt_load, hrt_unload. 2. The two cards are detected as grayscale cards, and give us a warning message about sysfs needed. Sol: Switched the two cards, reboot, and load module again. It works. We diagnose the cards slots are sensitive. Moreover, sysfs is not a main issue.
Difficulties encountered and our solution • The pci color card was not unregistered when we unload the module Sol: we fixed the hrt_cleanup and hrt_pci_cleanup functions 4. The color doesn’t display well, still get fuzzy Sol: pixel mapping between kernel buf and user buf is not correct. We did fix the grab_field function
Difficulties encountered and our solution (cont) 5. Pixels mapping among user space, kernel buffer, and I/O devices do not work correctly, the color frames are still distorted Sol: We modified the grab_field functions, and changed the resolution in the test files as well • Missing libraries needed for Video4linux Sol: installed SDL libraries. • Issues of compiling the hrttest.c that uses the Video4linux Sol: modified the Makefile • Understand the others’s source code (>65 pages with more than 3700 lines of codes) Sol: we tried to do mapping, analysis statically, and draw links among functions
Discovered facts and our learns • Learn how to read the long long source code • Learn how to debug subtle errors • Improve how to use the following techniques • Char Device driver • Memory mapped I/O • Internal mutual exclusion (spinlocks and semaphores) • Interrupt & Timer management (tasklets and kernel timer API) Learn more about Linux like making a make file, etc… • Improve knowledge about Linux
Works left To work on the low-level operation of the frame grabber to support the new interrupt-driven I/O feature (if time permits)
Conclusion We have achieved most of our main goals