linux-kernel

i need information on system calls and understanding them

Hello guys, i am new to the Operating System development , and in college i have to add a system call to linux kernel, could you guys give me some in sight on what i will have to learn to be able to do this please. i have to extend the linux kernel, so any cool ideas would also be very helpful... thank you ...

How to patch wireless driver rtl8187 for 2.6.30 kernels?

I am using Backtrack 4 (installed on hdd), and I have an USB wifi adapter that uses rtl8187. I am trying to test wep cracking on my router (the signal is about 80%). I executed aireplay -9 and it shows "Injection is working 30/30 100%". But when start airodump to capture ivs, and aireplay -3 to inject, it only captures 1 iv every few s...

where do i add a systemcall to the linux Kernel source

Hello Guys i am tryin to add a new helloworld system call to a new version of the linux ubuntu kernel, i have been looking through the web but i cannot find a consistent example to show me what files i will have to modify to enable a helloworld system call to be added to the kernel. i have tried many and compile error have occured s...

how are pthreads on linux seen by scheduler

I've a question regarding pthread implementation on Linux. Suppose a process has 5 threads. Now how does the scheduler sees these threads (or doesnt see at all). e.g. When scheduler is invoked, does it only schedule the main process, and then its the onus of the main process to schedule between each of its thread. Or is it the other wa...

how do i switch custom kernels?

hello guys, i have created and installed a new kernel in my ubuntu system, but now i have added a new system call and created a new kernel, how do i set this new kernel as the one the OS should boot from. dpkg -i kernel-image-2.6.deb i tried this on my first kernel and this set the kernel to this one then i added a new system call ...

why am i getting these syntax errors when trying to implement system call

hello guys, still working on this system call!!! i have added a system call to a kernel, compiled and the OS is running off it. now i am getting syntax error on the compilation of my test application. testmycall.h #include<linux/unistd.h> #define __NR_mycall 244 _syscall1(long, mycall, int, i) testmycall.c #include<stdio.h> #i...

secure Linux distribution

hi, What do we mean by secure Linux distribution and securing Linux kernel? Abdul Khaliq ...

system timer implementation

Normally, a computer system only has a timer(hardware), and it trigger the system bu interrupts. But on application layer, we can set multiple tasks based on timer, like cron jobs. I am just wondering how system utilize the timer(hardware) to implement the application tasks(cron jobs, or java scheduled tasks). Thanks ...

help to understand macro

Hello I'm having problem to understand some piece of code in MTD driver #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y)) ... static struct mtd_partition my_parts[] = { { .name = "boot", .size = 0, .offset = 0, .mask_flags = MTD_WRITEABLE }, { .name = "linux", .size = 0, .offset = ...

How the share library be shared by different processes?

I read some documents that share library comiled with -fPIC argument, the .text seqment of the .so will be shared at process fork's dynamic linking stage (eq. the process will map the .so to the same physical address) i am interested in who (the kernel or ld.so ) and how to accomplish this? maybe i should trace the code, but i dont kno...

Building out-of-tree kernel modules, depmod - and, why reboot?

Hi all, I've been working with a userland program writeread.c (referred here), utilizing the ftdi_sio Linux driver. I had worked with the default ftdi_sio that comes with Ubuntu Lucid that I use - and then, as a sanity check, decided to rebuild ftdi_sio from source. I did not want to download the entire kernel source, so I opted for s...

Where does printk print to?

Hello guys, Just a quick question on printk function at the kernel level, if i call this where will the message be printed to.(im using ubuntu on i386 arch with the latest kernel downlaod) cant find it anywhere, if someone could also point me in the right direction for some sort of manual for the printk function it would be great! ...

Where do i get the api for the linux kernel that would let me access information within the kernel

Hello guys, i am new to linux, i am after implementing a simple system call on the linux kernel that prints to the syslog via printk, i would like to be able to extend this application , so i can details on the battery percentage of my laptop or check the speed of the hard drive in the computer, could any of you give me a hand on whe...

Adding a "useful" syscall not normally available to a non-root user....

Hey guys, I've implemented a simple Hello World syscall with limited functionality - that simply transitions from user mode to kernel mode, prints a message that is logged with the kernel messages, and transitions back to user mode. The next step for extra credit is to add a useful (new) syscall that is not normally available to a non-...

Example for kernel timer Implementation in Linux (in kernel 2.6.32)

hi, Could you please give any basic example of a kernel timer (start_ktimer) implementation in Linux? /renjith_g ...

i_mode file type value of 16

I have been told that I need to add a new file type to linux. File types are declared in fs.h Relevant part posted here: * File types * NOTE! These match bits 12..15 of stat.st_mode * (ie "(i_mode >> 12) & 15"). */ #define DT_UNKNOWN 0 #define DT_FIFO 1 #define DT_CHR 2 #define DT_DIR 4 #define DT_BLK ...

Interaction of fork and user-space memory mapped in the kernel

Consider a Linux driver that uses get_user_pages (or get_page) to map pages from the calling process. The physical address of the pages are then passed to a hardware device. Both the process and the device may read and write to the pages until the parties decide to end the communication. In particular, the communication may continue usin...