Linux 内存管理 重要结构体 (转)

Tags: Memory   Linux  

虚拟内存地址与实际内存地址之间的关系,是如此转换的,逻辑地址-->线性地址-->物理地址。也是从分段单元到分页单元的转换。在 linux中,用户程序所使用的地址与硬件使用的物理地址是不等同的。虚拟内存引入一个间接层,它使得许多操作成为可能。在引入虚拟内存这个概念和方法后,在系统中运行的程序可以分配比物理内存更多的内存。而linux的地址有分下面几个类型:

leon Published by 2014-01-27 17:11

Detail »

kernel module的实现机制浅

Tags: Linux  

先说一下kernel module大概是怎么一回事。说到 linux kernel大家都感觉非常牛逼的样子,可是我们却看不见摸不着,唯一能看见的是目录中有一个二进制文件vmlinuz,一般是在boot目录下,名字叫vmlinuz。这个就是最小版的linux kernel,非常的小,一是kernel本来就小,二是这还是个压缩文件。就是这个文件会被解压缩然后装载进内存,然后它实现内核的功能。可是我们想要扩展和维护内核时怎么办,作为传统的单内核,那就只能把整个内核源码拿来再加代码,再重新编译出一个vmlinuz出来,替换掉,这非常麻烦。所以linux就从传统的单内核给改进成了kernel module机制。

leon Published by 2014-01-21 17:55

Detail »

Hvmloader

Tags: XEN   Virtualization  

In the HVM case the "PV kernel" is actually hvmloader and isn't PV at all, the job of hvmloader is to load all the necessary information that qemu will use to build the necessary environment that will "fool" an unmodified guest that he is in fact on a physical machine. In summary hvmloader pretty much just fills data-structures as follows:

 

leon Published by 2014-01-19 13:23

Detail »

Linux内存管理伙伴算法

Tags: Memory   Linux  

伙伴算法

Linux内核内存管理的任务包括:

  • 遵从CPU的MMU(Memory Management Unit)机制
  • 合理、有效、快速地管理内存
  • 实现内存保护机制
  • 实现虚拟内存
  • 共享
  • 重定位

leon Published by 2014-01-12 04:35

Detail »

Linux Kernel Modules ( Drivers ) Location / Directory

Tags: Linux  

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:

leon Published by 2014-01-11 17:57

Detail »