Download presentation
Presentation is loading. Please wait.
Published byCrystal Hunting Modified over 9 years ago
1
A new device driver for a video frame grabber Binh Tran – Lucie Ngnepieba Term Project – Kernel Device – Summer 2006
2
Outline 1.Overview 2.Our goals 3.Our achievement 4. Difficulties and our solutions 5. Discovered facts and our learns 6. Future works 7. Conclusion
3
Overview ISA greyscale card PCI color card
4
Goals To compile correctly on the Linux distribution 2.6.16 To compile correctly on the Linux distribution 2.6.16 To improve the previous Video frame grabber device driver to support Video4Linux. 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 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).To work on the low-level operation of the frame grabber to support the new interrupt-driven I/O feature (if time permits).
5
Previous student’s works Taken from the previous student’s journal (Atulya Mahajan, Huan Keat ("Sean") Toh): Atulya Mahajan, Huan Keat ("Sean") TohAtulya Mahajan, Huan Keat ("Sean") Toh 1.The device driver ran on Linux distribution 2.6.10 and 2.6.11. 2. The greyscale works correctly, but the color was fuzzy. 3. The cleanup function was inconsistent 4. Kernel panic when unload the module
6
Our achievements Our device driverOur device driver – is stable with the 2.6.16.14 kernel –works properly, consistently without errors( ie load module, unload module, auto-detect different devices, no kernel panic) (goal #1) Our driver supports Video4linux (goal #2)Our driver supports Video4linux (goal #2) We improve the preview driver to support both grey scale and color cards (goal #3)We improve the preview driver to support both grey scale and color cards (goal #3)
7
Problems found in the original device driver and our solutions 1.When compiled and executed the hrt module was loaded, but: –No device was detected, –The major number did not show up Sol: we put a series of debugging messages to test, and we add code in the hrt_init_module, hrt_cleanup_module, hrt_load, hrt_unload. Sol: we put a series of debugging messages to test, and we add code in the hrt_init_module, hrt_cleanup_module, hrt_load, hrt_unload. 2. The two cards were detected as grayscale cards, and give us a warning message about sysfs needed.
8
(Cont) 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. 3.The pci color card was not unregistered when we unload the module(this prob panic the kernel when unloading). First found by Danny –Sol : we add lines of code to unregister the color card in the hrt_cleanup and hrt_pci_cleanup functions 4.Pixels mapping among user space, kernel buffer and I/O devices do not work correctly, the color display was fuzzy –Sol : pixel mapping between kernel and user buf was not correct. We changed the way the mapping was done in the grab_field function. –And set the resolution in the test file to 640 x 480.
9
(Cont) 5.Missing libraries needed for Video4linux –Sol : we installed SDL libraries that was missing and m odified the Makefile by adding the right location for those libraries
10
What we have learned Learn how to build a driver for many different cards, especially video cards, in a kernel on Linux distribution 2.6Learn how to build a driver for many different cards, especially video cards, in a kernel on Linux distribution 2.6 Learn how to dissect the long source code(>65 pages with more than 3700 lines of codes)Learn how to dissect the long source code(>65 pages with more than 3700 lines of codes) Learn how to debug subtle errorsLearn how to debug subtle errors Improve how to use the following techniquesImprove how to use the following techniques Char Device driverChar Device driver Memory mapped I/OMemory mapped I/O Internal mutual exclusion (spinlocks and semaphores)Internal mutual exclusion (spinlocks and semaphores) Use of IOCL’sUse of IOCL’s Interrupt & Timer management (tasklets and kernel timer API) Learn more about Linux like making a make file, etc…Interrupt & Timer management (tasklets and kernel timer API) Learn more about Linux like making a make file, etc… Improve knowledge about LinuxImprove knowledge about Linux
11
Works left The color display for different resolutions still needs to be doneThe color display for different resolutions still needs to be done To work on the low-level operation of the frame grabber to support the new interrupt-driven I/O feature (if time permits)To work on the low-level operation of the frame grabber to support the new interrupt-driven I/O feature (if time permits)
12
Conclusion We have achieved most of our main goals
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.