summaryrefslogtreecommitdiff
path: root/laden/laden.c
diff options
context:
space:
mode:
authorneal <neal>2007-07-26 20:48:41 +0000
committerneal <neal>2007-07-26 20:48:41 +0000
commita084d87a3692c39b8106b995705ca56a65cc0ea2 (patch)
tree624a47aaf79408ce9df8265bc525f996b9355461 /laden/laden.c
parent45cb4f373b40d36664601e545dc485077cc73f83 (diff)
2007-07-26 Neal H. Walfield <neal@gnu.org>
* loader.h (loader_add_region): Take an additional parameter, the L4 descriptor type. Update callers. (loader_elf_load): Likewise. (loader_regions_reserve): New function. * loader.c: Add field desc_type. (loader_add_region): Take an additional parameter, an L4 descriptor type. Save it in the allocated descriptor. Round the start address to a page boundary. (loader_remove_region): Remove all regions with the name NAME, not just the first one. (loader_regions_reserve): New function. (loader_elf_load): Take an additional parameter, an L4 descriptor type. Mark regions that we allocate with this type. Coalesce regions where possible. * laden.h: Include <assert.h>. (add_memory_map): Improve comment. Add an assert. * ia32-cmain.c (module_relocate): Rename from this... (modules_relocate): ... to this. Handle relocating multiple modules. (find_components): When protecting module data areas, coalesce when possible. Fix an off by one error when calculating the upper memory bound. Rename the module meta data region to better reflect its nature. * kip-fixup.c (kip_fixup): Call loader_regions_reserve before copying the memory descriptors. Don't set KIP->MEMORY_INFO.NR * laden.c (load_components): Allocate a stack for sigma0 and the root server just beyond their highest address. * kip-fixup.c (kip_fixup): Only boot versions of L4 that we know how to boot. * ia32-cmain.c (find_components): Only reserve conventional memory for an X2 kernel.
Diffstat (limited to 'laden/laden.c')
-rw-r--r--laden/laden.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/laden/laden.c b/laden/laden.c
index 88b9874..7caf888 100644
--- a/laden/laden.c
+++ b/laden/laden.c
@@ -80,42 +80,54 @@ load_components (void)
if (!kernel.low)
panic ("No L4 kernel found");
loader_add_region ("kernel-mod", kernel.low, kernel.high,
- rootserver_relocate, &kernel);
+ rootserver_relocate, &kernel, -1);
if (!sigma0.low)
panic ("No sigma0 server found");
loader_add_region ("sigma0-mod", sigma0.low, sigma0.high,
- rootserver_relocate, &sigma0);
+ rootserver_relocate, &sigma0, -1);
if (sigma1.low)
loader_add_region ("sigma1-mod", sigma1.low, sigma1.high,
- rootserver_relocate, &sigma1);
+ rootserver_relocate, &sigma1, -1);
if (!rootserver.low)
panic ("No rootserver server found");
loader_add_region ("rootserver-mod", rootserver.low, rootserver.high,
- rootserver_relocate, &rootserver);
+ rootserver_relocate, &rootserver, -1);
/* Since we did not panic, there are no conflicts and we can now
unpack the images. */
loader_elf_load ("kernel", kernel.low, kernel.high,
- &kernel.low, &kernel.high, &kernel.ip);
+ &kernel.low, &kernel.high, &kernel.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("kernel-mod");
loader_elf_load ("sigma0", sigma0.low, sigma0.high,
- &sigma0.low, &sigma0.high, &sigma0.ip);
+ &sigma0.low, &sigma0.high, &sigma0.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("sigma0-mod");
+#ifdef _L4_V2
+ /* Use the page following the extracted image as the stack. */
+ sigma0.sp = ((sigma0.high + 0xfff) & ~0xfff) + 0x1000;
+#endif
if (sigma1.low)
{
loader_elf_load ("sigma1", sigma1.low, sigma1.high,
- &sigma1.low, &sigma1.high, &sigma1.ip);
+ &sigma1.low, &sigma1.high, &sigma1.ip,
+ L4_MEMDESC_RESERVED);
loader_remove_region ("sigma1-mod");
}
loader_elf_load ("rootserver", rootserver.low, rootserver.high,
- &rootserver.low, &rootserver.high, &rootserver.ip);
+ &rootserver.low, &rootserver.high, &rootserver.ip,
+ L4_MEMDESC_BOOTLOADER);
loader_remove_region ("rootserver-mod");
+#ifdef _L4_V2
+ /* Use the page following the extracted image as the stack. */
+ rootserver.sp = ((rootserver.high + 0xfff) & ~0xfff) + 0x1000;
+#endif
}