Skip to content

Conversation

Hdksg10
Copy link
Contributor

@Hdksg10 Hdksg10 commented Sep 27, 2023

初步完成了e1000e系列网卡的驱动设计与开发工作,在qemu模拟的82574l网卡上完成了相关测试,系统可以通过网络设备在dhcp协议下自动分配ip。
文件改动概述:

  • e1000e.rs: 与e1000e系列硬件设备相关的操作,包括初始化,中断处理以及收/发包操作,提供了将来适配napi需要的一些接口
  • e1000e_driver.rs: 提供系统协议栈需要的驱动接口
  • 由于还没有统一的中断号管理系统,在中断相关的文件中手动添加了中断号
  • run_qemu.sh:修改了qemu启动选项用于模拟82574l设备

@fslongjin fslongjin requested a review from YJwu2023 October 7, 2023 04:07
Copy link
Collaborator

@YJwu2023 YJwu2023 left a comment

Choose a reason for hiding this comment

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

需要结合最新代码再更改一下才能合并
记得make fmt格式化代码

/// @brief 申请用于DMA的内存页
/// @param pages 页数(4k一页)
/// @return PhysAddr 获得的内存页的初始物理地址
pub fn dma_alloc(pages: usize) -> (usize, NonNull<u8>) {
Copy link
Member

Choose a reason for hiding this comment

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

这里的代码下一个pr可以把它整合到mm模块里面去。并且加上守卫来保护。目前这样的写法容易造成内存泄露、越界。

@@ -22,7 +24,7 @@ pub fn initial_kernel_thread() -> i32 {
mount_root_fs().expect("Failed to mount root fs");

virtio_probe();

e1000e_init();
Copy link
Member

Choose a reason for hiding this comment

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

@fslongjin fslongjin merged commit 77799cc into DragonOS-Community:master Oct 29, 2023
GnoCiYeH pushed a commit to GnoCiYeH/DragonOS that referenced this pull request Oct 31, 2023
* 测试RESET

* 测试RESET

* 基于轮询的实现

* 规范化部分unsafe的使用

* 完成中断处理函数,同时去除了不必要的内存拷贝行为,准备编写napi机制

* 实现现有协议栈下的部分napi机制;修复了内存泄漏的问题;添加了一部分代码注释

* 去除部分无用代码

* 去除一些无用代码

* 适配新的驱动模型

* 完成msi中断测试

* 去除一些无用代码

* 格式化代码

* 增加了一些注释,提高代码可读性

* 去除无关文件

* 优化了读取mac地址的方式,提高可读性
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.

3 participants