]> git.ameliathe1st.gay Git - voyage-au-centre-des-fichiers.git/commitdiff
Fixed priority of operations in address rounding
authorAmelia Coutard <eliottulio.coutard@gmail.com>
Sat, 8 Oct 2022 14:07:58 +0000 (16:07 +0200)
committerAmelia Coutard <eliottulio.coutard@gmail.com>
Sat, 8 Oct 2022 14:07:58 +0000 (16:07 +0200)
src/kernel.cpp

index fe6a38c0e6e8afb4bb39226c303a346ca33ce934..90a0704562096f4575483188be44fd0371e34a3c 100644 (file)
@@ -58,7 +58,7 @@ extern "C" void kmain(unsigned long magic, os::phys_ptr<const multiboot2::info_s
                        for (std::size_t i = 0; i < multiboot2::memory_map_number_of_entries(it); i++) {
                                if (multiboot2::memory_map_type(it, i) == 1) {
                                        const os::phys_ptr<os::paging::page> s{(multiboot2::memory_map_base_addr(it, i) + 0x1000 - 1) / 0x1000 * 0x1000};
-                                       const os::phys_ptr<os::paging::page> e{multiboot2::memory_map_base_addr(it, i) + multiboot2::memory_map_length(it, i) / 0x1000 * 0x1000};
+                                       const os::phys_ptr<os::paging::page> e{(multiboot2::memory_map_base_addr(it, i) + multiboot2::memory_map_length(it, i)) / 0x1000 * 0x1000};
                                        if (s < e) {
                                                remove_some_mem(
                                                s, e, kernel_start, kernel_end,