summaryrefslogtreecommitdiff
path: root/user1.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-06-26 20:31:52 +0000
committerrtm <rtm>2006-06-26 20:31:52 +0000
commitb61c2547b8b489cab16984c0940a1cb6593a2a3d (patch)
tree3ff33920d08b6221ec32b7aaff583a32edc8001b /user1.c
parenta44ee3cde8b55c314410210b9f3076797b9925fc (diff)
downloadxv6-labs-b61c2547b8b489cab16984c0940a1cb6593a2a3d.tar.gz
xv6-labs-b61c2547b8b489cab16984c0940a1cb6593a2a3d.tar.bz2
xv6-labs-b61c2547b8b489cab16984c0940a1cb6593a2a3d.zip
system call return values
initialize 2nd cpu's idt
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)
;
}