add copyright

This commit is contained in:
hustccc 2020-11-17 03:33:12 +09:00
parent cec5541744
commit a78ec35c17
9 changed files with 66 additions and 9 deletions

View File

@ -53,7 +53,7 @@ SDK_OBJS = \
$S/sysctl.o \
QEMU = qemu-system-riscv64
RUSTSBI = ./bootloader/SBI/rustsbi-k210
RUSTSBI = ./bootloader/SBI/sbi
TOOLPREFIX := riscv64-unknown-elf-
CC = $(TOOLPREFIX)gcc
@ -62,7 +62,7 @@ LD = $(TOOLPREFIX)ld
OBJCOPY = $(TOOLPREFIX)objcopy
OBJDUMP = $(TOOLPREFIX)objdump
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb
CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -g
CFLAGS += -MD
CFLAGS += -mcmodel=medany
CFLAGS += -ffreestanding -fno-common -nostdlib -mno-relax
@ -98,6 +98,12 @@ QEMUOPTS += -device loader,file=$T/kernel,addr=0x80200000
qemu: build
@$(QEMU) $(QEMUOPTS)
RUSTSBI:
@cd ./bootloader/SBI/rustsbi-k210 && cargo build && cp ./target/riscv64gc-unknown-none-elf/debug/rustsbi-k210 ../sbi
rustsbi-clean:
@cd ./bootloader/SBI/rustsbi-k210 && cargo clean
image = $T/kernel.bin
k210 = $T/k210.bin
k210-serialport := /dev/ttyUSB0
@ -105,6 +111,8 @@ k210-serialport := /dev/ttyUSB0
k210: build
@riscv64-unknown-elf-objcopy $T/kernel --strip-all -O binary $(image)
@riscv64-unknown-elf-objcopy $(RUSTSBI) --strip-all -O binary $(k210)
# @riscv64-unknown-elf-objcopy $T/kernel -O binary $(image)
# @riscv64-unknown-elf-objcopy $(RUSTSBI) -O binary $(k210)
# @cp $(RUSTSBI) $(k210)
@dd if=$(image) of=$(k210) bs=128k seek=1
# @dd if=sdcard.bin of=$(k210) bs=128k seek=3

View File

@ -47,6 +47,3 @@ may help you: [maixpy-doc](https://maixpy.sipeed.com/zh/get_started/env_install_
## TODO
The rest part of xv6-kernel and xv6-fs
## LICENSE
MIT License

View File

@ -319,8 +319,8 @@ sfence_vma()
{
// the zero, zero means flush all TLB entries.
// asm volatile("sfence.vma zero, zero");
asm volatile("sfence.vm");
// asm volatile("sfence.vma");
// asm volatile("sfence.vm");
asm volatile("sfence.vma");
}

View File

@ -1,3 +1,5 @@
// Copyright (c) 2006-2019 Frans Kaashoek, Robert Morris, Russ Cox,
// Massachusetts Institute of Technology
#include "include/types.h"
#include "include/param.h"
#include "include/memlayout.h"

View File

@ -77,7 +77,7 @@ uservec:
ld t1, 0(a0)
csrw satp, t1
; sfence.vma zero, zero
# sfence.vma zero, zero
sfence.vm
# a0 is no longer valid, since the kernel page
@ -101,7 +101,8 @@ userret:
# sfence.vma zero, zero
sfence.vm
# sfence.vma
# put the saved user a0 in sscratch, so we
# can swap it with our a0 (TRAPFRAME) in the last step.
ld t0, 112(a0)

View File

@ -57,6 +57,7 @@ void
kvminithart()
{
w_satp(MAKE_SATP(kernel_pagetable));
reg_info();
sfence_vma();
printf("kvminithart\n");
}

23
kernel/xv6-riscv-license Normal file
View File

@ -0,0 +1,23 @@
The xv6 software is:
Copyright (c) 2006-2019 Frans Kaashoek, Robert Morris, Russ Cox,
Massachusetts Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,3 +1,5 @@
// Copyright (c) 2006-2019 Frans Kaashoek, Robert Morris, Russ Cox,
// Massachusetts Institute of Technology
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

View File

@ -0,0 +1,23 @@
The xv6 software is:
Copyright (c) 2006-2019 Frans Kaashoek, Robert Morris, Russ Cox,
Massachusetts Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.