mirror of
https://git.stationery.faith/corn/corn.git
synced 2024-11-22 00:22:17 +00:00
fix acpi on uefi, kprint fixes
This commit is contained in:
parent
22df3f473c
commit
a717dbdd00
5 changed files with 14 additions and 11 deletions
|
@ -38,12 +38,10 @@ struct xsdp {
|
|||
char oemid[6];
|
||||
uint8_t revision;
|
||||
uint32_t rsdt_addr;
|
||||
struct {
|
||||
uint32_t length;
|
||||
uint64_t xsdt_addr;
|
||||
uint8_t extendeid_checksum;
|
||||
uint8_t reserved[3];
|
||||
} ext;
|
||||
uint32_t length;
|
||||
uint64_t xsdt_addr;
|
||||
uint8_t extendeid_checksum;
|
||||
uint8_t reserved[3];
|
||||
} __attribute__((packed));
|
||||
|
||||
// root system descriptor table
|
||||
|
@ -321,7 +319,7 @@ int acpi_init(void *rootsdp) {
|
|||
state.version = 2;
|
||||
struct xsdp *xsdp = (struct xsdp *) rsdp;
|
||||
kprintf("ACPI 2.0\n");
|
||||
acpi_load_table(xsdp->ext.xsdt_addr);
|
||||
acpi_load_table(xsdp->xsdt_addr);
|
||||
} else {
|
||||
panic("invalid acpi rev: %d\n", rsdp->revision);
|
||||
}
|
||||
|
|
|
@ -36,9 +36,9 @@ void log_backtrace(void) {
|
|||
void log_backtrace_ex(void *ip, void *bp) {
|
||||
struct stackframe *frame = bp;
|
||||
kputs("Stack trace:\n");
|
||||
kprintf(" 0x%p\n", ip);
|
||||
kprintf(" %p\n", ip);
|
||||
while (frame) {
|
||||
kprintf(" 0x%p\n", frame->rip);
|
||||
kprintf(" %p\n", frame->rip);
|
||||
frame = frame->rbp;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ static void read_memory_map(
|
|||
type = segment_type[6];
|
||||
else
|
||||
type = segment_type[seg->type];
|
||||
kprintf("ADDR: 0x%16p LEN: %4s TYPE: %s (%d)\n",
|
||||
kprintf("ADDR: %16p LEN: %4s TYPE: %s (%d)\n",
|
||||
(void *)seg->addr,
|
||||
btoa(seg->len, buf),
|
||||
type,
|
||||
|
|
|
@ -13,7 +13,7 @@ void kmain(struct boot_info *info) {
|
|||
screen_init();
|
||||
acpi_init(info->acpi_table);
|
||||
|
||||
kprintf("enterd kmain\n");
|
||||
kprintf("entered kmain\n");
|
||||
|
||||
//acpi_shutdown();
|
||||
|
||||
|
|
|
@ -709,6 +709,11 @@ void kvprintf(const char *format, va_list args) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (conversion == FMT_PTR) {
|
||||
flags |= FLG_ALTERNATE;
|
||||
flags |= FLG_ZERO;
|
||||
}
|
||||
|
||||
print_unsigned_number(num, flags, width, precision, type, cc);
|
||||
} else if (conversion == FMT_STR) {
|
||||
char *str = va_arg(args, char *);
|
||||
|
|
Loading…
Reference in a new issue