Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised Virtual Memory #45

Merged
merged 28 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
da8d5ee
made sure printf works even before uart is initialized
jdonszelmann Mar 3, 2020
2a0f78b
slice allocator works
jdonszelmann Mar 5, 2020
d1b904e
checkpoint!
jdonszelmann Mar 5, 2020
c540860
Vm WoRkS aAaAaAaAaAaAaA
jdonszelmann Mar 8, 2020
6e79bbc
Cleaned up source
jdonszelmann Mar 8, 2020
29c0a89
enabled high interrupt vectors to enable higher-half interrupts
jdonszelmann Mar 8, 2020
401470f
enabled high interrupt vectors to enable higher-half interrupts
jdonszelmann Mar 8, 2020
55141ee
Merge branch 'newvm' of github.com:rellermeyer/course_os into newvm
Mar 8, 2020
29253eb
Disable toolchain cache, to see if it fixs CI
Mar 8, 2020
be99ff8
Added tlb_cache_id_allocator tests and comments
Mar 8, 2020
82c027e
Added Semihosting call to exit with an arbitrary exit code, this should
Mar 8, 2020
d2e7052
hopefully fixed CI by building qemu ourselves
jdonszelmann Mar 9, 2020
7e0ea6f
fixed ci script
jdonszelmann Mar 9, 2020
51fcf51
Fixed heap init and randomized test order
Mar 9, 2020
96c485c
Cleanup codebase
Mar 9, 2020
cfa2050
added fatals in interrupt.c for invalid interrupt mask
jdonszelmann Mar 9, 2020
6c634c8
merge
jdonszelmann Mar 9, 2020
9a9e99e
added runconfigs to git
jdonszelmann Mar 9, 2020
53c4be6
renamed l1_in_l2 to find_l2pt
jdonszelmann Mar 9, 2020
3ffb246
changed fatals to warns in interrupt.c
jdonszelmann Mar 9, 2020
27bbc83
Added vscode run config
Mar 9, 2020
8aecf6a
Cleaned up gitignore
Mar 10, 2020
79ed90d
updated vas2.c. Has to be tested with a scheduler but is pretty complete
jdonszelmann Mar 10, 2020
1a39b69
Merge branch 'newvm' of github.com:rellermeyer/course_os into newvm
jdonszelmann Mar 10, 2020
b91078e
Switched to a memory model where the Process pagetable is separate fr…
Mar 10, 2020
5cdd28d
Removed outdated TODO
Mar 10, 2020
ccdfcc1
Added more docs
Mar 10, 2020
473f75c
Added debug runconfig
jdonszelmann Mar 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/os_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,26 @@ jobs:
path: toolchain
key: toolchain

- name: Cache Qemu
id: cache-qemu
uses: actions/cache@v1
with:
path: qemu/qemu
key: qemu

- name: Install Dependencies
run: |
sudo apt-get update &&
sudo apt-get install build-essential qemu-system-arm python3 wget texinfo zlib1g-dev -y
sudo apt-get install build-essential python3 wget texinfo zlib1g-dev -y

- name: Install Toolchain
#if: steps.cache-toolchain.outputs.cache-hit != 'true'
- name: Build Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: rm -rf toolchain/arm-none-eabi/ && make toolchain

- name: Build Qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: rm -rf qemu/qemu* && make qemu
redshiftss marked this conversation as resolved.
Show resolved Hide resolved

- name: Compile
run: make build

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ uboot-commands.ubt

NOTES
/server.PID

!/.idea/
dsluijk marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
all: toolchain kernel
all: requirements kernel

toolchain:
cd ./toolchain && ./build.sh
.PHONY: toolchain

qemu:
cd ./qemu && ./build.sh
.PHONY: qemu

requirements: toolchain qemu

libc:
$(MAKE) -C user/libc

Expand Down
1 change: 0 additions & 1 deletion a.s

This file was deleted.

4 changes: 1 addition & 3 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ TOOLCHAIN_DIR=toolchain
BARE_METAL_TUPLE=arm-none-eabi
BARE_METAL_TARGET:=$(BARE_METAL_TUPLE)

QEMU=qemu-system-arm

UBOOT_VERSION=2014.10
QEMU=./qemu/qemu/bin/qemu-system-arm

#CFLAGS = -mcpu=arm1136j-s
CFLAGS = -mcpu=arm1176jz-s
14 changes: 12 additions & 2 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS += -pipe -std=gnu99 -ffreestanding -Wall -Werror -g -O0 -mcpu=arm1176jzf-
#PI_CFLAGS = -mfpu=vfp -march=armv6zk -mtune=arm1176jzf-s -nostartfiles

