From b61c2547b8b489cab16984c0940a1cb6593a2a3d Mon Sep 17 00:00:00 2001 From: rtm Date: Mon, 26 Jun 2006 20:31:52 +0000 Subject: system call return values initialize 2nd cpu's idt --- user1.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'user1.c') 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) ; } -- cgit v1.2.3