NanumOS

Code

How big NanumOS is, as the number of lines of code we wrote ourselves. One counter that anyone can run again recounts everything every day.

449,280lines of code we wrote1,147,813lines of open-source code we include0.36test lines for every line of code71,964lines of documents

Counted on 2026-11-15

Sneak peek

For each language we write, a few real lines from one of our own files, the most used language first.

C 354,434 lines

How the Korean input method turns a consonant, a vowel and a final consonant into one syllable.

static uint32_t shown_cp(const struct ime *s) {
    if (s->cho >= 0 && s->jung >= 0) return 0xac00u + (uint32_t)((s->cho * 21 + s->jung) * 28 + s->jong);
    if (s->cho >= 0) return cho_compat[s->cho];
    if (s->jung >= 0) return 0x314fu + (uint32_t)s->jung;
    return 0;
}

ime.c

Python 220,105 lines

A piece of the counter behind this page: it skips blank lines and comment lines.

def strip_hash(text):
    code = raw = 0
    for line in text.split('\n'):
        raw += 1
        s = line.strip()
        if s and not s.startswith('#'):
            code += 1
    return code, raw

loc.py

Swift 9,573 lines

Where the Mac app decides how big a new home disk is.

    static func wantBytes(volumeOf path: String) -> UInt64 {
        if let m = UInt64(ProcessInfo.processInfo.environment["ZEUSOS_HOME_MIB"] ?? ""), m >= 64 { return m << 20 }
        let tib: UInt64 = 1 << 40
        let url = URL(fileURLWithPath: (path as NSString).deletingLastPathComponent)
        if let v = try? url.resourceValues(forKeys: [.volumeTotalCapacityKey]), let t = v.volumeTotalCapacity, t > 0 {
            return min(tib, UInt64(t) / (1 << 30) * (1 << 30))
        }
        return tib
    }
    static func span(_ bytes: UInt64) -> UInt64 { (bytes / 512 - 16384) / 2 }
    /// The Mac volume's free bytes (what the home can still really take).

home_disk.swift

JavaScript 7,141 lines

The loop that turns country flag drawings into small images for the radio.

for (const c of codes) {
  const f = path.join(nm, "flag-icons/flags/4x3", c.toLowerCase() + ".svg");
  if (!fs.existsSync(f)) continue;
  const r = new Resvg(fs.readFileSync(f), { fitTo: { mode: "width", value: +w } }).render();
  if (r.width !== +w || r.height !== (+w * 3) / 4) throw new Error(c + " size " + r.width + "x" + r.height);
  fs.writeFileSync(path.join(out, c + ".rgba"), r.pixels);
}

flags_raster.js

Shell 5,562 lines

Three lines that register the GPU broker as a service and start it.

sudo -n systemctl daemon-reload
sudo -n systemctl enable zgpu-broker >/dev/null 2>&1
sudo -n systemctl restart zgpu-broker

install_host.sh

Assembly 3,230 lines

A piece of the very first code to run when an ARM machine starts. It reads which privilege level it is in.

    msr daifset, #15
    mrs x1, CurrentEL
    lsr x1, x1, #2
    mov x20, x1               /* arm64_boot_el */
    mov x21, xzr              /* arm64_boot_vhe */
    cmp x1, #2
    b.ne 1f

start.S

C++ 2,881 lines

Where the GPU broker writes its log. It never writes a prompt or an answer.

static void logf(const char *fmt, ...) {   // the journal: connections, sizes, timings, refusals — never a prompt or an answer
    va_list ap; va_start(ap, fmt);
    char b[512]; vsnprintf(b, sizeof b, fmt, ap); va_end(ap);
    fprintf(stderr, "zgpu: %s\n", b); fflush(stderr);
}

zgpu_broker.cpp

Rust 338 lines

Small functions in the messenger's encryption part that take bytes from the C side safely.

