diff --git a/kernel/sys/syscall.c b/kernel/sys/syscall.c index b82c638a..328f84ae 100644 --- a/kernel/sys/syscall.c +++ b/kernel/sys/syscall.c @@ -665,6 +665,19 @@ static int sys_sysfunc(int fn, char ** args) { return 0; break; + case 13: + /* + * Set VGA text-mode cursor location + * (Not actually used to place a cursor, we use this to move the cursor off screen) + */ + PTR_VALIDATE(args); + outportb(0x3D4, 14); + outportb(0x3D5, (unsigned int)args[0]); + outportb(0x3D4, 15); + outportb(0x3D5, (unsigned int)args[1]); + + return 0; + default: debug_print(ERROR, "Bad system function %d", fn); break; diff --git a/userspace/extra/cursor-off.c b/userspace/extra/cursor-off.c index b540fb59..0316ca8e 100644 --- a/userspace/extra/cursor-off.c +++ b/userspace/extra/cursor-off.c @@ -1,11 +1,6 @@ -static void outb(unsigned char _data, unsigned short _port) { - __asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data)); -} +#include int main(int argc, char * argv[]) { - /* This should remove the hardware cursor. */ - outb(14, 0x3D4); - outb(0xFF, 0x3D5); - outb(15, 0x3D4); - outb(0xFF, 0x3D5); + int x[] = {0xFF,0xFF}; + return syscall_system_function(13, (char **)x); }