Running environment: linux-2.6.12
Compile environment: arm-linux-gcc(3.4.1)
Running platform: AT91RM9200
Write the module program testmodule.c
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux /module.h>
static int hello_init(void)
{
printk("Hello! This is the first test module!\ ");
return 0;
}
static void hello_exit(void)
{
printk("Module exit! Bye Bye!\ ");
return;
}
module_init(hello_init) ;
module_exit (hello_exit);
MODULE_LICENSE ( "GPL");
II prepared Makefile
Obj-m := testmodule.o
KDIR := /src/linux-2.6.12
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR SUBDIRS=$(PWD) modules
################################################################### ##########
Note: "$ (MAKE)" to a space in front of a "Tab"
KDIR kernel path, this The kernel must be the same as the kernel running on the AT91RM9200 (the compiler must be the same, or it won't run) .
Three, compile
Execute under linux: make CC=/src/3.4.1/bin/arm-linux-gcc
/*Note: /src/3.4.1/bin/arm-linux-gcc Path for cross-compilation environment*/
Generate testmodule.ko
IV, run
1. Download testmodule.ko to the board of AT91RM9200 through the serial port or network port.
2. Execute: chmod +x testmodule.ko Modify the properties of the module to make it an executable file
3, Execute: insmod testmodule.ko
Hello! This is the first test module!
Execution: rmmod testmodule.ko
Module exit! Bye Bye!
Tizen 1.0 was released, and Taize is a Linux-based open source software platform that runs on smartp
First look at the TCP server side of the program: #include <stdlib.h> #include <stdio.h>
1. Lock the redundant self-built account in the systemCheck method:Execute the command#cat /etc/pas
With the increasing use of Linux, there are a large number of network servers using the Linux operat
Linux wc command parameters and usage details
Remote access method for Linux and Windows operating systems
The principle of Windows CE cross-process memory injection
The linux shell implements multiple methods of random numbers (date, random, uuid)
Linux hwclock display and setting hardware clock command details
Use sz download and rz to upload files under SecureCRT
AMD says non-Android/Linux/Win systems are meaningless
Apache configuration virtual host +SSL
Simple comparison of linear power supply, thyristor power supply, switching power supply circuit
How to solve the problem of WP8.1 mobile phone contact display
Win10 registry adds right-click jump function to edit registry
How to solve the problem of Win7 laptop battery charge?
Meeting season: The world in the eyes of the giants
Windows XP cool search skills two
When the notebook hits the SBA U disk, I want to "steal" the data.
The font is too small. How to change the system font size under Win10
How to make the computer switch malfunction in Windows XP system
When prompted to start the vi editor in Linux, prompt E325: What should ATTENTION do?