add sysroutine, fix compiling mistakes