Skip to content

Commit

Permalink
feat #24: support for e1000 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-stars committed Aug 7, 2024
1 parent 87f6cbc commit 173466f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ $ kbuild patch remove axstarry

```

## Run with e1000 driver
```sh
$ make A=apps/monolithic_userboot FEATURES=img,sched_rr,e1000_net LOG=off ACCEL=n APP_FEATURES=batch NET=y BLK=y run
```

## Notes

- Please remove unnecessary dependencies in `Cargo.toml` before your commit.
Expand Down
9 changes: 7 additions & 2 deletions scripts/make/qemu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ qemu_args-$(BLK) += \
-device virtio-blk-$(vdev-suffix),drive=disk0 \
-drive id=disk0,if=none,format=raw,file=$(DISK_IMG)

qemu_args-$(NET) += \
# 如果 FEATURES 包括 e1000_net,则添加 -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:5555,hostfwd=udp::5555-:5555
ifeq ($(findstring e1000_net,$(FEATURES)),e1000_net)
qemu_args-$(NET) += \
-device e1000,netdev=net0 -object filter-dump,id=net0,netdev=net0,file=packets.pcap
else
qemu_args-$(NET) += \
-device virtio-net-$(vdev-suffix),netdev=net0
endif

ifeq ($(NET_DEV), user)
qemu_args-$(NET) += -netdev user,id=net0,hostfwd=tcp::5555-:5555,hostfwd=udp::5555-:5555
Expand All @@ -41,7 +47,6 @@ else ifeq ($(NET_DEV), tap)
QEMU := sudo $(QEMU)
else ifeq ($(NET_DEV), bridge)
qemu_args-$(NET) += -netdev bridge,id=net0,br=virbr0
QEMU := sudo $(QEMU)
else
$(error "NET_DEV" must be one of "user", "tap", or "bridge")
endif
Expand Down

0 comments on commit 173466f

Please sign in to comment.