linux内核移植s3c2410,准备工作
1.首先是获得linux内核源码,好像是废话,下载地址如下:ftp://ftp.kernel.org/pub/linux/kernel/v2.6/下载:
linux-2.6.16.22.tar.bz2 patch-2.6.22.6.bz2
上面一步需要说明的是一般而言,linux内核的各个补丁文件是根据某个linux内核的版本号来作的patch。
将上面的两个压缩文件解压:
tar jxvf linux-2.6.22.tar.bz2
tar jxvf patch-2.6.22.6.bz2
cd linux-2.6.22
patch -p1 < ../patch-2.6.22.6
2.linux内核源码结构和Makefile分析
linux内核源码的结构比较清晰,我就不罗嗦了,如果对于linux源码的结构不是很了解的话,可以参考下面的文章
http://www.kerneltravel.net/kernel-book/%E7%AC%AC%E4%B8%80%E7%AB%A0%E8%B5%B0%E8%BF%9Blinux/1.6.2.htm
对于移植linux到s3c2410而言,主要的工作目录是/arch/arm/下。
在windows中大多是IDE来负责项目的管理,但是在linux中主要是通过Makefile来实现相应的功能。Makefiie主要有下面的
三个作用:
1.首先决定编译那些文件
2.怎样编译这些文件
3.如何链接这些编译完的文件,他们的顺序有是什么。
###################
1.首先决定编译那些文件
##################
linux中Makefie体系:
在linux内核文件夹中的Documentation/kbuild/makefiles.txt中对内核中的Makefile中提供了详细的信息:
The Makefiles have five parts:
Makefile the top Makefile. 顶层的Makefile
.config the kernel configuration file.配置文件,在顶层的Makefile中使用.config来决定使用那些文件
arch/$(ARCH)/Makefile the arch Makefile.和体系平台相关的Makefile
scripts/Makefile.* common rules etc. for all kbuild Makefiles.Makefile公用的通用规则,脚本等。
kbuild Makefiles there are about 500 of these.各个子目录下的Makefile,被该上层的Makefile调用
The top Makefile reads the .config file, which comes from the kernel
configuration process.
顶层的Makefile读取.config中的信息,这些.config信息来自于make menuconfig中
The top Makefile is responsible for building two major products: vmlinux
(t
相关文档:
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
/*
coder: ACboy
date: 2010-3-14
result: 1A
description: UVa 327 Evaluating Simple C Expressions
*/
#include <iostream>
#include <algorithm>
using namespace std;
struct Node {
char name;
int value;
int lastValue;
int pos;
};
int cmp(const Node & a, const Node &a ......
GCC 支持了许多不同的语言,包括 C、C++、Ada、Fortran、Objective C,Perl、Python 和 Ruby,甚至还有Java。
Linux 内核和许多其他自由软件以及开放源码应用程序都是用 C 语言编写并使用 GCC 编译的。
编译C++程序:
-c 只编译不连接
g++ file1 -c -o file1.o
g++ file2 -c -o file2.o
g++ f ......
2)编译阶段
(Compiling)
第二步进行的是编译阶段,在这个阶段中,Gcc首先要检查代码的规范性、是否有语法错误等,以确定代码的实际要做的工作,在检查无误后,Gcc把代码翻译成汇编语言。用户可以使用”-S”选项来进行查看,该选项只进行编译而不进行汇编,生成汇编代码。
选项 -S
用法:[root]# gcc &ndash ......
Linux Grep命令使用的详细介绍
1. grep简介
grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行
打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。Unix的
grep家族包括grep、 egrep和fgrep。egrep和fgrep的命令只跟grep有很小不 ......