-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Patch pci pcie #235
Patch pci pcie #235
Conversation
kernel/src/arch/mod.rs
Outdated
/// @brief 获取Segement的root地址,x86_64架构为acpi mcfg表中读取 | ||
/// @param segement 组id | ||
/// @return Result<PciRoot, PciError> 转换结果或出错原因 | ||
fn get_eacm_root(segement: SegmentGroupNumber) -> Result<PciRoot, PciError>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the get
function should defined as eacm_root
, according to the Rust Coding style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实其他地方也有这个问题,我等会一起改了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不过这个地方不用get的话感觉函数意义不够明确,我觉得其他地方修改这个地方保留get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不过这个地方不用get的话感觉函数意义不够明确,我觉得其他地方修改这个地方保留get
ok
kernel/src/driver/pci/pci.rs
Outdated
/// @param bus_device_function 在同一个group中pci设备的唯一标识符 | ||
/// @param register_offset 寄存器在设备中的offset | ||
/// @param data 要写入的值 | ||
pub(crate) fn write_config( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pub(crate)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们操作系统一般不会作为模块被调用,所以有没有crate区别不大
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
//kdebug!("{}",PCI_ROOT_0.unwrap()); | ||
} | ||
/// @brief pci初始化函数 | ||
pub fn pci_init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change the return value to Result<(),SystemError>
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对pci来说,这已经是错误处理的最高层函数了,所有错误上报到这个函数中集中处理,我觉得再次上报没有什么意义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
系统初始化的时候,我觉得应该需要知道pci这边是否初始化出错哈哈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c语言那边怎么处理这个,我看其他模块给c的接口也没有这个东西
@@ -12,8 +12,6 @@ | |||
use core::panic::PanicInfo; | |||
|
|||
/// 导出x86_64架构相关的代码,命名为arch模块 | |||
#[cfg(target_arch = "x86_64")] | |||
#[path = "arch/x86_64/mod.rs"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该不用删掉这个代码。这样导出的话能够使得内核其他部分的代码,用到arch的时候,不用带上arch::x86_64
这样的前缀,这样会更好
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不删除的话arch 文件夹下的mod.rs会不可用,上面的*就是为了弥补这个删除的副作用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第一个问题里面的*就是为了用到arch的时候,不用带上arch::x86_64这样的前缀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦哦哦,明白了
* 新增VFS文档,以及修改文档配置 (#209) * 1.新增vfs设计文档 2.修改文档版权标志为"2022-2023, DragonOS Community" 3.修改电脑版文档页面的宽度为90% * layout.html末尾加空行 * 修正了FAT32判断逻辑,解决了文件系统为FAT12/16时系统无法正常启动的问题。 (#211) * fix(fat): fix determination of fat type casue crash if fs is fat12/16 * refactor(fat): split BiosParameterBlock.validate() into BiosParameterBlockFAT32.validate() and BiosParameterBlockLegacy.validate() * 调整“最大允许的簇号”的常量放置的位置。 * 增加x87FPU支持 (#212) * remove `ret_from_syscall` *修复ps2键盘驱动程序inode在进程fork的时候导致死锁的问题. *更新: VFS每次拷贝文件描述符的时候,都会去调用inode的open函数 * 部分函数从返回值为Result<<>,i32>修改为Result<<>,SystemError> (#210) * 将Result<<>,i32>替换为Result<<>,SystemError> * bugfix: 显示双缓冲区初始化的时候,连续注册了两次Video Softirq的问题。 * 第一套键盘扫描码的状态机 (#216) 第一套键盘扫描码的状态机 * 将TTY与stdio进行连接,实现基本的stdio功能 (#217) * 将stdio与tty接上 * Patch keyboard capslock alt (#219) * keyboard-alt-capslock * 解决键盘输入'%'字符的时候无法回显的bug * Add dup,dup2 (#224) * dup,dup2 * fix: sys_dup2语义与posix不一致的问题 * 添加了qemu使用VNC作为图像输出的选项 (#222) * 添加了qemu使用VNC作为图像输出的选项 * 设置vnc端口为5900 * 软中断&定时器重构 (#223) * 软中断&定时器重构 * 修改timer的clock() * 删除debug信息 * V0.1.6发行日志&更新构建系统文档 (#225) 1.更新构建系统文档 2.V0.1.6发行日志 * Patch add 0.1.6 changelog (#226) * 修正标题错误 * 修复显示刷新线程的空指针问题 (#228) * 新增设备驱动模型,为设备和驱动提供高层视图 (#227) * 添加base mod * 添加设备驱动模型相关文件 * 删除单独的mod文件,使用mod.rs,修改一些格式上的问题 * 移动驱动错误类型到该文件 * 修改一些格式上的问题 * 修改CFSqueue从Vec变成红黑树 (#229) 使用了由tickbh编写的rbtree: https://github.com/tickbh/rbtree-rs/blob/master/src/lib.rs * new: lazy_init (#230) * Patch add lazy init (#236) * 修正并发安全问题 * pci重构+pcie支持 (#235) * pci重构+pcie支持 * pci重构测试完成 * 修正makefile的问题 * 小修改 * 修改函数名字 * 增加对dhcpv4的支持(tcp、udp socket已写好,但由于缺少epoll机制,尚未完整测试) (#237) * 为virtio网卡完成smoltcp的phy层配置 * raw socket * 初步写完udp和tcp socket * 能够正常通过dhcp获取ipv4地址(具有全局iface btree) * 调整brk系统调用,使得参数、返回值与Linux一致 (#238) * 新增用于测试relibc的app * 为适配relibc,修改do_execve中关于用户栈的内容的设置 * 调整brk系统调用,使得参数、返回值与Linux一致 * 修改errno,使其与relibc的保持一致 (#234) 修改errno,使其与relibc的保持一致 * 修复ecam无法获取MCFG table的问题 (#241) * 修复Issue#220;vnc的端口号恢复5900 (#243) * 修复Issue#220 * qemu-vnc端口号恢复为5900 * new: DowncastArc and its docs (#244) * 增加定时器和软中断文档,修改了softirq面向c的接口 (#245) * 增加定时器和软中断文档 * 修改softirq对c的接口和文档 * 修改文档格式 * 新增网络socket的系统调用接口 (#247) 1.修复spinlock忘记恢复rflags的问题 2.WaitQueue增加wakeup_all的功能 3.完善tcp,udp,raw socket 4.把PollStatus结构体改为使用bitflags 5.新增iovec结构体 6.完成网络的系统调用 7.在bootstrap里面添加dnsmasq bridge-utils iptables * 新增SysFS (#250) * 添加sysfs * 注册sysfs * 添加sysfs相关 * 添加rust-anlyzer辅助配置 * 将设备与sysfs相关联 * 添加单独的文件管理sysfs下的文件夹 * 解决使用zsh在构建DragonOS时,无法直接使用一键初始化脚本进行安装的问题 (#252) * 匿名管道重构&增加IrqArch trait以及IrqFlags及其守卫 (#253) * 实现匿名管道 * 增加IrqArch trait以及IrqFlags及其守卫 * 根据sysfs完善设备驱动模型 & 添加sysfs官方文档 (#254) * 根据sysfs完善设备驱动模型 * 添加sysfs官方文档 * doc: V0.1.7发行日志 (#255)
No description provided.