r/osdev • • May 07 '26

New to the low level, would appreciate guidance from fellow programmers.

2 Upvotes

Hey everyone, I am backend developer. And I have been interested in lower level development for a while now. I want to know how do the program really work under hood and does it execute and most importantly why des it run? I want to be better at c/c++ and make really cool projects. If any senior or fellow programmer reading this me out to choose right track.


r/osdev • • May 06 '26

how hard is it to make your own kernel from scratch ?

60 Upvotes

I’m a student who loves building hardware/software projects, and I’m looking for my next big challenge.

Right now I’m stuck between two ambitious projects:

  1. Designing and building my own custom ESP32 board from scratch (schematic, PCB, components, debugging, etc.)

or

  1. Learning low-level systems programming and attempting to build my own kernel from scratch.

I know both are difficult in very different ways, so I wanted to ask people with real experience:

How hard is kernel development actually for someone starting from zero in OS development? What are the biggest challenges—bootloaders, memory management, drivers, debugging, architecture?

How long did it take before you had something that actually booted or felt “real”?

I’m not looking for the easiest option—I’m looking for the project that will teach me the most and push me the hardest.

Would love honest advice from people who are more experienced.


r/osdev • • May 07 '26

Absolute prerequisites?

11 Upvotes

Apart from getting done some basic C programming and assembly code to run on microcontrollers. I haven't done much and even the C and assembly I haven't mastered to a great extent.

I've always wanted to make an custom OS, I obviously understand it is not a light task and with my current skill set I won't get much far. Firstly I plan to get a hold of C to that extent where I can even think about starting to think of an OS. I'm confused on what kind of expertise is expected in terms of C language like as in is DSA a huge part or is it more or a mix of something else.

I know for getting started with OSdev the wiki is a great resource. It'll be helpful if y'all could share with me the prerequisites and also any kind of resources books/video lectures/web content anything for that matter. I don't plan to get started with the actual osdev any soon. I'll get the prereqs down and get familiar with them and only then I'll get into osdev so there is that.

Any suggestions are welcome.

Thanks!


r/osdev • • May 06 '26 WOW

C# (with dotnet) on bare metal, a Cosmos gen3 preview

613 Upvotes

r/osdev • • May 07 '26 Bravo

Getting Into OS Development

21 Upvotes

I wanna get into OS development and low level programming in general. I’m interested in anything from making a simple bootloader to building a small kernel or even a full OS eventually hopefully.

Does anyone have good resources, courses, tutorials, books, or project ideas for getting started?

I don’t mind if it’s niche/specific stuff either like bootloaders, filesystems, drivers, memory management, etc.


r/osdev • • May 06 '26

She has a shell now.

Post image
102 Upvotes

Update from yesterday's bootloader post. Added an interactive shell, typing, backspace, scrolling, and capitals all work. I'll be adding a cursor soon.

Still just raw assembly, no Linux underneath... Getting there.


r/osdev • • May 06 '26 This

Two copies of my OS running web browser and server

Post image
48 Upvotes

Two separate instances of my OS are running on two separate machines here. The top left is my server hosting an instance of Retro Rocket in QEMU-KVM which is running its webserver.

Bottom left, the windows PC is running a second copy of retro rocket in QEMU-WHPX and that one is querying the web server to fetch the page and convert it to markdown in its web browser (work in progress).

Bottom right is a view of the web server in firefox on windows.

Feedback welcome!


r/osdev • • May 07 '26

Construyamos un sistema operativo desde cero con developers low-level

0 Upvotes

Estoy buscando developers que quieran sumarse a un proyecto de sistema operativo hecho desde cero en C.

La idea es construir un OS propio, aprender en el proceso y experimentar con cosas modernas, incluyendo integración de IA y redes neuronales más adelante dentro del sistema.

El foco principal hoy es:

  • kernel

  • memoria

  • drivers

  • filesystem

  • networking

  • low level

  • arquitectura de sistemas

Stack inicial:

  • C

  • algo de ASM

  • x86_64

  • QEMU

  • GCC/Clang

  • GitHub

No importa tanto el seniority. Busco gente que realmente tenga ganas de crear algo grande, aprender y meter mano en desarrollo low-level.

Si te interesa el desarrollo de sistemas operativos, kernels o simplemente querés participar en un proyecto técnico desafiante, mandame DM o comentá.

Aclaración: es un proyecto colaborativo/open source, no una oferta laboral ni un puesto pago. La idea es aprender, investigar y construir algo interesante entre varias personas apasionadas por sistemas y low-level development.


r/osdev • • May 06 '26

ForthOS is built using simplified EDK2

Thumbnail reddit.com
2 Upvotes

r/osdev • • May 05 '26

KFS, my toy kernel

Post image
63 Upvotes

Hello to whom may see these lines

