mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 17:26:31 +00:00
调整:devfs注册设备后,返回指向inode私有信息的指针
This commit is contained in:
@ -205,7 +205,7 @@ void ps2_keyboard_init()
|
||||
// 先读一下键盘的数据,防止由于在键盘初始化之前,由于按键被按下从而导致接收不到中断。
|
||||
io_in8(PORT_PS2_KEYBOARD_DATA);
|
||||
// 将设备挂载到devfs
|
||||
devfs_register_device(DEV_TYPE_CHAR, CHAR_DEV_STYPE_PS2_KEYBOARD, &ps2_keyboard_fops);
|
||||
devfs_register_device(DEV_TYPE_CHAR, CHAR_DEV_STYPE_PS2_KEYBOARD, &ps2_keyboard_fops, NULL);
|
||||
kinfo("ps/2 keyboard registered.");
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include "tty.h"
|
||||
|
||||
static struct devfs_private_inode_info_t * tty_inode_private_data_ptr; // 由devfs创建的inode私有信息指针
|
||||
static int tty_private_data;
|
||||
|
||||
/**
|
||||
@ -87,6 +88,6 @@ struct vfs_file_operations_t tty_fops={
|
||||
|
||||
void tty_init(){
|
||||
//注册devfs
|
||||
devfs_register_device(DEV_TYPE_CHAR, CHAR_DEV_STYPE_TTY, &tty_fops);
|
||||
kinfo("tty driver registered.");
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user