1. openSUSE是一款优秀的linux。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
2.选择默认虚拟机
3.选择稍后安装操作系统
4.选择linux opensuse
5. 选择默认虚拟机名称
6.设置处理器为双核。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
7.内存设置为2G
8. 选择网络地址转换
9.设置IO控制器
10. 选择默认磁盘类型
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
11.创建一个新的虚拟磁盘
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
12.设置磁盘大小
13.选择路径保存虚拟磁盘
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
14. 完毕虚拟机创建
15.设置虚拟机
16.选择opensuse镜像
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
17.开启虚拟机
18.虚拟机启动
19.安装opensuse
20.安装程序载入
21.系统启动中
22.系统初始化中
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
23.选择中文,開始安装
24.允许协议
25.单击下一步。这两步兴许完毕
26.单击下一步
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
27.同步NTPserver
28.单击下一步
29.选择KDE桌面
30.设置账户password
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
31.開始分析系统
32.開始安装软件
33.全选全部的选项
C/C++开发
Linux内核驱动开发
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
34.開始安装
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
35.安装中
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
36.安装进行时
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
37.安装完毕进入界面
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
38.写一个C语言的helloworld
39.启动终端
40.进入路径
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
41.编译运行
42.写一个C++的代码1,cc
43. 打印语句,C++
44.打印出结果
45. 驱动的helloworld
#include <linux/init.h> //驱动初始化
#include <linux/module.h>//驱动模块
MODULE_LICENSE("Dual BSD/GPL");//遵循linux协议
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");//打印驱动信息
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");//打印驱动信息
}
module_init(hello_init);//打印驱动初始化信息
module_exit(hello_exit);//打印驱动结束信息
46.q驱动的编译选项,注意all,clean以下的操作前面都要加tab键
pwd = $(shell pwd)
KERNEL_SRC = /lib/modules/$(shell uname-r)/build
obj-m := hello.o
module-objs := hello.o
all:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
clean:
rm *.ko
rm *.o
47.编译驱动
48 超级管理员载入驱动
49 看到驱动输出
50 卸载驱动,并查看
51驱动退出。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRjYXN0Y3Bw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
52遍历全部驱动
53. 驱动程序list
54.
这个时候openSUSE CCPP以及Linux内核驱动开发环境搭建完毕,希望大家认真实践。