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
1 change: 0 additions & 1 deletion Kernel/Core/Kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ static InitResultT SystemInitialize(void) {

return INIT_SUCCESS;
}
// Main kernel entry point with improved error handling
void KernelMain(uint32_t magic, uint32_t info) {
AsciiSplash();
PrintKernelSuccess("[KERNEL] VoidFrame Kernel - Version 0.0.1-alpha loaded\n");
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Drivers/Pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#define ICW4_8086 0x01

void PitInstall() {
// Set PIT frequency to ~100Hz (10ms intervals)
uint16_t divisor = 1193180 / 100;
uint16_t divisor = 1193180 / PIT_FREQUENCY_HZ;

outb(0x43, 0x36); // Command byte: channel 0, lobyte/hibyte, rate generator
outb(0x40, divisor & 0xFF); // Low byte
Expand Down
5 changes: 4 additions & 1 deletion Kernel/Drivers/Pic.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef PIC_H
#define PIC_H

#define PIT_FREQUENCY_HZ 5000 // Default PIT frequency in Hz (1000Hz = 1ms intervals)

int PicInstall();
void PitInstall();

#endif
#endif
4 changes: 3 additions & 1 deletion Kernel/Process/Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void InitScheduler(void) {

// Initialize priority queues with different time quantums
for (int i = 0; i < MAX_PRIORITY_LEVELS; i++) {
MLFQscheduler.queues[i].quantum = QUANTUM_BASE * (1 << i); // 10, 20, 40, 80 ticks
MLFQscheduler.queues[i].quantum = QUANTUM_BASE / (1 << i); // 10, 5, 2, 1 ticks
MLFQscheduler.queues[i].head = 0;
MLFQscheduler.queues[i].tail = 0;
MLFQscheduler.queues[i].count = 0;
Expand Down Expand Up @@ -385,6 +385,8 @@ uint32_t CreateSecureProcess(void (*entry_point)(void), uint8_t privilege) {
// Clear the entire slot first
FastMemset(&processes[slot], 0, sizeof(Process));



// Allocate stack
void* stack = AllocPage();
if (!stack) {
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Process/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define MAX_PRIORITY_LEVELS 4
#define QUANTUM_BASE 10 // Base time quantum in ticks
#define BOOST_INTERVAL 1000 // Boost all processes every 1000 ticks
#define BOOST_INTERVAL 100 // Boost all processes every 100 ticks

#define PROC_PRIV_SYSTEM 0 // Highest privilege (kernel services)
#define PROC_PRIV_USER 1 // User processes
Expand Down