Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现Ps/2鼠标驱动 #500

Merged
merged 35 commits into from
Jan 24, 2024

Conversation

2447742618
Copy link
Contributor

No description provided.

self.inner.lock().devices.clone()
}

fn add_device(&self, device: Arc<dyn crate::driver::base::device::Device>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种带前缀的都改一下,不然将来如果这个Device移动文件位置了,修代码很困难

}

fn dev_groups(&self) -> &'static [&'static dyn crate::filesystem::sysfs::AttributeGroup] {
return &[&SerioDeviceAttrGroup];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认属性组应该由那个SerioManager之类的东西去负责创建,而不是每个驱动都写自己有这个属性。

_char: u8,
_int: u8,
) -> Result<(), system_error::SystemError> {
todo!()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中断处理的地方,可以接到这里。

) -> Result<usize, SystemError> {
let guard = self.inner.lock_irqsave();
if offset > 0 && offset + len < guard.buf.len() {
buf.copy_from_slice(&guard.buf[offset..offset + len]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个buf我在想能否开大一点,然后通过一个index来记录它目前是正在操作第几位(或者用ringbuffer库)。我担心就是,用户程序读不过来。

Copy link
Member

@fslongjin fslongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
它的读方法并没有正确的实现。

并且作为一个将来可以改进的点(现在可以先不写),linux的输入设备会接入到/sys/devices/virtual/input目录下,但是这个目前没有接入。

@fslongjin fslongjin merged commit a381e48 into DragonOS-Community:master Jan 24, 2024
7 checks passed
@2447742618 2447742618 deleted the patch-mouse-driver branch January 24, 2024 14:41
yuyi2439 pushed a commit to yuyi2439/DragonOS that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants