| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| This folder has no files. | |||
| Totals: 0 Items | 0 | ||
LazyOS π΄
"The World's Most Reluctant Operating System"
A bare-metal x86 (32-bit) operating system that runs on GRUB/Multiboot but refuses to do anything without being sufficiently flattered first.
What is LazyOS?
LazyOS is a fully bootable hobby OS written in C++ and NASM assembly that
implements the Lazy Bribe Protocol: every command (except help and
clear) requires the user to first listen to an excuse from the OS, and then
convince it to cooperate with flattery.
Technical stack:
- Bootloader: GRUB Multiboot (NASM
boot.asm) - Kernel language: C++17 (freestanding / no stdlib)
- VGA text mode driver (80Γ25, 16 colors)
- PS/2 Keyboard driver (polled, US QWERTY scancode set 1)
- No external libraries β all string utils written from scratch
- Kernel loads at physical address 1MB (standard Multiboot)
Project Structure
lazyos/
βββ boot/
β βββ boot.asm # GRUB Multiboot header + _start entry
βββ kernel/
β βββ kernel.cpp # kernel_main β initializes drivers, runs shell
β βββ shell.cpp # Shell loop + all commands + Lazy Bribe mechanic
βββ drivers/
β βββ vga.cpp # VGA text mode 80x25 driver
β βββ keyboard.cpp # PS/2 polled keyboard driver (scancode set 1)
βββ lib/
β βββ kstring.cpp # Bare-metal string utilities
βββ include/
β βββ vga.h
β βββ keyboard.h
β βββ shell.h
β βββ kstring.h
βββ linker.ld # Linker script β loads at 0x100000 (1MB)
βββ grub.cfg # GRUB menu entry
βββ Makefile # Build system
βββ README.md # This file
Prerequisites
You need a i686-elf cross-compiler toolchain. The host compiler will not work because it generates host-native code.
Install cross-compiler (Linux)
The easiest method is using the OSDev cross-compiler guide or a package:
# Ubuntu/Debian β install prebuilt cross-toolchain
sudo apt install gcc-multilib g++-multilib nasm \
grub-pc-bin grub-common xorriso \
qemu-system-x86
# If you need a true i686-elf-gcc, build it from source:
# See: https://wiki.osdev.org/GCC_Cross-Compiler
Note: Some distributions provide
i686-linux-gnu-gccwhich is not the same asi686-elf-gcc. For a true freestanding build, you need the bare-metal ELF cross-compiler. The Makefile usesi686-elf-gcc.
macOS (with Homebrew)
brew install i686-elf-gcc nasm xorriso qemu
Building
# Build just the kernel binary
make all
# Build a bootable ISO image
make iso
# Build ISO and run in QEMU
make run
# Quick run (kernel only, no ISO)
make run-kernel
# Clean build artifacts
make clean
Commands
Once booted, you'll see the LazyOS banner and a shell prompt:
lazy@os ~>
| Command | Description | Requires Bribe? |
|---|---|---|
help |
Show this command list | No (free!) |
clear |
Clear the screen | No (free!) |
vibe |
Check the current OS vibe/mood status | Yes |
nap |
Make the OS take a micro-nap | Yes |
rate |
The OS rates you as a user | Yes |
philosophy |
Hear a deep thought from the OS | Yes |
todo |
View the OS's to-do list | Yes |
complain |
File an official complaint (OS complains about YOU) | Yes |
coinflip |
Flip a coin | Yes |
shutdown |
Attempt to shut down the system | Yes |
The Lazy Bribe Protocol
Every non-free command goes through two steps:
Step 1 β The Excuse The OS prints a random excuse for why it doesn't feel like running your command. Examples:
- "Ugh... I just got comfortable. My CPU is LITERALLY napping right now."
- "Error 418: I'm a teapot and I'm too tired to brew anything."
Step 2 β The Bribe
You must type a convincing phrase at the bribe> prompt.
The OS accepts inputs containing phrases like:
| Accepted Bribes (case-insensitive, substring match) |
|---|
pretty please |
you are the best os ever |
i beg you |
you're amazing |
greatest os |
i love you |
please please |
most powerful os |
| (and ~12 more variants) |
If your bribe is accepted:
"Fine. FINE. You win. Running it..."
If rejected:
"That was pathetic. Command refused. Try harder next time."
Technical Notes
Memory Layout
0x00000000 β 0x000FFFFF Reserved / BIOS / IVT
0x00100000 β end LazyOS kernel (loaded by GRUB)
0xB8000 VGA text mode framebuffer
VGA Driver
- 80Γ25 text mode, 16 foreground + 8 background colors
- Hardware cursor updated via CRTC registers (0x3D4/0x3D5)
- Supports:
\n,\r,\t,\b, automatic scroll-up
Keyboard Driver
- Polled (no IRQ/PIC setup β keeps the kernel minimal)
- US QWERTY scancode set 1
- Handles: shift, caps lock, backspace, enter
- Ring buffer: 256 characters
No stdlib
All string operations are implemented in lib/kstring.cpp:
kstrlen, kstrcpy, kstrcmp, kstricmp, kstrcontains, kstrtrim,
kstrtolower, kitoa, kutohex, etc.
Pseudo-Random Numbers
Uses a 32-bit LCG (Linear Congruential Generator) seeded at 0xCAFEBABE.
Powers the random excuse/bribe-response selection.
Troubleshooting
"i686-elf-gcc: command not found" You need the cross-compiler. See the Prerequisites section.
QEMU black screen / triple fault
Run make run-debug and check /tmp/lazyos-debug.log.
grub-mkrescue fails
Make sure xorriso is installed: sudo apt install xorriso
Keyboard not responding in QEMU
Click inside the QEMU window to grab input. Press Ctrl+Alt+G to release.
License
Do whatever you want with this. The OS certainly won't stop you. It doesn't have the energy.
Built on Pure Procrastination. Powered by Spite.