Skip to content

Commit

Permalink
acpi fix (#125)
Browse files Browse the repository at this point in the history
acpi fix
  • Loading branch information
pimnik98 authored Jan 22, 2024
2 parents 320c6b1 + 6bdd3cd commit 10d3c7c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions README.MD:Zone.Identifier

This file was deleted.

2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ QEMU_FLAGS = -cdrom kernel.iso -m $(MEMORY_SIZE) \
-rtc base=localtime \
-d guest_errors,cpu_reset,int \
-audiodev pa,id=pa0 \
-smp 1 \
-smp 2 \
-netdev user,id=net0,net=192.168.111.0,dhcpstart=192.168.111.128,hostfwd=tcp::9999-:8888 \
-device rtl8139,netdev=net0,id=mydev0 \
-M pcspk-audiodev=pa0 \
Expand Down
11 changes: 6 additions & 5 deletions kernel/src/sys/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ void acpi_scan_all_tables(uint32_t rsdt_addr) {
get_kernel_page_directory(),
rsdt_addr,
rsdt_addr,
PAGE_SIZE,
PAGE_SIZE * 2,
PAGE_PRESENT
);


uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader));
uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader)) / sizeof(uint32_t);

qemu_log("LEN: %d (// %d)", rsdt->Length, sizeof(ACPISDTHeader));

Expand All @@ -96,10 +95,12 @@ void acpi_scan_all_tables(uint32_t rsdt_addr) {
break;
}

tty_printf("[%x] Found table: %.4s\n", entry, entry->Signature);
qemu_log("[%x] Found table: %.4s", entry, entry->Signature);
}

unmap_single_page(get_kernel_page_directory(), (virtual_addr_t) rsdt_addr);
unmap_single_page(get_kernel_page_directory(), ((virtual_addr_t) rsdt_addr) + PAGE_SIZE);
}


Expand Down Expand Up @@ -133,7 +134,7 @@ void find_facp(size_t rsdt_addr) {
qemu_log("OEMID: %s", rsdt->OEMID);
qemu_log("Length: %d entries", rsdt->Length);

uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader));
uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader)) / sizeof(uint32_t);

qemu_log("SDTs available: %d", sdt_count);

Expand Down Expand Up @@ -193,7 +194,7 @@ void find_apic(size_t rsdt_addr) {
qemu_log("OEMID: %s", rsdt->OEMID);
qemu_log("Length: %d entries", rsdt->Length);

uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader));
uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader)) / sizeof(uint32_t);

qemu_log("SDTs available: %d", sdt_count);

Expand Down
Binary file removed netdump.pcap
Binary file not shown.
1 change: 0 additions & 1 deletion run_efi.sh

This file was deleted.

0 comments on commit 10d3c7c

Please sign in to comment.