diff --git a/Makefile b/Makefile index 5ba13c8..2c740db 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ LIVECD := $(RELEASE_DIR)/aurix-$(GITREV)-livecd_$(ARCH)-$(PLATFORM).iso LIVEHDD := $(RELEASE_DIR)/aurix-$(GITREV)-livehdd_$(ARCH)-$(PLATFORM).img LIVESD := $(RELEASE_DIR)/aurix-$(GITREV)-livesd_$(ARCH)-$(PLATFORM).img -QEMU_FLAGS := -m 512m -smp 4 -rtc base=localtime -serial stdio +QEMU_FLAGS := -m 2G -smp 4 -rtc base=localtime -serial stdio # QEMU Audio support #QEMU_FLAGS += -audiodev coreaudio,id=coreaudio0 -device ich9-intel-hda -device hda-output,audiodev=coreaudio0 diff --git a/boot/arch/x86_64/common/proto/aurix/handoff.c b/boot/arch/x86_64/common/proto/aurix/handoff.c index f4ff1c4..f23645e 100644 --- a/boot/arch/x86_64/common/proto/aurix/handoff.c +++ b/boot/arch/x86_64/common/proto/aurix/handoff.c @@ -21,6 +21,7 @@ #include #include #include +#include #include struct gdt { @@ -68,21 +69,21 @@ void aurix_arch_handoff(void *kernel_entry, pagetable *pm, void *stack, uint32_t __asm__ volatile( "cli\n" - "lgdt %[gdtr]\n" - "ltr %[tss]\n" - "pushq $0x08\n" - "lea 1f(%%rip), %%rax\n" - "pushq %%rax\n" - "lretq\n" - "1:\n" - "movq $0x10, %%rax\n" - "movq %%rax, %%ds\n" - "movq %%rax, %%es\n" - "movq %%rax, %%ss\n" - "movq %%rax, %%fs\n" - "movq %%rax, %%gs\n" + //"lgdt %[gdtr]\n" + //"ltr %[tss]\n" + //"pushq $0x08\n" + //"lea 1f(%%rip), %%rax\n" + //"pushq %%rax\n" + //"lretq\n" + //"1:\n" + //"movq $0x10, %%rax\n" + //"movq %%rax, %%ds\n" + //"movq %%rax, %%es\n" + //"movq %%rax, %%ss\n" + //"movq %%rax, %%fs\n" + //"movq %%rax, %%gs\n" - "lidt %[idt]\n" + //"lidt %[idt]\n" "movq %[pml4], %%cr3\n" "movq %[stack], %%rsp\n" diff --git a/boot/common/init.c b/boot/common/init.c index a794057..4385ac5 100644 --- a/boot/common/init.c +++ b/boot/common/init.c @@ -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 load_drivers(); diff --git a/boot/common/print.c b/boot/common/print.c index 5b75d05..241a43b 100644 --- a/boot/common/print.c +++ b/boot/common/print.c @@ -36,12 +36,19 @@ #include #include +#include +#include +#include +#include + 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); } diff --git a/boot/platform/uefi/entry.c b/boot/platform/uefi/entry.c index 27d0dc8..6fe9c6a 100644 --- a/boot/platform/uefi/entry.c +++ b/boot/platform/uefi/entry.c @@ -107,6 +107,8 @@ void uefi_exit_bs(void) int tries = 0; + log("uefi_exit_bs(): Calling ExitBootServices(), this will be the last log you'll see before handoff!\n"); + do { map_key = 0; map_size = 0; @@ -137,6 +139,4 @@ void uefi_exit_bs(void) platform_reboot(); UNREACHABLE(); } - - debug("uefi_exit_bs(): ExitBootServices() success!\n"); }