-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major improvements from evaluation (#10)
* Fixes to readme * Refine README.md * Fixes formatting * Sets current process to 'tp' and streamline system calls * Improves revocation * Remove tp as current process, improve IPC code * Fixes trapped project for sifive_unleashed * Fixes ping-pong for sifive_unleashed * Fixes proc_acquire+ipc_wait race condition * Fixes IPC and revocation * Typo in default.ld * Remove cap_is_revocable * Adds NPREMPT option. Define NPREMPT for the kernel to diable in-kernel preemption. * Fixes reply when there is no receiver * Adds another qemu platform. qemu_virt: One core, deterministic. qemu_virt4: Four core, non-deterministic. * Adds more descriptive QEMU script * Adds description of qemu for sifive_unleashed * Add debug output to kernel with different verbosity levels. * Improves scheduler debug output * Fixes PMP revocation * Improves printing of initial capabilities * Formatting * Adds kernel assert statements * Improves revoke efficiency * Improves delete * Improves userland libraries * Fixes a bug in syscall mon_reg_write mon_reg_read * Improves altio * Streamlines cap_ops * Fixes cap_is_valid, which checks that the capability has a valid form * Fixes NDEBUG and NPREEMPT macro * Simplifies CSR * Sets registers s1-s11 to call used registers * Enables fence.i instruction * Aligns kernel stack to 8-byte * Sets INSTRUMENT macro in head.S * Fixes alt_printf * Improves cap_pmp_load/unload * Improves cap_pmp_load/unload * Improves scheduler * Reorganize system call code and arguments * Adds size target to makefiles * Improves 'make format' and removes 'make docs' * Adds 'make size' to demonstrator * Adds demonstrator to project list * Improves Makefile * Various minor improvements * Fixes syscall.c, IPC copy data bug. * Fixes a bug * Fixes cap_ipc.c reply.cap getting the wrong value.
- Loading branch information
1 parent
f5b7994
commit 2a9dabc
Showing
90 changed files
with
2,910 additions
and
2,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
.POSIX: | ||
export ROOT=${abspath .} | ||
.SECONDARY: | ||
|
||
|
||
PROJECTS:=projects/hello projects/trapped projects/ping-pong | ||
PLATFORM?=qemu_virt | ||
|
||
include tools.mk | ||
include common/plat/${PLATFORM}.mk | ||
PROJECTS:=projects/hello \ | ||
projects/trapped \ | ||
projects/ping-pong \ | ||
projects/demonstrator | ||
|
||
all: ${PROJECTS} | ||
|
||
${PROJECTS}: common | ||
|
||
common ${PROJECTS}: | ||
make -C $@ all PLATFORM=${PLATFORM} | ||
@${MAKE} -C $@ all | ||
|
||
clean: | ||
for i in ${PROJECTS}; do \ | ||
make -C $$i clean PLATFORM=${PLATFORM}; \ | ||
@for i in common ${PROJECTS}; do \ | ||
${MAKE} -C $$i clean; \ | ||
done | ||
|
||
docs: | ||
doxygen | ||
|
||
format: | ||
clang-format -i $(shell find -name '*.[hc]' -not -path '*/.*') | ||
clang-format -i $$(find * -type f -name '*.[hc]') | ||
|
||
.PHONY: all docs clean common ${PROJECTS} | ||
.PHONY: all clean format common ${PROJECTS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,15 @@ | ||
.POSIX: | ||
.SECONDARY: | ||
|
||
include plat/${PLATFORM}.mk | ||
PLATFORM?=${patsubst plat/%.mk, %, ${wildcard plat/*.mk}} | ||
|
||
include ${ROOT}/tools.mk | ||
all: ${addsuffix .all, ${PLATFORM}} | ||
clean: ${addsuffix .clean, ${PLATFORM}} | ||
|
||
# CFLAGS | ||
CFLAGS:=-march=${ARCH} -mabi=${ABI} -mcmodel=${CMODEL} \ | ||
-DPLATFORM_${PLATFORM} \ | ||
-Os -flto -ffat-lto-objects \ | ||
-nostdlib -Iinc \ | ||
%.all: | ||
${MAKE} -f build.mk PLATFORM=${@:.all=} all | ||
|
||
BUILD :=build/${PLATFORM} | ||
SRCS2OBJS=${patsubst src/%.S, ${BUILD}/%.o, ${filter %.S, ${1}}} \ | ||
${patsubst src/%.c, ${BUILD}/%.o, ${filter %.c, ${1}}} | ||
|
||
ALTC_SRCS :=${wildcard src/altc/*.[cS]} | ||
S3K_SRCS :=${wildcard src/s3k/*.[cS]} | ||
START_SRCS:=${wildcard src/start/*.S} | ||
|
||
PLAT_OBJS :=${call SRCS2OBJS, ${PLAT_SRCS}} | ||
ALTC_OBJS :=${call SRCS2OBJS, ${ALTC_SRCS}} | ||
S3K_OBJS :=${call SRCS2OBJS, ${S3K_SRCS}} | ||
START_OBJS:=${call SRCS2OBJS, ${START_SRCS}} | ||
|
||
TARGETS:=${BUILD}/libplat.a \ | ||
${BUILD}/libaltc.a \ | ||
${BUILD}/libs3k.a \ | ||
${START_OBJS} | ||
|
||
|
||
all: ${TARGETS} | ||
|
||
clean: | ||
rm -rf ${TARGETS} | ||
|
||
${BUILD}/libplat.a: ${PLAT_OBJS} | ||
@mkdir -p ${@D} | ||
${AR} cr $@ $^ | ||
|
||
${BUILD}/libaltc.a: ${ALTC_OBJS} | ||
@mkdir -p ${@D} | ||
${AR} cr $@ $^ | ||
|
||
${BUILD}/libs3k.a: ${S3K_OBJS} | ||
@mkdir -p ${@D} | ||
${AR} cr $@ $^ | ||
|
||
${BUILD}/%.o: src/%.c | ||
@mkdir -p ${@D} | ||
${CC} -o $@ $< -c ${CFLAGS} | ||
|
||
${BUILD}/%.o: src/%.S | ||
@mkdir -p ${@D} | ||
${CC} -o $@ $< -c ${CFLAGS} | ||
%.clean: | ||
${MAKE} -f build.mk PLATFORM=${@:.clean=} clean | ||
|
||
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.POSIX: | ||
|
||
ROOT:=${abspath ..} | ||
|
||
include plat/${PLATFORM}.mk | ||
|
||
include ${ROOT}/tools.mk | ||
|
||
# CFLAGS | ||
CFLAGS:=-march=${ARCH} -mabi=${ABI} -mcmodel=${CMODEL} \ | ||
-DPLATFORM_${PLATFORM} \ | ||
-Os -flto -ffat-lto-objects \ | ||
-nostdlib -Iinc \ | ||
|
||
BUILD :=build/${PLATFORM} | ||
SRCS2OBJS=${patsubst src/%.S, ${BUILD}/%.o, ${filter %.S, ${1}}} \ | ||
${patsubst src/%.c, ${BUILD}/%.o, ${filter %.c, ${1}}} | ||
|
||
ALTC_SRCS :=${wildcard src/altc/*.[cS]} | ||
S3K_SRCS :=${wildcard src/s3k/*.[cS]} | ||
START_SRCS:=${wildcard src/start/*.S} | ||
|
||
PLAT_OBJS :=${call SRCS2OBJS, ${PLAT_SRCS}} | ||
ALTC_OBJS :=${call SRCS2OBJS, ${ALTC_SRCS}} | ||
S3K_OBJS :=${call SRCS2OBJS, ${S3K_SRCS}} | ||
START_OBJS:=${call SRCS2OBJS, ${START_SRCS}} | ||
|
||
TARGETS:=${BUILD}/libplat.a \ | ||
${BUILD}/libaltc.a \ | ||
${BUILD}/libs3k.a \ | ||
${START_OBJS} | ||
|
||
|
||
all: ${TARGETS} | ||
|
||
clean: | ||
rm -rf ${BUILD} | ||
|
||
${BUILD}/libplat.a: ${PLAT_OBJS} | ||
@mkdir -p ${@D} | ||
@${AR} cr $@ $^ | ||
@printf "AR\t$@\n" | ||
|
||
${BUILD}/libaltc.a: ${ALTC_OBJS} | ||
@mkdir -p ${@D} | ||
@${AR} cr $@ $^ | ||
@printf "AR\t$@\n" | ||
|
||
${BUILD}/libs3k.a: ${S3K_OBJS} | ||
@mkdir -p ${@D} | ||
@${AR} cr $@ $^ | ||
@printf "AR\t$@\n" | ||
|
||
${BUILD}/%.o: src/%.c | ||
@mkdir -p ${@D} | ||
@${CC} -o $@ $< -c ${CFLAGS} | ||
@printf "CC\t$@\n" | ||
|
||
${BUILD}/%.o: src/%.S | ||
@mkdir -p ${@D} | ||
@${CC} -o $@ $< -c ${CFLAGS} | ||
@printf "CC\t$@\n" | ||
|
||
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
#pragma once | ||
#include <stdarg.h> | ||
#include <stddef.h> | ||
|
||
int alt_getchar(void); | ||
int alt_putchar(char c); | ||
int alt_putstr(const char *str); | ||
int alt_puts(const char *str); | ||
int alt_gets(char *str); | ||
int alt_printf(const char *fmt, ...); | ||
int alt_snprintf(char *restrict s, size_t n, const char *restrict fmt, ...); | ||
int alt_vsnprintf(char *restrict s, size_t n, const char *restrict fmt, | ||
va_list ap); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.