diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..4eee051 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,43 @@ +# 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 debian:bookworm-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + # Core build tools + clang \ + lld \ + cmake \ + ninja-build \ + make \ + git \ + # GRUB image generation + grub-pc-bin \ + grub-common \ + xorriso \ + mtools \ + # QEMU for running the OS + qemu-system-x86 \ + # Handy utilities + file \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Verify the cross-compilation toolchain can produce an i386-elf binary. +RUN echo 'void _start(void){for(;;)__asm__("hlt");}' > /tmp/test.c \ + && clang -target i386-elf -m32 -march=i386 -ffreestanding -fno-stack-protector \ + -nostdlib -fuse-ld=lld -Wl,-e,_start \ + /tmp/test.c -o /tmp/test.elf \ + && file /tmp/test.elf | grep -q "ELF 32-bit.*80386" \ + && echo "Toolchain OK" \ + && rm /tmp/test.c /tmp/test.elf + +WORKDIR /workspaces/claude-os diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fbac6df --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "ClaudeOS Dev", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cmake-tools", + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack" + ], + "settings": { + "cmake.generator": "Ninja", + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/cmake/toolchain-i386-clang.cmake" + } + } + } + }, + "postCreateCommand": "echo 'ClaudeOS devcontainer ready!'", + "remoteUser": "root" +}