Skip to content

Elieren/Kernel-C

Repository files navigation

Kernel

Project Description

This project is an educational platform for step-by-step learning and development of basic operating system components. The goal is not to create a fully functional OS, but to understand how its key mechanisms work "from the inside."

preview

RoadMap

  • IDT initialization and interrupt handling (CPU exceptions + IRQs).

  • PIC remapping and sending EOI.

  • PIT (timer) — initialization and handler, incrementing uptime (seconds).

  • RTC — reading the current time (accounting for BCD/12h/24h formats, timezone offset).

  • VGA console: character output, scrolling, hardware cursor.

  • Keyboard handler: scan-code → ASCII, Shift/CapsLock, Backspace, Enter, string input with prompt.

  • System call vector (0x80) is already connected in the IDT — framework ready.

  • Add a syscall for string output to the terminal (sys_write).

  • Memory allocator.

  • Add power off and reboot to kernel.

  • Multitasking.

  • Create terminal.

  • Implement a basic file system.

  • Make the terminal a separate application rather than part of the kernel.

  • Implement Long mode

  • Implement working multitasking for Long mode (x86_64)

  • Rewrite terminal to (NASM x86_64).

  • Check syscall operation (status working)

  • Build kernel in iso with GRUB

  • Added support for BIOS and UEFI (Multiboot2).

  • Added commands ls, cd, pwd, mkdir, rm for working with the file system and moving around directories.

    • ls
    • cd
    • pwd
    • mkdir
    • rm
  • Added graphics mode with screen resolution support.

  • Added power off support for power modes via ACPI.

  • Added sleep support to power modes.

  • Added PCI driver for working with devices.

  • Added IDE driver for working with disks.

  • Support for Loading and Executing C User Programs in Kernel.

  • Added Spinlock for exclusive access.

  • Added Seqlock for frequent reading.

  • RSDP search and validation system added.

  • Added user mode.

  • Added panic.

  • Added process names.

  • Added basic sound implementation driver.

  • Added mouse driver.

Iist of available commands:

To view the list of available commands, use the "help" command.

Build and Run

Quick Start

# Building the kernel and creating an ISO image
make iso
# Running in QEMU
make run

Basic Build Commands

Command Description
make or make all Build the kernel (default)
make iso Build the kernel and create a bootable ISO image
make run Build, create ISO, and run in QEMU
make debug Run with debug information and gdb stub
make clean Remove all build artifacts
make help Help for available commands

Prerequisites

Make sure the necessary tools are installed:

sudo apt install grub-pc-bin xorriso mtools qemu-system-x86

Detailed Description of Targets

Basic Build

make
  • All build artifacts (.o files and final binary) are placed in the build/ folder
  • Final binary: build/kernel.elf

Running in QEMU

Normal Run:

make run

Creates an ISO image and runs the kernel in the QEMU emulator

Run with Debugging:

make debug

Build with debug information, create ISO, and run in QEMU with serial output and gdb support

Custom QEMU Options

Pass options through the QEMU_OPTS variable:

# Running with gdb stub and 512 MB of RAM
make run QEMU_OPTS="-s -S -m 512"
# Debugging with gdb
make debug QEMU_OPTS="-s -S"

Note: the -s -S flags enable gdb stub and pause the CPU until the debugger is connected

Cleanup

make clean

Removes the build/ folder and all build artifacts

Additional

For a detailed list of all available commands, run:

make help

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •