2021-09-25 16:02:50 +02:00
|
|
|
#include "vxBoot/terminal.h"
|
|
|
|
#include "vxBoot/fs/smemfs.h"
|
2021-10-08 19:32:46 +02:00
|
|
|
#include "vxBoot/loader.h"
|
2022-01-04 15:18:58 +01:00
|
|
|
#include "vxBoot/gui.h"
|
|
|
|
#include "vxBoot/cli.h"
|
2021-09-25 16:02:50 +02:00
|
|
|
|
|
|
|
#include <gint/display.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* entry of the bootloader */
|
|
|
|
int main(void)
|
|
|
|
{
|
2021-09-25 19:03:58 +02:00
|
|
|
/* change default font on fx9860 */
|
|
|
|
#ifdef FX9860G
|
|
|
|
extern font_t font_hexa;
|
|
|
|
dfont(&font_hexa);
|
|
|
|
#endif
|
2022-01-04 15:18:58 +01:00
|
|
|
#ifdef FXCG50
|
|
|
|
extern font_t font_fxcg50;
|
|
|
|
dfont(&font_fxcg50);
|
|
|
|
#endif
|
2021-09-25 19:03:58 +02:00
|
|
|
|
2021-10-08 19:32:46 +02:00
|
|
|
/* early log */
|
|
|
|
terminal_open();
|
|
|
|
terminal_write(
|
|
|
|
"Welcome to vxBoot, the bootstrapper for the Vhex kernel!\n"
|
|
|
|
"Type `help` for instruction on how to use vxBoot\n"
|
|
|
|
);
|
|
|
|
|
2021-09-25 16:02:50 +02:00
|
|
|
/* automated hook */
|
|
|
|
/* TODO: better way to execute early command */
|
|
|
|
smemfs_mount();
|
2021-10-08 19:32:46 +02:00
|
|
|
loader_scan();
|
2021-09-25 16:02:50 +02:00
|
|
|
|
2022-01-04 15:18:58 +01:00
|
|
|
/* GUI Loop */
|
|
|
|
if (loader_kernel_img_count() >= 1)
|
|
|
|
gui_main();
|
|
|
|
cli_main();
|
2021-09-25 16:02:50 +02:00
|
|
|
return (1);
|
|
|
|
}
|