r/kerneldevelopment • • Sep 21 '26

What I've learned this week (14)

Thumbnail
reddit.com
3 Upvotes

r/kerneldevelopment • • Sep 14 '26

Just For Fun Can an operating system replicate itself perfectly?

3 Upvotes

Would it theoretically be possible to create an operating system that decompiles itself, recompiles itself, and installs itself to another disk while remaining bit-for-bit identical to the parent OS?

some rules:

  1. No Source on Disk: The storage media contains only the compiled binary image. The codebase exists on disk exactly once, as raw executable code/data.

  2. Upon booting into RAM, the OS must decompile its own executing machine code into an intermediate source representation in memory, recompile that source back into a new binary image, and write it to a target drive.

  3. The child image written to the target disk must have the exact same cryptographic hash (SHA-256) as the parent OS image.

  4. It cannot simply dd / copy the raw sectors from drive to drive. The binary must pass through the decompiler, compiler pipeline.


r/kerneldevelopment • • Aug 16 '26

What I've learned the last few weeks

Thumbnail reddit.com
3 Upvotes

r/kerneldevelopment • • Aug 03 '26

Saving OS Image Size in NanoOs

Thumbnail
reddit.com
3 Upvotes

r/kerneldevelopment • • Mar 04 '26

I’m working on a multiplatform kernel

3 Upvotes

Is there any way yall can help me figure out the build system, cuz, despite doing this for years I’m not really too good at multi arch work


r/kerneldevelopment • • Dec 06 '25

Showcase I made operate system from scratch

Thumbnail
github.com
3 Upvotes

A lightweight, purely custom 64-bit Operating System kernel and bootloader from scratch. It features a custom 2-stage bootloader that transitions from Real Mode to Long Mode, loads a Flat Binary kernel, and provides a dual-output (VGA+Serial) interactive shell with memory management and permission systems, you can download the image and try it or the complete source, it is assembled with two scripts, one to compile the kernel and the other for the img with a custom bootloader, it seems quite fast, and the buddy works well, it would be necessary to work on multitasking (partially implemented but little tested) fs (which has not yet been implemented) and on the conversion to make it an iso (the modified bootloader complicates everything), but the system works, and it has never happened to me that it crashed


r/kerneldevelopment • • Oct 08 '25

Showcase CitadelOS

3 Upvotes

x86_64 OS that have:

  • Custom filesystem.

  • Custom bootloader for this filesystem.

  • Pixel font renderer.

  • IDE and AHCI support.

  • Multitasking and processes.

I am planing to implement user mode, USB and NVMe support, SMP, and GUI in future.


r/kerneldevelopment • • Sep 27 '26

Showcase An Array of linked lists as An IRQ dispatcher For a custom X86 operating system.

Thumbnail
reddit.com
2 Upvotes

r/kerneldevelopment • • Sep 20 '26

Learning Resources for TAPI and NPU Kernel Programming

2 Upvotes

Hi everyone, I recently joined a semiconductor as AI Kernel Engg. My work involes writing TAPI code. Tensor API(TAPI) is provided by our company by Synopsys, and it's for NPU. I know this much only. And I don't have any prior experience of writing the kernel as well so can anyone suggest some good resources so that I can code and experiment with them.


r/kerneldevelopment • • Aug 29 '26

RISC -V architecture based OS

Thumbnail reddit.com
2 Upvotes

r/kerneldevelopment • • Jul 11 '26

NanoOs

Thumbnail
reddit.com
2 Upvotes

r/kerneldevelopment • • Mar 31 '26

How much is allowed to be inside a microkernel's kernel space before you have a hybrid kernel?

Thumbnail reddit.com
2 Upvotes

r/kerneldevelopment • • Feb 10 '26

Question Question about implementing your own libc

Thumbnail reddit.com
2 Upvotes

cross repost, ignore last paragraph, i know the purpose of this subreddit is to avoid sloppy osdev


r/kerneldevelopment • • Jan 02 '26

Building my own LibC

Thumbnail reddit.com
2 Upvotes

r/kerneldevelopment • • Oct 10 '26

Showcase Grayscale Raster Font implemeted in PyramydOS!!!

1 Upvotes

I ported GRF (the same font format used in PatchworkOS) into PyramydOS and it looks so clean, even better than last time I used it

https://github.com/adam-bassem/PyramydOS


r/kerneldevelopment • • Oct 02 '26

Doom and other games

Thumbnail reddit.com
1 Upvotes

r/kerneldevelopment • • Sep 18 '26

Am I the only crazy person trying to make a multi-user OS for an 8-bit system?

Thumbnail
reddit.com
1 Upvotes

r/kerneldevelopment • • Sep 10 '26

Agon Light 2 Port of NanoOs

Thumbnail reddit.com
1 Upvotes

r/kerneldevelopment • • Sep 01 '26

What I've learned this week (11)

Thumbnail reddit.com
1 Upvotes

r/kerneldevelopment • • Aug 24 '26

I build an embedded kernel from scratch in rust

Thumbnail
reddit.com
1 Upvotes

r/kerneldevelopment • • Jul 09 '26

Discussion Substrate (WIP)

Thumbnail reddit.com
1 Upvotes

r/kerneldevelopment • • May 11 '26

Showcase Implementing priorities in a scheduler in C

Thumbnail kamkow1lair.pl
1 Upvotes

