Impossible OS Docs

Compiler and SDK

What is it?

This roadmap gives Impossible OS a developer kit and a compiler that runs on the OS itself: SDK headers installed at C:\Impossible\Include\, import libraries, a port of the Tiny C Compiler (TCC) that produces PE programs, cc, run and make in the shell, an SDK installer and documentation, with GCC or Clang as a long-term goal. None of its eleven sections has shipped. Today every user program is cross-compiled on the host with clang-19, and the SDK directory holds one header and an example.

How does it work?

Today: the host build. User programs are built by the kernel's own Makefile:

  • Compiler flags. clang-19 --target=x86_64-elf with -ffreestanding -nostdlib -nostdinc, no SSE, no red zone, -std=gnu11 -O2 (USER_CFLAGS in the Makefile).
  • Runtime. Each program links crt0.o (crt0.asm) and user/libc.a, built from the small libc in user/lib/ (string, stdlib, stdio, ctype, math, the Win32 test shim and start-up code; headers in user/include/).
  • Output. Statically linked ELF at base 0x800000 through user.ld. The files are named .exe (for example hello.exe and cmd.exe on the system disk), but they are ELF inside.
  • EIF. The OS also has its own native executable format. Today the host script build-eif.py only wraps a raw binary (from nasm -f bin) into a one-segment EIF for the loader test; see EIF Executable Format.

Today: the SDK directory. sdk/ holds a README, one header (impossible/windows.h, which declares the file API), an example (hello.c) and an API reference. sdk/lib/ is empty, so the -limpossible the README shows has nothing to link against yet, and the README itself lists the process, memory, threading, Registry and window APIs as planned. sdk/build.sh builds only a host tool for mounting IXFS images.

Planned design.

  1. Headers. impossible.h with type, error, memory, process, thread, synchronisation, file, string, I/O and time headers, then window, message, painting, GDI, input, dialog, menu, control, font and bitmap headers.
  2. Import libraries. COFF .lib files for kernel32, user32, gdi32, ntdll, shell32 and msvcrt, generated by a host mkimportlib and installed by make install-sdk.
  3. TCC. TCC cross-compiled to a PE tcc.exe that uses C:\Impossible\Include\ and C:\Temp\ and does its I/O through the Win32 calls; installed on the disk image with libtcc1.a; tested by compiling itself; then used to build IxUI programs.
  4. Shell. cc and run built-ins and a small make with variables and timestamp dependencies.
  5. Installer and documents. A packaged SDK, a CMake toolchain file, a getting-started guide and a porting guide.
  6. Long term. GCC and G++ with libstdc++, for C++.

What are its interfaces?

Interface Status
Host build: USER_CFLAGS, crt0.o, user/libc.a, user.ld Shipped (ELF output)
sdk/include/impossible/windows.h Declarations only
sdk/include/impossible.h and subsystem headers, sdk/lib/*.lib Planned
tcc.exe, libtcc1.a, cc, run, make.exe Planned
make install-sdk, SDK installer Planned

How do I use it?

To build a program today, add it to the userland target in the Makefile beside the existing test programs and run bash scripts/build.sh; it lands on the system disk as an ELF .exe. The user-mode test framework describes the pattern the test programs follow. Compiling on the OS itself is not possible yet.

What is not implemented yet?

The host-side SDK packaging (the cross-compile wrapper and release bundle) is planned separately in the SDK distribution roadmap.

How does it compare with Windows 11 and Linux?

Windows 11 has no compiler out of the box; developers install Visual Studio or MinGW and the Windows SDK. Linux distributions ship or package GCC and Clang with headers under /usr/include and make. The Impossible OS plan is to ship a small C compiler and the SDK pre-installed, so run hello.c works on a fresh install with no setup. Today programs can only be built on the host.

See also

Impossible OS is free software under the GPL-3.0-only license. Last updated Edit this page on GitHub