1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-30 00:00:15 +01:00

use uart device to dump kernel messages

This commit is contained in:
Stefan Lankes 2018-04-28 23:29:36 +00:00
parent 7a6efe3256
commit e6558c0b9b
3 changed files with 17 additions and 9 deletions

View file

@ -123,6 +123,9 @@ hcmask: .byte 255,255,255,0
.global host_logical_addr
host_logical_addr: .quad 0
.global uart_mmio
uart_mmio: .dword 0
start64:
//mrs x0, s3_1_c15_c3_0 // Read EL1 Configuration Base Address Register

View file

@ -33,6 +33,7 @@
#include <asm/uart.h>
volatile static unsigned int* mmio = NULL;
extern unsigned int uart_mmio;
/* Puts a single character on a serial device */
int uart_putchar(unsigned char c)
@ -59,21 +60,23 @@ int uart_puts(const char *text)
int uart_early_init(char* cmdline)
{
if (is_uhyve())
return 0;
// default value of our QEMU configuration
mmio = (unsigned int*) 0x09000000;
if (is_uhyve()) {
mmio = (unsigned int*) uart_mmio;
} else {
// default value of our QEMU configuration
mmio = (unsigned int*) 0x09000000;
}
return 0;
}
int uart_init(void)
{
if (is_uhyve())
return 0;
mmio = (unsigned int*) 0x09000000;
if (is_uhyve()) {
mmio = (unsigned int*) uart_mmio;
} else {
mmio = (unsigned int*) 0x09000000;
}
return 0;
}

View file

@ -477,6 +477,8 @@ int load_kernel(uint8_t* mem, char* path)
}
*((uint64_t*) (mem+paddr-GUEST_OFFSET + 0xbc)) = (uint64_t) guest_mem;
if (verbose)
*((uint32_t*) (mem+paddr-GUEST_OFFSET + 0x174)) = (uint32_t) UHYVE_UART_PORT;
}
*((uint64_t*) (mem+paddr-GUEST_OFFSET + 0x158)) += memsz; // total kernel size
}