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
相关文档:
Linux内核中的双循环链表
2006-11-27 19:14
双循环链表传统实现
在传统的双循环链表实现中,如果创建某种数据结构的双循环链表,通常采用的办法是在这个数据结构的类型定义中加入两个(指向该类型对象的)指针next和prev。例如:
typedef struct foo {
…
struct foo *p ......
/*
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 ......
为了用vc写一个最简单的 socket 程序,花费了一个下午的时间,过程中出现的错误有:
'SOCKET' : illegal use of this type as an expression
syntax error : missing ';' before 'type'
syntax error : identifier 'InitWinsock' --> bool InitWinsock( ......
在Linux系统中,每台设备都是当成一个文件夹来对待。
设备 &nbs ......