Showing posts with label Kernel. Show all posts
Showing posts with label Kernel. Show all posts

Wednesday, September 18, 2013

Tuesday, September 17, 2013

Difference between .o and .ko file

http://stackoverflow.com/questions/10476990/difference-between-o-and-ko-file

The short answer is that the .ko file is your object file linked with some kernel automatically generated data structures that are needed by the kernel.
The .o file is the object file of your modules - the result of compiling your c files. The kernel build system then automatically creates another C file with some data structures describing the kernel module (named your_module_kmod.c), compile this C file into another object file and links your object file and the object file it built together to create the .ko file.
The dynamic linker in the kernel that is in charge of loading kernel modules, expects to find the data structure the kernel put in the kmod object in the .ko file and will not be able to load your kernel module without them

Saturday, July 28, 2012

Sunday, July 1, 2012

Loading and unloading modules in Linux

# /sbin/lsmod
List of modules and the programs /kernel use


http://www.techrepublic.com/article/loading-and-unloading-modules-in-linux/5031591

rmmod ppp

Wednesday, January 25, 2012

AT&T assembly homework

How to write assembly under Linux.

http://asm.sourceforge.net/intro/

-- nasm

foo : no name, fill with your own name here.

GCC inline asm:
http://ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
for homework 1
http://cs.njit.edu/~sohna/cs680/hw1.html

Introduction to UNIX assembly programming
http://asm.sourceforge.net/intro/hello.html

lea (AT&T assembly)
Load-effective-address

Intel Pentium Instruction Set Reference (Basic Architecture Overview)
http://faydoc.tripod.com/cpu/

Trick:
Using lea instruction to compute certain products.
The trick is to use the scaled index addressing modes.
http://webster.cs.ucr.edu/AoA/Windows/HTML/IntegerArithmetic3.html
What is scaled index addressing modes.
Addressing modes:
http://en.wikipedia.org/wiki/Addressing_mode
scaled addressing modes:
http://en.wikipedia.org/wiki/Addressing_mode#Scaled