文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>编译内核必备的三个工具

编译内核必备的三个工具

时间:2007-01-17  来源:适兕

也许计划永远都是失败的,本打算是练习工作上的一个常见的配置,就是前面的那篇HA,可是因为想升级Fedora core 5到6,结果耽搁了,那么在下载的过程中,就拿出了前几天刚下载到的linux kernel in a nutshell看看,开篇,我在此也是作个简单的半汉化介绍而已。
废话就不多说了,正式开始。

如题,欲编译内核必须的三个工具分别,GCC编译器、binutils和make。下面分别作一个简单的介绍:
 GCC
linux kernel是用C语言写的,尽管在一些地方会出现一点AT&T的汇编。
GCC的主页地址http://gcc.gnu.org

The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).

We strive to provide regular, high quality releases, which we want to work well on a variety of native and cross targets (including GNU/Linux), and encourage everyone to contribute changes and help testing GCC. Our sources are readily and freely available via SVN and weekly snapshots.

Major decisions about GCC are made by the steering committee, guided by the mission statement

也就是说gcc不止是C,例如我们经常遇到的gcj。
这是我在我的Fedora core 5上执行的查看其版本信息的输出。
[root@lee pam.d]# gcc --version
gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
Copyright (C) 2006 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
[root@lee pam.d]# ld -v
GNU ld 版本 2.16.91.0.6 20060212

[root@lee pam.d]# make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

二、链接器
  The GNU Binutils are a collection of binary tools. The main ones are:
  • ld - the GNU linker.
  • as - the GNU assembler.

But they also include:

  • addr2line - Converts addresses into filenames and line numbers.
  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.
  • gprof - Displays profiling information.
  • nlmconv - Converts object code into an NLM.
  • nm - Lists symbols from object files.
  • objcopy - Copys and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.
  • windres - A compiler for Windows resource files.

Most of these programs use BFD, the Binary File Descriptor library, to do low-level manipulation. Many of them also use the opcodes library to assemble and disassemble machine instructions.

尽管我们只需要其中的一个ld。但不要妨碍人家发展。

三、make 构建工具
大名鼎鼎的make,没错,就是它!
make is a tool that walks the kernel source tree to determine which files need to be compiled, and then calls the compiler and other build tools to do the work in
building the kernel.
http://www.gnu.org/software/make/从这里可以得到更多的关于make的介绍。

接下来讲的是几个使用内核的工具:
 util-linux
[root@lee pam.d]# fdformat --version
fdformat (util-linux 2.13-pre6)
[root@lee pam.d]# which fdformat
/usr/bin/fdformat
[root@lee pam.d]# rpm -qf /usr/bin/fdformat
util-linux-2.13-0.20

module-init-tools
[root@lee pam.d]# depmod -V
module-init-tools 3.2-pre9
文件系统工具fsck.jfs,quota等。
还有下面这几个:
[root@lee pam.d]# udevinfo -V
udevinfo, version 084
[root@lee pam.d]# ps --version
procps version 3.2.6

[root@lee pam.d]# pccardctl -V
pcmciautils 011
Copyright (C) 2004-2005 Dominik Brodowski, (C) 1999 David A. Hinds
Report errors and bugs to <[email protected]>, please.
附件中是这篇文章!
文件: ch02.pdf
大小: 240KB
下载: 下载
相关阅读 更多 +
排行榜 更多 +
儿童学英语

儿童学英语

学习教育 下载
今天开始生存

今天开始生存

动作格斗 下载
飞碟快闪

飞碟快闪

动作格斗 下载