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
相关文档:
/*
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( ......
1、将文件checkout到本地目录
svn checkout path(path是服务器上的目录)
例如:svn checkout svn://192.168.1.1/pro/domain
简写:svn co
2、往版本库中添加新的文件
svn add file
例如:svn add test.php(添加test.php)
svn add *.php(添加当前目录下所有的php文件)
3、将改动的文件提交到版本库
svn commit - ......
Unix基础
登录和退出
登陆:可以用Neterm、SecureCRT等终端登陆工具〔192.168.25.12 常用软件下有〕或者
telnet、ftp命令。
1. telnet 远程终端访问
命令格式:telnet [hostname|IP address]
退出:ctrl+d or logout or exit
2. ftp 远程文件传输
......
系统
# uname -a # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue # 查看操作系统版本
# cat /proc/cpuinfo # 查看CPU信息
# hostname # 查看计算机名
# lspci -tv # 列出所有PCI设备
# lsusb -tv # 列出所有USB设备
# lsmod # ......