diff --git a/kernel/include/process.hpp b/kernel/include/process.hpp index f149084b..b690bbfe 100644 --- a/kernel/include/process.hpp +++ b/kernel/include/process.hpp @@ -16,6 +16,12 @@ namespace scheduler { +constexpr const size_t MAX_PRIORITY = 2; +constexpr const size_t MIN_PRIORITY = 0; +constexpr const size_t PRIORITY_LEVELS = MAX_PRIORITY - MIN_PRIORITY + 1; + +typedef size_t pid_t; + enum class process_state : char { EMPTY = 0, NEW = 1, @@ -30,7 +36,7 @@ struct segment_t { }; struct process_t { - size_t pid; + pid_t pid; bool system; diff --git a/kernel/include/scheduler.hpp b/kernel/include/scheduler.hpp index ac611383..fd83f2ca 100644 --- a/kernel/include/scheduler.hpp +++ b/kernel/include/scheduler.hpp @@ -13,8 +13,6 @@ namespace scheduler { -typedef size_t pid_t; - constexpr const size_t MAX_PROCESS = 128; pid_t get_pid(); diff --git a/kernel/src/keyboard.cpp b/kernel/src/keyboard.cpp index d9521ca5..b27ed20f 100644 --- a/kernel/src/keyboard.cpp +++ b/kernel/src/keyboard.cpp @@ -139,7 +139,7 @@ void keyboard::get_char_blocking(){ start = (start + 1) % BUFFER_SIZE; --count; - auto pid = scheduler::current_pid(); + auto pid = scheduler::get_pid(); //TODO Give key to process pid } else {