struct W(Vec<u8>);
impl W {
    fn u32(&mut self, v: u32) { self.0.extend_from_slice(&v.to_le_bytes()); }
    fn u64(&mut self, v: u64) { self.0.extend_from_slice(&v.to_le_bytes()); }
    fn bytes(&mut self, b: &[u8]) { self.u32(b.len() as u32); self.0.extend_from_slice(b); }

lib.rs

Growth, day by day

our code   open-source code included

0500k1,000k1,500k10-2711-0611-15
The numbers behind the chart
DayOur codeOpen-sourceTests
2026-10-2798018
2026-10-281,6220759
2026-10-293,37801,666
2026-10-306,83503,843
2026-10-3147,487462,93614,638
2026-11-0183,373642,32422,203
2026-11-02118,541672,08631,506
2026-11-03160,634672,18446,194
2026-11-04199,081705,37362,429
2026-11-05208,517705,37368,879
2026-11-06226,022705,37376,179
2026-11-07199,328705,37362,278
2026-11-08199,368705,37362,278
2026-11-09251,5081,037,20388,943
2026-11-10292,5441,040,352106,418
2026-11-11308,5011,040,352114,660
2026-11-12366,3621,070,770129,409
2026-11-13378,1271,077,023131,968
2026-11-14439,5311,147,813153,256
2026-11-15449,1521,147,813161,312

Where the lines are

Kernel and drivers73,957
Desktop and apps232,679
Commands and libraries42,989
Server programs16,412
Build and project tools83,243
Tests161,312

Tests are counted on their own, not inside the number for our code.

What we use from others

These are open-source projects included as they are, or nearly. Each one is listed with its licence, and none of them is counted in the number for our own code.

ProjectLicenceLines
dav1dBSD-2-Clause224,194
SQLitepublic domain203,624
FreeTypeFreeType License88,107
musl libcMIT71,846
QuickJSMIT67,935
libvpxBSD-3-Clause59,918
MicroPythonMIT55,482
Xiph audio decoderBSD-3-Clause47,334
PCRE2BSD-3-Clause with exception47,004
BearSSLMIT36,094
OpenH264 (decoder)BSD-2-Clause33,022
PacketVideo AAC decoderApache-2.028,472
CMU Pronouncing Dictionary (reading table, generated)BSD-style23,786
LuaMIT20,296
Berkeley SoftFloatBSD-3-Clause18,229
zlibzlib17,681
OpenBSD iwx (Intel Wi-Fi driver)ISC15,055
sbaseMIT13,713
noVNCMPL-2.0 / BSD / MIT11,759
dr_flacpublic domain or MIT-08,813
lai (AML interpreter)MIT-style7,662
The One True AwkLucent permissive6,338
stb_imageMIT or public domain5,833
simplewebpBSD-3-Clause4,532
stb_vorbispublic domain or MIT4,046
nanosvgzlib3,812
web-platform-testsBSD-3-Clause3,501
stb_truetypeMIT or public domain3,483
rqrr / quirc (QR reader)MIT or Apache-2.0, ISC3,149
MonocypherBSD-2-Clause or CC02,416
LZ4BSD-2-Clause2,208
minimp3CC01,709
CoreMarkApache-2.01,679
stb_sprintfpublic domain or MIT1,473
TLSF allocatorBSD-3-Clause874
GNU Unifont glyphs (generated table)SIL OFL 1.1758
OpenSSH bcrypt_pbkdf and BlowfishISC / BSD-3-Clause719
llama2.cMIT671
toybox bzcat0BSD384
mbed TLS (md4.c, trimmed)Apache-2.0202
By language (our code)
LanguageLines
C354,434
Python220,105
Swift9,573
JavaScript7,141
Shell5,562
Make3,818
Assembly3,230
C++2,881
HTML1,788
CSS1,208
Go345
Rust338
Linker script169

How it was counted

Code we wrote: the lines of our source files, without blank lines and comment-only lines. It adds up the kernel and drivers, the desktop and apps, the commands, the server programs and the build tools; tests and documents are left out. Tables that a tool generates are counted apart and not included.

Code from others: decided file by file. A file inside a listed folder (whose licence file must really exist) is from others; a file with our name in its header is ours. A file whose origin cannot be told makes the check fail.

Test ratio: the lines of test code divided by the lines of code we wrote.

Documents: the lines of manuals and written records (Markdown), without blank lines.

Technical details

The counter is one file, tools/loc.py (standard library only); the list of included projects is tools/loc_imports.tsv. Run twice on the same checkout it gives the same numbers.

python3 tools/loc.py --check
python3 tools/loc.py --history

Each day is counted straight from git, from the first commit of that day (no checkout). Results are cached per file content, so a re-run only reads new files. Past days use today's list of included projects.

The numbers on this page come from docs/loc/latest.json and docs/loc/history.tsv, recounted whenever the site is built each day.

FAQ

Is it open source?

Not yet; it is being polished in private. When it is released, the core will be offered under AGPL-3.0 or a commercial licence, your choice, and the SDK for making apps will be MIT. DropViz, a tool we already published, is Apache-2.0.

Is it really one person? How?

Yes. One person uses AI models like many pairs of hands, and every change must pass the tests before it goes in. The factory that runs this is called Hephaestus (see Hephaestus).

Why C?

To build a small, fast operating system from scratch. New parts that read data from outside start in Rust, and everything is hammered continuously with fuzzing (feeding it random input).

Is it Linux-based?

No. The kernel is our own from the ground up. Some unmodified Linux programs run through a compatibility layer, and the browser runs in a small Linux virtual machine next to it.

Can I try it?

Yes, right in your browser (Try).

NanumOS 0.1.8349 · 2026-11-16