# variables to define in the preprocessor.
MEMORY = 128M
MEMORY = 1G
DEFINITIONS = MEM_DEBUG
test: DEFINITIONS += ENABLE_TESTS # if we execute the test: rule, enable tests before recompiling
KERNEL_PARAMS = root=/dev/ram mem=$(MEMORY)
Expand All @@ -25,8 +25,8 @@ CC:=$(TOOLCHAIN_PATH)/$(BARE_METAL_TUPLE)-gcc
AS:=$(TOOLCHAIN_PATH)/$(BARE_METAL_TUPLE)-as
LD:=$(TOOLCHAIN_PATH)/$(BARE_METAL_TUPLE)-gcc
OBJCOPY:=$(TOOLCHAIN_PATH)/$(BARE_METAL_TUPLE)-objcopy
MKIMAGE:=$(CURDIR)/../u-boot/u-boot-$(UBOOT_VERSION)/tools/mkimage
GDB:=$(TOOLCHAIN_PATH)/$(BARE_METAL_TUPLE)-gdb
QEMU := $(CURDIR)/../${QEMU}

DIRS = $(shell find $(SOURCEDIR)/ -type d -print)
C_SOURCE_FILES := $(foreach dir,$(DIRS),$(wildcard $(dir)/*.c)) $(TEST_MAIN_FILE)
Expand Down Expand Up @@ -57,8 +57,18 @@ run: build | builddir
#${QEMU} -M versatilepb -cpu arm1176 -sd $(BUILDDIR)/card.sd -m $(MEMORY) -nographic -semihosting -monitor none -serial stdio -kernel build/flash.bin -append "-load 0x410000 0x14000"
${QEMU} -kernel $(BUILDDIR)/kernel.elf -m $(MEMORY) -serial stdio -monitor none -M raspi2 -cpu arm1176 -nographic -append "-load 0x410000 0x14000" -semihosting

debug: build | builddir
${QEMU} -kernel $(BUILDDIR)/kernel.elf -m $(MEMORY) -serial stdio -monitor none -M raspi2 -cpu arm1176 -nographic -append "-load 0x410000 0x14000" -semihosting -S -s
redshiftss marked this conversation as resolved.
Show resolved Hide resolved

start_debug: build | builddir
$(GDB) -ex "target remote localhost:1234" -ex "symbol-file $(BUILDDIR)/kernel.sym"

$(BUILDDIR)/kernel.elf: $(OBJECT_FILES) | builddir
$(LD) -T linker/kernel.ld -nostartfiles -Wl,-Map,kernel.map $^ -o $@
$(OBJCOPY) --only-keep-debug $(BUILDDIR)/kernel.elf $(BUILDDIR)/kernel.sym
$(OBJCOPY) --strip-debug $(BUILDDIR)/kernel.elf



# Begin Pi Make
$(BUILDDIR)/kernelPi.elf: $(C_OBJECT_FILES) | builddir
Expand Down
44 changes: 33 additions & 11 deletions kernel/linker/kernel.ld
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
ENTRY(_Reset)

__KERNEL_VIRTUAL_OFFSET = 0x80000000;
__BOOT_ADDRESS = 0x8000;

SECTIONS
{
. = 0x8000;
P_KERNBASE = .;
.startup . : { build/common/startup.o(.text) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
P_KERNTOP = .;
. = ALIGN(8);
. = . + 0x1000;
stack_top = .;
}
. = __BOOT_ADDRESS;
__BOOT_START = .;
.boot : {
*/startup.o (.text)
*/startup.o (.data)
*/stacks.o (.text)
*/startup.o (.bss)
}
__BOOT_END = .;
. += __KERNEL_VIRTUAL_OFFSET;

__KERNEL_BASE = .;
.text : AT(ADDR(.text) - __KERNEL_VIRTUAL_OFFSET) {
*(EXCLUDE_FILE (*/boot.o */stacks.o) .text)
*(.rodata*)
}

.data : AT(ADDR(.data) - __KERNEL_VIRTUAL_OFFSET){
*(EXCLUDE_FILE (*/boot.o */stacks.o) .data)
}

.bss : AT(ADDR(.bss) - __KERNEL_VIRTUAL_OFFSET) {
*(EXCLUDE_FILE (*/boot.o */stacks.o) COMMON)
*(EXCLUDE_FILE (*/boot.o) .bss)
}

/*make kernel top megabyte aligned*/
. = ALIGN(1024 * 1024);
__KERNEL_TOP = .;
}
12 changes: 0 additions & 12 deletions kernel/linker/kernelPi.ld

This file was deleted.

21 changes: 0 additions & 21 deletions kernel/old/drivers/clock.c

This file was deleted.

159 changes: 0 additions & 159 deletions kernel/old/fs/cmdline/Documents

This file was deleted.

39 changes: 0 additions & 39 deletions kernel/old/fs/cmdline/Makefile

This file was deleted.

Binary file removed kernel/old/fs/cmdline/buildfs
Binary file not shown.
Loading