KernelDriverProgrammingCourse2015/OutlineDay2
Jump to navigation
Jump to search
Kernel Driver Programming Course Day 2
- Intro
- Welcome
- Results of the first course day, a number of changes have been queued up for merging into the official kernel sources
- Some further changes are queued up in my sunxi-wip branch as they rely on the pmic for otg vbus-detection and the matching pmic code is not yet merged upstream
- Plan for today:
- Kernel is an intermediate between hardware and applications, a device driver typically has 2 interfaces, one side talking to the hardware, and another side talking to userspace
- i2c hardware and driver basics
- Looking at a userspace interface from a userspace pov: input devices / evdev
- Looking at evdev from the kernel side
- Handson
- i2c hardware and driver basics
- i2c hardware basics
- Exploring an i2c device using i2cdetect and i2cget
- Looking at a basic i2c driver
- Lunch Break
- Looking at a userspace interface from a userspace pov: input devices / evdev
- evemu-record demo
- Looking at evdev from the kernel side
- Looking at an example of an i2c input driver
- Handson
- Building and running your own kernel
- Build and install u-boot for your board using the instructions from Day 1
- Cross compile your own kernel, following the [[KernelDriverProgrammingCourse2015/PreparationDay2 preparation instructions] for today
- Install this kernel by copying arch/arm/boot/zImage to the cards boot partition
- Also copy over the build dtb files arch/arm/boot/dts/sun?i-*.dtb to the dtb dir under the boot partition
- Boot your board, login as root and do "uname -a" to verify that the board is running your kernel
- Building and running a standalone driver
- On your laptop download the basic i2c driver, edit the Makefile adjusting the path to the linux kernel sources and CROSS_COMPILE= settings to match your system
- Type "make" to build the driver, and then transfer the generated .ko file to your ARM board
- On your arm system do "insmod i2c-basic-drv.ko" and then "lsmod" to verify that the module has loaded
- Pick a project and start working on it
- Any project from the list will do, basically there are 3 options to chose from:
- Projects to enable features and or complete boards in u-boot / devicetree as done during [[KernelDriverProgrammingCourse2015/OutlineDay1 | day 1].
- Writing an i2c input device driver, as discussed today, either a Silead GSL1680 touchcreen driver, Focaltech ft5x touchscreen driver, Memsic MXC622X accelerometer driver, Freescale MMA7660 or MMA8452 accelerometer driver or a Bosch BMA250 accelerometer driver.
- Any other project from the list
- Building and running your own kernel