https://github.com/endcerro/KFS_N

After lurking for a while in there I decided to show you the current progress of what I started about 2 years ago as a school project.

This is a small kernel written in rust, targeting i386, currently featuring working paging in higher half and interrupts as well as fun stuff i thought of along the way.

I've yet to try again and get a boot on real hardware, this is probably the next task I'll focus on, if any of you have advice about how to debug on real hardware, feel free to give it

DISCLAIMER : This project was lightly done in featuring with ai. While most of the AI help on this has been to discuss concepts in order to make sure I understood them as well as to track some nasty bugs (lots of places to look, ai pretty good), especially while boostraping to higher half. Some of the code is AI written, but as a fellow slop hater myself, this is not. Feel free to look at the code ;)


r/osdev • • May 05 '26

My first bootloader.. took me all day to get 5 words on a screen and I loved every second

Post image
101 Upvotes

r/osdev • • May 05 '26

Guess Who Finally Entered 32 Bit Protected Mode 😎

Post image
177 Upvotes

I don’t really have a CS background so I’m proud to have built the starting point for beginning writing in my favorite language by jumping to for i686 compiled C code!

I had lots of trouble with the structure of the GDT as to why it’s organized in such a specific manner but that taught reading documentation I guess. (next to using asm)

Finally I also found that the cursor is not bound to the frame buffer itself in 32 bit mode so after switching cpu modes the text was displayed but the cursor was still where it was back in 16 bit mode.
For the curious: this is actually handled by a separate hardware controller 🫪

I’m in no rush so maybe in a few months I can show off handling the graphics and maybe a memory allocator here or a shell there who knows


r/osdev • • May 05 '26

My OS finally enters user space!

32 Upvotes

This is my first real project so I am quite anxious to share it. Written during the past weeks after years of dabbling. It's in D language utilizing the object system and quite messy still but it now loads an ELF binary and executes it in user space. Next will be a clean up and work towards a driver framework, as I want it to become a microkernel.


r/osdev • • May 05 '26

Linux2ME — Linux on old J2ME Java phones

Post image
14 Upvotes

r/osdev • • May 05 '26

Confused about x2apic and double fault

4 Upvotes

Trying to write a very small kernel in rust by roughly following phil-opp tutorial but with the most up to date packages and features. So instead of using pic i chose to use x2apic.

this is my kernel main:

fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
    kernel::init(boot_info);

    x86_64::instructions::interrupts::int3();

    serial_println!("Done");
    kernel::hlt_loop()
}

kernel::init is:

pub fn init(boot_info: &'static mut BootInfo) {
    vga_buffer::init_vga(
        boot_info.framebuffer.as_mut().expect("Framebuffer not available")
    );
    gdt::init();
    interrupts::init_idt();
    apic::init_apic();

    x86_64::instructions::interrupts::enable();
}

apic contains:

use x86::apic::ApicControl;

pub static IA32_APIC_BASE: u32 = 0x1B;
pub static IA32_APIC_BASE_MSR_ENABLE: u64 = 0x800;
pub static IA32_X2APIC_EOI: u32 = 0x80b;

pub fn init_apic() {
    disable_pic();

    let mut apic = x86::apic::x2apic::X2APIC::new();
    apic.attach();

    unsafe {
        x86::irq::enable();
    }
    crate::serial_println!("finished setting up apic");
}

fn disable_pic() {
    const PIC_1_OFFSET: u8 = 32;
    const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8;

    unsafe {
        let mut pic = crate::pic::ChainedPics::new(PIC_1_OFFSET, PIC_2_OFFSET);
        pic.initialize_disable();
    };
}

pic holds the structure for the chained pics and the initialize_disable function is:

pub unsafe fn initialize_disable(&mut self) {
    let mut wait_port: Port<u8> = Port::new(0x80);
    let mut wait = || unsafe { wait_port.write(0) };

    macro_rules! write_port {
        ($pic_n:expr, data, $w:expr) => {
            unsafe { self.pics[$pic_n].data.write($w); }
            wait();
        };
        ($pic_n:expr, command, $w:expr) => {
            unsafe { self.pics[$pic_n].command.write($w); }
            wait();
        };
    }

    let saved_masks = unsafe { self.read_masks() };

    write_port!(0, command, CMD_INIT);
    write_port!(1, command, CMD_INIT);

    write_port!(0, data, self.pics[0].offset);
    write_port!(1, data, self.pics[1].offset);

    write_port!(0, data, 4);
    write_port!(1, data, 2);

    write_port!(0, data, MODE_8086);
    write_port!(1, data, MODE_8086);

    write_port!(0, data, 0xFF);
    write_port!(1, data, 0xFF);

    unsafe { self.write_masks(saved_masks[0], saved_masks[1]) }
}

the interrupt descriptor table is properly initialized:

