GithubHelp home page GithubHelp logo

linuxkernel's Introduction

北京大学软件与微电子学院Linux内核分析与驱动编程课程实验

🥢如果对您有帮助,请给一个star,感激不尽🥢

实验报告:

模块的全称是“动态可加载内核模块”( Loadable Kernel Module,LKM),其在内核空间运行,目标代码通常由一组函数和数据结构组成。模块实际上是一种目标对象文件,其不能独立运行,但是其代码可以在运行时链接到系统中作为内核的一部分运行或从内核中取下, 从而可以动态扩充内核的功能。

了解fork与vfork的区别,并显示进程的相关信息。

Linux中有多种同步机制,选择其中两种进行深入剖析。

深入剖析malloc()和mmap()


实验要求

实验要求

实验要求

实验要求

实验要求


实验要求:题目自选,主要工作与Linux内核相关,可以使源代码分析或者实验及结果分析。

Linux进程虚拟地址空间分析

1.变量的存储位置

.text、(ro_data)、.data、.bss存储的内容是清楚的,但是各种变量在相应部分内存储的顺序仍是不清楚的。

(未初始化/初始化为0/初始化为非0)(const)(static)(局部/全局),共计有24种不同的变量。设计包含所有种类变量的测试程序,通过cat proc/pid/maps程序内的变量线性地址的输出,确定每种变量的位置,以及相同段内变量的相对位置

2.堆的动态分配

当申请动态分配的空间小于128k时,malloc会调用brk系统调用。剖析brk函数,同时调研堆的使用的注意事项和常见问题

3.文件的存储映射区

剖析mmap系统调用,同时做以下几个实验:

1.写一个测试程序,它打开某个文件,然后while(1)。将该可执行程序执行两遍,使用cat proc/pid/maps查看文件存储映射区是否有相应的文件,以及该部分的flags

2.验证动态链接库和静态链接库的区别,写一个程序,用两种链接方式生成两种可执行文件,观察两者的.text区的大小,和文件存储映射区的内容

4.栈的使用

设计实验验证栈在程序执行期间的作用。

linuxkernel's People

Contributors

wuhao9714 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

827992983

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.