123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
- /*
- * IMPORTANT! DO NOT ADD LIBRARY CALLS TO THIS FILE.
- * The entire text image must fit on one page
- * (and there's no data segment, so any read/write data must be on the stack).
- */
- #include <u.h>
- #include <libc.h>
- char cons[] = "#c/cons";
- char boot[] = "/boot/boot";
- char dev[] = "/dev";
- char c[] = "#c";
- char e[] = "#e";
- char ec[] = "#ec";
- char s[] = "#s";
- char srv[] = "/srv";
- char env[] = "/env";
- void
- startboot(char *argv0, char **argv)
- {
- char buf[200];
- USED(argv0);
- /*
- * open the console here so that /boot/boot,
- * which could be a shell script, can inherit the open fds.
- */
- open(cons, OREAD);
- open(cons, OWRITE);
- open(cons, OWRITE);
- bind(c, dev, MAFTER);
- bind(ec, env, MAFTER);
- bind(e, env, MCREATE|MAFTER);
- bind(s, srv, MREPL|MCREATE);
- exec(boot, argv);
- rerrstr(buf, sizeof buf);
- buf[sizeof buf - 1] = '\0';
- _exits(buf);
- }
|