7 int nflag, pflag, bflag;
15 for(i = 0; i < 16; i++) {
16 print("R%2d %.8ux", i, P->R[i]);
17 if((i % 4) == 3) print("\n");
25 if(bind("/arm/bin", "/bin", MREPL) < 0)
27 if(bind("/rc/bin", "/bin", MAFTER) < 0)
29 putenv("cputype", "arm");
30 putenv("objtype", "arm");
43 if(P->path != nil && decref(P->path) == 0)
51 fprint(2, "usage: 5e [-npb] text [...]\n");
56 suicide(char *fmt, ...)
62 vsnprint(buf, sizeof(buf), fmt, va);
64 fprint(2, "%s\n", buf);
71 notehandler(void *, char *note)
73 if(strncmp(note, "sys:", 4) == 0)
76 if(strncmp(note, "emu:", 4) == 0)
84 dotext(int argc, char **argv)
88 if(**argv == '/' || **argv == '.' || **argv == '#') {
89 if(loadtext(*argv, argc, argv) < 0)
90 sysfatal("loadtext: %r");
93 file = smprint("/bin/%s", *argv);
94 if(loadtext(file, argc, argv) < 0)
95 sysfatal("loadtext: %r");
100 main(int argc, char **argv)
103 case 'n': nflag++; break;
104 case 'p': pflag++; break;
105 case 'b': bflag++; break;
111 sysfatal("we don't have privates");
112 if(rfork(RFREND | RFNAMEG | RFENVG) < 0)
113 sysfatal("rfork: %r");
118 initfs("armproc", "/proc");
121 atnotify(notehandler, 1);
126 while((P->notein - P->noteout) % NNOTE) {
127 donote(P->notes[P->noteout % NNOTE], 0);