hello.c:

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("xudonglee"); static int hello_init(void)
{
printk(KERN_ALERT "Hello, world!\n");
return ;
} static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, My Dear World!\n");
} module_init(hello_init);
module_exit(hello_exit);

Makefile:

obj-m = hello.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

The files:

order in terminal:

make

insmod hello.ko

tail /var/log/messages(read the log of output)

rmmod hello.ko

tail /var/log/messages(read the log of output)

Linux kernel develop -- Hello World的更多相关文章

  1. 【嵌入式开发】 Linux Kernel 下载 配置 编译 安装 及 驱动简介

    作者 : 韩曙亮 转载请出名出处 : http://blog.csdn.net/shulianghan/article/details/38636827 一. Linux 内核简介 1. 内核功能简介 ...

  2. 提交 linux kernel 补丁流程备忘录

    1. 订阅 linux 邮件列表 linux 邮件列表 Kernel Mailing Lists 是所有 linux kernel 开源贡献者协同工作的平台,可以通过向 VGER.KERNEL.ORG ...

  3. Linux kernel make 常用选项介绍

    Linux kernel 编译方法大全记录 一.这是一个我自己写的自动make脚本: #!/bin/sh export ARCH=arm export CROSS_COMPILE=arm-linux- ...

  4. Linux Kernel代码艺术——系统调用宏定义

    我们习惯在SI(Source Insight)中阅读Linux内核,SI会建立符号表数据库,能非常方便地跳转到变量.宏.函数等的定义处.但在处理系统调用的函数时,却会遇到一些麻烦:我们知道系统调用函数 ...

  5. Linux Kernel 代码艺术——编译时断言

    本系列文章主要写我在阅读Linux内核过程中,关注的比较难以理解但又设计巧妙的代码片段(不关注OS的各个模块的设计思想,此部分我准备写在“深入理解Linux Kernel” 系列文章中),一来通过内核 ...

  6. linux kernel的中断子系统 softirq

    linux kernel的中断子系统之(八):softirq http://www.wowotech.net/irq_subsystem/soft-irq.html http://www.ibm.co ...

  7. karottc A Simple linux-virus Analysis、Linux Kernel <= 2.6.37 - Local Privilege Escalation、CVE-2010-4258、CVE-2010-3849、CVE-2010-3850

    catalog . 程序功能概述 . 感染文件 . 前置知识 . 获取ROOT权限: Linux Kernel <= - Local Privilege Escalation 1. 程序功能概述 ...

  8. linux kernel 字符设备详解

    有关Linux kernel 字符设备分析: 参考:http://blog.jobbole.com/86531/ 一.linux kernel 将设备分为3大类,字符设备,块设备,网络设备. 字符设备 ...

  9. linux kernel 杂谈

    首先介绍一下背景吧,工作三个星期了.复习了一波u-boot,跟了一下事件上报,搞了下平台设备,扣了一个内存检查代码. 想想生活是不是有点无聊.对啊,真的很无聊!!!! 无聊也没有办法啊,所以找点方法去 ...

随机推荐

  1. oracle根据分隔符将字符串分割成数组函数

    --创建表类型 create or replace type mytype as table of number;--如果定义成varchar--CREATE OR REPLACE type myty ...

  2. Web API - window - 获取滑动位置

    这两个属性都可以获取当前页面的滑动高度 虽然取到了同样的数据,但是我相信底层还是有区别的 不然不会用浪费api吧!

  3. JavaScript实例

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...

  4. 1032 - A-B 组合数学

    http://www.ifrog.cc/acm/problem/1032 1032 - A-B Time Limit:1s Memory Limit:128MByte Submissions:680S ...

  5. FragmentTabHost

    FragmentTabHost public class FragmentTabHost  extends TabHost implements TabHost.OnTabChangeListener ...

  6. media type的类型汇总

    用的比较多的是screen和print:区分打印和屏幕显示(Android,iPhone都不是手持设备handheld,都是screen设备)

  7. Activity生命周期(二)

    ------siwuxie95 在项目 ActivityLifeCircle 的 MainActivity.java 中添加方法: onCreate()  onStart()  onResume()  ...

  8. elasticsearch Java API汇总

    http://blog.csdn.net/changong28/article/details/38445805#comments 3.1 集群的连接 3.1.1 作为Elasticsearch节点 ...

  9. Linux下守护进程初探

    守护进程一直后台运行,与终端脱离,一般负责周期性地执行系统任务,服务器应用一般以守护进程进行运行.实现一个守护进程主要分为5部: 1.脱离父进程 2.setsid(可以选择再次fork) 3.umas ...

  10. 在指定控件位置弹出popup window

    先看效果图 黄色的就是弹出的popup window 首先自定义一个view用来显示,文件名为layout_my_view.xml <?xml version="1.0" e ...