Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

0x00-Kernel 🖥️

"Bare-metal development at the highest privilege level."

0x00-Kernel is a minimalist micro-kernel developed in x86 Assembly (Real Mode). The name references the Ring 0 privilege level (DPL 00), where the code interacts directly with the silicon without the abstractions of a modern operating system. This project was built to explore fundamental concepts of computer architecture, hardware interrupts, and memory management.


🚀 Current Features

  • Two-Stage Bootloader: Overcomes the 512-byte MBR limit by loading the Kernel from Sector 2 of the disk into RAM address 0x8000.
  • VGA Video Driver: Direct manipulation of video memory at 0xB8000 for screen clearing and color control.
  • Keyboard Driver (PS/2): Interception of Scan Codes via I/O Port 0x60 with ASCII translation using a lookup table.
  • Interface Security: Implementation of a logic lock on the Backspace key to prevent visual interface corruption using interrupt 0x10, AH=0x03.
  • Modularization: Code organized into reusable modules (.asm) using the %include directive.

📂 Project Structure

.
├── src/
│   ├── boot/
│   │   └── boot.asm      # Stage 1: Boot sector loader
│   └── kernel/
│       ├── kernel.asm    # Stage 2: Entry point and main loop
│       ├── keyboard.asm  # Input driver (Keyboard)
│       └── screen.asm    # Text output functions
├── bin/                  # Compiled binaries (.bin)
└── run.bat               # Automation script to compile/run in QEMU.

🛠️ How to Compile and Run

Prerequisites

  • NASM (Netwide Assembler)
  • QEMU (Hardware Emulator)

Execution

Simply run the automation script to compile the stages, merge the binaries, and start the emulation:

./run.bat

🧠 Technical Deep Dive

The Boot Flow

  1. The BIOS loads the first 512 bytes (boot.asm) at 0x7C00.
  2. boot.asm uses interrupt int 0x13 to read the Kernel from the disk and move it to 0x8000.
  3. Control is transferred via jmp 0x8000, starting the kernel in real mode.

The Keyboard Driver

The Kernel operates in polling mode, monitoring the status register of the 8042 controller (Port 0x64). When bit 0 is active, the code reads the Scan Code from port 0x60 and uses a mapping table to convert the electrical signal into a human-friendly ASCII character.


🎓 Learning Objectives

This project was developed as part of independent Low-level studies, focusing on:

  • Reverse Engineering and Binary Analysis.
  • Low-level Driver Development.
  • Register and Stack management in x86 Assembly.

Developed by 0xRobert de Souza Lages.
Interested in high-performance systems, hardware, and what happens under the hood.

About

EN: A minimalist x86 real-mode kernel operating at Ring 0. Features a custom 2-stage bootloader, VGA text-mode drivers, and PS/2 keyboard handling. PT: Micro-kernel minimalista em Assembly x86 operando em Ring 0. Inclui bootloader de dois estágios, drivers de vídeo VGA e teclado PS/2.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages