深入理解Linux内核第3版--笔记-4.pdf


Chapter 20. Program ExZecution

    20.1. Executable Files
        An executable file is a regular file that describes how to initialize a new execution context
        20.1.1. Process Credentials and Capabilities
            
            20.1.1.0. Process Credentials 
            Table 20-1. Traditional process credentials
            Name                 Description
            uid, gid             User and group real identifiers
            euid, egid             User and group effective identifiers
            fsuid, fsgid             User and group effective identifiers for file access
            groups             Supplementary group identifiers
            suid, sgid             User and group saved identifiers
        
            20.1.1.1. Process capabilities    
            20.1.1.2. The Linux Security Modules framework

        20.1.2. Command-Line Arguments and Shell Environment
            int main(int argc, char *argv[])
            int main(int argc, char *argv[], char *envp[])
             


            Figure 20-1. The bottom locations of the User Mode stack

        20.1.3. Libraries
            static libraries :
            This means that the executable file produced by the linker includes not only the code of the original program but also the
            code of the library functions that the program refers to.
            shared libraries:
            The executable file does not contain the library object
            code, but only a reference to the library name. When the program is loaded in memory for
            execution, a suitable program called dynamic linker (also named ld.so ) takes care of analyzing the
            library names in the executable file, locating the library in the system's directory tree and making
            the requested code available to the executing process.

            A process can also load additional shared
            libraries at runtime by using the dlopen( ) library function.
            

        20.1.4. Program Segments and Process Memory Regions

             Text segment
            Initialized data segment
            Uninitialized data segment (bss)
            Stack segment

            Each mm_struct memory descriptor (see the section "The Memory Descriptor" in Chapter 9) includes
            some fields that identify the role of a few crucial memory regions of the corresponding process:

            start_code, end_code
            start_data, end_data
            start_brk, brk
            arg_start, arg_end
            env_start, env_end

            20.1.4.1. Flexible memory region layout

                 
        20.1.5. Execution Tracing
            We focus on how the kernel supports execution tracing rather than discussing how debuggers work.
            In Linux, execution tracing is performed through the ptrace( ) system call, which can handle the
            commands listed in Table 20-5.
                

    20.2. Executable Formats

为了透彻理解linux的工作机理,以及为何它在各种系统上能顺畅运行,你需要深入到内核的心脏。cpu与外部世界的所有交互活动都是由内核处理的,哪些程序会分享处理器的时间,以什么样的顺序来分享。内核不遗余力地管理有限的内存,以使数以千计的进程有效地共享系统资源。内核还精心组织数据传送,使得cpu不再受限于慢速硬盘。    《深入理解linux内核》第三将引领你畅游内核中用到的最主要数据结构、算法和编程技巧。如果你的确想了解计算机内部的实现机理,那么作者透过现象探寻本质,提供了颇有价值的深入分析。本书针对具体的intel平台,讨论了其重要特征,逐行剖析了相关的代码片段。但是,本书涵盖的内容不仅仅局限于代码的机理,还解释了linux运作方式的理论支撑。    本书第三涵盖linux 2.6,从中可以看到几乎内核每个子系统都有相当大的变化,首当其冲的是内存管理和块设备部分。本书集中讨论了如下内容:    内存管理,包括文件缓冲、进程交换以及直接内存访问(dma)    虚拟文件系统层和第二及第三扩展文件系统    进程创建及调度   信号、中断及设备驱动程序的主要接口   定时   内核中的同步   进程间通信(ipc)   程序执行   本书将使你熟悉linux所有的内在工作机理,但本书不仅仅是一种学术演练。你将了解到什么条件会促使linux产生最佳性能,你还会看到,linux在各种环境下如何满足进程调度、文件访问及内存管理期间系统提出的快速响应要求。本书有助于你充分展现linux系统的魅力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值