×

Method, apparatus, and computer-readable medium for providing physical memory management functions

  • US 7,809,918 B1
  • Filed: 07/22/2005
  • Issued: 10/05/2010
  • Est. Priority Date: 07/22/2005
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method for providing physical memory management functions to programs executing in a pre-boot environment, the method comprising:

  • receiving an allocation request from a program executing in the pre-boot environment for allocating a portion of a physical computer memory, wherein the allocation request identifies a requested memory size, wherein the memory management functions are configured to maintain a single list of data structures describing the physical computer memory, the list of data structures comprising a first data structure describing a first area of the physical computer memory that is available for allocation, the first area comprising a first memory portion and a second memory portion contiguous to the first memory portion, the first data structure comprising a first pointer node, a first size node, and a first next node, the first pointer node referencing a beginning of the first memory portion of the physical computer memory, the first size node describing a combined memory size of the first memory portion and the second memory portion, the first next node referencing a null value, and wherein each and every data structure in the list of data structures describes an unallocated portion of the physical computer memory;

    in response to receiving the allocation request, determining whether the requested memory size is available for allocation;

    in response to determining that the requested memory size is available for allocation through the first memory portion, (i) allocating the first memory portion, (ii) updating the first pointer node from referencing the beginning of the first memory portion to referencing a beginning of the second memory portion, (iii) updating the first size node from describing the combined memory size of the first memory portion and the second memory portion to describing a memory size of the second memory portion, and (iv) returning a pointer to the first memory portion in response to the allocation request;

    receiving a request to deallocate a second area of the physical computer memory that has been allocated, the request comprising a pointer to the second area of the physical computer memory to be deallocated; and

    in response to receiving the deallocation request, determining the size of the second area, determining whether the second area was allocated by the memory management functions, and in response to determining that the second area was allocated by the memory management functions, (i) deallocating the second area, (ii) creating a second data structure describing the second area, and (iii) updating the first next node from referencing the null value to referencing the second data structure, the second data structure comprising a second pointer node, a second size node, and a second next node, the second pointer node referencing a beginning of the second area, the second size node describing a memory size of the second area, and the second next node referencing the null value.

View all claims
  • 3 Assignments
Timeline View
Assignment View
    ×
    ×