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

feat: add initial process, thread and scheduler #46

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
0990135
make run depend on build so it doesn't crash after make clean
jdonszelmann Feb 19, 2020
f2585bd
removed dead code 'SampleFile.c'
jdonszelmann Feb 19, 2020
91d38dc
removed someones personal logfile it seems
jdonszelmann Feb 19, 2020
5345478
added cmakelist to make development in clion possible
jdonszelmann Feb 19, 2020
97fa2ca
all build files now generate in a build directory
jdonszelmann Feb 19, 2020
c2f3bda
tidied makefile
jdonszelmann Feb 19, 2020
dfe447d
simplified source files in cmakelist
Feb 19, 2020
a278388
Merge branch 'repairs' of github.com:rellermeyer/course_os into repairs
Feb 19, 2020
4187be8
fixed segfault due to move to build dir
jdonszelmann Feb 20, 2020
868d6bb
Updated gdb to 9.1 (so that it works with py3)
Feb 20, 2020
486381d
moved process related code to processs/
jdonszelmann Feb 20, 2020
813f87a
cleaned up the root folder
jdonszelmann Feb 20, 2020
8fd7dce
huge refactor of all source files.
jdonszelmann Feb 20, 2020
c1c1826
new test framework autodetecting tests and executing them in ci
jdonszelmann Feb 21, 2020
2be2bea
Added:
Feb 23, 2020
8416baf
test framework ignores commented tests. Implemented a SLL. qstrings n…
jdonszelmann Feb 24, 2020
b05e3e9
Merge pull request #39 from rellermeyer/repairs
rellermeyer Feb 25, 2020
2ca330b
Merge pull request #40 from rellermeyer/refactor
rellermeyer Feb 25, 2020
9403ee1
chore: ignore emitted files by the build process
Feb 26, 2020
bc579a0
chore: add editorconfig
Feb 26, 2020
cd6d43b
Added a hashmap (from linux/facebook), improved uart api.
jdonszelmann Feb 27, 2020
69d7ee0
Updated gitignore
Zedfrigg Feb 27, 2020
530bc82
Modernised build scripts
Zedfrigg Feb 27, 2020
cb56be9
Some cleanup and transfered the vm test to our new testing framework.
Feb 27, 2020
7f6c773
Merge branch 'wip' of github.com:rellermeyer/course_os into wip
Feb 27, 2020
11ab0e3
remove accidentally added file :sweat_smile:
Feb 27, 2020
5461f8e
added some hashmap tests
Feb 28, 2020
91add9f
Added CI with Github actions.
Feb 28, 2020
a295470
Merge pull request #42 from rellermeyer/wip
Feb 28, 2020
6fcb134
Updated cmakelist so that IntelliJ knows we are compiling ARM.
Feb 28, 2020
d208123
Testing if we can upgrade the toolchain to some more modern tools.
Feb 28, 2020
7fffa37
using armv6 instead of v5 for uboot
Feb 29, 2020
bc7eee7
removed uboot and improved uart interface
jdonszelmann Feb 29, 2020
2c06c64
Merge remote-tracking branch 'origin/refactor' into upgraded-toolchain
Feb 29, 2020
6f0b40c
Merge branch 'repairs' into refactor
jdonszelmann Feb 29, 2020
9ef1147
removed uboot dir
jdonszelmann Feb 29, 2020
a6f7fad
Merge branch 'refactor' of github.com:rellermeyer/course_os into refa…
jdonszelmann Feb 29, 2020
3004a40
Fixed virtual memory.
Feb 29, 2020
e60fb45
Merge branch 'upgraded-toolchain' into refactor
Feb 29, 2020
7af56fb
rebuild toolchain cache
Feb 29, 2020
d1522c4
timer interrupts work (though currently disabled).
jdonszelmann Mar 2, 2020
7e78107
Merge branch 'refactor' of github.com:rellermeyer/course_os into upgr…
jdonszelmann Mar 2, 2020
da8d5ee
made sure printf works even before uart is initialized
jdonszelmann Mar 3, 2020
c947872
Kernel makefile fixes
Zedfrigg Mar 3, 2020
2a0f78b
slice allocator works
jdonszelmann Mar 5, 2020
d274feb
feat: add initial process, thread and scheduler
Mar 5, 2020
d1b904e
checkpoint!
jdonszelmann Mar 5, 2020
e2c6a54
[WIP] Timer implementation, pagefaults for unknown reason
Zedfrigg Mar 7, 2020
eeb1772
Reason is no longer unknown, it was a null ptr
Zedfrigg Mar 7, 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
1c86ba3
Updated readme
jdonszelmann Mar 10, 2020
a3c4b3b
added cross compiler text
jdonszelmann Mar 10, 2020
72823e0
Update README.md
Mar 10, 2020
ae8e991
added kernel and test readmes
jdonszelmann Mar 10, 2020
7102ffd
Merge branch 'new_readme' of github.com:rellermeyer/course_os into ne…
jdonszelmann Mar 10, 2020
42e08e7
added s to creating tests
jdonszelmann Mar 10, 2020
28bb277
Merge pull request #45 from rellermeyer/newvm
Mar 11, 2020
4f000ae
Merge remote-tracking branch 'origin/master' into refactor
Mar 11, 2020
050fad7
Merge remote-tracking branch 'origin/new_readme' into refactor
Mar 11, 2020
f63f820
Started on finishing up refactor
Mar 11, 2020
7f8ff99
Finished up init blurb
Mar 11, 2020
b381485
Copy of Final Really Final This time refactor (42).txt
Mar 11, 2020
93c929b
Merge pull request #44 from rellermeyer/refactor
jdonszelmann Mar 11, 2020
3cf6f1e
makes header files show up as c files in stead of cpp
jdonszelmann Mar 11, 2020
9c2c771
remove cpp stuff
jdonszelmann Mar 11, 2020
081d257
remove doxyfile
jdonszelmann Mar 11, 2020
8009a94
Merge pull request #50 from rellermeyer/gitattributes
Mar 11, 2020
35df06d
Read log level from env
Mar 12, 2020
149c4f5
Reformated everything according to .clang-format
Mar 12, 2020
807ff60
made gitattributes work for github (forreal now)
jdonszelmann Mar 12, 2020
a03c605
enabled expansion and contraction of the heap. Added 'format all' script
jdonszelmann Mar 12, 2020
8c9679f
Merge branch 'master' into timers
jdonszelmann Mar 13, 2020
1f7b55b
tmp
jdonszelmann Mar 13, 2020
98cfa75
Merge branch 'heapexpand' into timers
jdonszelmann Mar 13, 2020
b1118a7
feat: add current WIP code
Mar 14, 2020
818e769
Merge branch 'master' into scheduler
Mar 14, 2020
4d8d910
Merge branch 'master' into scheduler
Mar 14, 2020
88ab567
fix: imports
Mar 14, 2020
ce3b3b6
Merge branch 'heapexpand' into scheduler
Mar 14, 2020
8c0c3e3
reformat
jdonszelmann Mar 14, 2020
7b53af4
fix: vas compilation
Mar 14, 2020
b29a9a9
context switching works
jdonszelmann Mar 14, 2020
b6010fe
syscalls
jdonszelmann Mar 14, 2020
ff03b35
Merge pull request #52 from rellermeyer/heapexpand
Mar 14, 2020
235f24e
chore: cleanup in thread.c
Mar 14, 2020
f8c50b9
chore: do some general cleanup
Mar 14, 2020
af7941b
chore: clean up switch_context asm
Mar 14, 2020
6e7c847
fix: wrong commenting style
Mar 14, 2020
4aaa14d
chore: remove userspace
Mar 14, 2020
fe53661
feat: add simple userspace programs
Mar 14, 2020
ec61b92
chore: add memcmp from gcc
Mar 14, 2020
4c970bd
feat: add initial ELF loader :tada:
Mar 15, 2020
25137ad
feat: add more helper functions related to the scheduler and syscalls
Apr 2, 2020
aebdf67
Unused code now results in a warning rather than an error
Zedfrigg Apr 2, 2020
f05371e
Priority queue bugfix
Zedfrigg Apr 2, 2020
9eda15a
Periodic timers and timer descheduling support
Zedfrigg Apr 2, 2020
627b701
Fixed accidental recursion in panic function
Zedfrigg Apr 7, 2020
85cf63b
Timer functions now interrupt-safe, added timer order test
Zedfrigg Apr 7, 2020
9546c46
Added timer function declarations
Zedfrigg Apr 7, 2020
10ddc79
More prio queue bugfixing, changed some param checks to asserts
Zedfrigg Apr 7, 2020
fc4a31c
Ported and fixed more prio queue tests
Zedfrigg Apr 7, 2020
1b640f4
Multiple timers scheduled for same time now function correctly
Zedfrigg Apr 7, 2020
d0ebcd0
Adjusted timer test delays to speed up tests
Zedfrigg Apr 7, 2020
29b875c
Merge branch 'master' into timers
Zedfrigg Apr 7, 2020
aba8717
Merge remote-tracking branch 'remotes/origin/timers' into scheduler
Zedfrigg Apr 8, 2020
c1c41a8
Replaced GNU memcmp with BSD implementation
Zedfrigg Apr 8, 2020
866a9bb
feat: add scheduling out of threads
Apr 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
BasedOnStyle: Google
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: WithoutElse
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
ColumnLimit: 100
DerivePointerAlignment: false
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 4
IndentWrappedFunctionNames: true
Language: Cpp
MaxEmptyLinesToKeep: 2
PointerAlignment: Middle
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never

