From c4c8d6c35751a588166dcd88f26872120a2b3b72 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 18 Feb 2017 14:05:24 -0700 Subject: [PATCH] WIP: NVME support --- Cargo.toml | 1 + drivers | 2 +- initfs/etc/pcid.toml | 6 ++++++ mk/initfs.mk | 1 + mk/qemu.mk | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1201b64..1320928 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "drivers/ahcid", "drivers/bgad", "drivers/e1000d", + "drivers/nvmed", "drivers/pcid", "drivers/ps2d", "drivers/rtl8168d", diff --git a/drivers b/drivers index 5b223c0..28dbc45 160000 --- a/drivers +++ b/drivers @@ -1 +1 @@ -Subproject commit 5b223c06d0bcd4c936bad3ad6ec8324fd0ba16a6 +Subproject commit 28dbc45637364b6ac68d2d091b6c5fa2420f3546 diff --git a/initfs/etc/pcid.toml b/initfs/etc/pcid.toml index 65813a7..9b7e348 100644 --- a/initfs/etc/pcid.toml +++ b/initfs/etc/pcid.toml @@ -4,6 +4,12 @@ class = 1 subclass = 6 command = ["ahcid", "$NAME", "$BAR5", "$IRQ"] +[[drivers]] +name = "NVME storage" +class = 1 +subclass = 8 +command = ["nvmed", "$NAME", "$BAR0", "$IRQ"] + [[drivers]] name = "Bochs Graphics Array" class = 3 diff --git a/mk/initfs.mk b/mk/initfs.mk index 7e9267b..b4e295c 100644 --- a/mk/initfs.mk +++ b/mk/initfs.mk @@ -2,6 +2,7 @@ $(BUILD)/initfs.rs: \ initfs/bin/init \ initfs/bin/ahcid \ initfs/bin/bgad \ + initfs/bin/nvmed \ initfs/bin/pcid \ initfs/bin/ps2d \ initfs/bin/redoxfs \ diff --git a/mk/qemu.mk b/mk/qemu.mk index 940b27e..c1a31da 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -36,7 +36,7 @@ qemu_no_build: qemu_extra: build/harddrive.bin if [ ! -e build/extra.bin ]; then dd if=/dev/zero of=build/extra.bin bs=1048576 count=1024; fi - $(QEMU) $(QEMUFLAGS) -drive file=$<,format=raw -drive file=build/extra.bin,format=raw + $(QEMU) $(QEMUFLAGS) -drive file=$<,format=raw -drive file=build/extra.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL qemu_extra_no_build: if [ ! -e build/extra.bin ]; then dd if=/dev/zero of=build/extra.bin bs=1048576 count=1024; fi