Why 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 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 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 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 ArticleRust Kernel: Undefined refrence to...
Im writing a kernel in Rust, but are having some problems with the panicking module.I have written a build script that should build the boot image of the OS, but i seem to get an error while trying to...
View ArticleTwo USB Linux Kernel driver urbs are timing out
Doing some Linux Kernel USB driver learning. I've got a Seeeduino Xiao SAMD21 and have changed the VID/PID (yeah I know) so it looks like "my own" device.The Xiao's program is simple- take in a Serial...
View ArticleBuilt-in kernel driver still need device tree?
If I build a kernel driver as a module, it can be inserted into the kernel at run-time manually with insmod or modprobe, that i am clear. But are the following statements about device tree, correct?If...
View Articlesys/types.h: No such file or directory
I am trying to compile module but get this error.fatal error: sys/types.h: No such file or directorycompilation terminated.Here is my module file headers#include <linux/init.h> // Macros used to...
View Articlewhat is good about writing your own kernel [closed]
I'm very interested in operating systems programming.I want to write my own kernel from empty paper.I know C language well and a bit assembly.I've intended to buy Andrew tanenbaum's book: "Operating...
View ArticleMy Multiboot Info Structure is not correct. Why?
I am trying to write a physical allocator, and to do so I need the base address for available memory, the high address for available memory, and a memory map. This is all provided to me by the BIOS...
View ArticleFrom-VESA VBE Not Displaying Any Output as Intended
I've recently been working on a mini operating system written completely from scratch. After implementing a bootloader and minimalised kernel, I tested the whole program on GDB, with the breakpoint...
View ArticleLInux kernel log
I'm running embedded Linux (Angstrom distribution, for Atmel). I would like to read the kernel message log during shutdown, same stuff I'd get with dmesg. Basically I'm exploring a few issues I have by...
View ArticleAuto-sync of config file in linux kernel compilation produces wrong...
I need to load the symbols into gdb so that I can debug the boot loader. I am on an ARM architecture compiling for x86. I have tried this and the symbols do not load. This is the process I follow.Since...
View ArticlePython Class not loaded MNT_NOSUID
I am attempting to connect the GDB to my compiled linux kernel. I changed the .config file and enabled debugging. I input into gdb the following.source vmlinux-gdb.pyThe result isPython Exception...
View Articleshared memory segment vs shared memory object
What is the difference between shared memory object (created using shm_open) and shared memory segment(shmget)?Do they have any limitations that cant be tuned like in case of shared memory shmmax and...
View ArticleExtract vmlinux from vmlinuz or bzImage
I want to generate System.map from vmlinuz,cause most of machines don't have the file System.map.In fact,vmlinuz are compressed to vmlinuz or bzImage.It's any tool or script can do this?I tried:dd...
View ArticleSet kernel parameters on an Android Pixel 8 running CalyxOS
I am running a rooted CalyxOS (rooted using magisk) on a Google Pixel 8 (Shiba) device.uname -a: Linux localhost 5.15.137-android14-11-gbc062a78e195-ab12057991 #1 SMP PREEMPT Mon Jul 8 12:34:46 UTC...
View ArticleInterlockedExchange on two CPU cores
I have a Windows 7 driver where I want to synchronize access to a variable. Can I use InterlockedExchange for it?My current understanding of InterlockedExchange is, that InterlockedExchange is done via...
View ArticleHow can I get the BSOD bugcheck code text description by code/windows API
I can get the bugcheck code and the parameters for one BSOD.And then I can get the text descriptions from Bug Check Code Reference.But how can I use some windows API or c++ code to get such text...
View ArticleHow to mount a subdirectory(inode ) to a specific path? Kernel development
I'm working on a directory-level snapshot feature based on a file system, where a snapshot of a directory is recorded by an inode, and I want to implement how the snapshot sharing mount should be...
View ArticleCalling ObOpenObjectByName NT kernel API from user mode
ObOpenObjectByName seems to be an internal NT kernel API that is barely documented. This API is exported by ntoskrnl. Can I use this API from user mode application, and if I can, how can I link against...
View ArticleHow to write a panic message if the UART is already locked by the panicking...
I'm working on a hobby RISC-V OS kernel (QEMU virt) in no_std Rust and want my panic_handler to print the panic information to UART (is it the right way?).My println! macro eventually calls a _print...
View Articlex86 ASM: DD Being Used as an "Instruction"?
In the following x86 assembly code:dd 0x1BADB002dd 0x00dd - (0x1BADB002+0x00)The values don't seem to be assigned to any variables. So what does this snippet of code do? I've heard something about it...
View ArticleIn kernel development, why do developers avoid pasting in high level...
Context: I am a somewhat seasoned C++ and Python developer, and a beginner in Rust with no experience in assembly or machine code following the blogOS guide trying to create a minimal kernel that...
View Articlelinux kernel: allocate huge buffer
In my kernel module, I have to allocate a huge buffer of 1GB.This buffer has to be mapped to user space.In user space I will read 1GB file into this buffer.From this buffer, I have to initiate DMA to a...
View ArticleHow to delete all the kernels in VSCode?
I'm always using VSCode and some time ago I uninstalled anaconda. The problem is that when I use the Jupyter notebooks in VSCode if I don't remember of changing it, the kernel that it use as default is...
View ArticleOSDev: After bootloader jumps to kernel, nothing happens (QEMU blank screen)
I'm building a hobby x86 OS from scratch (bootloader in NASM, kernel in C).Problem:My bootloader prints "BOOT" and loads my kernel (linked at 0x1000) from disk into memory and then jumps to...
View ArticleUbuntu AWS kernel not updating? [closed]
I have an Ubuntu 22.04.5 LTS AMI at AWS. I update it every month with:sudo apt updatesudo apt -y upgradeWhen this AMI was originally provisioned in Nov 2023, the installed kernel was...
View ArticleRaspberry pi not booting after update to kernel and bootloader [closed]
So I was trying to enable I2S for a microphone, and was following steps from chatGPT, and it told me to I had to add these to the config.txt file:dtparam=i2s=ondtoverlay=i2s-micI did that and then it...
View Articlevirt_to_phys vs dma_map_single in smmu enable system
can someone please help in explaining why virt_to_phys cant be used in case of SMMU to get the IOVA address, as in SMMU enabled system physical address are not exposed , so can we use virt_to_phys in...
View Article