Skip to content

Latest commit

 

History

History
77 lines (67 loc) · 1.96 KB

README.md

File metadata and controls

77 lines (67 loc) · 1.96 KB

pijoy

Sega megadrive gamepad driver for raspberry pi gpio

  1. Get running kernel sources
  • find pi firmware git hash:
zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head
  • find pi kernel sources git hash:
firmware/extra/git_hash
  • get pi kernel sources
  • setup KERNEL_SRC environment variable:
export KERNEL_SRC={path-to-kernel-sources}
  • get Module.symvers from firmware repo:
cp firmware/extra/Module.symvers ${KERNEL_SRC}
  1. Get running kernel config
  • ensure configs module running:
modprobe configs
  • get running kernel config:
zcat /proc/config.gz > ${KERNEL_SRC}/.config
  1. Setup compiler tools
  • setup CCPREFIX environment variable:
export CCPREFIX=/{tools-path}/arm-bcm2708/{compiler-path}/bin/arm-linux-gnueabihf-
  • prepare kernel sources:
make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
make ARCH=arm CROSS_COMPILE=${CCPREFIX} modules_prepare
  1. Build module
  • run make within pijoy module directory:
make ARCH=arm CROSS_COMPILE=${CCPREFIX} -C ${KERNEL_SRC} M=$(pwd)
  1. Upload and run compiled module
  • upload module to pi:
scp pijoy.ko pi@raspberry:/home/pi/
  • install module on pi:
mv /home/pi/pijoy.ko /lib/modules/$(uname -r)/
  • load module on pi:
modprobe pijoy dev1=0,6

Links


Building pi kernel

Github

Pi compiler tools

Pi kernel sources

Pi firmware (kernel+modules) builds

rpi-update tool for easy firmware update

Pi firmware mirror used by rpi-update tool

rpi-source utility that installs the kernel source