aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.c
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-22 15:46:59 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-22 15:46:59 +0100
commitdcda5731ecbbce70edeaa7662e9ea0fc190a1943 (patch)
tree8f0ec0843f573c49d069112dc62fb324678296c7 /kernel/main.c
parent8231af9d8d759ae89c8214ca2410b0feab9dfb8c (diff)
downloadfbos-dcda5731ecbbce70edeaa7662e9ea0fc190a1943.tar.gz
fbos-dcda5731ecbbce70edeaa7662e9ea0fc190a1943.zip
Enable the timer from the SBI interface
A basic interrupt handler has been implemented which tracks the seconds that have been elapsing along the way. Depending on the value of these seconds, then a task has to be called. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 089614f..9cdb61e 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -20,19 +20,17 @@ struct task_struct tasks[4] = {
*/
__noreturn __kernel void start_kernel(void *dtb)
{
- // TODO: disable irqs, etc.
-
printk("Welcome to FizzBuzz OS!\n");
+ // Extract information from the DTB blob.
struct initrd_addr addr = find_dt_initrd_addr(dtb);
-
extract_initrd((unsigned char *)addr.start, addr.end - addr.start);
- // TODO: this is the jump address for the first task.
- const char *ddr = (const char *)tasks[1].addr + tasks[1].entry_offset;
- __unused(ddr);
-
- // TODO: reenable stuff
+ // At this point everything has already been handled: setup the interrupt
+ // vector and enable the timer to start ticking and scheduling the three
+ // tasks at hand.
+ seconds_elapsed = 0;
+ setup_interrupts();
for (;;)
;