kern
diff 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 diff
1.1 --- a/src/test_proc.S Mon Aug 15 06:17:58 2011 +0300 1.2 +++ b/src/test_proc.S Tue Aug 16 03:26:53 2011 +0300 1.3 @@ -4,16 +4,28 @@ 1.4 .text 1.5 .globl test_proc 1.6 test_proc: 1.7 + /* fork another process */ 1.8 + movl $SYS_FORK, %eax 1.9 + int $SYSCALL_INT 1.10 + 1.11 +infloop: 1.12 /* --- print a message --- */ 1.13 movl $SYS_HELLO, %eax 1.14 int $SYSCALL_INT 1.15 1.16 + /* --- call getpid --- */ 1.17 + movl $SYS_GETPID, %eax 1.18 + int $SYSCALL_INT 1.19 + /* copy the pid to ebx to use as a sleep interval */ 1.20 + movl %eax, %ebx 1.21 + shl $1, %ebx 1.22 + 1.23 /* --- sleep for 5 seconds --- */ 1.24 movl $SYS_SLEEP, %eax 1.25 - movl $3, %ebx 1.26 + /*movl $3, %ebx*/ 1.27 int $SYSCALL_INT 1.28 1.29 - jmp test_proc 1.30 + jmp infloop 1.31 1.32 .globl test_proc_end 1.33 test_proc_end: