[i386] Free allocated base memory on exit, if possible

Code paths that automatically allocate memory from the FBMS at 40:13
should also free it, if possible.

Freeing this memory will not be possible if either

  1. The FBMS has been modified since our allocation, or

  2. We have not been able to unhook one or more BIOS interrupt vectors.
This commit is contained in:
Michael Brown
2008-11-18 19:43:13 +00:00
parent 85f82f09e9
commit 0a8a17e669
9 changed files with 133 additions and 29 deletions

View File

@@ -52,7 +52,7 @@ memlen: .long _filesz - 512
*****************************************************************************
*/
entry:
/* Install low and high memory regions */
/* Install gPXE */
call install
/* Jump to .text16 segment */
@@ -64,7 +64,10 @@ entry:
pushl $main
pushw %cs
call prot_call
popl %eax /* discard */
popl %ecx /* discard */
/* Uninstall gPXE */
call uninstall
/* Reboot system */
int $0x19