//kernel/trunk/contrib/conf/gxemul.sh |
---|
1,4 → 1,4 |
#!/bin/sh |
# Uspace addresses outside of normal memory (kernel has std. 8 or 16MB) |
# we place the pages at 24M |
gxemul $@ -E testmips -X 0x81800000:../uspace/ns/ns 0x81900000:../uspace/kbd/kbd 0x81a00000:../uspace/init/init kernel.bin |
gxemul $@ -E testmips -X 0x81800000:../uspace/ns/ns 0x81900000:../uspace/kbd/kbd 0x81a00000:../uspace/fb/fb 0x81b00000:../uspace/init/init kernel.bin |
//kernel/trunk/generic/src/syscall/syscall.c |
---|
47,17 → 47,17 |
#include <syscall/copy.h> |
#include <sysinfo/sysinfo.h> |
static __native sys_io(int fd, const void * buf, size_t count) { |
return count; /*Syscall deprecated*/ |
static __native sys_io(int fd, const void * buf, size_t count) |
{ |
// return count; /*Syscall deprecated*/ |
// TODO: buf sanity checks and a lot of other stuff ... |
/* |
size_t i; |
for (i = 0; i < count; i++) |
putchar(((char *) buf)[i]); |
return count;*/ |
return count; |
} |
/** Dispatch system call */ |
//kernel/trunk/arch/mips32/src/start.S |
---|
222,7 → 222,7 |
sub $k0, 8 # 8=SYSCALL |
beqz $k0, syscall_shortcut |
add $k0, 8 # Revert $k1 back to correct exc number |
add $k0, 8 # Revert $k0 back to correct exc number |
REGISTERS_STORE_AND_EXC_RESET $sp |
239,11 → 239,13 |
#define SS_SP EOFFSET_SP |
#define SS_STATUS EOFFSET_STATUS |
#define SS_EPC EOFFSET_EPC |
#define SS_K1 EOFFSET_K1 |
syscall_shortcut: |
# We have a lot of space on the stack, with free use |
mfc0 $t1, $epc |
mfc0 $t0, $status |
sw $t1,SS_EPC($sp) # Save EPC |
sw $k1,SS_K1($sp) # Save k1, which is not saved during context switch |
and $t2, $t0, REG_SAVE_MASK # Save only KSU,EXL,ERL,IE |
li $t3, ~(0x1f) |
270,6 → 272,7 |
# restore epc+4 |
lw $t0,SS_EPC($sp) |
lw $k1,SS_K1($sp) |
addi $t0, $t0, 4 |
mtc0 $t0, $epc |