summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/transitions/librm.S
diff options
context:
space:
mode:
authorMichael Brown2005-04-09 18:14:09 +0200
committerMichael Brown2005-04-09 18:14:09 +0200
commit1f6dfd7047eab181e93819d99d8b8e1600c8f514 (patch)
tree5ec2e3b64e0a14cd9caf7b63cba127b750bc7700 /src/arch/i386/transitions/librm.S
parentNeed to provide sizeof(struct free_base_memory_header) to assembly code. (diff)
downloadipxe-1f6dfd7047eab181e93819d99d8b8e1600c8f514.tar.gz
ipxe-1f6dfd7047eab181e93819d99d8b8e1600c8f514.tar.xz
ipxe-1f6dfd7047eab181e93819d99d8b8e1600c8f514.zip
Allow ourselves to be freed by basemem.c without being damaged.
Diffstat (limited to 'src/arch/i386/transitions/librm.S')
-rw-r--r--src/arch/i386/transitions/librm.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/i386/transitions/librm.S b/src/arch/i386/transitions/librm.S
index 5299841c..c915b7ee 100644
--- a/src/arch/i386/transitions/librm.S
+++ b/src/arch/i386/transitions/librm.S
@@ -8,6 +8,9 @@
/* Drag in local definitions */
#include "librm.h"
+/* Drag in FREE_BASEMEM_HEADER_SIZE */
+#include "basemem.h"
+
/****************************************************************************
* This file defines librm: a block of code that is designed to reside
* permanently in base memory and provide the interface between
@@ -130,6 +133,19 @@ _librm_start:
sym
/****************************************************************************
+ * Note that the first sizeof(struct free_base_memory_header) bytes of
+ * librm will get vapourised by free_base_memory(). Since we need
+ * librm to continue working even when this happens, we put some
+ * padding here.
+ *
+ * We must also ensure that the total size of librm is <1kB, otherwise
+ * free_base_memory() will stomp somewhere in the middle of us as
+ * well...
+ ****************************************************************************
+ */
+ .fill FREE_BASEMEM_HEADER_SIZE, 1, 0
+
+/****************************************************************************
* GDT for initial transition to protected mode
*
* PHYSICAL_CS and PHYSICAL_DS are defined in an external header file.