summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/int_syscall_handler.asm1
-rw-r--r--fs/ext2.c2
-rw-r--r--kernel/kernel.c2
-rw-r--r--kernel/syscalls.c24
4 files changed, 18 insertions, 11 deletions
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm
index e9bc79d..23b9f84 100644
--- a/asm/int_syscall_handler.asm
+++ b/asm/int_syscall_handler.asm
@@ -58,7 +58,6 @@ done:
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
mov eax,ebx
- nop
done_blocking:
diff --git a/fs/ext2.c b/fs/ext2.c
index c59f864..27fe31e 100644
--- a/fs/ext2.c
+++ b/fs/ext2.c
@@ -248,7 +248,7 @@ int ext2_read_dir(uint8_t *ram, int inode_nr,fs_dirent *dirs,int max)
i++;
}while(buf[i-1]!=0);
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"name: %s\n",dirs[c].name);
+// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"name: %s\n",dirs[c].name);
c++;
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 6058480..d95772e 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -133,6 +133,8 @@ void kernel_main(uint32_t initial_stack, int mp)
// For now this starts three "tasks" which are scheduled
// round robin style.
//
+ syscall_execve(15,0,0);
+
task_init();
//
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 1de5d3a..b0a4ba1 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -10,7 +10,7 @@
static int preread;
-static int alloc=0x600000; // TODO: implement properly sbrk!!!
+static int alloc=0xa00000; // TODO: implement properly sbrk!!!
int syscall_write(int file, char *buf, int len)
{
@@ -35,8 +35,8 @@ int syscall_read(int file, char *buf, int len)
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"read(file=%d, buf=0x%08X, len=%d)", file,buf,len);
#endif
- // stdin
- if(file==1)
+ // stdin TODO: other descroptiors!
+ if(file==1||file!=1)
{
char c;
@@ -74,9 +74,12 @@ int syscall_execve(char *name, char **argv, char **env)
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"execve (name=0x%08X, argvs=0x%08X, env=0x%08X)", name,argv,env);
#endif
+
ext2_inode_content(EXT2_RAM_ADDRESS,name,0x800000,0x100000);
// autorun "user-space" prog
+ asm("push $10");//argv TODO: addresse
+ asm("push $20"); //argc TODO: real number of params!
asm("push $0x800000");
asm("ret");
}
@@ -84,10 +87,10 @@ int syscall_execve(char *name, char **argv, char **env)
int syscall_open(char *name, int flags, int len)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"open (name=0x%08X, flags=%d, len=%d)", name,flags,len);
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"open (name=0x%08X(\"%s\"), flags=%d, len=%d)",name, name,flags,len);
#endif
- return 1;
+ return 99;
}
@@ -133,14 +136,17 @@ int syscall_lseek(int file,int ptr,int dir)
return preread;
}
-caddr_t syscall_sbrk(int incr, int none1, int none2)
+uint32_t syscall_sbrk(int incr, int none1, int none2)
{
- #ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"sbrk (incr=%d)", incr);
- #endif
+ if(incr==0)alloc=0xa00000; // TODO: implement properly sbrk!!!
int oldalloc=alloc;
alloc+=incr;
+
+ #ifdef LOG_SYSCALLS
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"sbrk (incr=%d) = 0x%08X", incr,oldalloc);
+ #endif
+
return oldalloc;
/*