linux-kernel

Linux kernel scheduling

Hi, I wish to know how Old Linux scheduling algorithm SJF (shortest job first) calculates the process runtime ? ...

ifconfig packet count

Hi, if I type ifconfig i get packet for Tx and RX ... where exactly the piece of code to increment this counter? Is it in the network driver itself? or in the kernel ? If possible please provide lxr link of the counter variable used. Thx ! ...

Using gdb to single-step assembly code outside specified executable causes error "cannot find bounds of current function"

I'm outside gdb's target executable and I don't even have a stack that corresponds to that target. I want to single-step anyway, so that I can verify what's going on in my assembly code, because I'm not an expert at x86 assembly. Unfortunately, gdb refuses to do this simple assembly-level debugging. It allows me to set and stop on app...

walking list in KDB/kernel debugger

I need to walk a link list in the kernel debugger. How can I determine the head pointer and walk the list? I have a listing and can find the address and location in the code where I check to see if I have a head, so I know the specific code location and address. But not sure how to determine the pointer or how to determine the next elem...

Linux Kernel Threads - scheduler

Hi People, Is Linux Kernel scheduler a part of init process? My understanding is that it is part of Kernel threads managed internally not visible to user by either top or ps. Please correct my understanding. Is it possible to view standard kernel threads through any kernel debugger to see how standard threads occupy cpu activity? -Kar...

getpriority() function in linux

Hi all.. may i know the exact usage of getpriority() call used in linux.. even after searching thru net, i couldnt understand it exactly.. can someone explain it with an example.. thnx in advance :) ...

How to allocate an executable page in a Linux kernel module?

I'm writing a Linux kernel module, and I'd like to allocate an executable page. Plain kmalloc returns a pointer within a non-executable page, and I get a kernel panic when executing code there. It has to work on Ubuntu Karmic x86, 2.6.31-20-generic-pae. ...

mounting without -o loop

Hi, I have written a dummy (ram disk) block device driver for linux kernel. When the driver is loaded, I can see it as /dev/mybd. I can successfully transfer data onto it using dd command, compare the copied data successfully. The problem is that when I create ext2/3 filesystem on it, I have to use -o loop option with the mount command...

Linux UML - Need gcc on the UML instance. Would like to mount gcc from hostfs

I know how to mount the hostfs directories when needed for my UML Linux instance. I need to get gcc and all it's dependencies from my host Linux instance by mounting the files in my UML instance. I think the paths are not working properly because it comes up with an error about cc1 and execvp when I mount all files and try to run gcc. ...

nested page-faulting of user-space address in Linux

Hi, I would like to know if it is functionally wrong to page-fault a user-space address when kernel is running fault-handler to bring in a user-page. OS is Linux 2.6.30 Assume that both user-addresses are valid ( falling within vma , rw permission ) for the task. When I check the kernel code, i find that the kernel does not mind...

Linux Scheduling Mechanism in 2.6.22?

Hello, I'm doing some kind of performance evaluation using two different vanilla Linux kernels, 2.6.22 and 2.6.31, since I assume each of them uses a different scheduling mechanism: 2.6.22 uses the old O(1) scheduler, whilst 2.6.31 adopts the CFS. Could anybody confirm the correction of this assumption? ...

Linux Kernel programming: trying to get vm_area_struct->vm_start crashes kernel

Hi, this is for an assignment at school, where I need to determine the size of the processes on the system using a system call. My code is as follows: ... struct task_struct *p; struct vm_area_struct *v; struct mm_struct *m; read_lock(&tasklist_lock); for_each_process(p) { printk("%ld\n", p->pid); m = p->mm; v = m->mmap; ...

User Mode Linux - Installing a module error

I am trying to run 'make' on a module in User Mode Linux to install a simple makefile. Here is my make file: obj-m := hello.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules When I run this in User Mode Linux I get the following error: make[1]: Enterin...

How do I compile a module in User Mode Linux

Having a tough time compiling a module for User Mode Linux. I just need a basic way to compile a very basic module in user mode linux and cannot seem to get it to work. I checked out the how-to on sourceforge for UML but had no luck. Anyone have a working example of what it takes? Thanks! ...

Changing the Interrupt descriptor Table

I am using Linux 2.6.26 kernel version and I am trying to change the interrupt descriptor table using a kernel module. I am only trying to change the page fault table entry here. So I make a copy of the original IDT and make changes to the page fault table entry only. The objective of the ISR is to print out information of the page fault...

Can anybody point me at documentaion for linux libaio-0.3.107

Hello all, I have just inherited an chunk of an embedded Linux project that makes a lot of use of libaio-0.3.107 and am struggling to find any documentation and/or example code to assist me in making sense of it. Anybody got anything they could recomened? Thanks ...

Which kernel APIs can be used in non-gpl kernel module?

Hi All, Company is producing the embedded network equipment.and we need to protect some private feature in the kernel module from GPL violation and I remember some kernel API can be used without GPL violation. Such as, libc, skb, dev. But does anyone know the exact kernel API list which can be used in non-GPL kernel module? Any sugges...

what is pagecache page

/* * Each physical page in the system has a struct page associated with * it to keep track of whatever it is we are using the page for at the * moment. Note that we have no way to track which tasks are using * a page, though if it is a pagecache page, rmap structures can tell us * who is mapping it. */ include/linux/mm_types.h He...

In the linux kernel, where is the first process initialized?

I'm looking for the code in the linux kernel (2.4.x) that initializes the first process, pid=0. Many searches provided many clues, but I still cannot find it. Any pointers, anyone? ...

Linux Kernel Module - Creating proc file - proc_root undeclared error

I copy and paste code from this URL for creating and reading/writing a proc file using a kernel module and get the error that proc_root is undeclared. This same example is on a few sites so I assume it works. Any ideas why I'd get this error? Does my makefile need something different. Below is my makefile as well: Example code for a bas...