summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-20 02:02:28 +0200
committerMiguel <m.i@gmx.at>2018-09-20 02:02:28 +0200
commit631fdbefc89a6202c5b8e2bf0e15a6ca7df809ef (patch)
treed0cd13fcb6590c6d3bf88193ca344521ee3e3e78 /kernel
parent1e08b64b43bf9c50b644da3f76d5a8bcc73f62da (diff)
newlib and pipes
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kernel.c2
-rw-r--r--kernel/scheduler.c4
-rw-r--r--kernel/syscalls.c9
3 files changed, 7 insertions, 8 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 20bfab6..ba968d5 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -102,7 +102,7 @@ void kernel_main(uint32_t eax,uint32_t ebx)
ext2_dump_info(VMEM_EXT2_RAMIMAGE);
ext2_mount("/");
sysfs_mount("/sys");
- pipe_mount("/sys/pipes");
+ pipe_mount("/pipes");
// -- APIC -- //
klog("Advanced Programmable Interrupt Controller (APIC) config ...");
diff --git a/kernel/scheduler.c b/kernel/scheduler.c
index 8f7f6d6..e834afc 100644
--- a/kernel/scheduler.c
+++ b/kernel/scheduler.c
@@ -291,7 +291,7 @@ void task_syscall_worker()
{
uint32_t syscall=task_list[cpu][i].eax;
-// klog("task pid=%d waiting on syscall %d/%s on cpu %d slot %d.",task_list[cpu][i].pid,syscall,syscall_get_name(syscall),cpu,i);
+ klog("task pid=%d waiting on syscall %d/%s on cpu %d slot %d.",task_list[cpu][i].pid,syscall,syscall_get_name(syscall),cpu,i);
task_list[cpu][0].vmem=task_list[cpu][i].vmem; // switch syscall worker to pagedir of calling userprog
x86_set_page_directory(task_list[cpu][0].vmem);
@@ -313,6 +313,8 @@ void task_syscall_worker()
task_list[cpu][i].ecx,
task_list[cpu][i].ebx,
task_list[cpu][i].pid);
+
+ klog("... returned : %d",ret);
scheduler_wake_all();
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 4f6508a..3b599c0 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -348,17 +348,14 @@ uint32_t syscall_exit(int pid)
//
int syscall_close(int file,int none1,int none2)
{
-
- //if(file!=0&&file!=1&&file!=2)
- // kpanic("unhandled syscall: close");
-
- return -1;
+ if(file<3)return 0;
+ fd_close(&fds[file]);
+ return 0;
}
// TODO: check if file is termminal!
int syscall_isatty(int file,int none1,int none2)
{
-
return 1;
}