linux根文件系统与initrd(转)
1
根文件系统
简单来说,(根文件系统)就是系统第一个
mount
的文件系统
Filesystem
Handling
Like
every
traditional
Unix
system,
Linux
makes
use
of
a
system 's
root
filesystem
:
it
is
the
filesystem
that
is
directly
mounted
by
the
kernel
during
the
booting
phase
and
that
holds
the
system
initialization
scripts
and
the
most
essential
system
program.
Other
filesystems
can
be
mounted
either
by
the
initialization
scripts
or
directly
by
the
users on
directories
of
already
mounted
filesystems.
Being
a
tree
of
directories
every
filesystem
has
its
own
root
directory.
The
directory
on
which
a
filesystem
is
mounted
is
called
the
mount
point.
A
mounted
filesystem
is
a
child
of
the
mounted
相关文档:
linux中一共有32种信号,在/usr/include/bits/signum.h 头文件中可以看到
#define SIGHUP 1 /* Hangup (POSIX). */
#define SIGINT 2 /* Interrupt (ANSI).& ......
1.下载linux kernel源代码
到http://www.kernel.org/下载linux内核源代码,这里我们使用2.6.24.4的内核.
解压linux-2.6.24.4.tar.bz2
[matt@localhost GEC2410]$ tar -xvjf linux-2.6.24.4.tar.bz2
[matt@localhost GEC2410]$ cd linux-2.6.24.4
2.修改Makefile,设置交叉编译器
ARCH ?= arm
CROSS_COMPILE ......
#include <unistd.h>
int daemon(int nochdir,int noclose)
在创建精灵进程的时候,往往需要将精灵进程的工作目录修改为"/"根目录
并且将标准输入,输出和错误输出重定向到/dev/null
daemon的作用就是当参数nochdir为0时,将根目录修改为工作目录
noclose为0时,做输入,输出以及错误输出重定向到/dev/null
执 ......
Linux 安装中文包
首先,安装中文包:
#yum groupinstall chinese-support
其次,修改一下字符编码的配置。
# vi /etc/sysconfig/i18n
修改后内容如下:
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030"
SYSFONT="latarcyrheb-sun16"
最后重启服 ......
因为公司的板子上键盘不好按,所以写个网络版的,方便调试。
client .c
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#inclu ......