2011-03-30 12:46:40 +00:00
|
|
|
|
#include <u.h>
|
|
|
|
|
#include <libc.h>
|
|
|
|
|
#include <auth.h>
|
|
|
|
|
#include <fcall.h>
|
|
|
|
|
#include "../boot/boot.h"
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
boot(int argc, char *argv[])
|
|
|
|
|
{
|
2011-06-14 19:03:03 +00:00
|
|
|
|
char cputype[64];
|
2011-06-04 05:19:29 +00:00
|
|
|
|
char buf[32];
|
2011-03-30 12:46:40 +00:00
|
|
|
|
|
|
|
|
|
fmtinstall('r', errfmt);
|
|
|
|
|
|
|
|
|
|
bind("#c", "/dev", MBEFORE);
|
|
|
|
|
open("/dev/cons", OREAD);
|
|
|
|
|
open("/dev/cons", OWRITE);
|
|
|
|
|
open("/dev/cons", OWRITE);
|
|
|
|
|
/*
|
|
|
|
|
* init will reinitialize its namespace.
|
|
|
|
|
* #ec gets us plan9.ini settings (*var variables).
|
|
|
|
|
*/
|
|
|
|
|
bind("#ec", "/env", MREPL);
|
|
|
|
|
bind("#e", "/env", MBEFORE|MCREATE);
|
|
|
|
|
bind("#s", "/srv", MREPL|MCREATE);
|
2011-08-15 23:49:37 +00:00
|
|
|
|
bind("#σ", "/shr", MREPL);
|
2011-04-16 20:42:16 +00:00
|
|
|
|
|
|
|
|
|
if(Debug){
|
2011-06-04 08:07:21 +00:00
|
|
|
|
int i;
|
|
|
|
|
|
2011-04-16 20:42:16 +00:00
|
|
|
|
print("argc=%d\n", argc);
|
|
|
|
|
for(i = 0; i < argc; i++)
|
2014-01-19 23:47:55 +00:00
|
|
|
|
print("%p %s ", argv[i], argv[i]);
|
2011-04-16 20:42:16 +00:00
|
|
|
|
print("\n");
|
|
|
|
|
}
|
2011-08-17 21:27:31 +00:00
|
|
|
|
USED(argc);
|
2011-03-30 12:46:40 +00:00
|
|
|
|
|
|
|
|
|
readfile("#e/cputype", cputype, sizeof(cputype));
|
2011-04-16 20:42:16 +00:00
|
|
|
|
setenv("bootdisk", bootdisk, 0);
|
2011-06-04 08:07:21 +00:00
|
|
|
|
|
2011-04-16 20:42:16 +00:00
|
|
|
|
/* setup the boot namespace */
|
2011-06-04 07:18:11 +00:00
|
|
|
|
bind("/boot", "/bin", MAFTER);
|
|
|
|
|
run("/bin/paqfs", "-q", "-c", "8", "-m" "/root", "/boot/bootfs.paq", nil);
|
2011-06-04 05:19:29 +00:00
|
|
|
|
bind("/root", "/", MAFTER);
|
|
|
|
|
snprint(buf, sizeof(buf), "/%s/bin", cputype);
|
|
|
|
|
bind(buf, "/bin", MAFTER);
|
2011-04-16 20:42:16 +00:00
|
|
|
|
bind("/rc/bin", "/bin", MAFTER);
|
2011-06-14 19:03:03 +00:00
|
|
|
|
exec("/bin/bootrc", argv);
|
2011-03-30 12:46:40 +00:00
|
|
|
|
}
|