From af1089a4262414b64714b87180f2223c8a40918f Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Wed, 8 Apr 2026 16:40:09 +0200 Subject: [Phase 2.1] GDT user space segments + heap growth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restructure GDT to add kernel_data/user_data/user_code in the order required for SYSCALL/SYSRET ABI: 0x08 kernel code, 0x10 kernel data, 0x18 user data, 0x20 user code, 0x28 TSS STAR MSR values: STAR[47:32]=0x08, STAR[63:48]=0x10 - Add TSS.privilege_stack_table[0] (RSP0) with 8 KiB static initial stack for Ring3→Ring0 hardware interrupt transitions - Expose GDT static and all Selectors fields as pub (needed by syscall module) - Add set_kernel_stack(VirtAddr) for scheduler to update RSP0 per-process - Grow HEAP_SIZE 100 KiB → 4 MiB to support process table + kernel stacks - Fix pre-existing lifetime elision lint in allocator.rs - Update flake.nix: add cpio, busybox, gdb, binutils, e2fsprogs - Update NOTES.md with decisions and next steps Co-Authored-By: Claude Sonnet 4.6 --- flake.nix | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index ace0bf6..6a2215a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,20 +1,39 @@ { - description = "Dev shell for kernel/build environment"; + description = "Dev shell for Strix OS kernel development"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; in { devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ - rustup # Rust - qemu # VM - ]; - + packages = with pkgs; [ + # Rust toolchain (nightly specified by rust-toolchain file) + rustup + + # QEMU for running kernel and integration tests + qemu + + # cpio: required by build.rs to pack the initramfs archive + cpio + + # busybox statically linked: placed in initramfs/ for the embedded rescue shell + busybox + + # Debugging and inspection tools + gdb + binutils # objdump, nm, readelf + + # Disk image tools for testing ext2/ext4 (Phase 4+) + e2fsprogs # mkfs.ext2, mkfs.ext4, debugfs + ]; + + # Ensure cargo uses the nightly toolchain from rust-toolchain + shellHook = '' + rustup show + ''; }; }; } - -- cgit v1.2.3