|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "tty.h"#include "hal/cpu/core.h"#include "hal/graphic/graphic.h"#include "init/init.h"#include "input.h"#include "libk/serial.h"#include "notify.h"#include "procc/scheduler.h"#include "procc/workqueue.h"#include "str.h"#include "string.h"#include "sys/err_no.h"#include "type.h"#include "vfs/dentry.h"#include "vfs/dev.h"#include "vfs/vfs.h"#include "vfs/vnode.h"#include <autoconf.h>#include <console/console.h>Go to the source code of this file.
Data Structures | |
| struct | win_size |
Macros | |
| #define | TIOCGWINSZ 0x5413 |
| #define | FONT_SIZE 14 |
Functions | |
| static void | configure_tty (int tty) |
| static int | char_ioctl (vnode_t *vnode, uint32_t req, void *arg) |
| static long | char_write (vnode_t *vnode, void *buf, size_t len, size_t offset) |
| static void | do_scroll (struct tty_internal *priv) |
| static int | char_read (vnode_t *vnode, void *buf, size_t len, size_t offset) |
| static void | tty_input_handler (uint32_t event, void *data, void *ctx) |
| INIT (TTY) | |
| void | start_tty () |
| void | change_active_tty (int tty) |
| int | get_active_tty () |
| dentry_ptr | get_active_tty_dentry () |
| void | tty_check_and_flush () |
| dentry_ptr | get_tty_dentry (int tty) |
Variables | |
| static dentry_ptr | __tty_dentry [VOXIA_TTY_MAX_COUNT] = {0} |
| static int | __current_tty_active = 0 |
| static vops_file_t * | __tty_ops = 0 |
| #define TIOCGWINSZ 0x5413 |
Definition at line 21 of file tty.c.
Referenced by char_ioctl().
| void change_active_tty | ( | int | tty | ) |
Definition at line 251 of file tty.c.
References __current_tty_active.
Definition at line 104 of file tty.c.
References EBADF, ENOTTY, serial2_printf(), TIOCGWINSZ, vnode::vnode_private, vxGetHeight(), vxGetWidth(), win_size::ws_col, win_size::ws_row, win_size::ws_xpixel, and win_size::ws_ypixel.
Referenced by INIT().
Definition at line 124 of file tty.c.
References EINVAL, ENOSYS, get_current_core_data(), head, tty_internal::head, tty_internal::input_buffer, tty_internal::input_lock, len, offset, serial2_printf(), spin_acquire(), spin_release(), tty_internal::tail, and vnode::vnode_private.
Referenced by INIT().
|
static |
Definition at line 214 of file tty.c.
References __tty_dentry, __tty_ops, create_and_attach_vnode(), create_dev(), DEV_MAJOR_TTY, itoa(), kalloc(), memset(), vnode::ops, screen_cols(), screen_rows(), str(), str_concat(), str_release(), vnode::type, VNODE_TYPE_CHR, and vxnamei().
Referenced by INIT().
|
static |
Definition at line 43 of file tty.c.
References tty_internal::cursorx, tty_internal::cursory, FONT_SIZE, tty_internal::rows, and vxScroll().
| int get_active_tty | ( | ) |
Definition at line 253 of file tty.c.
References __current_tty_active.
| dentry_ptr get_active_tty_dentry | ( | ) |
Definition at line 255 of file tty.c.
References __current_tty_active, and __tty_dentry.
Referenced by tty_check_and_flush(), and tty_input_handler().
| dentry_ptr get_tty_dentry | ( | int | tty | ) |
| INIT | ( | TTY | ) |
Definition at line 81 of file tty.c.
References __tty_ops, char_ioctl(), char_read(), char_write(), configure_tty(), kalloc(), memset(), NOTIFY_HIGHT, notify_register(), and tty_input_handler().
| void start_tty | ( | ) |
Definition at line 246 of file tty.c.
References clear_screen(), and console_set_pos().
Referenced by __attribute__().
| void tty_check_and_flush | ( | ) |
Definition at line 259 of file tty.c.
References __current_tty_active, do_scroll(), get_active_tty_dentry(), LOG2_INFO, putc(), putc_utf8(), utf8_char_len(), dentry::vnode, vnode::vnode_private, and width.
Referenced by char_write().
|
static |
Definition at line 49 of file tty.c.
References data, get_active_tty_dentry(), memcopy(), serial2_printf(), dentry::vnode, and vnode::vnode_private.
Referenced by INIT().
|
static |
Definition at line 32 of file tty.c.
Referenced by change_active_tty(), get_active_tty(), get_active_tty_dentry(), and tty_check_and_flush().
|
static |
Definition at line 31 of file tty.c.
Referenced by configure_tty(), get_active_tty_dentry(), and get_tty_dentry().
|
static |
Definition at line 33 of file tty.c.
Referenced by configure_tty(), and INIT().