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
相关文档:
目的:
本文是《一种定位内存泄露的方法(Solaris)》对应的Linux版本,调试器使用gdb。主要介绍实例部分。其他请见《一种定位内存泄露的方法(Solaris)》。
实例:
模拟new失败的程序:
#include <stdexcept>
class ABC
{
public:
virtual ~ABC(){}
&nb ......
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 ......
因为公司的板子上键盘不好按,所以写个网络版的,方便调试。
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 ......