2021-11-26 06:41:56 +03:00
|
|
|
/**
|
|
|
|
* @brief cursor-off - Disables the VGA text mode cursor.
|
2018-08-14 11:13:38 +03:00
|
|
|
*
|
|
|
|
* This is an old tool that calls a special system call
|
|
|
|
* to change the VGA text-mode cursor position. The VGA
|
|
|
|
* terminal renders its own cursor in software, so we
|
|
|
|
* try to move the hardware cursor off screen so it doesn't
|
|
|
|
* interfere with the rest of the terminal and look weird.
|
2021-11-26 06:41:56 +03:00
|
|
|
*
|
|
|
|
* @copyright
|
|
|
|
* This file is part of ToaruOS and is released under the terms
|
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2016-2018 K. Lange
|
2018-08-14 11:13:38 +03:00
|
|
|
*/
|
2021-06-10 03:35:48 +03:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
2018-12-10 12:44:34 +03:00
|
|
|
#include <sys/sysfunc.h>
|
2018-03-06 17:12:32 +03:00
|
|
|
|
|
|
|
int main(int argc, char * argv[]) {
|
2021-06-10 03:35:48 +03:00
|
|
|
int fd = open("/dev/port", O_RDWR);
|
|
|
|
if (fd < 0) return 1;
|
|
|
|
lseek(fd, 0x3D4, SEEK_SET);
|
|
|
|
write(fd, (unsigned char[]){14}, 1);
|
|
|
|
lseek(fd, 0x3D5, SEEK_SET);
|
|
|
|
write(fd, (unsigned char[]){0xFF}, 1);
|
|
|
|
lseek(fd, 0x3D4, SEEK_SET);
|
|
|
|
write(fd, (unsigned char[]){15}, 1);
|
|
|
|
lseek(fd, 0x3D5, SEEK_SET);
|
|
|
|
write(fd, (unsigned char[]){0xFF}, 1);
|
|
|
|
return 0;
|
2018-03-06 17:12:32 +03:00
|
|
|
}
|