diff options
| author | Robert Morris <rtm@csail.mit.edu> | 2020-08-13 08:05:13 -0400 | 
|---|---|---|
| committer | Robert Morris <rtm@csail.mit.edu> | 2020-08-13 08:05:13 -0400 | 
| commit | e1a2cd59faf0cf7a3b315cefff11d68b68ec54a7 (patch) | |
| tree | 79bc9fa5898946b04e61b3366003b117bf6773c2 | |
| parent | d32eac366fd06ec58cc3b34a3ca1824864bd7618 (diff) | |
| parent | 315c37c0f1e7c05f7b7d0ec145a2002b0612c49c (diff) | |
| download | xv6-labs-e1a2cd59faf0cf7a3b315cefff11d68b68ec54a7.tar.gz xv6-labs-e1a2cd59faf0cf7a3b315cefff11d68b68ec54a7.tar.bz2 xv6-labs-e1a2cd59faf0cf7a3b315cefff11d68b68ec54a7.zip | |
Merge branch 'riscv' of g.csail.mit.edu:xv6-dev into riscv
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | README | 24 | ||||
| -rw-r--r-- | doc/riscv-privileged-20190608-1.pdf | bin | 0 -> 533858 bytes | |||
| -rw-r--r-- | doc/riscv-privileged-v1.10.pdf | bin | 536816 -> 0 bytes | |||
| -rw-r--r-- | doc/riscv-spec-20191213.pdf | bin | 0 -> 1021610 bytes | |||
| -rw-r--r-- | doc/riscv-spec-v2.2.pdf | bin | 615016 -> 0 bytes | |||
| -rw-r--r-- | kernel/entry.S | 2 | ||||
| -rw-r--r-- | kernel/proc.c | 14 | ||||
| -rw-r--r-- | kernel/ramdisk.c | 2 | ||||
| -rw-r--r-- | kernel/virtio_disk.c | 1 | ||||
| -rw-r--r-- | kernel/vm.c | 4 | 
11 files changed, 26 insertions, 23 deletions
| @@ -79,7 +79,7 @@ $K/kernel: $(OBJS) $K/kernel.ld $U/initcode  	$(OBJDUMP) -t $K/kernel | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $K/kernel.sym  $U/initcode: $U/initcode.S -	$(CC) $(CFLAGS) -nostdinc -I. -Ikernel -c $U/initcode.S -o $U/initcode.o +	$(CC) $(CFLAGS) -march=rv64g -nostdinc -I. -Ikernel -c $U/initcode.S -o $U/initcode.o  	$(LD) $(LDFLAGS) -N -e start -Ttext 0 -o $U/initcode.out $U/initcode.o  	$(OBJCOPY) -S -O binary $U/initcode.out $U/initcode  	$(OBJDUMP) -S $U/initcode.o > $U/initcode.asm @@ -15,24 +15,26 @@ Clements.  We are also grateful for the bug reports and patches contributed by  Silas Boyd-Wickizer, Anton Burtsev, Dan Cross, Cody Cutler, Mike CAT, -Tej Chajed, eyalz800, Nelson Elhage, Saar Ettinger, Alice Ferrazzi, -Nathaniel Filardo, Peter Froehlich, Yakir Goaron,Shivam Handa, Bryan -Henry, Jim Huang, Alexander Kapshuk, Anders Kaseorg, kehao95, Wolfgang -Keller, Eddie Kohler, Austin Liew, Imbar Marinescu, Yandong Mao, Matan -Shabtay, Hitoshi Mitake, Carmi Merimovich, Mark Morrissey, mtasm, Joel -Nider, Greg Price, Ayan Shafqat, Eldar Sehayek, Yongming Shen, Cam -Tenny, tyfkda, Rafael Ubal, Warren Toomey, Stephen Tu, Pablo Ventura, -Xi Wang, Keiichi Watanabe, Nicolas Wolovick, wxdao, Grant Wu, Jindong -Zhang, Icenowy Zheng, and Zou Chang Wei. +Tej Chajed, Asami Doi, eyalz800, , Nelson Elhage, Saar Ettinger, Alice +Ferrazzi, Nathaniel Filardo, Peter Froehlich, Yakir Goaron,Shivam +Handa, Bryan Henry, jaichenhengjie, Jim Huang, Alexander Kapshuk, +Anders Kaseorg, kehao95, Wolfgang Keller, Jonathan Kimmitt, Eddie +Kohler, Austin Liew, Imbar Marinescu, Yandong Mao, Matan Shabtay, +Hitoshi Mitake, Carmi Merimovich, Mark Morrissey, mtasm, Joel Nider, +Greg Price, Ayan Shafqat, Eldar Sehayek, Yongming Shen, Fumiya +Shigemitsu, Takahiro, Cam Tenny, tyfkda, Rafael Ubal, Warren Toomey, +Stephen Tu, Pablo Ventura, Xi Wang, Keiichi Watanabe, Nicolas +Wolovick, wxdao, Grant Wu, Jindong Zhang, Icenowy Zheng, and Zou Chang +Wei.  The code in the files that constitute xv6 is -Copyright 2006-2019 Frans Kaashoek, Robert Morris, and Russ Cox. +Copyright 2006-2020 Frans Kaashoek, Robert Morris, and Russ Cox.  ERROR REPORTS  Please send errors and suggestions to Frans Kaashoek and Robert Morris  (kaashoek,rtm@mit.edu). The main purpose of xv6 is as a teaching -operating system for MIT's 6.828, so we are more interested in +operating system for MIT's 6.S081, so we are more interested in  simplifications and clarifications than new features.  BUILDING AND RUNNING XV6 diff --git a/doc/riscv-privileged-20190608-1.pdf b/doc/riscv-privileged-20190608-1.pdfBinary files differ new file mode 100644 index 0000000..2303a01 --- /dev/null +++ b/doc/riscv-privileged-20190608-1.pdf diff --git a/doc/riscv-privileged-v1.10.pdf b/doc/riscv-privileged-v1.10.pdfBinary files differ deleted file mode 100644 index 6942fe7..0000000 --- a/doc/riscv-privileged-v1.10.pdf +++ /dev/null diff --git a/doc/riscv-spec-20191213.pdf b/doc/riscv-spec-20191213.pdfBinary files differ new file mode 100644 index 0000000..533c1cb --- /dev/null +++ b/doc/riscv-spec-20191213.pdf diff --git a/doc/riscv-spec-v2.2.pdf b/doc/riscv-spec-v2.2.pdfBinary files differ deleted file mode 100644 index e4a4634..0000000 --- a/doc/riscv-spec-v2.2.pdf +++ /dev/null diff --git a/kernel/entry.S b/kernel/entry.S index ef5a56a..62fe1f2 100644 --- a/kernel/entry.S +++ b/kernel/entry.S @@ -1,7 +1,7 @@  	# qemu -kernel starts at 0x1000. the instructions          # there seem to be provided by qemu, as if it          # were a ROM. the code at 0x1000 jumps to -        # 0x8000000, the _start function here, +        # 0x80000000, the _start function here,          # in machine mode. each CPU starts here.  .section .data  .globl stack0 diff --git a/kernel/proc.c b/kernel/proc.c index cf7f260..417e30a 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -183,13 +183,13 @@ proc_freepagetable(pagetable_t pagetable, uint64 sz)  // a user program that calls exec("/init")  // od -t xC initcode  uchar initcode[] = { -  0x17, 0x05, 0x00, 0x00, 0x13, 0x05, 0x05, 0x02, -  0x97, 0x05, 0x00, 0x00, 0x93, 0x85, 0x05, 0x02, -  0x9d, 0x48, 0x73, 0x00, 0x00, 0x00, 0x89, 0x48, -  0x73, 0x00, 0x00, 0x00, 0xef, 0xf0, 0xbf, 0xff, -  0x2f, 0x69, 0x6e, 0x69, 0x74, 0x00, 0x00, 0x01, -  0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -  0x00, 0x00, 0x00 +  0x17, 0x05, 0x00, 0x00, 0x13, 0x05, 0x45, 0x02, +  0x97, 0x05, 0x00, 0x00, 0x93, 0x85, 0x35, 0x02, +  0x93, 0x08, 0x70, 0x00, 0x73, 0x00, 0x00, 0x00, +  0x93, 0x08, 0x20, 0x00, 0x73, 0x00, 0x00, 0x00, +  0xef, 0xf0, 0x9f, 0xff, 0x2f, 0x69, 0x6e, 0x69, +  0x74, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00  };  // Set up first user process. diff --git a/kernel/ramdisk.c b/kernel/ramdisk.c index 9901294..eb60ee7 100644 --- a/kernel/ramdisk.c +++ b/kernel/ramdisk.c @@ -1,5 +1,5 @@  // -// ramdisk that uses the disk image loaded by qemu -rdinit fs.img +// ramdisk that uses the disk image loaded by qemu -initrd fs.img  //  #include "types.h" diff --git a/kernel/virtio_disk.c b/kernel/virtio_disk.c index 3cff024..06e0645 100644 --- a/kernel/virtio_disk.c +++ b/kernel/virtio_disk.c @@ -264,6 +264,7 @@ virtio_disk_intr()      disk.used_idx = (disk.used_idx + 1) % NUM;    } +  *R(VIRTIO_MMIO_INTERRUPT_ACK) = *R(VIRTIO_MMIO_INTERRUPT_STATUS) & 0x3;    release(&disk.vdisk_lock);  } diff --git a/kernel/vm.c b/kernel/vm.c index d45210a..b48a022 100644 --- a/kernel/vm.c +++ b/kernel/vm.c @@ -65,9 +65,9 @@ kvminithart()  // A 64-bit virtual address is split into five fields:  //   39..63 -- must be zero.  //   30..38 -- 9 bits of level-2 index. -//   21..39 -- 9 bits of level-1 index. +//   21..29 -- 9 bits of level-1 index.  //   12..20 -- 9 bits of level-0 index. -//    0..12 -- 12 bits of byte offset within the page. +//    0..11 -- 12 bits of byte offset within the page.  pte_t *  walk(pagetable_t pagetable, uint64 va, int alloc)  { | 
