Setting up paging and managing memory in low-level C (kernel) without OS
I have an issue where I think I just misunderstands how this works.In low-level C code (aka running C code without an OS) I have to create a way for memory to be managed, providing my own malloc...
View ArticleMakefile for Linux kernel module
I'm trying to create a Makefile for compiling a Linux kernel module with multiple source files. However, I encounter a compilation error unless I manually specify the object files.Header...
View ArticleProblems removing identity mapping in x86 kernel
I'm doing a bit of operating system development and here's my target. I've enabled paging and want to remove the identity mapping. Previously, I had two mappings, identity map of 0-4M and kernel at...
View ArticleWhy do dynamic value prints panic in my no_std kernel?
I'm trying to print dynamic values off in no_std Rust, but whenever I do, my kernel panics, and I can't even print the panic message because printing it panics too. I use a function I made called write...
View ArticleCannot boot Windows guest in VirtualBox without kernel module error
I'm running Vagrant (1.8.1) + VirtualBox (5.0.12) on Windows 7 and trying to boot up a Windows 7 image (modernIE/w7-ie8). However, I get this error:---------------------------VirtualBox - Error In...
View ArticleBootloader Fails to Load More Than 53 Sectors Despite Modifications
https://github.com/UdayKhare09/EXO_OS is my repo.I am working on a custom bootloader for my operating system, and I am encountering an issue where the bootloader fails to load more than 53 sectors from...
View ArticleHow to view a device driver stack?
There is a picture on the Microsoft site which represent a USB device driver stack (in other word, the list of all drivers which applys for the device work).What software shall I use to get this list?...
View Articleheaders not working at a kernel level on eBPF code
So I'm developing something on eBPF.I needed to use the unistd.h header because I wanted to use sleep function. However, I realized that when I type in#include <unistd.h>these headers don't get...
View ArticleKernel file not loading correctly in MASM
Just making a simple OS as a beginner for my assembly project. I have this very simple bootloader which prints a character B and reads the second sector (kernel) from drive and loads it at 10000h...
View ArticleZero values for stack base and stack limit addresses in NT_TIB struct (Kernel...
When running the !pcr command in Windbg, the NT_TIB structure shows zeros for StackBase and StackLimit. I am debugging drivers on Windows 7 x32 Ultimate using Windbg via COM port. OS is running on...
View ArticleSpinlocks in single processor and multi processor
I read and studied how spinlocks work. Now I have a question which I can't find an exhaustive answer to:how do they work in a UP (uni-processor) environment and in a SMP (symmetric multi processor)...
View ArticleKernel can't find rootfs on STM32MP151
I'm trying to get a board based on this module up and running using recent boot stages and kernel (6.1.*).Can't use the manufacturer provided files, because those are atleast two years old and...
View ArticleHow to let two kernel threads access the same block for atomic operations
How can two (or more) kernel threads read the same block from a block device, into the same kernel memory, in such a way as they can use atomic operations to modify its contents, before marking it as...
View ArticleAttach usb to cuttlefish device via crosvm
I have a problem when connecting usb to cuttlefish. I tried using crosvm to attach as follows:$ sudo HOME=$PWD ./bin/crosvm usb attach 00:00:00:00 /dev/bus/usb/002/003...
View ArticleHow can I set breakpoints in assembly code?
I am looking over the startup code for the Linux OS. It looks like it all starts in header.S. Main is called, the kernel is unpacked and then start_kernel is the first function ran.How can I step...
View ArticleCan a kernel mode and user mode object file be linked together and run?
I have a Windows kernel mode driver (compiled with MSVC +/kernel). I am writing the test suite for it and have come across an snag:The testing suite is obvious built in user mode (sans /kernel) since...
View ArticleMakefile builds kernel objects and binary, but doesn't create ISO image...
I'm developing a hobby kernel and I'm having trouble with my build process. My Makefile successfully compiles the kernel files and creates a binary file (alinux.bin), but the step to create the ISO...
View ArticleHow to make a circular kernel?
For the Code below, I am wondering how to make a circular kernel instead of a rectangular one. I am currently looking at something circular, and I want to find the BGR average values for it. By...
View ArticleWhy does gpiochip_set_irq_hooks() either exit early or warn and continue?
I have a kernel module which provides a gpiochip, accessible from userspace using libgpiod (gpioget/set/mon, etc.).After moving from kernel 5.10 to 6.1, I get a new warning: not an immutable chip,...
View Articlecan not show the backtrace when using qemu to debug vmlinux
kernel version: 5.10.145-rt74+debug tool: qemuqemu-system-aarch64 --versionQEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.30)Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project...
View ArticleWhat is a Windows Kernel Driver?
What is Windows Kernel Driver written with the WDK?What is different from normal app or service?
View ArticleAnsible: Failed to reload sysctl: sysctl: cannot stat...
I'm setting up kubernetes cluster with ansible. I get the following error when trying to enable kernel IP routing:Failed to reload sysctl: sysctl: cannot stat...
View ArticleWindows Keyboard Filter Driver Crashes on Keypress (No Sign of DriverEntry...
I'm writing a basic keyboard filter driver using WDM. I load the .sys using sc create and sc start, and attach it to \Device\KeyboardClass0. The driver seems to load, but as soon as I press any key,...
View ArticleKernel mode clock_gettime()
I'm trying to use the POSIX clock functions in the kernel but the compiler keeps giving me the error: error: implicit declaration of function ‘clock_gettime’long __timer_end(struct timespec...
View ArticleHow can I print the current time in the kernel?
I'm a beginner at Linux.I should print the current time and do something through system call in Linux.I did the other task, but failed to print the current time.I...
View Articlexdp-redirect fail in native mode
My Intel X710 NIC (driver i40e v2.28.5, firmware 11.1.7) fails to execute XDP_REDIRECT in native mode, while the same program works fine in skb mode. The system runs Ubuntu 6.8.0-58-generic with the...
View ArticleSimulate a USB Device for Automation
I have to simulate a USB Device for automation and testing purposes (in Linux). Original driver/application for this device uses “libusb” to communicate with it.I don’t have much experience in Linux...
View ArticleWhere does QEMU load the kernel image with the "-kernel" option?
I build an elf file for a cortex-M processor with below code. Then I use objcopy to convert it into a bin file.Part of the start up assembly code: .section .isr_vector, "ax" .align 2 .globl...
View ArticleVisual Studio 2015 kernel debugger gets stuck
I am attempting to write a KMDF driver using visual studio 2015. When I try to deploy the driver and start the debugger everything seems to work: visual studio is able to build the solution and deploy...
View ArticleDoes madvise(___, ___, MADV_DONTNEED) instruct the OS to lazily write to disk?
Hypothetically, suppose I want to perform sequential writing to a potentially very large file.If I mmap() a gigantic region and madvise(MADV_SEQUENTIAL) on that entire region, then I can write to the...
View Article