aboutsummaryrefslogtreecommitdiffstats
path: root/src/memmap.c
Commit message (Collapse)AuthorAgeFilesLines
* Rework malloc to use a "first fit" algorithm.Kevin O'Connor2010-06-061-17/+0
| | | | | | | | | | | | | | | | | The existing malloc implementation effectively uses a stack - all new allocations come from the top of the stack. When allocating memory with a large alignment, the pad used to align the new memory is unavailable to other users. Also, memory released by calling free() is only available to other users when all memory allocated after it is also freed. This new malloc scheme uses a first fit approach to finding available memory. It makes it possible to use alignment padding and freed space for new allocations. This helps reduce the required memory in the permanent memory zones (ZoneHigh and ZoneLow) where users have the need to allocate structures with high alignment (eg, virtio and usb).
* Introduce standard warnings for allocation failures and timeouts.Kevin O'Connor2010-02-141-1/+1
| | | | | There is no need for custom warnings for many common failures. Introduce a common warning which is consistent and more visible.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-3/+3
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Add support for using floppy images in CBFS.Kevin O'Connor2009-08-161-0/+17
| | | | | | Add new "ramdisk" type for disk accesses. Extract out high-mem finding code from pmm into find_high_area(). Fix bug in GDB_BASE and GDT_LIMIT macros (wrong bit shifts).
* Add Post Memory Manager (PMM) support.Kevin O'Connor2009-08-011-90/+0
| | | | | | | | | | | | Complete the initial implementation of PMM. Default new PMM code to be enabled. Move malloc code from memmap.c to pmm.c. Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh). Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit PMM code use "big real" mode and requires 32bit accesses). Allow pmm allocations to occur during bcv executions also. Add low-memory clearing before boot. Also, align the default f-seg memory.
* Fix coreboot bios table copying by delaying to after memory scan.Kevin O'Connor2009-07-281-2/+7
| | | | | | | | Delay coreboot bios table scan after memory scan and malloc setup is complete. Also, fix sign underflow in malloc memory available check. Add check to ensure high bios area is big enough for zone. Add more debug info to malloc setup/finalize.
* Update TODO items.Kevin O'Connor2009-07-251-1/+1
|
* Add malloc_high/fseg() and rework bios table creation to use them.Kevin O'Connor2009-07-251-13/+90
| | | | | | | | Add malloc like functions for memory management instead of open-coding memory reservation in all callers. Add ability for unused high ram to be returned for general purpose use. Break up acpi table creation into multiple functions. Also, move smbios tables into high ram (instead of f-segment).
* Add support for field width argument to %x (eg, %08x).Kevin O'Connor2009-05-051-2/+2
| | | | Patch from Stefan Reinauer; modified by Kevin O'Connor.
* Minor - simplify add_e820() function.Kevin O'Connor2009-04-261-14/+11
|
* Minor - simplify add_e820() function.Kevin O'Connor2009-02-271-33/+28
| | | | | | Make code a little simpler. This also fixes a corner-case where a hole could be incorrectly added to the map.
* Clear out the BiosTableSpace array on each boot.Kevin O'Connor2009-02-171-0/+1
| | | | This makes sure ctrl-alt-delete doesn't leave left over settings.
* Minor - rename BX_PANIC to panic.Kevin O'Connor2009-02-081-1/+1
|
* Reserve space for buffers in f-segment; don't allocate from freespace.Kevin O'Connor2009-01-171-17/+4
| | | | | | | Define the e820list as a regular array. Define a buffer for run-time built bios tables. Reserving the space in advance should help prevent run-time errors when space becomes tight.
* Try to automatically fit sections into open spaces in the fixed area.Kevin O'Connor2009-01-171-5/+5
| | | | | | | | | | | | | Enhance layoutrom.py script to find and locate sections into fixed area. Have layoutrom.py create output file instead of using redirect from make. Don't use freespace2 for bios tables in f segment - freespace in fixed area is now automatically filled. Change checkrom script to test final_code16_end instead of _start - this improves catching of alignment errors. Don't align gdt to 8 bytes - it causes whole section to be aligned, which causes entry point to be misaligned. Explicitly reserve space for variables in fixed area so that the space for them is not auto-filled.
* Change license from GPLv3 to LGPLv3.Kevin O'Connor2009-01-151-1/+1
| | | | | | | | Change license of contributions from Kevin O'Connor from GPLv3 to LGPLv3 (or later). Since the work as a whole is based on Kevin's contributions and the "bochs bios" which has a license of LGPL (v2 or later), this effectively makes the work as a whole available under LGPLv3 (or later).
* Various minor comment updates.Kevin O'Connor2008-12-101-1/+1
|
* Don't reset .bss on reboots.Kevin O'Connor2008-11-291-0/+1
| | | | | Since .data isn't reset on a reboot, it's confusing to reset .bss. Fixup all places that assumed .bss variables were reset.
* Update e820 map in place instead of copying it.Kevin O'Connor2008-11-081-15/+10
| | | | | | | Allocate the e820 map space in the 0xf0000 segment and do all updates in place. This reduces the need to access external memory during post. Also, move e820 pointer and count from ebda to variables in 0xf0000.
* Print out percentage of space used for bios tables during boot.Kevin O'Connor2008-08-291-4/+7
|
* Use ld to build final rom; remove custom build utilities.Kevin O'Connor2008-07-051-2/+5
| | | | | | It's possible to build the final rom with a little LD magic - so use that instead of the buildrom.py / defsyms.py method. Also, rename all occurances of ".globl" to the more clear ".global".
* Define 16bit OFFSET_x to be 32bit addresses; introduce CONFIG_BIOS_ADDR.Kevin O'Connor2008-07-041-2/+2
| | | | | The rom16.o object will now have absolute (32bit applicable) addresses. Replace several 0xf0000 and 0x10000 uses with CONFIG_BIOS_ADDR/SIZE macros.
* Extract 'struct bregs' out of biosvar.h; clean up header includes.Kevin O'Connor2008-07-041-0/+1
|
* Breakup rombios32.c into pciinit.c and smbios.cKevin O'Connor2008-07-041-0/+4
|
* Make 0xa0000 - 0x10000 a "gap" in the e820 map.Kevin O'Connor2008-06-211-2/+4
| | | | | | Declaring memory between 0xa0000 - 0x10000 confuses windows, so don't do that. Add capability to remove mappings in the memory mapping code.
* Support auto-merging e820 maps of same type.Kevin O'Connor2008-06-111-10/+25
| | | | | Two bordering e820 maps with the same memory type should merge into one mapping of the type.
* Enhance e820 memory map generation - include files missing from last commit.Kevin O'Connor2008-06-081-0/+138