summaryrefslogtreecommitdiffstats
path: root/src/sys
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-09-09 15:21:12 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-09-09 15:21:12 -0500
commit51621c156c03feff0d5e4246ecd2e18473fd347d (patch)
tree4e64c4bb13b54a081e3b2d0d2db886d4f3379def /src/sys
parent80b83026362d07b10ed1ae16afb162f7699757cb (diff)
downloadtalos-hostboot-51621c156c03feff0d5e4246ecd2e18473fd347d.tar.gz
talos-hostboot-51621c156c03feff0d5e4246ecd2e18473fd347d.zip
Add task_exec system call.
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/init/init_main.C14
-rw-r--r--src/sys/vfs/vfs_main.C22
2 files changed, 35 insertions, 1 deletions
diff --git a/src/sys/init/init_main.C b/src/sys/init/init_main.C
index 72bfc64a8..ef9dfb1e7 100644
--- a/src/sys/init/init_main.C
+++ b/src/sys/init/init_main.C
@@ -1,5 +1,8 @@
#include <kernel/console.H> // TODO : Remove this.
+#include <kernel/syscalls.H>
+#include <sys/syscall.h>
+
#include <sys/task.h>
#include <sys/mutex.h>
#include <sys/msg.h>
@@ -7,6 +10,7 @@
mutex_t global_mutex;
+/*
void init_child(void* unused)
{
mutex_lock(global_mutex);
@@ -15,6 +19,7 @@ void init_child(void* unused)
for (volatile int i = 0 ; i < 100000; i++);
task_end();
}
+*/
void vfs_main(void*);
@@ -24,7 +29,12 @@ void init_main(void* unused)
printk("Bringing up VFS...");
task_create(&vfs_main, NULL);
- task_yield(); // TODO... add a barrier to ensure VFS is fully up.
+
+ // TODO... add a barrier to ensure VFS is fully up.
+ while (NULL == _syscall0(Systemcalls::MSGQ_RESOLVE_ROOT));
+ task_yield();
+
+
/*
uint64_t* mmio_addr = (uint64_t*) mmio_map((void*)0x800000000, 1);
printk("MMIO Access %llx\n", *mmio_addr);
@@ -51,6 +61,8 @@ void init_main(void* unused)
}
*/
+ task_exec("libexample.so", NULL);
+
while(1)
task_yield();
}
diff --git a/src/sys/vfs/vfs_main.C b/src/sys/vfs/vfs_main.C
index 481df1101..0b41bb631 100644
--- a/src/sys/vfs/vfs_main.C
+++ b/src/sys/vfs/vfs_main.C
@@ -2,6 +2,7 @@
#include <sys/msg.h>
#include <sys/vfs.h>
+#include <sys/task.h>
#include <util/locked/list.H>
#include <kernel/console.H> // TODO : Remove this.
@@ -92,6 +93,27 @@ void vfs_main(void* unused)
msg_respond(vfsMsgQ, msg);
}
break;
+
+ case VFS_MSG_EXEC:
+ {
+ printk("VFS: Got exec request of %s\n",
+ (const char*)msg->data[0]);
+ VfsSystemModule* module = &VFS_MODULES[0];
+ tid_t child = -1;
+ while ('\0' != module->module[0])
+ {
+ if (0 == strcmp((const char*) msg->data[0],
+ module->module))
+ {
+ child = task_create(module->start,
+ (void*) msg->data[1]);
+ break;
+ }
+ }
+ msg->data[0] = child;
+ msg_respond(vfsMsgQ, msg);
+ }
+ break;
default:
msg_free(msg);
OpenPOWER on IntegriCloud