kernel

What is the "linux-2.6.3x.x/include/asm-generic/' for?

My os-book says that if you want to add a system call to the Linux kernel, edit the linux-2.x/include/asm-i386/unistd.h. But the linux kernel's source structure seems to change a lot. In the linux-2.6.34.1 version kernel source tree, I only find a linux-2.6.34.1/include/asm-generic/unistd.h and linux-2.6.34.1/arch/x86/include/asm/unistd...

Writing a POSIX-compliant kernel

I've wanted to write a kernel for some time now. I already have a sufficient knowledge of C and I've dabbled in x86 Assembler. You see, I've wanted to write a kernel that is POSIX-compliant in C so that *NIX applications can be potentially ported to my OS, but I haven't found many resources on standard POSIX kernel functions. I have foun...

linux kernel "historical" git repository with _full_ history

I think many developers like to investigate sources with help of "git gui blame". As explained in 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 it needs to have special historical Linux repository for this purpose. I have looked a lot of the prepared historical repositories but I didn't found one containing changes from zero version so I giv...

problem hooking NT dll file functions!

Hello all, what is the best tool to track the NT API's. ...

linux du command source code

Where I can find the source code for du and other Linux utilities? ...

linux kernel module char device

Hi Kernel Gurus, i'm writing a char device in linux - xubuntu , and i'm wondering if i have to implement ioctl OR maybe i can use the regular read write funcs?? thanks all, Amit ...

Getting iPhone's battery level

I have a simple question. How do I get iPhone's battery level? [UIDevice currentDevice] batteryLevel] Simple enough? However there is a little catch - I can't use UIKit. Here is what I wrote so far, but I don't think it works: // notification port IONotificationPortRef nport = IONotificationPortCreate(kIOMasterPortDefault); CFRu...

Is there a way to get destination mac addres in ANSI C

Is there a way to get the destination MAC address, if the destination IP is known, using ANSI C? I would preferably do it with a system call so the kernel deals with it all and I can take advantage of the ARP cache. I know I can build and send my own ARP request, but then I would not have the caching functionality etc unless I implement ...

OS's Boot-loader doesn't work

I am making a custom Operating System. I have two nasm files: boot.asm: [BITS 16] ;tell the assembler that its a 16 bit code [ORG 0x7C00] ;Origin, tell the assembler that where the code will ;be in memory after it is been loaded INT 0x13 JMP $ ;infinite loop TIMES 510 - ($ - $$) db 0 ;fill the rest of sector with 0 DW 0...

Execute a program in kernel space in Linux

If I want to execute a user program (not a kernel module) in Linux kernel space, what options do I have? I have looked at KML(kernel mode linux) but that is specific to IA-32 architecture. I want a solution which is cross platform and can work on embedded linux systems. ...

find process that's generating CAL interrupts (syscalls)

I have a peak of CAL type interrupts, 20,000 per second. How do I find the process that's generating them on SUSE11? Thanks! ...

Process state when calling syscall?

What process state has when it calls a syscall? I mean, don't asume it's an I/O syscall like read or write... It's the process itselft that executes kernel code, or the process is suspendes and there's like a "kernel thread" that execute the syscall handler (and knows wich process called (current))? I'm not sure if changes from execu...

How do the PROT flags within mmap(), translate to register values ?

I am interested in tracing how the mmap system call translates to register values on an ARM cpu. More interested in the path taken and where and when do these "PROT" attributes actually translate to a page attribute within the kernel. I did trace the system call till the "mmap_region" call under mm/mmap.c. From here, I fail to see where ...

Compiling kernel to a binary file on mac

I was following these tutorials to make a simple kernel that I would then load using GRUB. The instructions for compiling didn't work (ld couldn't find the -T option) and when I finally got a compiled file it was in Macho format. What are the correct steps to take when compiling these files on Mac. Edit: I compiled the code on an Ubuntu ...

difference b/w operating system and kernel

I was unable to figure out the difference between operating system and kernel.Can anybody help me please....... ...

Minimun Stable Linux Kernel

Hi, I need to compile a minimun minimun minimun minimun linux kernel, I mean, with the basic and generic modules to get it work on low resources machines. Is there any specification of the minimun modules that a kernel must have to acomplish my needs??? The unique requirement is that it must be stable. Where can I find information ...

What is a MIG subsystem and can anyone give an example of creating one?

I've been looking at Mac OS Architecture and I found something refereed to as MIG. I think it is used for inter process communications but I'd like to find out more. Can someone tell me more about MIG (and what it stands for) ? Here is a strucure of a 'defs' file: subsystem example 36270; #include <mach/std_types.defs> routine mig_t...

what does double underscore mean in variable name in c language

Possible Duplicate: Why do people use __(double underscore) so much in C++ I was studying the linux kernel programming code. There aere some data structures and function which starts with double underscore(_ _) like _ _ u32 len how that is different from normal variables ...

What's actually in the Managed Runtime Initiative's kernel patches and JVM?

http://managedruntime.org/ is pretty sparse on what exactly are in the tarballs and why users would want them. http://lwn.net/Articles/392307/ has some more details, but the author also isn't sure what the memory management modules actually do. Apparently the high-level goal is to reduce GC pauses, but I'd be interested in (pointers to) ...

Got "error: division by zero in #if" in jiffies.h when compiling driver code with llvm-gcc

Hello, I'm trying to use llvm-gcc (llvm version 1.7) to compile a driver program (linux/drivers/net/zorro8390.c) in the linux kernel source code (version 2.6.18.8) for research purpose, but I get a lot of errors from the jiffies.h: bash-3.2$ llvm-gcc -D__GNUCC -E -I../../include zorro8390.c -o test.o In file included from ../../include...