Skip to content
Merged
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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ git clone https://github.com/assembler-0/VoidFrame.git
cd VoidFrame
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/<linux/windows/macos>-x64.cmake -G Ninja
ninja -j$(nproc)
ninja run
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/<linux/windows/macos>-x64.cmake \
-G Ninja \
-DVF_SCHEDULER=<MLFQ/EEVDF> # Optional, MLFQ is default
ccmake . # Optinal, tune as needed
cmake --build .
```
```bash
# XMake
Expand Down Expand Up @@ -90,7 +93,10 @@ xmake run
- [x] Vesa (VBE)
- [x] Multiboot2 Info parsing
### Core
- [x] Multi-tasking (MLFQ)
- [x] MLFQ
- [x] EEVDF
- [ ] SMP
- [ ] Threads
- [x] Per-process authentication check (Astra)
- [x] Dynamic ML-inspired PIT frequency scaling (DynamoX)
- [x] Virtual Memory (canonical)
Expand Down
12 changes: 5 additions & 7 deletions arch/x86_64/interrupts/Interrupts.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#include "Interrupts.h"

#include "APIC.h"
#include "Atomics.h"
#include "Console.h"
#include "Format.h"
#include "Ide.h"
#include "Kernel.h"
#include "MLFQ.h"
#include "PS2.h"
#include "PageFaultHandler.h"
#include "Panic.h"
#include "Scheduler.h"
#include "StackTrace.h"
#include "ethernet/Network.h"

Expand All @@ -26,7 +24,7 @@ asmlinkage void InterruptHandler(Registers* regs) {
// Handle hardware interrupts first
if (regs->interrupt_number >= 32) switch (regs->interrupt_number) {
case 32: // Timer interrupt (IRQ 0)
MLFQSchedule(regs);
Schedule(regs);
AtomicInc(&APICticks);
Net_Poll();
ApicSendEoi();
Expand Down Expand Up @@ -109,11 +107,11 @@ asmlinkage void InterruptHandler(Registers* regs) {
case FAULT_KILL_PROCESS:
// Kill the offending process
PrintKernelWarning("Killing process ");
PrintKernelInt(MLFQGetCurrentProcess()->pid);
PrintKernelInt(GetCurrentProcess()->pid);
PrintKernelWarning(" due to page fault\n");
MLFQKillCurrentProcess("Page Fault (segmentation fault)");
KillCurrentProcess("Page Fault (segmentation fault)");
// Switch to the next ctx immediately
MLFQSchedule(regs);
Schedule(regs);
return;

case FAULT_RETRY:
Expand Down
6 changes: 3 additions & 3 deletions arch/x86_64/syscall/Syscall.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "Syscall.h"
#include "Console.h"
#include "MLFQ.h"
#include "Scheduler.h"

uint64_t SyscallHandler(uint64_t syscall_num, uint64_t arg1, uint64_t arg2, uint64_t arg3) {
switch (syscall_num) {
case SYS_EXIT:
MLFQKillCurrentProcess("SYS_EXIT");
MLFQYield();
KillCurrentProcess("SYS_EXIT");
Yield();
return arg1;

case SYS_WRITE:
Expand Down
Loading