initcode.c 574 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * IMPORTANT! DO NOT ADD LIBRARY CALLS TO THIS FILE.
  3. * The entire text image must fit on one page.
  4. */
  5. #include <u.h>
  6. #include <libc.h>
  7. char cons[] = "#c/cons";
  8. char boot[] = "/boot/boot";
  9. char dev[] = "/dev";
  10. char c[] = "#c";
  11. char e[] = "#e";
  12. char ec[] = "#ec";
  13. char s[] = "#s";
  14. char srv[] = "/srv";
  15. char env[] = "/env";
  16. void
  17. startboot(char *argv0, char **argv)
  18. {
  19. open(cons, OREAD);
  20. open(cons, OWRITE);
  21. open(cons, OWRITE);
  22. bind(c, dev, MAFTER);
  23. bind(ec, env, MAFTER);
  24. bind(e, env, MCREATE|MAFTER);
  25. bind(s, srv, MREPL|MCREATE);
  26. exec(boot, argv);
  27. for(;;);
  28. }