diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-04-08 16:40:09 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-04-08 16:40:09 +0200 |
| commit | af1089a4262414b64714b87180f2223c8a40918f (patch) | |
| tree | b208cdb34d0c4b43c5acff98127a824b4289e26a /flake.nix | |
| parent | eb61ec76367731579eb585f39b251da629beb871 (diff) | |
[Phase 2.1] GDT user space segments + heap growth
- 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 <noreply@anthropic.com>
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 35 |
1 files changed, 27 insertions, 8 deletions
@@ -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 + ''; }; }; } - |
