general cleanup in kernel code removing unised defines etc
This commit is contained in:
parent
f479e151cb
commit
8dc72a2d8e
8
kernel.c
8
kernel.c
@ -33,10 +33,10 @@ void read_binary_table()
|
||||
{
|
||||
char msg[28] = "found bin with id 0 at pos 0";
|
||||
|
||||
malloc_info info;
|
||||
|
||||
info.allocate_memory_end = (void*) 0xFF0000;
|
||||
info.allocate_memory_start = (void*) 0;
|
||||
malloc_info info = {
|
||||
.allocate_memory_end = (void*) 0xFF0000,
|
||||
.allocate_memory_start = (void*) 0
|
||||
};
|
||||
|
||||
// calculate the end of loaded binaries
|
||||
for (int i = 0; i < NUM_BINARIES; i++) {
|
||||
|
6
kernel.h
6
kernel.h
@ -1,12 +1,6 @@
|
||||
#ifndef H_KERNEL
|
||||
#define H_KERNEL
|
||||
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#define PROCESS_COUNT 8 // number of concurrent processes
|
||||
#define NUM_BINARIES 4 // number of binaries loaded simultaneously
|
||||
|
||||
// scheduler settings
|
||||
#define TIME_SLICE_LEN 10 // number of cpu time ticks per slice
|
||||
|
||||
|
@ -86,7 +86,7 @@ struct process_control_block* scheduler_select_free()
|
||||
pcb->status = PROC_RDY;
|
||||
return pcb;
|
||||
}
|
||||
timeout_available = true;
|
||||
timeout_available = 1;
|
||||
}
|
||||
|
||||
// if it's waiting for another process, check if the process exited
|
||||
@ -107,13 +107,13 @@ struct process_control_block* scheduler_select_free()
|
||||
pcb->status = PROC_RDY;
|
||||
return pcb;
|
||||
}
|
||||
timeout_available = true;
|
||||
timeout_available = 1;
|
||||
}
|
||||
}
|
||||
} while (pcb != current_process);
|
||||
|
||||
// when we finished iterating over all processes and no process can be scheduled we have a problem
|
||||
if (timeout_available == false) {
|
||||
if (timeout_available == 0) {
|
||||
// either process deadlock without timeout or no processes alive.
|
||||
//TODO: handle deadlocks by killing a process
|
||||
dbgln("No thread active!", 17);
|
||||
|
Loading…
Reference in New Issue
Block a user