Beginning of refactor
This commit is contained in:
parent
02e846f1ab
commit
860c9ea53c
5 changed files with 52 additions and 17 deletions
|
@ -38,6 +38,16 @@ void axboot_init()
|
|||
|
||||
config_init();
|
||||
|
||||
#if defined(__aarch64__) && !defined(AXBOOT_UEFI)
|
||||
struct axboot_entry rpi_kernel = {
|
||||
.name = "AurixOS for Raspberry Pi",
|
||||
.image_path = "\\System\\axkrnl",
|
||||
.protocol = PROTO_AURIX
|
||||
};
|
||||
loader_load(&rpi_kernel);
|
||||
UNREACHABLE();
|
||||
#endif
|
||||
|
||||
#ifdef AXBOOT_UEFI
|
||||
#include <driver.h>
|
||||
load_drivers();
|
||||
|
|
|
@ -36,12 +36,19 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
#include <mm/mman.h>
|
||||
#include <lib/string.h>
|
||||
|
||||
int32_t _fltused = 0;
|
||||
int32_t __eqdf2 = 0;
|
||||
int32_t __ltdf2 = 0;
|
||||
|
||||
extern struct axboot_cfg cfg;
|
||||
|
||||
CHAR16 wstr[1024];
|
||||
|
||||
void log(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -57,6 +64,15 @@ void log(const char *fmt, ...)
|
|||
if (cfg.bootlog_filename != NULL) {
|
||||
vfs_write(cfg.bootlog_filename, (char *)&buf, size);
|
||||
}
|
||||
|
||||
#ifdef AXBOOT_UEFI
|
||||
char *bufp = &buf;
|
||||
size_t n = mbstowcs((wchar_t *)&wstr, (const char **)&bufp, 1024);
|
||||
wstr[n] = L'\r';
|
||||
wstr[n+1] = L'\0';
|
||||
gSystemTable->ConOut->OutputString(gSystemTable->ConOut, wstr);
|
||||
gBootServices->Stall(100000);
|
||||
#endif
|
||||
}
|
||||
|
||||
void debug(const char *fmt, ...)
|
||||
|
@ -68,6 +84,14 @@ void debug(const char *fmt, ...)
|
|||
npf_vsnprintf(buf, sizeof(buf), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
#ifdef AXBOOT_UEFI
|
||||
char *bufp = &buf;
|
||||
size_t n = mbstowcs((wchar_t *)&wstr, (const char **)&bufp, 1024);
|
||||
wstr[n] = L'\r';
|
||||
wstr[n+1] = L'\0';
|
||||
gSystemTable->ConOut->OutputString(gSystemTable->ConOut, wstr);
|
||||
gBootServices->Stall(100000);
|
||||
#endif
|
||||
uart_sendstr(buf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue