kern

view src/test_proc.S @ 68:0a205396e1a0

- added a generic red-black tree data structure - added a VM map as an red-black tree of vm_pages in the process structure - constructed the vm map of the memory passed by the kernel initially to the first process.
author John Tsiombikas <nuclear@mutantstargoat.com>
date Mon, 10 Oct 2011 04:16:01 +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: