Skip to content

Instantly share code, notes, and snippets.

View dhilst's full-sized avatar
😻

Daniel Hilst dhilst

😻
View GitHub Profile
@dhilst
dhilst / HelloWorld.c
Created May 6, 2014 16:36
JNI Hello World
#include "HelloWorld.h"
JNIEXPORT void JNICALL Java_HelloWorld_sayHello
(JNIEnv *env, jclass class)
{
puts("Hello from C world");
}
@dhilst
dhilst / Kbuild
Last active August 29, 2015 14:04
How to export out-of-tree ioctls to userspace?
CFLAGS_mymodule.o := -DDEBUG
obj-m := mymodule.o
header-y += mymodule.h
@dhilst
dhilst / gpio
Created September 8, 2015 17:12
/*
* MCP23S08 SPI/GPIO gpio expander driver
*/
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
/*
* MCP23S08 SPI/GPIO gpio expander driver
*/
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
@dhilst
dhilst / foo
Created February 16, 2013 20:00
hello gist world
bar
tar
zar
@dhilst
dhilst / Makefile
Created April 29, 2013 01:24
Driver Hello World Makefile
obj-m += gkos_char_device.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
rm *.ko *.o *.mod.c *.mod.o
@dhilst
dhilst / .config
Last active December 19, 2015 11:49
buildroot libevas error
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2013.05 Configuration
#
BR2_HAVE_DOT_CONFIG=y
# BR2_arcle is not set
# BR2_arceb is not set
BR2_arm=y
# BR2_armeb is not set
# BR2_aarch64 is not set
@dhilst
dhilst / Makefile
Last active December 19, 2015 13:29
kernel dynamic char buffer
obj-m += cdev04.o
KDIR ?= /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
@dhilst
dhilst / Makefile
Last active December 19, 2015 14:48
obj-m += llist.o
KDIR ?= /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
@dhilst
dhilst / Makefile
Created August 5, 2013 00:01
cdev06
obj-m += cdev06.o
KDIR = /home/geckos/abs/linux/src/linux-3.10
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
@rm -v *~