2019-12-01 22:57:02 +01:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017-2019 by Löwenware Ltd
|
|
|
|
* Please, refer LICENSE file for legal information
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file main.c
|
|
|
|
* @author Ilja Kartašov <ik@lowenware.com>
|
|
|
|
* @brief
|
|
|
|
*
|
|
|
|
* @see https://lowenware.com/
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <core/log.h>
|
|
|
|
#include <core/arch.h>
|
|
|
|
#include <core/irq.h>
|
|
|
|
#include <core/timer.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
k_main(void);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
k_main(void)
|
|
|
|
{
|
|
|
|
k_log_init();
|
|
|
|
|
|
|
|
k_logs("Starting Lowe OS (EL");
|
|
|
|
k_logi(aarch64_get_el(), 10);
|
2019-12-02 12:59:40 +01:00
|
|
|
k_logs(")\r\n");
|
2019-12-01 22:57:02 +01:00
|
|
|
|
|
|
|
if (k_arch_init())
|
|
|
|
goto panic;
|
|
|
|
|
|
|
|
k_timer_init();
|
|
|
|
k_irq_enable_controller();
|
|
|
|
k_irq_enable();
|
|
|
|
|
|
|
|
goto ok;
|
|
|
|
/*
|
|
|
|
k_logs("\tclock");
|
|
|
|
if (k_clock_init())
|
|
|
|
goto panic;
|
|
|
|
|
|
|
|
k_logs(" - ok\n\tscheduler");
|
|
|
|
if (k_scheduler_init())
|
|
|
|
goto panic;
|
|
|
|
|
|
|
|
k_logs(" - ok\n");
|
|
|
|
|
|
|
|
k_scheduler_run();
|
|
|
|
*/
|
|
|
|
|
|
|
|
panic:
|
|
|
|
k_logs(" - ERROR\n");
|
|
|
|
ok:
|
|
|
|
for (;;) {
|
|
|
|
__asm__("WFE");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|