Kernel that only runs an NES emulator
Summary
A minimal kernel designed to run a NES emulator without any operating system, with additional programs like Mandelbrot fractal visualization.
View Cached Full Text
Cached at: 08/15/26, 09:41 AM
vmartinv/nek
Source: https://github.com/vmartinv/nek
Introduction
Nintendo Entertainment Kernel is a very basic kernel with only the minimun to run a NES emulator. This means that it can be run without any OS. It does not have pagging nor userspace nor any kind of protection at all. Only one program can be run. It is embedded in the kernel, which means the program’s code is compiled alongside the kernel.
Screenshots


Building
You should use make and provide the cross compiler:
PATH=/path/to/crosscompiler/bin:$PATH make kernel program=emulador
If there are not errors, kernel.elf should be in the bin folder.
Examples
Besides “emulador” there are three other working programs:
- mandelbrot (shows a explorable fractal)
- paleta (shows nes avalaible colors)
- corazon (a heart animation using math functions)
All of them can be compiled with the kernel using make.
Ej: make program=examples/mandelbrot
Installing
You may copy kernel.elf to /boot/ and add an entry at /etc/grub.d/40_custom like:
menuentry “nek” {
multiboot /boot/kernel.elf module /boot/initrd.img
}
Remember to update the config file:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Testing
The makefile should run QEMU using the disk image disk.img. A loop device to this file must have been set up in the mount folder.
Dependencies
- i686 cross compiler (both C and ASM), like GCC and nasm
- GRUB2(optional): Generates .iso (cd image)
- QEMU(optional): Emulation
- Doxygen and Graphviz (optional): For generating the documentation
- grub-mkrescue (optional): For generating a booteable cd image (.iso)
Boot call stack
GRUB (multiboot standard)
kernel/arch/x86/init/boot.s <– calls c code, initializes stack
kernel_entry() at kernel/arch/x86/init/kernel_entry.c <–base system initilization
kmain() at kernel/kmain.c <— some services are started
main() at program/main.(c|cpp) <— main program
Folder Structure
- kernel folder has all related to the kernel
- kernel/arch code that depends on the architecture
- kernel/fs file system(currently only vfs implemented)
- fdlibm: a math library downloaded from internet
- util/specs: Some useful documents
- informe: University report (in spanish)
- iso: a few files to generate an .iso with the kernel
- util: contains the program to generate the initrd and a few other things
- util/fuente: Tools/file used to generate the console font
Similar Articles
TinyNES Review – A Super Niche NES Console
Review of the TinyNES, a niche open-source NES console that uses original CPU/PPU chips with modern components for cleaner video/audio, though limited to composite output.
A Versatile PDP-11/70 Emulator
An article about 'Kek', a versatile PDP-11/70 emulator that runs on platforms from Linux to microcontrollers like the Teensy 4.1 and ESP32, capable of running various Unix versions.
Boot Naked Linux
This article describes how to create a minimal Linux boot that runs a single process, stripping down the usual initramfs to boot in under a second.
Show HN: Kern – container and resource runtime in a 1.5 MB binary, no daemon
Kern is a minimal, fast container and resource runtime that provides rootless sandboxes and resource management in a single 1.52 MB binary without a daemon.
A Windows Kernel in a Browser Tab, Part I: Cold Boot, Fast Boot, and Four Megabytes
The article describes nanokrnl, a 64-bit Windows kernel written in Rust, and nanox, a 65KB WebAssembly emulator that boots it directly in long mode in a browser, achieving a running OS in about four megabytes.