Raise MEM_E820_ENTRIES_NUM to 256, remove memmap entry count max check in zealbooter at suggestion of mintsuki.

This commit is contained in:
TomAwezome 2022-09-12 04:26:10 -04:00
parent 8297c769e6
commit 111e3475e3
2 changed files with 3 additions and 16 deletions

View file

@ -427,7 +427,7 @@ class CSysLimitBase
}; };
#help_index "Memory/Info" #help_index "Memory/Info"
#define MEM_E820_ENTRIES_NUM 64 #define MEM_E820_ENTRIES_NUM 256
#define MEM_E820t_USABLE 1 #define MEM_E820t_USABLE 1
#define MEM_E820t_RESERVED 2 #define MEM_E820t_RESERVED 2
#define MEM_E820t_ACPI 3 #define MEM_E820t_ACPI 3

View file

@ -44,7 +44,7 @@ struct CDate {
int32_t date; int32_t date;
} __attribute__((packed)); } __attribute__((packed));
#define MEM_E820_ENTRIES_NUM 64 #define MEM_E820_ENTRIES_NUM 256
#define MEM_E820T_USABLE 1 #define MEM_E820T_USABLE 1
#define MEM_E820T_RESERVED 2 #define MEM_E820T_RESERVED 2
@ -243,21 +243,8 @@ void _start(void) {
kernel->mem_physical_space = 0; kernel->mem_physical_space = 0;
size_t mem_count = 0;
if (memmap_request.response->entry_count > MEM_E820_ENTRIES_NUM)
{
mem_count = MEM_E820_ENTRIES_NUM;
// If limine hands us more regions than the constant, cap it off early instead of buffer overflowing into kernel headers.
// This won't guarantee we'll get lucky with framebuffer placement passed via limine.
// If the mem_count gets capped at the constant, the system should still boot fully (drive activity lights, reading compiler and code from disc, etc),
// just possibly with no visible framebuffer. :^)
}
else
{
mem_count = memmap_request.response->entry_count;
}
printf("memory map:\n"); printf("memory map:\n");
size_t mem_count = memmap_request.response->entry_count; // MEM_E820_ENTRIES_NUM now == 256, which is also Limine's memmap entry count max
for (size_t i = 0; i < mem_count; i++) { for (size_t i = 0; i < mem_count; i++) {
struct limine_memmap_entry *entry = memmap_request.response->entries[i]; struct limine_memmap_entry *entry = memmap_request.response->entries[i];
int our_type; int our_type;