Initial programs from intro chapter

This commit is contained in:
Remzi Arpaci-Dusseau
2018-08-15 11:52:29 -05:00
parent 54a012aa8e
commit f90b42f9fa
7 changed files with 165 additions and 0 deletions

19
intro/cpu.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
int main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "usage: cpu <string>\n");
exit(1);
}
char *str = argv[1];
while (1) {
printf("%s\n", str);
Spin(1);
}
return 0;
}