Files
RedBear-OS/src
vasilito 397c701d45 kernel: map and set user stack for initial bootstrap init
The initial bootstrap init (started directly by the kernel via
usermode_bootstrap) had RSP = 0 from InterruptStack::init(), which
does NOT set RSP. This caused any push/call in the binary to fault
on address 0.

The Rust panic handler caught the resulting page fault and generated
ud2 — visible as 'Invalid opcode fault' at a low RIP before main()
ever runs. This was the root cause of the init crash.

Fix:
- Map 8 pages (32 KiB) of user stack just above the initfs image
- Set RSP to the top of the stack
- Add debug log showing the mapped region

The stack is intentionally small (32 KiB) — enough for Rust _start
to run but small enough to detect stack overflow immediately. Once
init calls fexec_impl to spawn the real init, the real init gets its
own full 8 MB stack via the redox-rt exec path.
2026-07-10 22:48:21 +03:00
..
2026-07-08 00:29:43 +03:00
2026-04-08 19:40:41 +01:00
2026-04-08 19:40:41 +01:00
2026-04-23 16:33:15 +07:00
2026-04-26 15:37:40 +07:00
2026-03-03 14:51:32 +00:00
2026-07-08 00:29:43 +03:00
2026-03-10 05:58:26 +07:00