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 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ build/
/.idea/
!/.idea/runConfigurations
/.vscode/
!/.idea/settings.json
*~
*.swp
[._]*.s[a-w][a-z]
Expand Down Expand Up @@ -60,4 +61,5 @@ compile_commands.json
# Misc
NOTES
/server.PID

compile_commands.json
user/swi/swi
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"cwd": "${workspaceRoot}",
// "preLaunchTask": "run_debug",
"valuesFormatting": "prettyPrinters"
},
}
]
}
}
297 changes: 0 additions & 297 deletions kernel/COPYRIGHT

This file was deleted.

26 changes: 1 addition & 25 deletions kernel/src/common/include/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,6 @@

#define BRANCH_INSTRUCTION 0xe59ff018 // ldr pc, pc+offset (where offset is 0x20 bytes)

// System Call Types
// TODO: maybe make enum?
#define SYSCALL_CREATE 0
#define SYSCALL_SWITCH 1
#define SYSCALL_DELETE 2
#define SYSCALL_OPEN 3
#define SYSCALL_READ 4
#define SYSCALL_WRITE 5
#define SYSCALL_CLOSE 6
#define SYSCALL_SET_PERM 7
#define SYSCALL_MEM_MAP 8
#define SYSCALL_SEEK 9
#define SYSCALL_MKDIR 10
#define SYSCALL_COPY 11
#define SYSCALL_LS 12
#define SYSCALL_MALLOC 13
#define SYSCALL_ALIGNED_ALLOC 14
#define SYSCALL_FREE 15
#define SYSCALL_PRINTF 16
#define SYSCALL_DUMMY 99
#define SYSCALL_EXIT 100
#define SYSCALL_WRITEV 101
#define SYSCALL_PAUSE 102

void init_vector_table(void);

// vector table handlers, should be loaded at 0x00 in this order!
Expand All @@ -68,7 +44,7 @@ extern void _Reset();
void reset_handler(void);

void __attribute__((interrupt("UNDEF"))) undef_instruction_handler(); // 0x04
long __attribute__((interrupt("SWI"))) software_interrupt_handler(); // 0x08
void swi_handler(void * registers); // Initially handled in asm
void __attribute__((interrupt("ABORT"))) prefetch_abort_handler(); // 0x0c
void __attribute__((interrupt("ABORT"))) data_abort_handler(); // 0x10
void reserved_handler(); // 0x14
Expand Down
8 changes: 8 additions & 0 deletions kernel/src/common/include/interrupt_asm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef COURSE_OS_INTERRUPT_ASM_H
#define COURSE_OS_INTERRUPT_ASM_H

#include "interrupt.h"

long __attribute__((interrupt("SWI"))) software_interrupt_handler(); // 0x08

#endif // COURSE_OS_INTERRUPT_ASM_H
2 changes: 2 additions & 0 deletions kernel/src/common/include/kernel_programs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
void kernel_one();
void kernel_two();
Loading