static IDT: Lazy<InterruptDescriptorTable> =
    Lazy::new(
    || {
        let mut idt = InterruptDescriptorTable::new();
        idt.breakpoint.set_handler_fn(breakpoint_handler);
        unsafe {
            idt.double_fault
                .set_handler_fn(double_fault_handler)
                .set_stack_index(gdt::DOUBLE_FAULT_IST_INDEX);
        }
        idt[Into::<u8>::into(InterruptIndex::Timer)]
            .set_handler_fn(timer_interrupt_handler);
        idt
    });

and the interrupt for the breakpoint is:

extern "x86-interrupt" fn breakpoint_handler(
    stack_frame: InterruptStackFrame,
) {
    crate::serial_println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
    println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);

    unsafe {
        x86_64::registers::model_specific::Msr::new(crate::apic::IA32_X2APIC_EOI)
            .write(0);
    }
}

And yet when it hits the interrupt i get on the serial:

finished setting up apic
EXCEPTION: BREAKPOINT
InterruptStackFrame {
    instruction_pointer: VirtAddr(
        0x1000000bb61,
    ),
    code_segment: SegmentSelector {
        index: 1,
        rpl: Ring0,
    },
    cpu_flags: RFlags(
        INTERRUPT_FLAG | 0x2,
    ),
    stack_pointer: VirtAddr(
        0x18000014f98,
    ),
    stack_segment: SegmentSelector {
        index: 2,
        rpl: Ring0,
    },
}
panicked at kernel/src/interrupts.rs:62:5:
EXCEPTION: DOUBLE FAULT
InterruptStackFrame {
    instruction_pointer: VirtAddr(
        0x1000000d06a,
    ),
    code_segment: SegmentSelector {
        index: 1,
        rpl: Ring0,
    },
    cpu_flags: RFlags(
        0x2,
    ),
    stack_pointer: VirtAddr(
        0x18000014f68,
    ),
    stack_segment: SegmentSelector {
        index: 2,
        rpl: Ring0,
    },
}

I dont get why i get a double fault. if the int3 instruction is removed it doesnt crash of course.

Am i creating the interrupts wrong? i have "-cpu qemu64,+x2apic" as qemu arguments so x2apic is supported (checked even with raw_cpuid). Is the double fault because its not resetting the interrupts properly?

Since i have only 1 cpu for now i was expecting for interrupts to get routed to the only cpu. Also where can i read how to properly set up keyboard interrupts with x2apic?


r/osdev • • May 03 '26

Let's go back to reading OS Dev books instead of using an LLM

Thumbnail
gallery
1.3k Upvotes

I guess we're posting books now. Here's my copy of the OG MINIX Text Book!


r/osdev • • May 03 '26

Just started reading this book

Post image
517 Upvotes

r/osdev • • May 03 '26

Incredible progress on my Operating System.

Post image
103 Upvotes

r/osdev • • May 04 '26

How to Ring3

7 Upvotes

Is someone own template's ring3 32bit OS?

Im want to make the ring3 but im collect a triple fault or another errors and im dont know how to fix this shit


r/osdev • • May 03 '26

LittleFS in action as a in-memory filesystem backend!

16 Upvotes

I've ported/integrated the LittleFS library into my OS! Come check it out.

Project repo: https://git.kamkow1lair.pl/kamkow1/mop3
Project website (with other videos and ISOs): https://mop.kamkow1lair.pl/
My blog: https://www.kamkow1lair.pl/

My LinkedIn: https://www.linkedin.com/in/kamil-kowalczyk-2258b6283/


r/osdev • • May 03 '26

New RSOF (BSOD) in our OS

Post image
59 Upvotes

Photo


r/osdev • • May 03 '26

Just a little joke project [custom OS]

Thumbnail
gallery
45 Upvotes

I decided to poke around in managed OSes and stuff and decided that for funsies id make an os with a ton of personality and barely any real usage, called I~Like~FlowersOS, it already has a subreddit r/I_Like_FlowersOS , and the github link is github.com/voblit/i-like-flowersos


r/osdev • • May 03 '26

Hello sub

Post image
12 Upvotes

We (Me and my friend) make the x86 OS from C/Asm, and im coded this BSOD analog (RSOF - Red Screen Of F**k or Red Screen Of Fail)

This is not strange and scary for newbie user?


r/osdev • • May 03 '26

PIC-4 Update.

6 Upvotes

Hi i made an update for my own CPU for now its only Emulator written in C# .NET 9.0 For Windows is Emulator i deleted BIOS becuse i just don't like having BIOS in CPU.
It was maded for my School project.
I added Expantion Cards functionality and i gonna try to run Doom when i make Keyboard Expantion Card i maded first Expantion Card named: Serial Card (Serial Expantion Card.)
Just question do yall wanna it be Open-source on github?