mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Attempt migration to Buildroot 2017.08 + kernel 4.12.
Build fails at: https://git.busybox.net/buildroot/commit/?id=c128c5f3c79b31d89256ffbc5c650ba613d3d52b
This commit is contained in:
Submodule buildroot updated: 083c0735e9...8ce27bb9fe
@@ -1,3 +1,7 @@
|
||||
# Must match the Linux kernel source.
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12"
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_12=y
|
||||
|
||||
BR2_GLOBAL_PATCH_DIR="../global_patch_dir"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="../kernel_config_fragment"
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="../busybox_config_fragment"
|
||||
|
||||
@@ -10,7 +10,6 @@ This method allows getting multiple file descriptors from a single filesystem,
|
||||
which reduces namespace pollution.
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/anon_inodes.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/errno.h> /* EFAULT */
|
||||
@@ -19,6 +18,7 @@ which reduces namespace pollution.
|
||||
#include <linux/kernel.h> /* min */
|
||||
#include <linux/module.h>
|
||||
#include <linux/printk.h> /* printk */
|
||||
#include <linux/uaccess.h> /* copy_from_user */
|
||||
|
||||
#include "anonymous_inode.h"
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ in drivers (syscalls being the other one).
|
||||
Here we use debugfs.
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/errno.h> /* EFAULT */
|
||||
#include <linux/fs.h> /* file_operations */
|
||||
#include <linux/kernel.h> /* min */
|
||||
#include <linux/module.h>
|
||||
#include <linux/printk.h> /* printk */
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <uapi/linux/stat.h> /* S_IRUSR */
|
||||
|
||||
static struct dentry *debugfs_file;
|
||||
|
||||
@@ -19,10 +19,10 @@ Documentation/ioctl/ioctl-number.txt has some info:
|
||||
- https://askubuntu.com/questions/54239/problem-with-ioctl-in-a-simple-kernel-module/926675#926675
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/printk.h> /* printk */
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
|
||||
#include "ioctl.h"
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ Then see how clicking the mouse and keyboard affect the interrupts. This will po
|
||||
- 12: mouse click and drags
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
|
||||
#define NAME "lkmc_character_device"
|
||||
#define MAX_IRQS 256
|
||||
|
||||
@@ -14,13 +14,13 @@ Related:
|
||||
- https://github.com/ikwzm/udmabuf
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h> /* min */
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/slab.h>
|
||||
|
||||
static const char *filename = "lkmc_mmap";
|
||||
@@ -38,13 +38,14 @@ static void vm_close(struct vm_area_struct *vma)
|
||||
}
|
||||
|
||||
/* First page access. */
|
||||
static int vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
int (*fault)(struct vm_fault *vmf);
|
||||
static int vm_fault(struct vm_fault *vmf)
|
||||
{
|
||||
struct page *page;
|
||||
struct mmap_info *info;
|
||||
|
||||
pr_info("vm_fault\n");
|
||||
info = (struct mmap_info *)vma->vm_private_data;
|
||||
info = (struct mmap_info *)vmf->vma->vm_private_data;
|
||||
if (info->data) {
|
||||
page = virt_to_page(info->data);
|
||||
get_page(page);
|
||||
|
||||
@@ -66,7 +66,6 @@ TODO: does it have any side effects? Set in the edu device at:
|
||||
Use setpci, devmem and /sys.
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* put_user */
|
||||
#include <linux/cdev.h> /* cdev_ */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
@@ -74,6 +73,7 @@ Use setpci, devmem and /sys.
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/uaccess.h> /* put_user */
|
||||
|
||||
/* https://stackoverflow.com/questions/30190050/what-is-base-address-register-bar-in-pcie/44716618#44716618
|
||||
*
|
||||
|
||||
@@ -6,7 +6,6 @@ PCI driver for our minimal pci_min.c QEMU fork device.
|
||||
probe already does a mmio write, which generates an IRQ and tests everything.
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
@@ -14,6 +13,7 @@ probe already does a mmio write, which generates an IRQ and tests everything.
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
|
||||
#define BAR 0
|
||||
#define CDEV_NAME "lkmc_hw_pci_min"
|
||||
|
||||
@@ -6,7 +6,6 @@ Outcome: user echoes jiffies every second.
|
||||
https://stackoverflow.com/questions/30035776/how-to-add-poll-function-to-the-kernel-module-code/44645336#44645336
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/delay.h> /* usleep_range */
|
||||
#include <linux/errno.h> /* EFAULT */
|
||||
@@ -17,6 +16,7 @@ https://stackoverflow.com/questions/30035776/how-to-add-poll-function-to-the-ker
|
||||
#include <linux/module.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/printk.h> /* printk */
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/wait.h> /* wait_queue_head_t, wait_event_interruptible, wake_up_interruptible */
|
||||
#include <uapi/linux/stat.h> /* S_IRUSR */
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ Bibliography:
|
||||
- https://stackoverflow.com/questions/25399112/how-to-use-a-seq-file-in-linux-modules
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/errno.h> /* EFAULT */
|
||||
#include <linux/fs.h>
|
||||
@@ -32,6 +31,7 @@ Bibliography:
|
||||
#include <linux/printk.h> /* pr_info */
|
||||
#include <linux/seq_file.h> /* seq_read, seq_lseek, single_release */
|
||||
#include <linux/slab.h> /* kmalloc, kfree */
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <uapi/linux/stat.h> /* S_IRUSR */
|
||||
|
||||
static int max = 2;
|
||||
|
||||
@@ -8,13 +8,13 @@ This example behaves like a file that contains:
|
||||
cd
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/errno.h> /* EFAULT */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/printk.h> /* pr_info */
|
||||
#include <linux/seq_file.h> /* seq_read, seq_lseek, single_release */
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
#include <uapi/linux/stat.h> /* S_IRUSR */
|
||||
|
||||
static struct dentry *debugfs_file;
|
||||
|
||||
2
linux
2
linux
Submodule linux updated: 361bb62367...ae140b613d
Reference in New Issue
Block a user