From e3a868ed57edf98e8f54e5de88c19458d79118ba Mon Sep 17 00:00:00 2001 From: NDRAEY Date: Sun, 21 Jan 2024 19:47:00 +0900 Subject: [PATCH 1/3] acpi --- kernel/src/sys/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/sys/acpi.c b/kernel/src/sys/acpi.c index 16a9172ae..be0670dea 100644 --- a/kernel/src/sys/acpi.c +++ b/kernel/src/sys/acpi.c @@ -78,7 +78,6 @@ void acpi_scan_all_tables(uint32_t rsdt_addr) { PAGE_PRESENT ); - uint32_t sdt_count = (rsdt->Length - sizeof(ACPISDTHeader)); qemu_log("LEN: %d (// %d)", rsdt->Length, sizeof(ACPISDTHeader)); @@ -96,6 +95,7 @@ void acpi_scan_all_tables(uint32_t rsdt_addr) { break; } + tty_printf("[%x] Found table: %.4s", entry, entry->Signature); qemu_log("[%x] Found table: %.4s", entry, entry->Signature); } From 6c9af32d0c96227dfff7ee1c29de71fb497cb9fa Mon Sep 17 00:00:00 2001 From: NDRAEY Date: Mon, 22 Jan 2024 11:41:48 +0900 Subject: [PATCH 2/3] Files: Remove useless files --- README.MD:Zone.Identifier | 3 --- netdump.pcap | Bin 1956 -> 0 bytes run_efi.sh | 1 - 3 files changed, 4 deletions(-) delete mode 100644 README.MD:Zone.Identifier delete mode 100644 netdump.pcap delete mode 100644 run_efi.sh diff --git a/README.MD:Zone.Identifier b/README.MD:Zone.Identifier deleted file mode 100644 index 43a1a01e3..000000000 --- a/README.MD:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -HostUrl=https://github.com/ diff --git a/netdump.pcap b/netdump.pcap deleted file mode 100644 index 93551f1eeb4805db8d670b85339170ccd4488b35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1956 zcmca|c+)~A1{MYcU}Rtfa`GRpN&QpE#*oFt0LK5pASi@E$Rvz|!Ign22BgD5uwoL3 z21zowFgP=LFfcGOvN3#qEqj20p#da?0wDTPgoZRHxhXi=l#$U09DY3P!HJdmMVSo$ zhqRvt+VP;2r%}SjU;|8sAPh};p$AqlF#%Ja0HYqrg${z-SwSM;l;_Og!YHK}$plY% z5I-DPk>3DP1L6(Ol*eSo0`edu3o!dJFoW4_Ad=abg@G}!;Xf!WzsPZtnTzl3PAnNY xxtMu07elfQRY*|EQ&!-_my3aU8<>m1i58KI-(LacVo1t^IAr+eVpamV7yz9dh*tmr diff --git a/run_efi.sh b/run_efi.sh deleted file mode 100644 index 7d86209a7..000000000 --- a/run_efi.sh +++ /dev/null @@ -1 +0,0 @@ -qemu-system-x86_64 -bios /usr/share/qemu/OVMF.fd -cdrom SayoriOS.iso From 6bdd3cd6aa6fbbbcce7b0986d82aa4a0cb10ff93 Mon Sep 17 00:00:00 2001 From: NDRAEY Date: Mon, 22 Jan 2024 12:05:31 +0900 Subject: [PATCH 3/3] ACPI: Fix table searching process --- config.mk | 2 +- kernel/src/sys/acpi.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config.mk b/config.mk index c9ed4637c..91f16f5c6 100755 --- a/config.mk +++ b/config.mk @@ -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 \ diff --git a/kernel/src/sys/acpi.c b/kernel/src/sys/acpi.c index be0670dea..6c32eebdb 100644 --- a/kernel/src/sys/acpi.c +++ b/kernel/src/sys/acpi.c @@ -74,11 +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)); @@ -95,11 +95,12 @@ void acpi_scan_all_tables(uint32_t rsdt_addr) { break; } - tty_printf("[%x] Found table: %.4s", entry, entry->Signature); + 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); } @@ -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); @@ -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);