summaryrefslogtreecommitdiff
path: root/task
diff options
context:
space:
mode:
authormarcus <marcus>2004-10-26 03:12:56 +0000
committermarcus <marcus>2004-10-26 03:12:56 +0000
commit282b4402a57531809e6ae4acac1ac2da085d8669 (patch)
tree9502fc4d61ed7ab3b283e7a94a4705967263d716 /task
parent17c63a18de3494a4d3bbf45ffc415a5c7945524d (diff)
hurd/
2004-10-26 Marcus Brinkmann <marcus@gnu.org> * startup.h: New file. * headers.m4: Add hurd/startup.h. wortel/ 2004-10-26 Marcus Brinkmann <marcus@gnu.org> * startup.c: Rewritten to match new startup data format. * wortel.c: Include <hurd/startup.h>. (start_task): Large chunks rewritten to match new startup data format. task/ 2004-10-26 Marcus Brinkmann <marcus@gnu.org> * ia32-crt0.S (__hurd_startup_data): New symbol. (_start): Save the first argument on the stack in __hurd_startup_data. * ia32-cmain.c: Include <hurd/startup.h>. (__hurd_startup_data): New prototype. (wortel_thread_id, wortel_cap_id): Do not initialize statically. (cmain): Initialize wortel_thread_id and wortel_cap_id.
Diffstat (limited to 'task')
-rw-r--r--task/ChangeLog10
-rw-r--r--task/ia32-cmain.c16
-rw-r--r--task/ia32-crt0.S12
3 files changed, 34 insertions, 4 deletions
diff --git a/task/ChangeLog b/task/ChangeLog
index 099dc7e..3edc27c 100644
--- a/task/ChangeLog
+++ b/task/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-26 Marcus Brinkmann <marcus@gnu.org>
+
+ * ia32-crt0.S (__hurd_startup_data): New symbol.
+ (_start): Save the first argument on the stack in
+ __hurd_startup_data.
+ * ia32-cmain.c: Include <hurd/startup.h>.
+ (__hurd_startup_data): New prototype.
+ (wortel_thread_id, wortel_cap_id): Do not initialize statically.
+ (cmain): Initialize wortel_thread_id and wortel_cap_id.
+
2004-04-26 Marcus Brinkmann <marcus@gnu.org>
* ia32-cmain.c: Include <hurd/wortel.h>.
diff --git a/task/ia32-cmain.c b/task/ia32-cmain.c
index 8721db3..1263229 100644
--- a/task/ia32-cmain.c
+++ b/task/ia32-cmain.c
@@ -1,5 +1,5 @@
/* ia32-cmain.c - Startup code for the ia32.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
Written by Marcus Brinkmann.
This file is part of the GNU Hurd.
@@ -33,11 +33,16 @@
#include "task.h"
#include <hurd/wortel.h>
+#include <hurd/startup.h>
-/* Initialized in cmain. FIXME. */
-l4_thread_id_t wortel_thread_id = 0xc8001;
-wortel_cap_id_t wortel_cap_id = 1;
+/* Initialized by the machine-specific startup-code. */
+extern struct hurd_startup_data *__hurd_startup_data;
+
+
+/* Initialized in cmain. */
+l4_thread_id_t wortel_thread_id;
+wortel_cap_id_t wortel_cap_id;
/* Initialize libl4, setup the argument vector, and pass control over
@@ -51,6 +56,9 @@ cmain (void)
l4_init ();
l4_init_stubs ();
+ wortel_thread_id = __hurd_startup_data->wortel.server;
+ wortel_cap_id = __hurd_startup_data->wortel.cap_id;
+
argc = 1;
argv = alloca (sizeof (char *) * 2);
argv[0] = program_name;
diff --git a/task/ia32-crt0.S b/task/ia32-crt0.S
index dddd992..397b14d 100644
--- a/task/ia32-crt0.S
+++ b/task/ia32-crt0.S
@@ -26,6 +26,10 @@
.globl start, _start
start:
_start:
+ /* The Hurd startup data is the first argument on the stack. */
+ movl 4(%esp), %eax
+ movl %eax, __hurd_startup_data
+
/* Initialize the stack pointer. */
movl $(stack + STACK_SIZE), %esp
@@ -42,3 +46,11 @@ loop: hlt
/* Our stack area. */
.comm stack, STACK_SIZE
+
+
+ .data
+
+ /* This variable holds a pointer to the Hurd startup data. */
+ .global __hurd_startup_data
+__hurd_startup_data:
+ .long 0