kern

view src/test_proc.S @ 61:5b29b15c5412

removed the unimplemented exit syscall
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 17 Aug 2011 05:38:40 +0300
parents 437360696883
children b45e2d5f0ae1
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 * we'll use the process id, multiplied by two as a
18 * sleep interval, to avoid having the two test processes
19 * sleep for identical amounts of time.
20 */
21 movl $SYS_GETPID, %eax
22 int $SYSCALL_INT
23 movl %eax, %ebx
24 shl $1, %ebx
26 /* --- sleep for (pid * 2) seconds ---
27 * ebx (the argument to sleep) already contains the
28 * correct value
29 */
30 movl $SYS_SLEEP, %eax
31 int $SYSCALL_INT
33 jmp infloop
35 .globl test_proc_end
36 test_proc_end: