Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1260234
  • 博文数量: 548
  • 博客积分: 7597
  • 博客等级: 少将
  • 技术积分: 4224
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-15 13:21
个人简介

嵌入式软件工程师&&太极拳

文章分类

全部博文(548)

文章存档

2014年(10)

2013年(76)

2012年(175)

2011年(287)

分类: LINUX

2011-03-01 00:19:12

编译 内核
先     生成 .config
.config  is  etc of Makefile

make vmlinux 生成 vmlinux is elf
make Image   生成 image  is bin
make zImage  生成 zImage  is compress bin have uncompress zip
make modules 生成        become  module


Kconfig -> make menuconfig -> .config -> makefile(obj-$(CONFIG_xxx) += xxx.o) -> Make

.config -> include/linux/autoconf.h  (if CONFIG_XXX=y then #define CONFIG_XXX)
if(is module) then #define CONFIG_XXX_MODULE


kernel.header  只有头文件
kernel.devel    源文件

make M=//M is var in Makefile
make modules_install  生成在目录  /lib/modules
make modules_install INSTALL_MOD_PATH=/arm/qt2440_root/
就生成在目录 /arm/qt2440_root/lib/modules

modprobe

touch modules.dep
path/mde.ko: path/xx.ko
path/xx.ko:

dempod -a -b path/  version  
   将到lib/modules/ 生成所有模块的依赖

make s3c2410_defconfig
内核提供的相应平台的config

#include

解决与平台相关的头文件引用 使用让  asm 连接 到 相应 asm-arch

每个进程都有一个内核栈  内核程序数使用调用他的进程的内核栈
进程的内核空间以8k对齐。 高为栈, 最底部为thread_info have pointer to task_struct



头文件尽量 在.c 文件里 #include  不然容易 (李不称)
在.h中用#include的情况只有
#include "other.h"
struct something {
int a;
int b;
struct other sss;
};

对于下面情况 这样:
struct other no;
struct something {
int a;
int b;
struct other *sss;
};
阅读(617) | 评论(0) | 转发(0) |
0

上一篇:arm笔记八之laili

下一篇:Qt编译

给主人留下些什么吧!~~