clock interrupt mechanism added.
[mit-jos.git] / lib / libmain.c
blobb296a8c4bff49e92838576c97eb09af7256a3778
1 // Called from entry.S to get us going.
2 // entry.S already took care of defining envs, pages, vpd, and vpt.
4 #include <inc/lib.h>
6 extern void umain(int argc, char **argv);
8 volatile struct Env *env;
9 char *binaryname = "(PROGRAM NAME UNKNOWN)";
11 void
12 libmain(int argc, char **argv)
14 // set env to point at our env structure in envs[].
15 // LAB 3: Your code here.
16 envid_t envid;
18 envid = sys_getenvid();
19 env = &envs[ENVX(envid)];
21 // save the name of the program so that panic() can use it
22 if (argc > 0)
23 binaryname = argv[0];
25 // call user main routine
26 umain(argc, argv);
28 // exit gracefully
29 exit();