linux

 Requirements for building and using the kernel

 

Tools to build the kernel

Most linux distributions offfer an installation option to install a range of kernel backing packages.

If your distribution offers this option, it is easiest to install this instead of trying to track down all of the individual programs that are needed for this task.

-------------------------------------------------------------------------------------------------------------------------------

COMPILER

The linux kernel is write in the C programming language, with a small amount of assembly language in some places.

To build the kernel, the gcc C compiler must be used.

Most linux distributions have a package entitled gcc that should be installed.

If you wish to download the compiler and build it yourself, you can find it at http://gcc.gnu.org

 

To determine whick version of gcc you have on your system, run the following command:

$gcc --version

-----------------------------------------------------------------------------------------------------------------------------------

LINKER

The C compiler, gcc, does not all of the compiling on its own.

It needs an additional set of tools known as binutils to do the linking and assembing of source files.

The binutils package also contains useful utilities that can manipulate object files in lots of usful ways, such as to view the contents of a library.

To determine which version of binutils you have on your system, run the following command:

$ld --version

--------------------------------------------------------------------------------------------------------------------------

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.

The kernel requires the GNU version of make, which can usually be found in a package called make for your distribution.

To determine which version of make you have on your system, run the following command:

$make --version

-----------------------------------------------------------------------------------------------------------------------------------------------

UTIL-LINUX

The util-linux package is a collection of small utilties that do a wide range of different tasks.

Most  of these utilities handle the mounting and creation of disk partitions and manipulation of the hardwrare clock in the system.

To determine which version of the util-linux package you have on your system, run the following command

$fdformat --version

-----------------------------------------------------------------------------------------

module-init-tools

The module-init-tools package is needed if you wish to use linux kernel modules.

A kenel module is a loadable chunck of code that can be added to or removed from the kernel while the kernel is running.

It is useful to compile device drivers as modules and then load only the ones that correspond to the hardward present in the system.

To determine which version of the module-init-tools package your have on your system, run the following command:

$depmod --version

---------------------------------------------------------------------------------------------------------------------------------

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值