Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
390 commits
Select commit Hold shift + click to select a range
1f8b455
Mark memory slices as reserved to prevent them being freed
fayalalebrun Feb 12, 2021
90aa297
Use standard bash random variable for random number generation
fayalalebrun Feb 12, 2021
45eb37a
Remove outdated comment
fayalalebrun Feb 12, 2021
8c3c5f9
Merge pull request #60 from ValentijnvdBeek/make-file-program-checking
jdonszelmann Feb 16, 2021
cd74c3d
Merge remote-tracking branch 'origin/master' into random-tests
fayalalebrun Feb 16, 2021
0a52229
Merge pull request #63 from fayalalebrun/random-tests
jdonszelmann Feb 16, 2021
10728b5
fix cmakelist
jdonszelmann Feb 16, 2021
0046c4d
Use docker in CI; Don't echo random number if pipe is closed
fayalalebrun Feb 16, 2021
a551b5f
Separate build and test stages
fayalalebrun Feb 16, 2021
991b8bc
Merge pull request #70 from fayalalebrun/random-tests
fayalalebrun Feb 16, 2021
de7705d
Merge branch 'master' of github.com:rellermeyer/course_os into fix_clion
jdonszelmann Feb 16, 2021
ab90337
Merge pull request #64 from rellermeyer/fix_clion
jdonszelmann Feb 16, 2021
ff43448
Skrewing around with context switching (DOES NOT WORK, I THINK)
Feb 17, 2021
9d6e2a1
Improved version of context switching, might actually work?
Feb 17, 2021
b17c2a2
Improved code readability
Feb 17, 2021
47a2558
Improved comments
Feb 17, 2021
405c6c0
Started adding a skeleton of a syscall helper that will hopefully be …
nasko25 Feb 17, 2021
eb43463
Found a bug in interrupt.c while testing.
nasko25 Feb 18, 2021
a71f78c
Fixed the bug in interrupt.c
nasko25 Feb 18, 2021
966be34
Merge remote-tracking branch 'origin/master' into memdetect
fayalalebrun Feb 18, 2021
8e22105
Merge remote-tracking branch 'origin/master' into memdetect
fayalalebrun Feb 18, 2021
1d91b6b
Add POSIX error handling; add test for invalid slice
fayalalebrun Feb 18, 2021
bd09d25
Change wording of test to "reserved"
fayalalebrun Feb 18, 2021
41ca67b
Very weird. Adding an empty kprintf call to the end of the dummy case…
nasko25 Feb 18, 2021
7dedd57
Fix small bug in interrupt.c
Dimitar2000 Feb 18, 2021
c9d6264
Initial very minimal interface for PCB and scheduler
Feb 18, 2021
7be54ea
Fixed the weird kernel panic.
nasko25 Feb 18, 2021
7853bff
expanded the scheduler and PCB interface + added implementations
Feb 19, 2021
274777d
added TODO, how to handle empty queue?
Feb 19, 2021
d22f2db
fixed previous TODO
Feb 19, 2021
897ea13
Screwing around with things, doesn't work
Feb 19, 2021
7beab3f
Resolve merge conflicts
Feb 19, 2021
0931a8f
Resolve errors
Feb 19, 2021
6f36684
Merge pull request #61 from fayalalebrun/memdetect
fayalalebrun Feb 20, 2021
ab2b61f
Find native GDB & stdbool C99 compliance
ValentijnvdBeek Feb 21, 2021
c299d7d
Add memchr and memcmp
ValentijnvdBeek Feb 21, 2021
de0d53d
Add support for printing pointers in kprintf
ValentijnvdBeek Feb 21, 2021
32a9103
Implement most of string.h
ValentijnvdBeek Feb 21, 2021
4f4ea58
Add a tokenizer method and push_to_back for VPSSL
ValentijnvdBeek Feb 21, 2021
e78f2b0
string.h tests
ValentijnvdBeek Feb 21, 2021
d7905b6
Documentation changes
ValentijnvdBeek Feb 21, 2021
23064c5
Give an int pointer to the SWI handler when calling the fork syscall.
nasko25 Feb 21, 2021
bb8f3db
Added build/ and .cache/ to the gitignore.
nasko25 Feb 21, 2021
29a2f49
Almost working context saver, and fix gitignore issues
Feb 22, 2021
5d63124
Added more docs, and todos
Feb 22, 2021
b46b49e
Fix syntax error
Feb 22, 2021
62db3d8
Improves vscode launch config to work with default cpp extension, and…
Feb 22, 2021
4bc2947
Removes non-gitignored build files
Feb 22, 2021
f83dcad
Merge improved vscode launch file
Feb 22, 2021
2d63a04
Removes vscode launch files from gitignore
Feb 22, 2021
6c4f4e8
Adds root build directory to gitignore
Feb 22, 2021
115f20e
minor change to gitignore and better comment
Feb 22, 2021
7b06dbf
Merge remote-tracking branch 'origin/scheduler_setup_zohar' into sche…
Feb 22, 2021
7b58623
Add Emacs gdb command variable set automatically
fayalalebrun Feb 22, 2021
4483cf5
Update readme related to Emacs GDB command
fayalalebrun Feb 22, 2021
b4e29a9
fixed a laundry list of errors in my original code
Feb 22, 2021
f19c824
Fixed indentation issues.
nasko25 Feb 22, 2021
529bb5c
Pass arguments when calling SYS_kill.
nasko25 Feb 22, 2021
c5e2b63
The syscall interface should be done.
nasko25 Feb 22, 2021
7227095
Saving context now works
Feb 22, 2021
52ca7f1
Better code formatting?
Feb 22, 2021
10f8af4
Fix typo
Feb 22, 2021
91af0ea
Correct docs
Feb 22, 2021
c6ea912
Restructure struct to match loading order, added comments on switchin…
Feb 23, 2021
63c6291
Merged with scheduler_setup_zohar.
nasko25 Feb 23, 2021
bf0822e
Temp
nasko25 Feb 23, 2021
6602e2e
TMP 2 :)
Feb 23, 2021
2864959
Trying to set up automation for path of gdb
Feb 23, 2021
a0fa13b
everything is kinda fine but r3 is overwritten
nasko25 Feb 23, 2021
e76859c
Fixes debugging not working on open source vscode, and makes it more …
Feb 24, 2021
46ce3af
Replaces environment variable with working path
Feb 24, 2021
f7b64ee
Merge remote-tracking branch 'origin/scheduler_setup_zohar' into sche…
Feb 25, 2021
2d86287
"combined" execution states
Feb 25, 2021
77d1560
preemptively fixed mistakes, added kernelpanic if no processes active
Feb 25, 2021
4a288ce
Generic UART interface; OOP Uart Object; Reading characters; Cat program
ValentijnvdBeek Feb 25, 2021
64eba23
New kernel panic graphic; First command
ValentijnvdBeek Feb 25, 2021
70329b2
Merge remote-tracking branch 'labrun/emacs-gdb' into libc-stdio
ValentijnvdBeek Feb 25, 2021
e938d57
trying to switch to usermode; nothing works so far
nasko25 Mar 3, 2021
0fb2649
now it should compile
nasko25 Mar 3, 2021
012a1a0
WIP
ValentijnvdBeek Mar 3, 2021
e946e0c
BOOIIIISSS
Mar 3, 2021
fa49351
Resolve merge conflicts
Mar 3, 2021
1c25deb
merged with syscalls to get the allocate_page() fix
nasko25 Mar 3, 2021
4838faf
comments; switching to usermode appears to work
nasko25 Mar 3, 2021
ca9e606
Merge pull request #75 from rellermeyer/improved-vscode-config
Mar 5, 2021
3b9df7c
switching to userspace and calling swi finally works
nasko25 Mar 5, 2021
2296d84
cleaned the code a bit
nasko25 Mar 5, 2021
30a0df7
Another WIP
Mar 5, 2021
14ddd45
trying to set a usermode stack
nasko25 Mar 5, 2021
7e84e3f
context switching with software interrupts works
nasko25 Mar 5, 2021
ba259dd
passing values to the syscall handler works
nasko25 Mar 5, 2021
6a71848
calling two consecutive syscalls works!!!
nasko25 Mar 5, 2021
0df0e1b
Updates syscalls.c to work with context switching
Mar 7, 2021
a835a1c
Improve GDB emacs support
ValentijnvdBeek Mar 7, 2021
3200c17
save the sp in r4 before calling svc
nasko25 Mar 7, 2021
55377d6
Update documentation on context switching
Mar 7, 2021
b0c2661
Fix CMake compiler and linker detection.
Dimitar2000 Mar 7, 2021
7151d5d
made _save_state and _load_state macros
nasko25 Mar 7, 2021
deee404
Merge pull request #79 from rellermeyer/fix_cmake
Dimitar2000 Mar 7, 2021
79b2bf0
saving and loading state restores the user's registers when returning…
nasko25 Mar 8, 2021
0a2ec92
Add dtb files
fayalalebrun Mar 9, 2021
cb8d7bf
Add board option to makefile; Add linking of dtb into binary
fayalalebrun Mar 9, 2021
e2615d5
Add board configuration documentation
fayalalebrun Mar 9, 2021
96d8050
Move dtb files to kernel directory
fayalalebrun Mar 9, 2021
af3d248
Merge remote-tracking branch 'origin/scheduler_setup_Erik' into syscalls
Mar 11, 2021
8a76c3b
Started trying to schedule a process
Mar 11, 2021
a37fd27
Stack protection, debug shell, more io functions
ValentijnvdBeek Mar 12, 2021
778ce75
Add a debug API & arguments to commands
ValentijnvdBeek Mar 13, 2021
180ffef
Toggable memory tracing
ValentijnvdBeek Mar 13, 2021
2df8f6a
Add raspberry pi zero dumped device tree
fayalalebrun Mar 13, 2021
4a29658
Fix raspi0 core being disabled
fayalalebrun Mar 13, 2021
ce0916b
Fix timer tests failing
fayalalebrun Mar 14, 2021
43ba07f
Remove old memory detection mechanism; Add use of embedded dtb
fayalalebrun Mar 14, 2021
d94a02e
Add dtb struct; Add check for dtb magic number
fayalalebrun Mar 14, 2021
0f4403a
Context switching, now without user sp as parameter!
Mar 15, 2021
3e4af03
initilizing and running two processes in parallel!
nasko25 Mar 15, 2021
570a2a6
Now also saves r0, updated and added more comments
Mar 16, 2021
fb996d8
Fix typo
Mar 16, 2021
407cd00
Removes rogue folder
Mar 16, 2021
f0c39fb
Merge multiprocessing and libc-stdio
Mar 16, 2021
1b23ec6
Restructure assembly subroutines
Mar 16, 2021
0df74bb
Typo in include
Mar 16, 2021
e695e4e
Add first implementation of dtb parser
fayalalebrun Mar 16, 2021
8328004
Document debug
ValentijnvdBeek Mar 16, 2021
859b505
Fix bugs in dtb parser, now functional
fayalalebrun Mar 16, 2021
1779627
Add dtb memory detection; Overhaul hardware detection using DTB
fayalalebrun Mar 17, 2021
9695a82
Merge branch 'multiprocessing' into dtb
fayalalebrun Mar 18, 2021
2f11d82
Quick master update
Mar 18, 2021
6214e31
Add initial documentation file.
Dimitar2000 Feb 25, 2021
0f07eb5
Add header files for loader and elf.
Dimitar2000 Feb 28, 2021
54b44c1
Add a header file for expected common elf features
Dimitar2000 Feb 28, 2021
fbe7b21
Add structure definition and function declarations.
Dimitar2000 Feb 28, 2021
f43353b
Update elf_new.h: Add more declarations
Dimitar2000 Mar 1, 2021
3b73fda
ELF header parsing: Version 1
Dimitar2000 Mar 1, 2021
b1ebc17
Add declaration to loader.h
Dimitar2000 Mar 2, 2021
7eb9540
Update documentation. Add steps in overview.
Dimitar2000 Mar 6, 2021
1c4ad7d
Change methods' signatures
Dimitar2000 Mar 6, 2021
55054ea
Change functions' signatures.
Dimitar2000 Mar 6, 2021
1f9e5e9
Add initial loader implementation code
Dimitar2000 Mar 6, 2021
9e76ff4
Fix errors and remove unnecessary files
Dimitar2000 Mar 6, 2021
bc3fbcc
Add new elf enums and a function.
Dimitar2000 Mar 7, 2021
a9fb478
Loader: Implement program header table traversal and page allocation V1.
Dimitar2000 Mar 7, 2021
e3c0527
Loader: Add code for allocating stack and heap
Dimitar2000 Mar 18, 2021
bd2f24b
Loader: Add comments.
Dimitar2000 Mar 18, 2021
8d3bd8c
Loader: Update code to use PCB struct.
Dimitar2000 Mar 18, 2021
dae3ae5
Loader: Remove files from source set for CMake.
Dimitar2000 Mar 18, 2021
5b2322c
Add first implementation BCM2835 support
fayalalebrun Mar 20, 2021
b88563d
Fix wrong address used for interrupt registers
fayalalebrun Mar 20, 2021
2c6c6cc
Refactor timer test to use chipset functions
fayalalebrun Mar 20, 2021
546dc5c
Loader: Finish loader routine by initiating the exec state.
Dimitar2000 Mar 20, 2021
134feb6
Loader: Add comments to header file.
Dimitar2000 Mar 20, 2021
9985c2e
Loader: Add comments to implementation file.
Dimitar2000 Mar 20, 2021
716c10e
Loader: Comment out init_state code.
Dimitar2000 Mar 20, 2021
4f96a82
Fix system timer implementation; Fix failing test on raspi0
fayalalebrun Mar 20, 2021
ac7a3f6
Loader: Add a simple assembly function for using an external macro.
Dimitar2000 Mar 20, 2021
219d2b2
Fix r7 not being restored properly
Mar 22, 2021
9071403
Add pseudo code (not really but you get the point) for saving, and lo…
Mar 22, 2021
32342a7
Cleanup useless files
ValentijnvdBeek Mar 23, 2021
5fdac11
Fix CI
ValentijnvdBeek Mar 23, 2021
2b1a512
Remove pseudocode, and add IRQ mode constant
Mar 23, 2021
0d0259a
Add context switching in irq, and scheduler time-slices (UNTESTED...)
Mar 23, 2021
b1425ce
Remove unused DTB files
fayalalebrun Mar 24, 2021
1aca175
Add dtb readme
fayalalebrun Mar 24, 2021
6af63f6
Remove unnecessary memory variable
fayalalebrun Mar 24, 2021
2830c90
Refactore dtb source to use existing ALIGN macro
fayalalebrun Mar 24, 2021
dbf0db5
Move memory detection responsibility to hardware info
fayalalebrun Mar 24, 2021
9f193e1
debugging :)
nasko25 Mar 24, 2021
6c83e8b
move the irq handler to assembly
nasko25 Mar 24, 2021
e8ac244
Merge remote-tracking branch 'origin/multiprocessing' into cleanup
ValentijnvdBeek Mar 26, 2021
418177f
irq interrupts work
nasko25 Mar 26, 2021
d13f439
added comments and cleaned the code a bit
nasko25 Mar 26, 2021
360546d
WIP: Syscall method
ValentijnvdBeek Mar 26, 2021
51058ee
Merge branch 'multiprocessing' into cleanup
ValentijnvdBeek Mar 26, 2021
2cff622
bugfix
nasko25 Mar 26, 2021
cf8e3e1
Merge branch 'cleanup' into testing-framework-rewrite
ValentijnvdBeek Mar 28, 2021
4a14d69
Rewrite asserts and add a few new ones
ValentijnvdBeek Mar 28, 2021
10eca9f
Add an ANSI escape code library
ValentijnvdBeek Mar 28, 2021
485c64c
Rewrite unit tests; Configurable memory tracing; Memory leak detectio…
ValentijnvdBeek Mar 28, 2021
ebf91ed
Rewrite the test suite in Python and Jinja2
ValentijnvdBeek Mar 29, 2021
382426d
Use a Jinja macro for TEST_CREATE instead of a C macro
ValentijnvdBeek Mar 29, 2021
2cd9ec3
Rewrite the C macro into a Python macro
ValentijnvdBeek Mar 29, 2021
206bcaa
Organise test into test suites based on files
ValentijnvdBeek Mar 30, 2021
cb3a11d
fixed the failing tests
nasko25 Mar 30, 2021
864c248
Initial compile, doesn't run
ValentijnvdBeek Mar 31, 2021
75b2047
Merge memallocator
ValentijnvdBeek Mar 31, 2021
0eb2ada
Stylistic changes
ValentijnvdBeek Apr 1, 2021
b0bdb87
Fix some typos
ValentijnvdBeek Apr 1, 2021
4053cf3
Update generate_tests.sh
ValentijnvdBeek Apr 1, 2021
b2f137d
Add initial documentation file.
Dimitar2000 Feb 25, 2021
4221cde
Add header files for loader and elf.
Dimitar2000 Feb 28, 2021
bffd9cd
Add a header file for expected common elf features
Dimitar2000 Feb 28, 2021
421016c
Add structure definition and function declarations.
Dimitar2000 Feb 28, 2021
2be9cff
Update elf_new.h: Add more declarations
Dimitar2000 Mar 1, 2021
24badc3
ELF header parsing: Version 1
Dimitar2000 Mar 1, 2021
03d876d
Add declaration to loader.h
Dimitar2000 Mar 2, 2021
f1e2e7d
Update documentation. Add steps in overview.
Dimitar2000 Mar 6, 2021
a15104b
Change methods' signatures
Dimitar2000 Mar 6, 2021
9a36cb8
Change functions' signatures.
Dimitar2000 Mar 6, 2021
008dbc5
Add initial loader implementation code
Dimitar2000 Mar 6, 2021
09a56b8
Fix errors and remove unnecessary files
Dimitar2000 Mar 6, 2021
ba1d4d0
Add new elf enums and a function.
Dimitar2000 Mar 7, 2021
b168700
Loader: Implement program header table traversal and page allocation V1.
Dimitar2000 Mar 7, 2021
ffb431f
Loader: Add code for allocating stack and heap
Dimitar2000 Mar 18, 2021
3d1d1db
Loader: Add comments.
Dimitar2000 Mar 18, 2021
089cb01
Loader: Update code to use PCB struct.
Dimitar2000 Mar 18, 2021
de50949
Loader: Remove files from source set for CMake.
Dimitar2000 Mar 18, 2021
912f248
Loader: Finish loader routine by initiating the exec state.
Dimitar2000 Mar 20, 2021
26e1754
Loader: Add comments to header file.
Dimitar2000 Mar 20, 2021
66f82c4
Loader: Add comments to implementation file.
Dimitar2000 Mar 20, 2021
1765018
Loader: Comment out init_state code.
Dimitar2000 Mar 20, 2021
8d84538
Loader: Add a simple assembly function for using an external macro.
Dimitar2000 Mar 20, 2021
3912253
Add an exec file into the kernel image file.
Dimitar2000 Mar 26, 2021
f2d0dbf
Use R&L for good, and not evil.
ValentijnvdBeek Apr 2, 2021
c486f2d
Fix bug where the singly linked list assumed it ended with a NULL
ValentijnvdBeek Apr 2, 2021
fbc6319
Inject executable into kernel image file.
Dimitar2000 Mar 26, 2021
0d6958d
Add loader procedure to startup code. Fix some issues
Dimitar2000 Mar 29, 2021
ddf7f09
Loader: Add INFO messages and fix bugs.
Dimitar2000 Mar 30, 2021
793a754
Add a mkprex.sh
Dimitar2000 Apr 1, 2021
f61ea88
Loader: Change location of test executable in the linker script.
Dimitar2000 Apr 1, 2021
6213844
Loader: Fix a bug. Change return type of functions
Dimitar2000 Apr 1, 2021
825f072
Loader: Change elf_new.h to elf.h.
Dimitar2000 Apr 1, 2021
cfbb9cc
Loader: Fix macro usage. Change function subroutine.
Dimitar2000 Apr 2, 2021
6541f1c
Initial working version
ValentijnvdBeek Apr 2, 2021
fb8fbfe
Loader: Update loader functions.
Dimitar2000 Apr 2, 2021
2c75c16
Loader: Update shell script for making processes.
Dimitar2000 Apr 3, 2021
aa308ef
Loader: Rename docs file.
Dimitar2000 Apr 3, 2021
4d07def
Implement other targets; Update Docker; Fix Github Action
ValentijnvdBeek Apr 3, 2021
425da7e
Loader: Move test files to a new directory. Create a separate file fo…
Dimitar2000 Apr 3, 2021
d8bd73f
Remove sys and sched folder and their usages.
Dimitar2000 Apr 3, 2021
b34bee2
Loader: Change structure of files. Add defines.
Dimitar2000 Apr 4, 2021
b92adbb
Loader: Change structure of functions.
Dimitar2000 Apr 5, 2021
052c722
Loader: Update documentation.
Dimitar2000 Apr 5, 2021
cbfb530
Loader: Update documentation 2.
Dimitar2000 Apr 5, 2021
10f7952
Loader: Update documentation 3.
Dimitar2000 Apr 5, 2021
4d3bf20
Update kernel README.md
Apr 26, 2021
1b5e367
Merge remote-tracking branch 'origin/multiprocessing' into dtb
fayalalebrun Apr 26, 2021
3c28d0a
Updated the kernel readme
nasko25 Apr 26, 2021
cb0c7d0
Merge pull request #81 from fayalalebrun/dtb
fayalalebrun Apr 26, 2021
92117cb
Merge pull request #83 from rellermeyer/testing-framework-rewrite
ValentijnvdBeek Apr 26, 2021
7ff984a
Merge branch 'allocator-merge' into cleanup
ValentijnvdBeek Apr 26, 2021
9245405
Merge remote-tracking branch 'origin/elf_loader' into cleanup
ValentijnvdBeek Apr 26, 2021
f5e449b
Fix merge bugs
ValentijnvdBeek Apr 26, 2021
ce89ce3
Merge pull request #82 from rellermeyer/cleanup
ValentijnvdBeek Apr 26, 2021
9ecac90
Remove dependency on Make entirely
ValentijnvdBeek Apr 26, 2021
2d0ce3a
Merge branch 'cleanup' into elf_loader
ValentijnvdBeek Apr 26, 2021
248532e
Merge cleanup
ValentijnvdBeek Apr 26, 2021
8a66992
Update README and move directories
ValentijnvdBeek Apr 27, 2021
06297b3
Fix dtb issue; Remove debugging calls; Fix broken merge stuff
ValentijnvdBeek May 27, 2021
5b8d841
Fix the build system (hopefully) #2
ValentijnvdBeek May 27, 2021
2fdcee1
Small CI issue
ValentijnvdBeek Jun 1, 2021
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

