kernel

Why sizeof(spinlock_t) is greater than zero on uni-processor ?

The following line printed output as 4 whereas I was expecting 0. printk(KERN_INFO "size of spinlock_t %d\n", sizeof(spinlock_t)); I tried this on a system with single cpu. No debugging flags are enabled while building kernel like CONFIG_DEBUG_SPINLOCK or CONFIG_DEBUG_LOCK_ALLOC. According to kernel header files, it should be zero ...

If I know Windows kernel, what can I do?

Currently I am in a stage that can learn Windows kernel programming, but I am wondering after that which types of jobs I can do? For Linux kernel, seems till now only a bunch of driver works related jobs there. ...

How to call/hook kernel mode APIs from user mode?

I'd love to dive into kernel hooking - but my problem is that I don't like C/C++. But I've over 10 years experience in VB6 programming and would call my self as an expert in this language. So my question is if it was possible to use a tiny C kernel mode driver - which could be controlled by VB from the user mode via the DeviceIoControl A...

Does running an SMP kernel on a single-cpu machine hurt performance?

On my Ubuntu machine, default kernel image which is running is built for smp (CONFIG_SMP=y). But this machine has only 1 cpu. On uni-processor kernel, unlike smp kernel, spin_lock/unlock are null functions. So how does spin_lock() and spin_unlock behave in this setup? Is there any performance impact due to such smp specific code? ...

Using CUDA Kernels

I'm interested in using CUSP library for CUDA (available here). However, I'm either having trouble getting this library to work with my application linking with CUDA and/or CUBLAS static libraries. I'm assuming from glancing through the header and source files that I either use the kernels by building the related files as a static librar...

Problem with chardev.c example from The Linux Kernel Module Programmers Guide

I compiled and ran the chardev.c example from the lkmpg and when writing to the device received an unexpected error: anon@anon:~/lkmpg$ sudo echo "hi" > /dev/chardev bash: /dev/chardev: Permission denied The module write function looks like this: /* * Called when a process writes to dev file: echo "hi" > /dev/chardev */ static s...

Extending Functionality of Magic Mouse: Do I Need a kext?

I recently purchased a Magic Mouse. It is fantastic and full of potential. Unfortunately, it is seriously hindered by the software support. I want to fix that. I have done quite a lot of research and these are my findings regarding the event chain thus far: The Magic Mouse sends full multitouch events to the system. Multitouch events a...

Is there a way to drive a today's computer NIC with no underlying OS?

Hi, I would like to write an IO intensive application with no underlying OS, running on x86 architecture and driving any modern network interface controller. By having a look to Linux's drivers source code, I know that thousands lines of codes are required to drive, as an example, an Intel e1000e Gigabit controller. I think that such c...

controlling program execution

I am writing small debugging program for multithread apps. My idea is to run the target, that is being debuged for for example 100 nanosecs, then pause and examine its memory. However this ( just pseudocode ) nanosleep(100); //sleep debuger for 100 nanosec and let a program run kill(target_app_pid, SIGSTOP); //stop target ap...

Performance of IcedTea 6 vs Sun's HotSpot 6

How does IcedTea 6's performance stand up against Sun's own HotSpot on linux systems? I tried searching Google but Phoronix's test is the best I got, which is almost a year old now. Hopefully things have improved since then. Also, once Sun completely open sources the JVM, would it be possible to implement it for Linux platforms such tha...

compiling my own kernel (not from linux-kernel source)

I'm following the kernel tutorial from here im having problems compiling my files. i get the following errors when i try to compile: main.c:8: error: expected declaration specifiers or ‘...’ before ‘size_t’ main.c:8: error: conflicting types for ‘memcpy’ ./include/system.h:5: note: previous declaration of ‘me...

uniprocessor or multiprocessor

On unix, how could we know whether the system is multiprocessor or uniprocessor? ...

What is the exact architecture/components of MinWin?

I've always wanted a minimal windows NT build . Sounds like one's already there : MinWin. Can anyone tell me the exact design or architecture of MinWin and is it used in Windows 7 ? Windows Server 2008 already has a minimal Core build available for deployment . Why not Windows 7? ...

Writing a System Calls for linux

i try to write a system call. I followed these steps: linux/arch/x86/kernel/syscall_table_32.S ----> . long sys mycall linux/include/linux/syscalls.h --------> asmlinkage int sys mycall (int i , int j ); linux/arch/x86/include/asm/unistd_32.h ----> #define NR mycall 333 I changed linux/Makefile to core-y += kernel/ mm/ f...

Configuring kernel

After create a new system call, how to update the kernel? I tried these lines, make-kpkg clean fakeroot make-kpkg -initrd -append-to-version=-custom kernel_image kernel_headers But Ubuntu asked me if I am sure what I am doing, or not. But I am not sure. Do I have to say yes? Here is what did, Ubuntu said to me: You are attemptin...

How to debug driver load error?

I've made a driver for Windows, compiled it and tried to start it via SC manager, but I get the system error from the SC manager API: ERROR_PROC_NOT_FOUND The specified procedure could not be found. Is there a way to get more information about why exactly the driver fails to start? WinDbg or something? If I comment out all code in my ...

Job Requirements: What does "Kernel Developer" REALLY mean?

I couple of months ago I was jobhunting. Since my resume is still out there I'm getting an average to two phone calls and four e-mailed messsages per day inquiring if I'm still on the market. Most of these are calling for Linux kernel developers. However I've found that the term seems to be over-used; or at least that it covers a some...

Unable to debug the kernel driver using Serial cable

I am new to driver stuff. I have tried to debug the kernel driver using serial COM port without success. Could someone show me proper direction how to fix the problem? I am seeing the following messages on kd console. ERROR: DavReadRegistryValues/RegQueryValueExW(4). WStatus = 127 ERROR: DavReadRegistryValues/RegQueryValueExW(5). WSta...

How to better study Linux?

I'm taking a very basic university course on OS kernels and related stuff (process management, virtual memory, file systems, drivers..) I wanted to deepen my understanding of Linux in these fields, but also get to know it from a more practical point of view (important directories, the shell, important logs and files, hacking in general) ...

Read single sector

Hi, I am trying to read a single specific sector from the disk directly. I've currently run out of ideas and any suggestions how to go about it would be great! (I'm a linux newbie) ...