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-elfwith-ffreestanding -nostdlib -nostdinc, no SSE, no red zone,-std=gnu11 -O2(USER_CFLAGSin theMakefile). - Runtime. Each program links
crt0.o(crt0.asm) anduser/libc.a, built from the small libc inuser/lib/(string, stdlib, stdio, ctype, math, the Win32 test shim and start-up code; headers inuser/include/). - Output. Statically linked ELF at base
0x800000throughuser.ld. The files are named.exe(for examplehello.exeandcmd.exeon the system disk), but they are ELF inside. - EIF. The OS also has its own native executable format. Today the host script
build-eif.pyonly wraps a raw binary (fromnasm -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.
- Headers.
impossible.hwith 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. - Import libraries. COFF
.libfiles forkernel32,user32,gdi32,ntdll,shell32andmsvcrt, generated by a hostmkimportliband installed bymake install-sdk. - TCC. TCC cross-compiled to a PE
tcc.exethat usesC:\Impossible\Include\andC:\Temp\and does its I/O through the Win32 calls; installed on the disk image withlibtcc1.a; tested by compiling itself; then used to build IxUI programs. - Shell.
ccandrunbuilt-ins and a smallmakewith variables and timestamp dependencies. - Installer and documents. A packaged SDK, a CMake toolchain file, a getting-started guide and a porting guide.
- 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?
- SDK C Headers and SDK GUI Headers
- SDK Import Libraries
- Cross-Compile TCC, Install TCC, TCC Self-Hosting Tests and TCC IxUI Integration; all need programs that can call Win32, from Win32 PE Loader and Win32 API Surface
- Shell Compiler Integration
- SDK Installer and SDK Documentation
- GCC and Clang
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.