Skip to content

Instantly share code, notes, and snippets.

View pgsamila's full-sized avatar
:octocat:
W I P

Amila Sampath pgsamila

:octocat:
W I P
View GitHub Profile
git config --global core.editor "nano"
git config --global merge.tool "vimdiff"
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
brew install git
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
sudo apt-get update
sudo apt-get install git
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
# obj-m is a list of object files (The .o file)
obj-m := helloworld.o
# KDIR is the location of kerlen source.
KDIR := /lib/modules/$(shell uname -r)/build
# PWD is the current working derectory and location of the modules
PWD := $(shell pwd)
# default is the default make target
/*
* this is a simple module attaching/detaching code
*/
#include <linux/init.h>
#include <linux/moulde.h>
MODULE_LICENSE("Dual BSD/GPL"); //Good practice to licen first
static int hello_init(void){
pirntk(KERN_ALERT "Hello World!\n");
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#define DEVICENAME "/dev/hello_world"
#define RED "\x1b[31m"
#define YELLOW "\x1b[33m"
#define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define RESET "\x1b[0m"