From 94b0297b283158181837ae7bec3b3d7e8d7e9866 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Mon, 23 Feb 2026 08:34:13 +0100 Subject: [PATCH] Include attempt-1 devcontainer Dockerfile (AI+human) --- .devcontainer/Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..ff3e165 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,42 @@ +# ClaudeOS build environment +# +# Provides everything needed to build and test a bare-metal i386 kernel: +# - Clang + LLD for cross-compilation to i386-elf +# - GRUB 2 tools for generating bootable ISO and floppy images +# - QEMU (i386) for running integration tests +# - CMake + Ninja for the build system +# - xorriso and mtools used internally by grub-mkrescue / grub-mkimage + +FROM --platform=linux/amd64 alpine:3.23 + +RUN apk add --no-cache \ + # Core build tools + clang \ + lld \ + cmake \ + ninja \ + make \ + git \ + # GRUB image generation + grub \ + grub-bios \ + xorriso \ + mtools \ + # QEMU for running the OS + qemu-system-i386 \ + # Handy utilities + file \ + ca-certificates + +# Verify the cross-compilation toolchain can produce an i386-elf binary. +# Compile and link separately so ld.lld is invoked directly, avoiding the +# host gcc linker driver (which rejects -m32 on non-x86 hosts such as aarch64). +RUN echo 'void _start(void){for(;;)__asm__("hlt");}' > /tmp/test.c \ + && clang -v -target i386-elf -march=i386 -ffreestanding -fno-stack-protector \ + -c /tmp/test.c -o /tmp/test.o \ + && ld.lld -m elf_i386 -e _start --nostdlib /tmp/test.o -o /tmp/test.elf \ + && file /tmp/test.elf | grep -q "ELF 32-bit.*386" \ + && echo "Toolchain OK" \ + && rm /tmp/test.c /tmp/test.o /tmp/test.elf + +WORKDIR /workspaces/claude-os