linux-kernel

Linux on ICOP Technology Ebox

Has anyone tried running any linux distro from USB on the ICOP Technology Ebox : link ...

correct linux kernel configuration for hotplug.

i am using busybox and linux 2.6.32.4. my configuration is based on fedora 12. and started mdev according to mdev document. but i cant see my modules like network adapters and plugged usb devices. is there thing must be done? mdev commands (after mounts): echo /sbin/mdev > /proc/sys/kernel/hotplug /sbin/mdev -s ...

What is the best way to prevent out of memory (OOM) freezes on Linux?

Is there a way to make the OOM killer work and prevent Linux from freezing? I've been running Java and C# applications, where any memory allocated is usually used, and (if I'm understanding them right) overcommits are causing the machine to freeze. Right now, as a temporary solution, I added, vm.overcommit_memory = 2 vm.overcommit_ratio...

Debugging Linux Kernel in VMWare with Windows host

Hi there, I'm working on my first ever kernel module so I'm a bit new at this... My module is occasionally producing a panic and I cannot get to the bottom of it using printk. As far as I can tell my options for debugging are: 1.) Find the generated OOPS message and use ksymoops or 2.) Try at remote debug using kgdb I'm working on ...

Variable Context Switching Time

Hi there, I just made some changes to the context switch routine of Linux. I am facing now the following dilemma: The context switching time is no longer deterministic, i.e. the execution time varies on the applications that are switched out. I am wondering now what could be the negative implactions of such a behaviour. One potential pi...

assembler programming in user space

Hi, Is it possible to have a piece of code like this in user space? I mean is it possible to read/write co-processor register in user space in Netbsd / Linux? XYZ]# cat pmc.c static inline int arm11_pmc_ctrl_read(void) { unsigned int val; __asm volatile ("mrc p15, 0, %0, c15, c12, 0" : "=r" (val)); return val; } int mai...

'Hibernate' a process in linux

Hi, Is it possible to 'hibernate' a process in linux? Just like 'hibernate' in laptop, I would to write all the memory used by a process to disk, free up the RAM. And then later on, I can 'resume the process', i.e, reading all the data from memory and put it back to RAM and I can continue with my process? Thank you. ...

Limiting syscall access for a Linux application

Assume a Linux binary foobar which has two different modes of operation: Mode A: A well-behaved mode in which syscalls a, b and c are used. Mode B: A things-gone-wrong mode in which syscalls a, b, c and d are used. Syscalls a, b and c are harmless, whereas syscall d is potentially dangerous and could cause instability to the machine....

Gnu Debugger & Linux Kernel

Hi all, I have compiled my own Kernel module and now I would like to be able to load it into the GNU Debugger GDB. I did this once, a year ago or so to have a look at the memory layout. It worked fine then, but of course I was too silly to write down the single steps I took to accomplish this... Can anyone enlighten me or point me to a...

When to use kernel threads vs workqueues in the linux kernel

There are many ways to schedule work in the linux kernel: timers, tasklets, work queues, and kernel threads. What are the guidelines for when to use one vs another? There are the obvious factors: timer functions and tasklets cannot sleep, so they cannot wait on mutexes, condition variables, etc. What are the other factors in choosing ...

Nested struct viewer for Linux Kernel

I am in the process of tackling the Linux Kernel learning curve and trying to get my head round the information stored in nested struct specifically to resolve a ALSA driver issue. Hence, I am spending a lot of my time in the source code tracing through structures that have pointers to other structures that in turn have pointers to yet ...

What should I use on linux > 2.6.28 instead of __arch__swab32

I keep getting compilation error for a kernel module: XXX: In function 'yyy': ZZZ:125: error: implicit declaration of function '__arch__swab32' PowerPC, 2.6.30.x, Kamikaze toolchain. According to this the identifier went away after 2.6.28. What should I use instead? ...

Timing Measurements of Linux kernel routine

Hi, I added some additional code to the Linux kernel (the scheduler) and now I would like to know what is the impact of this modification. For user processes I always used: clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...); Now I am wondering if there is a kernel-equivalent routine that I could use to do something similar. Many thanks ...

Help writing a DVB driver for OS X

I'm looking at options to access DVB data on OS X. Initially I want to support the EyeTV DTT USB device, but in the long-run I'd like to support a number of popular devices. The problem I have is that there is no standard way of controlling such devices. All the applications I know of that use them either hide the driver code within t...

Linux Netfilter modules, dynamic memory allocation and synchronization

Hey guys, I'm working on a netfilter module that modifies TCP ack behavior and I am having some trouble with crashes. I think my problem is that I don't fully understand the netfilter architecture (and maybe the kernel in general, I'm pretty new to this). I have two main questions: 1.) Using kmalloc with the GFP_KERNEL flag seems to ca...

printk - showing in message log but not in terminal for any kernel log level

I'm doing some kernel modification and am trying to get printk to output information back to the console. I pass any kernel log level with it and do not properly get any response back on the console for even the highest log levels. I checked and the current log configuration for printk is 4 4 1 7. It prints properly each time to logs. ...

Initilisation of application in Linux

Hi all, I am desperately looking for a more or less detailed description of how an application is loaded into memory and then executed in Linux. Basically, I would like to know what information is read from the ELF file, which system calls are executed, such as exec() until this information is stored in the process descriptor. Does any...

External Linux kernel module dependencies

Hello all! I'm writing a kernel module which depends on one existing kernel module. I'm building my module out of the tree (as an external module). How can I declare the dependency, so that it is recognized by depmod? Thank you all Luis ...

I found some bizarre code in the linux kernel, could some one explain it to me?

I found this in initramfs.c, I haven't seen this syntax before, could some one explain what it is doing? static __initdata int (*actions[])(void) = { [Start] = do_start, [Collect] = do_collect, [GotHeader] = do_header, [SkipIt] = do_skip, [GotName] = do_name, [CopyFile] = do_copy, [GotSymlink] = do_symlink, [Reset] ...

Can I use strtok() in a Linux Kernel Module?

I need to do a parse on the data written to my module, and the use of the strtok() function of string.h would be useful. However I've tried #include <string.h> and #include <linux/string.h> with no success. Is this possible? Or will I have to write my own strtok function? Thanks ...