summaryrefslogtreecommitdiff
path: root/user1.c
diff options
context:
space:
mode:
Diffstat (limited to 'user1.c')
-rw-r--r--user1.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/user1.c b/user1.c
index ea260a2..9e0c731 100644
--- a/user1.c
+++ b/user1.c
@@ -1,4 +1,4 @@
-void
+int
fork()
{
asm("mov $1, %eax");
@@ -12,19 +12,25 @@ cons_putc(int c)
asm("int $48");
}
-void
+int
puts(char *s)
{
int i;
for(i = 0; s[i]; i++)
cons_putc(s[i]);
+ return i;
}
main()
{
- // fork();
- puts("hello!\n");
+ int pid;
+ pid = fork();
+ if(pid == 0){
+ cons_putc('C');
+ } else {
+ cons_putc('P');
+ }
while(1)
;
}