123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #include <filesystem/devfs/devfs.h>
- #include <filesystem/VFS/VFS.h>
- #include "tty.h"
- static struct devfs_private_inode_info_t * tty_inode_private_data_ptr;
- 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, &tty_inode_private_data_ptr);
- kinfo("tty driver registered. uuid=%d", tty_inode_private_data_ptr->uuid);
- }
|