...
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8

[*.yml]
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sources
*.c text diff=c
*.h text diff=c
*.h linguist-language=C
42 changes: 42 additions & 0 deletions .github/workflows/os_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: course_os test suite

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache Toolchain
id: cache-toolchain
uses: actions/cache@v1
with:
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 python3 wget texinfo zlib1g-dev -y

- 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

- name: Compile
run: make build

- name: Test
run: make test
63 changes: 48 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,65 @@
#these were not originally apart of the repo -- appeared after build
/kernel/kernel.bin
/kernel/flash.bin
/kernel/boot-commands
/kernel/card.sd
/toolchain/target/
/u-boot/u-boot-*
# Build files
kernel/kernel.bin
kernel/flash.bin
kernel/boot-commands
kernel/card.sd
kernel/src/test/test.c

# Toolchain dir, but not the build script
/toolchain/
!/toolchain/build.sh

# Qemu dir, again without its buildscript
/qemu/
!/qemu/build.sh

# Generic build dirs
build/
/cmake-build-*/

# Generated docs
/docs/
/html/
/latex/
/course_os_docs.pdf

# Editor specific
.settings/
.cproject
.project
/.idea/
!/.idea/runConfigurations
/.vscode/
!/.idea/settings.json
*~
*.swp
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist

# CCLS files
.ccls-cache/
compile_commands.json

#always exclude these from being pushed
# Binary files
*.o
*.img
*.map
*.elf
*.bin
*~
*.swp
/user/hello/hello
/user/hello/hello1
/user/hello/hello2
/user/libc/libc.a

[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
# Floobits (CLion collabrative editing plugin)
.floo
.flooignore

# Misc
NOTES
/server.PID
compile_commands.json
user/swi/swi
5 changes: 5 additions & 0 deletions .idea/runConfigurations/debug.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "attach",
"gdbpath": "${workspaceFolder}/toolchain/arm-none-eabi/bin/arm-none-eabi-gdb",
"name": "Debug",
"executable": "${workspaceFolder}/kernel/build/kernel.sym",
"target": ":1234",
"remote": true,
"cwd": "${workspaceRoot}",
// "preLaunchTask": "run_debug",
"valuesFormatting": "prettyPrinters"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.h": "c"
}
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make test",
"detail": "Runs the course_os test suite",
"type": "shell",
"command": "make test",
"problemMatcher": "$gcc",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "run_debug",
"detail": "Runs qemu with gdbserver",
"type": "shell",
"command": "make -C kernel debug",
}
]
}
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
########################################################################
## WARNING: This cmake file does *NOT* work to compile the course OS ##
## It is merely here to make clion detect all the source files ##
## so it can do code inspection. Use the supplied makefile to compile ##
########################################################################

cmake_minimum_required(VERSION 3.6)

project(course_os)

set(CMAKE_SYSTEM_NAME linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_SOURCE_DIR}/toolchain/arm-none-eabi/bin/arm-none-eabi-gcc)
set(CMAKE_C_LINK_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/toolchain/arm-none-eabi/bin/arm-none-eabi-ld)

file(GLOB_RECURSE kernel_sources ./kernel/src/*.c ./kernel/src/**/*.c)
file(GLOB_RECURSE kernel_include LIST_DIRECTORIES true ./kernel/src/**/include)

set(SOURCE_FILES ${kernel_sources})

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")

add_compile_definitions(ENABLE_TESTS MEM_DEBUG)

add_executable(course_os ${SOURCE_FILES})

message(${kernel_include})

include_directories(
${kernel_include}
)

Loading