r/kerneldevelopment • • Jan 03 '26

Question Variables are not working with Multiboot 2

1 Upvotes

Hi guys, I'm a newbie to OS Dev. After finishing with OS Dev Barebones, I was trying to write a kernel that boots up using multiboot 2 and prints hello world using VGA, but this time for my native architecture (x86_64). So far I managed to boot into my OS's kmain function, but when I try to read/write any variables I get garbage (or rather mostly 0xfff....). It's baffling me for a whole day and would be extremely grateful for some help.

(gdb) c
Continuing.

Breakpoint 1, kmain () at src/kmain.c:3
3void kmain() {
(gdb) i r
rax            0x36d76289          920085129
rbx            0x100000            1048576
...
rbp            0x0                 0x0
rsp            0x205ffc            0x205ffc
...
rip            0x200065            0x200065 <kmain>
eflags         0x200046            [ ID IOPL=0 ZF PF ]
cs             0x10                16
...
cr0            0x11                [ ET PE ]
...
(gdb) n

Breakpoint 1, kmain () at src/kmain.c:3
3 void kmain() {
(gdb) 

Breakpoint 1, kmain () at src/kmain.c:3
3 void kmain() {
(gdb) 

Breakpoint 1, kmain () at src/kmain.c:3
3 void kmain() {
(gdb) 

Breakpoint 1, kmain () at src/kmain.c:3
3 void kmain() {
(gdb) 

Breakpoint 1, kmain () at src/kmain.c:3
3 void kmain() {
(gdb) 
kmain () at src/kmain.c:4
4    const char *message = "hello world";
(gdb) p/x message
$1 = 0x0
(gdb) n
7        asm volatile ("HLT");
(gdb) p/x message
$2 = 0xf8f
(gdb) p/x *message
$3 = 0x0
(gdb) x/80hw message
0xf8f:    0x00000000    0x00000000    0x00000000    0x00000000
0xf9f:    0x00000000    0x00000000    0x00000000    0x00000000
0xfaf:    0x00000000    0x00000000    0x00000000    0x00000000
0xfbf:    0x00000000    0x00000000    0x00000000    0x00000000
0xfcf:    0x00000000    0x00000000    0x00000000    0x00000000
0xfdf:    0x00000000    0x00000000    0x00000000    0x00000000
0xfef:    0x00000000    0x00000000    0x00000000    0x00000000
0xfff:    0x05c68900    0x00000009    0x868de0ff    0x00000048
0x100f:    0x00408689    0x868d0000    0x000000b0    0x00328689
0x101f:    0x010f0000    0x00003096    0x40aeff00    0x66000000
0x102f:    0xb0002090    0x90000010    0xb48d2e90    0x00000026
0x103f:    0x00104800    0x00001000    0x0018b800    0xd88e0000
0x104f:    0xe08ec08e    0xd08ee88e    0x25c0200f    0x7fffffff
0x105f:    0x0fc0220f    0xe083e020    0xe0220fdf    0x00b800eb
0x106f:    0x890007ff    0x0000b8c4    0xc5890000    0x000000b8
0x107f:    0xb8c68900    0x00000000    0x89b8c789    0xbb36d762
0x108f:    0x00100000    0x000000b9    0x0000ba00    0xeafc0000
0x109f:    0x00200056    0x66900010    0xb48d2e90    0x00000026
0x10af:    0x00000000    0x00000000    0x00000000    0x00000000
0x10bf:    0x00ffff00    0xcf9a0000    0x00ffff00    0xcf930000
(gdb) i r
rax            0xf8f               3983
rbx            0x100000            1048576
...
rbp            0x205ff8            0x205ff8
rsp            0x205ff8            0x205ff8
...
rip            0x200074            0x200074 <kmain+15>
eflags         0x200012            [ ID IOPL=0 AF ]
cs             0x10                16
...
cr0            0x11                [ ET PE ]
...
(gdb) 
(gdb) list
2
3 void kmain() {
4    const char *message = "hello world";
5
6    while (1) {
7        asm volatile ("HLT");
8    }
9 }

My C is already in the GDB output, and my linker script is:

SECTIONS {
    . = 2M;

    .text ALIGN(4K): {
        _smultiboot = .;
        KEEP(*(.multiboot))
        _emultiboot = .;

        _stext = .;
        *(.text)
        _etext = .;
    }

    .rodata ALIGN(4K): {
        _srodata = .;
        *(.rodata)
        _erodata = .;
    }

    .data ALIGN(4K): {
        _sdata = .;
        *(.data)
        _edata = .;
    }

    .bss ALIGN(4K): {
        _sbss = .;
        *(COMMON)
        *(.bss)
        _ebss = .;
    }

    /DISCARD/ : {
        *(*.note.*)
        *(.eh_frame)
    }
}

Also the last few lines in my kernel binary (line numbers are in decimal):

0004084 00 00 00 00 >....<
0004088 00 00 00 00 >....<
0004092 00 00 00 00 >....<
0004096 68 65 6c 6c >hell<
0004100 6f 20 77 6f >o wo<
0004104 72 6c 64 00 >rld.<
0004108

PS: I read somewhere that Multiboot 2 boots into 32-bit protected mode, and memory map might cause a problem, though I have no idea how to fix it or even if that's the case here.

Edit: Source