2016-06-15 07:29:46 +00:00
|
|
|
/* Copyright 2016 secXsQuared
|
|
|
|
* Distributed under GPL license
|
|
|
|
* See COPYING under root for details
|
|
|
|
*/
|
|
|
|
|
2016-07-09 03:01:33 +00:00
|
|
|
#include "s_boot.h"
|
2016-06-15 07:29:46 +00:00
|
|
|
#include "k_alloc.h"
|
2016-07-09 03:01:33 +00:00
|
|
|
#include "k_intr.h"
|
2016-06-15 07:29:46 +00:00
|
|
|
#include "k_lib_test.h"
|
|
|
|
|
2016-07-09 03:01:33 +00:00
|
|
|
extern void KAPI hal_printf(char const *, ...);
|
|
|
|
|
2016-06-15 07:29:46 +00:00
|
|
|
// returning from this function results in halting the cpu
|
2016-07-09 03:01:33 +00:00
|
|
|
void KAPI k_main(k_hal_boot_info_t *boot_info)
|
2016-06-15 07:29:46 +00:00
|
|
|
{
|
|
|
|
if(boot_info == NULL)
|
|
|
|
{
|
2016-07-09 03:01:33 +00:00
|
|
|
// failed.
|
|
|
|
hal_printf("KERNEL: HAL init failed.\n");
|
|
|
|
return;
|
2016-06-15 07:29:46 +00:00
|
|
|
}
|
|
|
|
|
2016-07-09 03:01:33 +00:00
|
|
|
// init kernel heap
|
|
|
|
k_alloc_init();
|
2016-06-15 07:29:46 +00:00
|
|
|
|
|
|
|
hal_printf("KERNEL: Base Addr is 0x%X. Size is %uB, %uKB.\n",
|
|
|
|
boot_info->krnl_start,
|
|
|
|
(boot_info->krnl_end-boot_info->krnl_start),
|
|
|
|
(boot_info->krnl_end-boot_info->krnl_start)/1024);
|
|
|
|
|
|
|
|
hal_printf("KERNEL: CPU Vendor is \"%s\".\n", boot_info->cpu_vd_str);
|
|
|
|
|
|
|
|
linked_list_test();
|
|
|
|
avl_tree_test();
|
|
|
|
salloc_test();
|
|
|
|
|
|
|
|
hal_printf("KERNEL: Kernel tasks finished.\n");
|
2016-07-09 03:01:33 +00:00
|
|
|
|
|
|
|
return;
|
2016-06-15 07:29:46 +00:00
|
|
|
}
|