feat: Linux-like kernel command line parser with /proc/cmdline
Implement a proper kernel command line parsing system modeled after
Linux's cmdline triaging:
1. Kernel params: recognized 'key=value' tokens (init=, root=,
console=, loglevel=) are consumed by the kernel.
2. Kernel flags: recognized plain tokens (quiet, ring3, nokaslr,
single, noapic, nosmp) are consumed by the kernel.
3. Init envp: unrecognized 'key=value' tokens become environment
variables for the init process.
4. Init argv: unrecognized plain tokens (no '=' or '.') become
command-line arguments for the init process.
5. '--' separator: everything after it goes to init untouched.
6. First token (kernel path) is always skipped.
New files:
- include/kernel/cmdline.h: API (cmdline_parse, cmdline_get,
cmdline_has, cmdline_init_path, cmdline_init_argv/envp, cmdline_raw)
- src/kernel/cmdline.c: implementation with static storage
Changes:
- init.c: calls cmdline_parse() early, uses cmdline_has('ring3')
instead of the old cmdline_has_token() (removed)
- arch_platform.c: uses cmdline_init_path() for init binary path
(supports 'init=/path/to/init' from GRUB cmdline)
- procfs.c: added /proc/cmdline file (readable by userspace)
The 'ring3' parameter is no longer required for stable boot (the
scheduler bug causing panics without it was fixed in the previous
commit). It now only controls the inline ring3 test.