Kernel: Add some functionality to disable TTY input/output
Userspace programs can call tty_ctrl() to disable/enable tty from handling input and displaying output. This API is probably going to change in the future to ioctl calls but I'm not sure how ioctl is used and what functionality should it have. I decided to create whole new function and syscall for now. Next I will expose framebuffer in /dev/fb0 and then I can start work on graphical environment! :D
This commit is contained in:
25
libc/include/sys/banan-os.h
Normal file
25
libc/include/sys/banan-os.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _SYS_BANAN_OS_H
|
||||
#define _SYS_BANAN_OS_H 1
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define TTY_CMD_SET 0x01
|
||||
#define TTY_CMD_UNSET 0x02
|
||||
|
||||
#define TTY_FLAG_ENABLE_OUTPUT 1
|
||||
#define TTY_FLAG_ENABLE_INPUT 2
|
||||
|
||||
/*
|
||||
fildes: refers to valid tty device
|
||||
command: one of TTY_CMD_* definitions
|
||||
flags: bitwise or of TTY_FLAG_* definitions
|
||||
|
||||
return value: 0 on success, -1 on failure and errno set to the error
|
||||
*/
|
||||
int tty_ctrl(int fildes, int command, int flags);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -53,6 +53,7 @@ __BEGIN_DECLS
|
||||
#define SYS_SYNC 50
|
||||
#define SYS_MMAP 51
|
||||
#define SYS_MUNMAP 52
|
||||
#define SYS_TTY_CTRL 53
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user