在网络中,不少服务器采用的是Linux系统。为了进一步提高服务器的性能,可能需要 根据特定的硬件及需求重新编译Linux内核。编译Linux内核,需要根据规定的步骤进行,编译内核过程中涉及到几个重要的文件。比如对于RedHat Linux,在/boot目录下有一些与Linux内核有关的文件,进入/boot执行:ls –l。编译过RedHat Linux内核的人对其中的System.map 、vmlinuz、initrd-2.4.7-10.img印象可能比较深刻
虚拟内存地址与实际内存地址之间的关系,是如此转换的,逻辑地址-->线性地址-->物理地址。也是从分段单元到分页单元的转换。在 linux中,用户程序所使用的地址与硬件使用的物理地址是不等同的。虚拟内存引入一个间接层,它使得许多操作成为可能。在引入虚拟内存这个概念和方法后,在系统中运行的程序可以分配比物理内存更多的内存。而linux的地址有分下面几个类型:
kernel module的实现机制浅
Tags: Linux
先说一下kernel module大概是怎么一回事。说到 linux kernel大家都感觉非常牛逼的样子,可是我们却看不见摸不着,唯一能看见的是目录中有一个二进制文件vmlinuz,一般是在boot目录下,名字叫vmlinuz。这个就是最小版的linux kernel,非常的小,一是kernel本来就小,二是这还是个压缩文件。就是这个文件会被解压缩然后装载进内存,然后它实现内核的功能。可是我们想要扩展和维护内核时怎么办,作为传统的单内核,那就只能把整个内核源码拿来再加代码,再重新编译出一个vmlinuz出来,替换掉,这非常麻烦。所以linux就从传统的单内核给改进成了kernel module机制。
伙伴算法
Linux内核内存管理的任务包括:
- 遵从CPU的MMU(Memory Management Unit)机制
- 合理、有效、快速地管理内存
- 实现内存保护机制
- 实现虚拟内存
- 共享
- 重定位
Can you tell me an exact location of Linux kernel driver under Linux file system? Where to find all available modules under Linux operating systems?
The /lib/modules/kernel-version/ directory stores all compiled drivers under Linux operating system. You can use the modprobe command to intelligently add or remove a module from the Linux kernel. The modprobe command looks in the module directory /lib/modules/$(uname -r) for all the modules and other files, except for the optional /etc/modprobe.conf configuration file and /etc/modprobe.d directory. Type the following command to display current modules directory name: