nuclear@51: #define ASM nuclear@51: #include nuclear@44: nuclear@44: .text nuclear@44: .globl test_proc nuclear@44: test_proc: nuclear@57: /* fork another process */ nuclear@57: movl $SYS_FORK, %eax nuclear@57: int $SYSCALL_INT nuclear@57: nuclear@69: push %eax nuclear@69: nuclear@57: infloop: nuclear@44: /* --- print a message --- */ nuclear@44: movl $SYS_HELLO, %eax nuclear@44: int $SYSCALL_INT nuclear@44: nuclear@60: /* --- call getpid --- nuclear@60: * we'll use the process id, multiplied by two as a nuclear@60: * sleep interval, to avoid having the two test processes nuclear@60: * sleep for identical amounts of time. nuclear@60: */ nuclear@57: movl $SYS_GETPID, %eax nuclear@57: int $SYSCALL_INT nuclear@57: movl %eax, %ebx nuclear@57: shl $1, %ebx nuclear@57: nuclear@60: /* --- sleep for (pid * 2) seconds --- nuclear@60: * ebx (the argument to sleep) already contains the nuclear@60: * correct value nuclear@60: */ nuclear@44: movl $SYS_SLEEP, %eax nuclear@44: int $SYSCALL_INT nuclear@44: nuclear@57: jmp infloop nuclear@44: nuclear@44: .globl test_proc_end nuclear@44: test_proc_end: