2016-06-15 07:29:46 +00:00
|
|
|
/* Copyright 2016 secXsQuared
|
|
|
|
* Distributed under GPL license
|
|
|
|
* See COPYING under root for details
|
|
|
|
*/
|
|
|
|
|
2018-01-26 08:43:22 +00:00
|
|
|
#include "kernel/ke/boot.h"
|
2018-01-25 19:11:22 +00:00
|
|
|
#include "kernel/ke/alloc.h"
|
2018-01-26 08:43:22 +00:00
|
|
|
#include "test/test_case.h"
|
2018-02-08 19:51:29 +00:00
|
|
|
#include "kernel/ke/print.h"
|
2016-07-09 03:01:33 +00:00
|
|
|
|
2016-06-15 07:29:46 +00:00
|
|
|
// returning from this function results in halting the cpu
|
2018-01-26 08:43:22 +00:00
|
|
|
void KABI ke_main(boot_info_t *boot_info)
|
2016-06-15 07:29:46 +00:00
|
|
|
{
|
2016-10-17 06:05:34 +00:00
|
|
|
if (boot_info == NULL)
|
2016-06-15 07:29:46 +00:00
|
|
|
{
|
2016-07-09 03:01:33 +00:00
|
|
|
// failed.
|
2018-02-08 19:51:29 +00:00
|
|
|
ke_printf("KERNEL: HAL init failed.\n");
|
2016-07-09 03:01:33 +00:00
|
|
|
return;
|
2016-06-15 07:29:46 +00:00
|
|
|
}
|
|
|
|
|
2017-02-01 03:26:08 +00:00
|
|
|
// init kernel heap
|
|
|
|
//sx_pmm_init(boot_info->pmm_info);
|
2016-10-17 06:05:34 +00:00
|
|
|
|
2016-09-13 04:41:09 +00:00
|
|
|
ke_alloc_init();
|
2016-06-15 07:29:46 +00:00
|
|
|
|
2018-02-12 03:26:03 +00:00
|
|
|
// ke_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);
|
2016-06-15 07:29:46 +00:00
|
|
|
|
2018-02-08 19:51:29 +00:00
|
|
|
ke_printf("KERNEL: CPU Vendor is \"%s\".\n", boot_info->cpu_vd_str);
|
2016-06-15 07:29:46 +00:00
|
|
|
|
|
|
|
linked_list_test();
|
2016-10-17 06:05:34 +00:00
|
|
|
|
2016-06-15 07:29:46 +00:00
|
|
|
avl_tree_test();
|
2016-10-17 06:05:34 +00:00
|
|
|
|
2016-06-15 07:29:46 +00:00
|
|
|
salloc_test();
|
|
|
|
|
2018-02-08 19:51:29 +00:00
|
|
|
ke_printf("KERNEL: Kernel tasks finished.\n");
|
2016-07-09 03:01:33 +00:00
|
|
|
|
|
|
|
return;
|
2016-06-15 07:29:46 +00:00
|
|
|
}
|