2440 module test, hello world - life sucks
来源:互联网 发布:淘宝拍摄用什么镜头 编辑:程序博客网 时间:2024/05/01 17:41
hello.c
------------------------------------------------------------------------------------------
Makefile
-------------------------------------------------------------------------------------
make modules
make -C /home/fown/kernel/kernel-2.6.13 M=/home/fown/ldd/hello modules
make[1]: Entering directory `/home/fown/kernel/kernel-2.6.13'
WARNING: Symbol version dump /home/fown/kernel/kernel-2.6.13/Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] /home/fown/ldd/hello/hello.o
Building modules, stage 2.
MODPOST
CC /home/fown/ldd/hello/hello.mod.o
LD [M] /home/fown/ldd/hello/hello.ko
make[1]: Leaving directory `/home/fown/kernel/kernel-2.6.13'
--------------------------------------------------------------------------------------
2440
--------------------------------------------------------------------------------------
[root@FriendlyARM /]# insmod hello.ko
wellcome to the real world, it sucks!
[root@FriendlyARM /]# lsmod
Module Size Used by
hello 1120 0 - Live 0xbf000000
[root@FriendlyARM /]# rmmod hello
but you're gonna love it !
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
...{
printk(KERN_ALERT "wellcome to the real world, it sucks! ");
return 0;
}
static void hello_exit(void)
...{
printk(KERN_ALERT "but you're gonna love it ! ");
}
module_init(hello_init);
module_exit(hello_exit);
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
...{
printk(KERN_ALERT "wellcome to the real world, it sucks! ");
return 0;
}
static void hello_exit(void)
...{
printk(KERN_ALERT "but you're gonna love it ! ");
}
module_init(hello_init);
module_exit(hello_exit);
------------------------------------------------------------------------------------------
Makefile
KERNELDIR =/home/fown/kernel/kernel-2.6.13
PWD := $(shell pwd)
CC =/usr/local/arm/3.4.1/bin/arm-linux-gcc
obj-m := hello.o
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
PWD := $(shell pwd)
CC =/usr/local/arm/3.4.1/bin/arm-linux-gcc
obj-m := hello.o
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
-------------------------------------------------------------------------------------
make modules
make -C /home/fown/kernel/kernel-2.6.13 M=/home/fown/ldd/hello modules
make[1]: Entering directory `/home/fown/kernel/kernel-2.6.13'
WARNING: Symbol version dump /home/fown/kernel/kernel-2.6.13/Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] /home/fown/ldd/hello/hello.o
Building modules, stage 2.
MODPOST
CC /home/fown/ldd/hello/hello.mod.o
LD [M] /home/fown/ldd/hello/hello.ko
make[1]: Leaving directory `/home/fown/kernel/kernel-2.6.13'
--------------------------------------------------------------------------------------
2440
--------------------------------------------------------------------------------------
[root@FriendlyARM /]# insmod hello.ko
wellcome to the real world, it sucks!
[root@FriendlyARM /]# lsmod
Module Size Used by
hello 1120 0 - Live 0xbf000000
[root@FriendlyARM /]# rmmod hello
but you're gonna love it !
- 2440 module test, hello world - life sucks
- hello world module
- test&hello world
- hello world for test
- test hello world
- pat:hello world test
- Hello World for test
- Test Hello World
- linux kernel module - hello world
- linux的module的“hello world”程序
- linux内核驱动之hello world module
- Orchard(四):创建Module --Hello World
- a simple hello world nginx module
- java 字符串排序“hello”,“world”,“test”,“中国”
- c# hello world csc test.cs
- 2.1. Hello, World (part 1): The Simplest Module
- a hello world module for linux device driver
- Drupal——module开发实现hello world
- 一个多线程程序
- Design Float-设计类的digg网站
- 使用独立的DLL来存储图片(资源文件)
- 往事、回忆、轮回…… 《美国往事》
- C#通过ADO.NET建表
- 2440 module test, hello world - life sucks
- 一个好玩的绘画游戏
- 極意之道之簡體版
- C# 窗口全屏 隐藏任务栏 (代码)
- Glogster 在线设计自己的Flash海报
- 19 个有助提高创造力的在线工具
- java与常用数据库的连接[个人收藏]
- ChoiceExample
- DinPattern-背景图案下载