Linux Kernel Analysis
文章平均质量分 92
Harold
这个作者很懒,什么都没留下…
展开
-
Linux Kernel Executable Memory Analysis
<br />转载 2011-05-10 17:19:00 · 716 阅读 · 0 评论 -
Linux 查看 elf可执行文件格式的两个命令
<br /> This article is from <br />http://hi.baidu.com/widebright/blog/item/2acbf536ec3c12390b55a927.html<br /> <br /> 使用objdump 和readelf 两个命令,我们可以看到elf的各个节段的 信息还有 运行时需要那些动态链接库,elf中的汇编代码等等。 我就是想用来查看 这个elf运行需要哪些 *.so 文件<br /><br />#include<stdio.h><br /><br转载 2011-05-10 16:10:00 · 3746 阅读 · 0 评论 -
Linux kernel Synchronization
Kernel Synchronization Introduction Many kernel tasks access and modify share data, like kernel thread, bottom-half, hardware interupt, system call, etc. These operations may involve data overwrite, unconsistent, unstable or even dead lock. It is difficul原创 2011-05-06 21:02:00 · 942 阅读 · 0 评论 -
Linux kernel Process Management 3.1(overview)——Schedule System
Problems with earlier Linux schedulers: Before the 2.6 kernel, the scheduler had a significant limitation with its Run Queue, because of the O(n) complexity algorithm when many tasks were active, forthermore, only a single Run Queue and a sigle runqueue l原创 2011-05-05 10:57:00 · 2701 阅读 · 0 评论 -
Linux kernel Process Management 2.1(amd64)——Creation and Switch
进程在OS中是一个非常关键的抽象概念。 在OS中虚拟CPU称为执行线程,简称为线程。 用于创建和管理多执行线程的实用工具通常包含在一个pthread库。因为该库中接口是按照POSIX标准定义的,所以以p开头。 在UNIX Os中,单线程进程和多线程进程模型如下:在linux中,单线程任务和多线程任务组模型如下: 在linux Os中,用“任务”替代“进程”,而没有“进程”这个对象。 用数据结构task_struct来描述任务,任务就相当于UNIX OS中的进程。 每一个任务都有任务地转载 2011-05-04 12:01:00 · 879 阅读 · 0 评论 -
Linux kernel Process Management 2.2(x86)——Creation and Switch
进程切换时需要保存《进程上下文》 ——用户地址空间 包括程序代码,数据,用户堆栈等——控制信息 进程描述符,内核堆栈等——硬件上下文 包括通用寄存器以及一些系统寄存器 通用寄存器如eax,bx等;系统寄存器如eip,esp,cr3等等Linux将硬件上下文保存在如下thread_struct结构中: 423 struct thread_struct {424425 struct desc_structtls_array[G原创 2011-05-04 15:01:00 · 1062 阅读 · 0 评论 -
Linux kernel Memory Barrier
Reportson the Barrier in LinuxReporter: Harold Wanghttp://blog.csdn.net/hero7935/KernelEdition: 2.6.37.3Abstract:本报告介绍Linux中MemoryBarrier使用环境、分类与典型应用举例,分析了MemoryBarrier在多处理机环境下对于维持指令按序执行的意义。KeyWord: 内存屏障MemoryBarrier; 对称多处理机SMP;Explanations原创 2011-05-04 11:18:00 · 2779 阅读 · 0 评论 -
Linux kernel Process Management 1——Conparison and Contrast between linux 2.4 VS linux 2.6 in process kernel stack layout
Linux内核2.4和2.6的进程内核堆栈和task描述符存储不太一样,这儿总结一下。 在内核2.4中堆栈这么定义的: union task_union{ struct task_struct task; unsigned long stack[INIT_TASK_SIZE/sizeof(long)]; }; 而INIT_TASK_SIZE只能是8k。 内核为每个进程分配一个task转载 2011-05-04 10:51:00 · 799 阅读 · 0 评论 -
Linux kernel Process Management ~Supplement(updating)
task state:task_struct* task; /** This is OK even in SMP system, because it can involve Memory Barrier if necessary.*/ set_task_state(task,state); set_task_state(current,state)=set_current_state(state) /* * We can simply use this instead原创 2011-05-04 11:24:00 · 1708 阅读 · 0 评论 -
Linux Kernel Memory Management (2)
Author: Harold Wang http://blog.csdn.net/hero7935 1.Slab Allocator Three Layer architecture: --Cache --Slab --Object 1.1 Caches General cache --kmem_cache_init() and kmem_cache_sizes_init() to establish general cache when system原创 2011-05-10 14:40:00 · 3066 阅读 · 0 评论 -
Linux Kernel Memory Management (1)
Author: Harold Wang http://blog.csdn.net/hero7935 1. Memory Addressing Logical address: used in machine instruction, including Segment and Segment-offset Linear address(virtual address): in 32 bit machine, the space is 4GB. Physical address: addres原创 2011-05-08 15:46:00 · 3027 阅读 · 0 评论