I'm learning to create kernel modules on Raspbian Jessie based on The Linux Kernel Module Programming Guide
Currently I'm on hello-5.c part. I tried to add static u8 myByte = 'X';
but u8
is not recognized. Then I changed u8
with uint8_t
which is the same thing AFAIK and uint8_t
is recognized as a data-type.
The older version of the tutorial here stated static u8 myByte = 'X';
, so I want to reuse it with the newer tutorial.
The older tutorial included these:
#define MODULE
#define LINUX
#define __KERNEL__
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
While the newer tutorial included these;
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/stat.h>
I've tried using the old one, but the define
part generates errors, so I used the newer tutorial.
So, why uint8_t
can be recognized while u8
cannot in the newer version?