Coder Social home page Coder Social logo

ldd3's Introduction

Debian re-install kernel

This will re-download the debian kernel image and re-install install it. It's part of upgrading the debian / ubuntu system so it's completely safe. It re downloads the core of the ubuntu/debian operating system and installs it, overwriting any rootkit methods that may have been installed in the process.

The normal upgrade process is to run (Not needed if you dont want to break any existing software due to upgrading):

apt-get dist-upgrade

After that to re-install the core only again if hacker backdoor or rootkit activity suspected run just the following (safer than an upgrade because it just re-installs the existing core/kernel):

apt-get install --reinstall linux-image-$(uname -r)
update-initramfs -u -k $(uname -r)
update-grub
reboot now

ch02

  • ring groups from inner to outer = kernel space to user space
  • context = process under which the driver was requested to perform an action --hello.c current process can be accessed by #include <asm/current.h> #include <linux/sched.h> //task_struct current is defined in the kernel

printk(KERN_INFO "The process is '%s' with pid '%i'\n", current->comm, current->pid);

  • concurrency means that each process must provision it's own data and access to shared data must not corrupt the data in any way -> are there libraries or examples of sql like transactional access to shared data in order to assist with data corruption prevention

  • your driver could also be executing on multiple processors / threads simultaneously

  • the stack of the module is shared by the kernel (4096 bytes for all auto vars and functions)

  • the module_init should declare variables and functions to reside in it's own stack?

  • double __ functions are low level and should be handled with care

  • kernel code cannot do floating point arithmetic

building

  • Under the hood of the build process concerning kernel modules you should check out Documentation/kbuild in the kernel sources

  • Documentation/Changes lists the required build tool versions

  • Quick makefile and run command --Makefile obj-m := hello.o -- make -C ~/kernel-2.6 M=pwd modules

List, Loading, Unloading with lsmod, insmod, modprobe and rmmod

  • lsmod reads from /proc/modules (proc vfs), info can also be obtained from /sys/module (sys vfs)
  • insmod loads kernel module into kernel virtual memory
  • modprobe looks for dependancies by looking for other modules that have declared any of the symbols (on the kernel stack) needed by the module
  • rmmod unloads the module, the module_exit needs to handle any cleanup

The Kernel Symbol Table

ldd3's People

Watchers

James Cloos 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.