From 8f3fd73bd6306f0fe6db3a6114daccbdd3a25b0b Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 14 Apr 2012 15:31:39 +0200 Subject: [PATCH] The kernel provides the $cputype environmental variable. --- sortix/kernel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sortix/kernel.cpp b/sortix/kernel.cpp index 81752840..7a082cf0 100644 --- a/sortix/kernel.cpp +++ b/sortix/kernel.cpp @@ -370,8 +370,16 @@ static void InitThread(void* /*user*/) int argc = 1; const char* argv[] = { "init", NULL }; - int envc = 0; - const char* envp[] = { NULL }; +#if defined(PLATFORM_X86) + const char* cputype = "cputype=i486-pc-sortix"; +#elif defined(PLATFORM_X64) + const char* cputype = "cputype=x86_64-pc-sortix"; +#else + #warning No cputype environmental variable provided here. + const char* cputype = "cputype=unknown-pc-sortix"; +#endif + int envc = 1; + const char* envp[] = { cputype, NULL }; CPU::InterruptRegisters regs; if ( process->Execute("init", program, programsize, argc, argv, envc, envp,