From 696e647c0ffa80fd136656521b198c4a1ae609ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 3 Aug 2009 15:12:24 +0000 Subject: [PATCH] Implemented getting bootargs from OF. Untested. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32081 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/openfirmware/start.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system/boot/platform/openfirmware/start.c b/src/system/boot/platform/openfirmware/start.c index d4cf262c01..a885f8d578 100644 --- a/src/system/boot/platform/openfirmware/start.c +++ b/src/system/boot/platform/openfirmware/start.c @@ -132,6 +132,8 @@ _start(uint32 _unused1, uint32 _unused3, void *openFirmwareEntry) void start(void *openFirmwareEntry) { + char bootargs[512]; + // stage2 args - might be set via the command line one day stage2_args args; args.heap_size = HEAP_SIZE; @@ -139,6 +141,13 @@ start(void *openFirmwareEntry) of_init(openFirmwareEntry); + // check for arguments + if (of_getprop(gChosen, "bootargs", bootargs, sizeof(bootargs)) != OF_FAILED) { + static const char *sArgs[] = { NULL, NULL }; + sArgs[0] = (const char *)bootargs; + args.arguments = sArgs; + } + determine_machine(); console_init();