eliminate ramdisk
This commit is contained in:
parent
de9d72c908
commit
4adf016925
2
Makefile
2
Makefile
|
@ -23,7 +23,6 @@ OBJS = \
|
||||||
$K/sleeplock.o \
|
$K/sleeplock.o \
|
||||||
$K/file.o \
|
$K/file.o \
|
||||||
$K/pipe.o \
|
$K/pipe.o \
|
||||||
$K/ramdisk.o \
|
|
||||||
$K/exec.o \
|
$K/exec.o \
|
||||||
$K/sysfile.o \
|
$K/sysfile.o \
|
||||||
$K/kernelvec.o \
|
$K/kernelvec.o \
|
||||||
|
@ -163,7 +162,6 @@ ifndef CPUS
|
||||||
CPUS := 3
|
CPUS := 3
|
||||||
endif
|
endif
|
||||||
QEMUOPTS = -machine virt -kernel $K/kernel -m 3G -smp $(CPUS) -nographic
|
QEMUOPTS = -machine virt -kernel $K/kernel -m 3G -smp $(CPUS) -nographic
|
||||||
QEMUOPTS += -initrd fs.img
|
|
||||||
QEMUOPTS += -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
|
QEMUOPTS += -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
|
||||||
|
|
||||||
qemu: $K/kernel fs.img
|
qemu: $K/kernel fs.img
|
||||||
|
|
|
@ -101,7 +101,6 @@ bread(uint dev, uint blockno)
|
||||||
|
|
||||||
b = bget(dev, blockno);
|
b = bget(dev, blockno);
|
||||||
if((b->flags & B_VALID) == 0) {
|
if((b->flags & B_VALID) == 0) {
|
||||||
//ramdiskrw(b);
|
|
||||||
virtio_disk_rw(b);
|
virtio_disk_rw(b);
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
|
@ -114,7 +113,6 @@ bwrite(struct buf *b)
|
||||||
if(!holdingsleep(&b->lock))
|
if(!holdingsleep(&b->lock))
|
||||||
panic("bwrite");
|
panic("bwrite");
|
||||||
b->flags |= B_DIRTY;
|
b->flags |= B_DIRTY;
|
||||||
//ramdiskrw(b);
|
|
||||||
virtio_disk_rw(b);
|
virtio_disk_rw(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ main()
|
||||||
binit(); // buffer cache
|
binit(); // buffer cache
|
||||||
fileinit(); // file table
|
fileinit(); // file table
|
||||||
virtio_disk_init(); // emulated hard disk
|
virtio_disk_init(); // emulated hard disk
|
||||||
ramdiskinit(); // in-memory disk
|
|
||||||
userinit(); // first user process
|
userinit(); // first user process
|
||||||
started = 1;
|
started = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#define UART0 0x10000000L
|
#define UART0 0x10000000L
|
||||||
#define UART0_IRQ 10
|
#define UART0_IRQ 10
|
||||||
|
|
||||||
|
// virtio mmio interface
|
||||||
#define VIRTIO 0x10001000
|
#define VIRTIO 0x10001000
|
||||||
#define VIRTIO_IRQ 1 // really the first of 8 units
|
#define VIRTIO_IRQ 1 // really the first of 8 units
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ kvminit()
|
||||||
mappages(kernel_pagetable, UART0, PGSIZE,
|
mappages(kernel_pagetable, UART0, PGSIZE,
|
||||||
UART0, PTE_R | PTE_W);
|
UART0, PTE_R | PTE_W);
|
||||||
|
|
||||||
// virtio disk interface
|
// virtio mmio disk interface
|
||||||
mappages(kernel_pagetable, VIRTIO, PGSIZE,
|
mappages(kernel_pagetable, VIRTIO, PGSIZE,
|
||||||
VIRTIO, PTE_R | PTE_W);
|
VIRTIO, PTE_R | PTE_W);
|
||||||
|
|
||||||
|
@ -50,10 +50,6 @@ kvminit()
|
||||||
mappages(kernel_pagetable, (uint64)etext, PHYSTOP-(uint64)etext,
|
mappages(kernel_pagetable, (uint64)etext, PHYSTOP-(uint64)etext,
|
||||||
(uint64)etext, PTE_R | PTE_W);
|
(uint64)etext, PTE_R | PTE_W);
|
||||||
|
|
||||||
// map the qemu -initrd fs.img ramdisk
|
|
||||||
mappages(kernel_pagetable, RAMDISK, FSSIZE * BSIZE,
|
|
||||||
RAMDISK, PTE_R | PTE_W);
|
|
||||||
|
|
||||||
// map the trampoline for trap entry/exit to
|
// map the trampoline for trap entry/exit to
|
||||||
// the highest virtual address in the kernel.
|
// the highest virtual address in the kernel.
|
||||||
mappages(kernel_pagetable, TRAMPOLINE, PGSIZE,
|
mappages(kernel_pagetable, TRAMPOLINE, PGSIZE,
|
||||||
|
|
Loading…
Reference in a new issue