summaryrefslogtreecommitdiff
path: root/sys/src/9/ppc/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/src/9/ppc/main.c')
-rw-r--r--sys/src/9/ppc/main.c75
1 files changed, 3 insertions, 72 deletions
diff --git a/sys/src/9/ppc/main.c b/sys/src/9/ppc/main.c
index e2ab259cd..1eaabe8f7 100644
--- a/sys/src/9/ppc/main.c
+++ b/sys/src/9/ppc/main.c
@@ -1,12 +1,11 @@
#include "u.h"
+#include "tos.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
-#include "init.h"
#include "pool.h"
-#include "tos.h"
#define MAXCONF 64
@@ -147,21 +146,8 @@ plan9iniinit(void)
void
init0(void)
{
-// char **p, *q, name[KNAMELEN];
- int i;
char buf[2*KNAMELEN];
-
- up->nerrlab = 0;
- spllo();
-
- /*
- * These are o.k. because rootinit is null.
- * Then early kproc's will have a root and dot.
- */
- up->slash = namec("#/", Atodir, 0, 0);
- pathclose(up->slash->path);
- up->slash->path = newpath("/");
- up->dot = cclone(up->slash);
+ int i;
chandevinit();
@@ -183,62 +169,7 @@ init0(void)
}
kproc("alarm", alarmkproc, 0);
kproc("mmusweep", mmusweep, 0);
- touser((void*)(USTKTOP-sizeof(Tos)));
-}
-
-void
-userinit(void)
-{
- Proc *p;
- Segment *s;
- KMap *k;
- Page *pg;
-
- p = newproc();
- p->pgrp = newpgrp();
- p->egrp = smalloc(sizeof(Egrp));
- p->egrp->ref = 1;
- p->fgrp = dupfgrp(nil);
- p->rgrp = newrgrp();
- p->procmode = 0640;
-
- kstrdup(&eve, "");
- kstrdup(&p->text, "*init*");
- kstrdup(&p->user, eve);
-
- p->fpstate = FPinit;
-
- /*
- * Stack
- *
- * N.B. The -12 for the stack pointer is important.
- * 4 bytes for gotolabel's return PC
- */
- p->sched.pc = (ulong)init0;
- p->sched.sp = (ulong)p->kstack+KSTACK-(sizeof(Sargs)+BY2WD);
-
- /*
- * User Stack
- */
- s = newseg(SG_STACK, USTKTOP-USTKSIZE, USTKSIZE/BY2PG);
- p->seg[SSEG] = s;
- pg = newpage(1, 0, USTKTOP-BY2PG);
- segpage(s, pg);
-
- /*
- * Text
- */
- s = newseg(SG_TEXT, UTZERO, 1);
- s->flushme++;
- p->seg[TSEG] = s;
- pg = newpage(1, 0, UTZERO);
- pg->txtflush = ~0;
- segpage(s, pg);
- k = kmap(s->map[0]->pages[0]);
- memmove((ulong*)VA(k), initcode, sizeof initcode);
- kunmap(k);
-
- ready(p);
+ touser((void*)(USTKTOP - sizeof(Tos)));
}
void