kern

changeset 44:7bc74736c7e8

added the first test process code and system call numbers header
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 25 Jul 2011 11:29:57 +0300
parents 5f6c5751ae05
children b8f02479e3f4
files src/sysnum.h src/test_proc.S
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/sysnum.h	Mon Jul 25 11:29:57 2011 +0300
     1.3 @@ -0,0 +1,10 @@
     1.4 +#ifndef SYSNUM_H_
     1.5 +#define SYSNUM_H_
     1.6 +
     1.7 +#define SYSCALL_INT		0x80
     1.8 +
     1.9 +#define SYS_EXIT		0
    1.10 +#define SYS_HELLO		1
    1.11 +#define SYS_SLEEP		2
    1.12 +
    1.13 +#endif	/* SYSNUM_H_ */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/test_proc.S	Mon Jul 25 11:29:57 2011 +0300
     2.3 @@ -0,0 +1,18 @@
     2.4 +#include <sysnum.h>
     2.5 +
     2.6 +	.text
     2.7 +	.globl test_proc
     2.8 +test_proc:
     2.9 +	/* --- print a message --- */
    2.10 +	movl $SYS_HELLO, %eax
    2.11 +	int $SYSCALL_INT
    2.12 +
    2.13 +	/* --- sleep for 5 seconds --- */
    2.14 +	movl $SYS_SLEEP, %eax
    2.15 +	movl $5, %ebx
    2.16 +	int $SYSCALL_INT
    2.17 +
    2.18 +	jmp test_proc
    2.19 +
    2.20 +	.globl test_proc_end
    2.21 +test_proc_end: