Giter Site home page Giter Site logo

ak2_lab6's Introduction

AK-2 | Lab Work #6

Allocating Memory in the Linux Kernel

Task:

  • Declare a data structure for placement in a list that contains a field of type ktime_t in addition to the struct list_head element (include /linux/ktime.h in your linux-stable repository).
  • Create a static list header variable.
  • Before each greeting print, allocate memory for an instance of the declared structure, write in it the current kernel time obtained by the ktime_get() function.
  • In the hello_exit() function, go through the list and print the time of each event in nanoseconds, remove the list item and free the allocated memory.
  • At this stage, it is enough to allocate memory by calling ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); and free it by calling kfree(ptr);
  • Also add another field of type ktime_t and record the time before and after calling the print function, and on unloading of the module print the time spent on each print.

ak2_lab6's People

Contributors

jackshendrikov avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.