Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/kernel/multiboot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ void kernel::multiboot(uint32_t boot_addr)
if (info->flags & MULTIBOOT_INFO_CMDLINE) {
const auto* cmdline = (const char*) (uintptr_t) info->cmdline;
INFO2("* Booted with parameters @ {}: {}", (const void*)(uintptr_t)info->cmdline, cmdline);
kernel::state().cmdline = std::pmr::string(cmdline).data();
// Bootloader memory (_multiboot_free_begin); no temp .data()/strdup.
kernel::state().cmdline = cmdline;
}

if (info->flags & MULTIBOOT_INFO_MEM_MAP) {
Expand Down
11 changes: 7 additions & 4 deletions src/platform/x86_pc/init_libc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ namespace x86
argv[1] = 0x0;
int argc = 1;

// Env vars
argv[2] = std::pmr::string("LC_CTYPE=C").data();
argv[3] = std::pmr::string("LC_ALL=C").data();
argv[4] = std::pmr::string("USER=root").data();
// Env vars (static storage — not .data() of a temporary pmr::string)
static char env_lc_ctype[] = "LC_CTYPE=C";
static char env_lc_all[] = "LC_ALL=C";
static char env_user[] = "USER=root";
argv[2] = env_lc_ctype;
argv[3] = env_lc_all;
argv[4] = env_user;
argv[5] = 0x0;

// auxiliary vector
Expand Down