← All projects

02 / Operating systems

An experimental kernel

My small x86 kernel project in C and assembly. It includes startup code, interrupts, keyboard input, and memory-management experiments.

C · x86 assemblyLearning project
View repository

The problem

Application code normally inherits an initialized machine and a set of operating-system services. A kernel project starts earlier: it has to establish those foundations before higher-level software can rely on them.

How it is structured

The repository separates the kernel entry point, x86-specific code, drivers, and memory-management sources. The entry point initializes x86 state and records usable memory information from the boot environment.

Startup

Establish the initial machine state.

Devices

Handle input and visible output.

Memory

Explore mapping and block allocation.

Keyboard input

The keyboard handler reads a scan code and handles characters, backspace, and enter through screen and cursor operations. It is a direct view of the path from a device event to visible output.

Pages and allocation

Page-table initialization and a buddy-style allocator live in the memory-management code. They expose different responsibilities: describing address mappings and dividing memory into allocatable blocks.

Current capabilities

  • Kernel and x86 startup sources, with interrupt-related infrastructure.
  • Keyboard handling and screen-output routines.
  • Page-table initialization and a free-list-based allocation experiment.

Scope & limitations

This is a learning project, with a much smaller scope than a general-purpose operating system. Boot behavior on current hardware and process isolation haven’t been verified for this write-up.

A detail worth looking at

The keyboard handler is a small place to start reading. You can follow a scan code through to a character on screen, including the handling for backspace and enter.

Explore the source