Skip to content

Commit 26d84a3

Browse files
authored
新增VirtIO网卡驱动 (#194)
* 修复内存bug与grub安装脚本的错误 * 修改小bug * PCI增加功能与virtio-net驱动 * little fix * virtio-net小修改
1 parent 1d48996 commit 26d84a3

File tree

22 files changed

+1416
-10
lines changed

22 files changed

+1416
-10
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
"acpi.h": "c",
170170
"assert.h": "c",
171171
"sys_version.h": "c",
172-
"cmd.h": "c"
172+
"cmd.h": "c",
173+
"net.h": "c"
173174
},
174175
"C_Cpp.errorSquiggles": "Enabled",
175176
"esbonio.sphinx.confDir": "",

kernel/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ crate-type = ["staticlib"]
1111
# 运行时依赖项
1212
[dependencies]
1313
x86_64 = "0.14.10"
14+
virtio-drivers = "0.2.0"
15+
bitflags = "1.3"
1416

1517
# 构建时依赖项
1618
[build-dependencies]
@@ -22,3 +24,4 @@ version = "1.4.0"
2224
features = ["spin_no_std"]
2325

2426

27+

kernel/src/arch/x86_64/x86_64_pci.c

Whitespace-only changes.

kernel/src/arch/x86_64/x86_64_pci.h

Whitespace-only changes.

kernel/src/driver/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
CFLAGS += -I .
33

4-
kernel_driver_subdirs:=video interrupt usb pci acpi disk keyboard mouse multiboot2 timers tty hid
4+
kernel_driver_subdirs:=video interrupt usb pci acpi disk keyboard mouse multiboot2 timers tty hid virtio
55

66
ECHO:
77
@echo "$@"
@@ -14,4 +14,4 @@ all: $(kernel_driver_subdirs)
1414

1515

1616
clean:
17-
echo "Done."
17+
echo "Done."

kernel/src/driver/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
pub mod pci;
12
pub mod timers;
23
pub mod uart;
4+
pub mod virtio;

kernel/src/driver/pci/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod pci;

kernel/src/driver/pci/msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static __always_inline struct pci_msi_cap_t __msi_read_cap_list(struct msi_desc_
7171
}
7272

7373
/**
74-
* @brief 映射设备的msix表
74+
* @brief 映射设备的msix表 //MSIX表不再单独映射(To do)
7575
*
7676
* @param pci_dev pci设备信息结构体
7777
* @param msix_cap msix capability list的结构体

0 commit comments

Comments
 (0)