kern

view src/test_proc.S @ 57:437360696883

I think we're done for now. two processes seem to be scheduled and switched just fine, fork seems to work (NO CoW YET!)
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 16 Aug 2011 03:26:53 +0300
parents 0be4615594df
children 39188bbe8638
line source
1 #define ASM
2 #include <syscall.h>
4 .text
5 .globl test_proc
6 test_proc:
7 /* fork another process */
8 movl $SYS_FORK, %eax
9 int $SYSCALL_INT
11 infloop:
12 /* --- print a message --- */
13 movl $SYS_HELLO, %eax
14 int $SYSCALL_INT
16 /* --- call getpid --- */
17 movl $SYS_GETPID, %eax
18 int $SYSCALL_INT
19 /* copy the pid to ebx to use as a sleep interval */
20 movl %eax, %ebx
21 shl $1, %ebx
23 /* --- sleep for 5 seconds --- */
24 movl $SYS_SLEEP, %eax
25 /*movl $3, %ebx*/
26 int $SYSCALL_INT
28 jmp infloop
30 .globl test_proc_end
31 test_proc_end: