I am making a system call that loops through every process with a certain status (passed to the syscall as a parameter) and show their Name, PID, UID and the name of their children. This is what I have so far: This prints all of the system’s processes and their children, completely ignoring the condition if(task->state == state), which is
Tag: kernel
Linux kernel – Context switch when calling function from other module?
I am curious if calling a function from a different module in the Linux kernel triggers a context switch? Basically, I’m doing something like this. Say I have module A: module B: between the two measurements, I’m seeing a gap of up to 2 microseconds (after dividing through the TSC frequency). Could this gap be due to a context switch?
Generate raw binary from C code in Linux
I have been implementing just for fun a simple operating system for x86 architecture from scratch. I implemented the assembly code for the bootloader that loads the kernel from disk and enters in 32-bit mode. The kernel code that is loaded is written in C, so in order to be executed the idea is to generate the raw binary from
Why boost::aio is asynchronous when its implementation is based on epoll(synchronous)
We know: (1) epoll is synchronous, based on user query/system notify. A while loop is used to call all woke up fds. (2) boost::asio declares itself to be “asynchronous”, but its implementation on linux is using epoll. My question is: how can you implement “asyn” using a “syn” system call? Unless you use some kernel/system supported aio interface, right? Please
“Linux aio” and “Linux native aio” are the same thing?
I’m recently digging into linux io model, and I frequently hear that like windows IOCP, linux has its own aio model implementation: Glibc aio and kernel aio. Question: (1) when people say “linux native aio”, which model is indicated? (2) I hear 2 different terms, “linux aio” and “linux native aio”. Are they the same thing, or indicating different implementations?
Security concerns around KSM
When using KSM (Kernel Same-page Mapping), if two completely identical pages of memory are owned by two completely isolated processes, for example, two virtual machines, will those pages be merged? Or will they remain separate due to the fact that each process is isolated from each other? I’m confused because the VMs boil down to a single process on the
Each process has its own kernel stack, right?
I saw some SO questions come with a conclusion: Each process has its own kernel stack. But how about this code? Or how about this one? Whether does this program also have a corresponding kernel stack? More: For the 1st code above, I tested it like below. Press Ctrl+C to stop it, and see that system time is less than
sys/types.h: No such file or directory
I am trying to compile module but get this error. Here is my module file headers And my Makefile I have tried to search for this file Here are results I tried to set it as #include “/usr/include/sys/types.h” but got following error I am using Kali Linux(Debian) AMD64 platform What is wrong ? Thanks SOLVED Sorry this was my fault,
register protocol handler for a transport protocol in Linux kernel
I’m trying to implement the QUIC protocol in the Linux kernel. Since QUIC is working on top of UDP, I’ve been using the UDP code as a learning base. Now I want to register the protocol handler for the QUIC protocol but I don’t understand how and where to do it as I can’t find the relevant code piece in
Can bash be used to communicate directly with hardware?
I am interested in writing my own tool in bash to act in place of my current network controller (wpa_supplicant) if possible. For example if I want to issue commands in order to begin a wps authentication session with a router’s external registrar, is it possible, without using any pre-built tools, to communicate with the kernel to directly access the