| plan 9 kernel history: overview | file list | diff list |
1991/0709/pc/main.c (diff list | history)
| pc/main.c on 1991/0702 | ||
| 1991/0702 | #include "u.h" #include "lib.h" | |
| 1991/0706 | #include "mem.h" | |
| 1991/0702 | #include "dat.h" #include "fns.h" | |
| 1991/0706 | #include "io.h" | |
| 1991/0629 | ||
| 1991/0702 | main(void) | |
| 1991/0625 | { | |
| 1991/0703 | screeninit(); trapinit(); kbdinit(); | |
| 1991/0706 | clockinit(); mmuinit(); floppyinit(); | |
| 1991/0705 | spllo(); | |
| 1991/0709 | floppystart(0); | |
| 1991/0706 | for(;;){ int c; c = getc(&kbdq); if(c!=-1) screenputc(c); idle(); | |
| 1991/0709 | if((TK2SEC(m->ticks)%5)==0) if((TK2SEC(m->ticks)%10)==0) floppystop(0); else floppystart(0); | |
| 1991/0706 | } | |
| 1991/0625 | } | |
| 1991/0629 | void | |
| 1991/0702 | delay(int l) | |
| 1991/0625 | { | |
| 1991/0702 | int i; | |
| 1991/0625 | ||
| 1991/0702 | while(--l){ | |
| 1991/0706 | for(i=0; i < 100; i++) | |
| 1991/0702 | ; } | |
| 1991/0625 | } | |
| 1991/0702 | int sprint(char *s, char *fmt, ...) | |
| 1991/0625 | { | |
| 1991/0702 | return doprint(s, s+PRINTSIZE, fmt, (&fmt+1)) - s; | |
| 1991/0625 | } | |
| 1991/0629 | ||
| 1991/0702 | int print(char *fmt, ...) | |
| 1991/0629 | { | |
| 1991/0702 | char buf[PRINTSIZE]; int n; | |
| 1991/0629 | ||
| 1991/0702 | n = doprint(buf, buf+sizeof(buf), fmt, (&fmt+1)) - buf; screenputs(buf, n); return n; | |
| 1991/0703 | } void panic(char *fmt, ...) { char buf[PRINTSIZE]; int n; screenputs("panic: ", 7); n = doprint(buf, buf+sizeof(buf), fmt, (&fmt+1)) - buf; screenputs(buf, n); | |
| 1991/0706 | screenputs("\n", 1); spllo(); for(;;) idle(); | |
| 1991/0705 | } void sched(void) { | |
| 1991/0702 | } | |