I'm writing a Loadable Kernel Module for Linux that overwrites data in the memory address of another process. I want to overwrite a 4-byte integer.
Upon looking at ptrace(), I noticed a function named copy_from_user which, according to some documentation I found, seemed to fit the bill. However, when I try to load the module into the kernel (for a specific PID and address), it crashes.
hi all
i posted in another thread but this is what i found since
i am trying to handle a gettimeofday call by a program thats killing cpu on my machine
i searched and found this
can any of you gurus help me ?
Hello All,
To understand DMA, I tried to implement sample dma module in x86 machine on (SUSE ).
Hi everybody, I'm trying to compile a simple rtnetlink example written in c using gcc [ver 4.7.2] but I get this error : /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit statusand here is the include parts of example : #include <sys/socket.h>
#include <st
I am writing a program which monitors through select() on the keyboard and mouse device files. It waits for any write operation (this should happen when there is a keystroke or mouse movement) on those files and as soon as there is a write operation, some jobs are executed.
But it's not working.
I want to run my C code located in desktop with the header files located in other location. What should be the appropriate gcc command? I have attached the code below.
I am trying to include atomic in my C++ pthread program.
#include <atomic>
But, i got error:
error: atomic: No such file or directory
I tried :
#include <asm/atomic>
#include <atomic.h>
#include <linux/atomic>
#include <util/atomic>
#include <stdcatomic>
#include <catomic>
No one works.
My gcc is gcc version 4.1.2 20080704 (Red Hat 4.
This code consistently fails to build in ubuntu 12.04, 12.10, linux mint 13 and 14, but it compiles correctly on ubuntu maverick 10.10
#include <stdio.h>
#include <signal.h>
#include <stdio.h>
#include <signal.h>
#include <execinfo.h>
#include <stdlib.h>
#include <string.h>
//#define __USE_GNU
//#include <sys/ucontext.h>
#include <ucontext.h>
I am facing a problem while building a kernel module.
file1.c:
Quote:
#include <linux/kernel.h>
#include <linux/module.h>
#include "sam.h"
int __init sam_init(void)
{
printk(KERN_INFO "Hello, world - this is the kernel speaking\n");
return 0;
}
module_init(sam_init);
file2.c
Quote:
#include <linux/ke