![]() In QEMU, there's only one other region with type 0x01: that bogus bit to about 32MB that *doesn't exist*. Therefore, I'm storing it somewhere above 1MB. I'm making the decision not to put anything in lower memory for now, since I don't want to risk destroying anything there (the biggest fear being my precious memory map). On QEMU, it always reports as about 31-32MB. Including the regions 2, 3 and 4 (the first few entries, minus the ROM code at high 3GB+) I get exactly 4MB, so no problem there. No, I am running it off -cdrom, not the -kernel flag.Īlso: Notice that this problem only occurs on QEMU I get no such bogus reported memory on VMWare. I am using the multiboot.h file from the GNU website. GRUB (or any other good multiboot boatloader) installed and test with that.ġ. It would be preferable to use a disk image with Size values in the memory map entries are off, along with other problems. QEMU's built-in multiboot implementation is lacking, I have looked at the code and the You are using the -kernel flag with QEMU. This applies to 圆4 (which I think you're using?) too -snip-Ģ. #define GCC_PACKED _attribute_ ((packed)) My solution was an acpi table parser library, that's get called in every driver's init() method, but of course you can do things differently in your OS. Also there's a chance that a new device would require such info that cannot be represented in your universal structure, and modifying a common structure would require a lot of work in every driver. I thought parsing acpi tables into an universal driver structure would require more memory with only a little lookup performance benefit. Every driver parses the blocks that it's interested in (typically different info for different drivers), and it's only done once whenever a driver installed, so performance is not crutial. Maybe parsing the tables several times is not the best way to do things, but it's very easy and clear, also modular approach. every driver parse it to get it's device info, and because driver loading not restricted to boot time, I will need the tables later too. I handle it as firmware rom, and do not free it ever, because: But according to the wiki, when (if) I am done with the ACPI tables, I can reclaim it? It really doesn't matter if unusable memory is an LFB MMIO space or ACPI tables or whatever from memory management point of view. used by firmware, simply lost memory to kmalloc (cannot be freed) used by kmalloc, reusable memory allocated by your kmalloc (that can be freed) As a matter of fact, your memory allocator has to deal with only 3 types of memory: This way it does not matter whether you use E820 or GRUB map or EFI map (with fancy type codes), because you "translate" type codes too. Most OS devers specify their own map, and transform firmware provided map on boot. ![]() ![]() That is, there should be no overlaping, and should not contain free memory that was also reported non-free in another map record. Yes, you have to order the memory map records, and make them disjunct. 0x359A0 - 1 = 0x1 = 0x9F400 1) of memory to some virtual address that I can access from my 64-bit kernel (this is a loader) can I still access the memory map again, then re-evaluate the memory map (including translating it to some arbitrary format of mine?)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |