Skip to content

Commit

Permalink
feat(kernel): add LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasanchez committed May 11, 2022
1 parent 208c657 commit 056ef5e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
14 changes: 14 additions & 0 deletions kernel/inc/scheduling/lts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @file lts.h
* @author Tomás Sánchez <[email protected]>
* @brief Long Time Scheduler Class
* @version 0.1
* @date 05-10-2022
*
* @copyright Copyright (c) 2022
*
*/

// ============================================================================================================
// ***** Public Functions *****
// ============================================================================================================
35 changes: 35 additions & 0 deletions kernel/src/scheduling/lts.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @file lts.c
* @author Tomás Sánchez <[email protected]>
* @brief
* @version 0.1
* @date 05-10-2022
*
* @copyright Copyright (c) 2022
*
*/

#include <stdlib.h>
#include "kernel.h"
#include "pcb_unit.h"

void *
long_time_schedule(void *kernel_ref)
{
kernel_t *kernel = kernel_ref;

for (;;)
{
// Wait for a process to be created.
WAIT(kernel->sync.dispatch);
// TODO: Fetch from pcbs
}

return NULL;
}

void admit_process(kernel_t *kernel, pcb_t *pcb)
{
pcb_unit_t *process = new_pcb_unit(pcb);
// TODO: add to READY QUEUE
}

0 comments on commit 056ef5e

Please sign in to comment.