1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #include <filesystem/devfs/devfs.h>
- #include <filesystem/VFS/VFS.h>
- #include "tty.h"
- static int tty_private_data;
- long tty_open(struct vfs_index_node_t *inode, struct vfs_file_t *filp)
- {
- filp->private_data = &tty_private_data;
- return 0;
- }
- long tty_close(struct vfs_index_node_t *inode, struct vfs_file_t *filp)
- {
- filp->private_data = NULL;
- return 0;
- }
- long tty_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *filp, uint64_t cmd, uint64_t arg)
- {
- switch (cmd)
- {
- default:
- break;
- }
- return 0;
- }
- long tty_read(struct vfs_file_t *filp, char *buf, int64_t count, long *position)
- {
- return 0;
- }
- long tty_write(struct vfs_file_t *filp, char *buf, int64_t count, long *position)
- {
- return 0;
- }
- struct vfs_file_operations_t tty_fops={
- .open = tty_open,
- .close = tty_close,
- .ioctl = tty_ioctl,
- .read = tty_read,
- .write = tty_write,
- };
- void tty_init(){
-
- devfs_register_device(DEV_TYPE_CHAR, CHAR_DEV_STYPE_TTY, &tty_fops);
- kinfo("tty driver registered.");
- }
|