...
20 changes: 20 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
((nil . ((eval . (let ((root (projectile-project-root)))
(let ((command (concat "arm-none-eabi-gdb -i=mi -ex \"target remote localhost:1234\" -ex \"symbol-file " root "src/kernel/build/kernel.sym\"")))
(setq-local gud-gud-gdb-command-name command)
(setq-local gud-gdb-command-name command)
(set (make-local-variable 'compile-command)
(concat "cd " (concat root "src") " && make test"))
(let ((map (make-sparse-keymap)))

(set-keymap-parent map (current-local-map))
(use-local-map map)
(local-set-key [f5] 'compile)
(local-set-key [f6] 'co/gdb)

(defun co/gdb ()
(interactive)
(async-shell-command (concat "cd "
(concat (projectile-project-root) "src")
" && "
"make debug") nil 0)
(gdb gud-gdb-command-name)))))))))
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.git
.github
.idea
.vscode
projet/build/
project/kernel/build/

src/toolchain/
src/qemu/
!src/toolchain/build.sh
src/build/
src/kernel/build
!src/build/build.sh
src/docs/
src/html/
src/latex
src/course_os_docs.pdf

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
16 changes: 16 additions & 0 deletions .github/workflows/os_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: course_os test suite

on: [push]


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

- name: build
run: docker build -t course_os .

- name: test
run: docker run course_os sh -c 'cd build && ninja run-test'
84 changes: 67 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,82 @@
#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-*
/qemu/
!/qemu/build.sh
# Build files
/build
src/kernel/kernel.bin
src/kernel/flash.bin
src/kernel/boot-commands
src/kernel/card.sd
src/kernel/src/test_suite/test.c
src/kernel/src/test_suite/generated/
src/kernel/build
src/kernel/build/kernel.sym
build/
.cache/
builddir/

# Toolchain dir, but not the build script
src/toolchain/
toolchain/
!src/toolchain/build.sh
project/scripts/qemu-*/
*.bz2
arm-none-eabi/

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

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

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

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

# 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
kernel/build/kernel.sym

[._]*.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
*~
#*
5 changes: 5 additions & 0 deletions .idea/runConfigurations/attach_debugger.xml

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

8 changes: 8 additions & 0 deletions .idea/runConfigurations/debug.xml

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

8 changes: 8 additions & 0 deletions .idea/runConfigurations/test.xml

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

41 changes: 41 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "0.2.0",
"configurations": [
{

"name": "(gdb) Attach - C/C++",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/src/kernel/build/kernel.sym",
"cwd": "${workspaceFolder}/src/kernel/",
"miDebuggerPath": "${workspaceFolder}/src/toolchain/arm-none-eabi/bin/arm-none-eabi-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"linux": {
"MIMode": "gdb"
},
"miDebuggerServerAddress": "localhost:1234",
"preLaunchTask": "run_debug"

},
{
"name": "(gdb) Attach - Native",
"type": "gdb",
"request": "attach",
"gdbpath": "${workspaceFolder}/src/toolchain/arm-none-eabi/bin/arm-none-eabi-gdb",
"executable": "${workspaceFolder}/src/kernel/build/kernel.sym",
"target": ":1234",
"remote": true,
"cwd": "${workspaceRoot}",
"valuesFormatting": "prettyPrinters",
"preLaunchTask": "run_debug",
"postDebugTask": "stop_debug"
}
]
}

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"
}
}
58 changes: 58 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Set gdb_path",
"detail": "Adds generated toolchain to PATH variable. Will first load system and package binaries if available",
"type": "shell",
"command": "if [[ $(which arm-none-eabi-gdb) == *\"not\"* ]]; then export GDB_PATH=\"$(which arm-none-eabi-gdb)\"; else export GDB_PATH=\"${PWD}/src/arm-none-eabi/bin/\"; fi"
},
{
"label": "make test",
"detail": "Runs the course_os test suite",
"dependsOn": "set gdb_path",
"type": "shell",
"command": "make test",
"problemMatcher": "$gcc",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "run_debug",
"detail": "Runs qemu with gdbserver in the background",
"dependsOn": "set gdb_path",
"type": "shell",
"command": "cd ${workspaceFolder}/src/kernel && make debug",
"isBackground": true,
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"problemMatcher": {
"pattern": {
"regexp": "^.*$"
},
"background": {
"activeOnStart": true,
"beginsPattern": "make debug",
"endsPattern": "Configuring tools"
}
}
},
{
"label": "stop_debug",
"detail": "Stops the qemu emulator at port 1234",
"type": "shell",

"command": "kill $(sudo lsof -t -i:1234)"
}
]
}
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}/project/toolchain/arm-none-eabi/bin/arm-none-eabi-gcc)
set(CMAKE_C_LINK_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/project/toolchain/arm-none-eabi/bin/arm-none-eabi-ld)

file(GLOB_RECURSE kernel_sources ./project/kernel/src/*.c ./project/kernel/src/**/*.c ./project/kernel/src/**/*.s)
file(GLOB_RECURSE kernel_include LIST_DIRECTORIES true ./project/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}
)

13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM fedora:33
MAINTAINER Jan S. Rellermeyer <[email protected]>

RUN yum install -y arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib qemu-system-arm-core python3 python3-jinja2 meson gcc

WORKDIR /work
COPY project .
EXPOSE 1234

# Since we installed the toolchain from the repositories we don't need
# to install them separately. So we can just fake 'em.
RUN meson build --cross-file cross_gcc.build && cd build && meson compile
#VOLUME build /work/kernel/build
Loading