kern
view src/test_proc.S @ 59:ef9cc2e90277
added a comment describing the push of just_forked address to the stack frame of the newly-forked process.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 17 Aug 2011 05:33:03 +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: