loader relocation
RFC 1/1 loader relocation
As discussed on two other threads, this patch is a proof of concept of relocation in the loader.
Some comments:
- grub_protected_malloc() is like malloc, but with the garantee that it won't overlap with a particular region. Do you think this is the right approach? Should this be kept as a layer on top of the memory manager, like now, or rather be integrated with it to take advantage of its internal knowledge? I find that the current implementation is an ugly hack...
- This works for multiboot only. How far can we go at making it more generic? At least the malloc part should be; not sure about the rest.
- The phdr(i) hack can be committed separately in case we decide that it is necessary for this feature (or just convenient for readability). It's described at:
http://www.mail-archive.com/[email protected]/msg03517.html
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call… if you are unable to speak? (as seen on /.)
include/grub/i386/loader.h +10 -0
@@ -29,13 +29,23 @@extern grub_addr_t EXPORT_VAR (grub_os_area_addr );extern grub_size_t EXPORT_VAR (grub_os_area_size ); +extern grub_addr_t EXPORT_VAR (playground ); +extern grub_addr_t EXPORT_VAR (requested_addr ); +extern int EXPORT_VAR (playground_size ); +void EXPORT_FUNC (grub_linux_boot_zimage ) (void ) __attribute__ ((noreturn));void EXPORT_FUNC (grub_linux_boot_bzimage ) (void ) __attribute__ ((noreturn));/* The asm part of the multiboot loader. */ +void EXPORT_FUNC (grub_multiboot_real_boot_1st ) (grub_addr_t entry, +struct grub_multiboot_info *mbi, +void *next) + __attribute__ ((noreturn));void EXPORT_FUNC (grub_multiboot_real_boot ) (grub_addr_t entry,struct grub_multiboot_info *mbi) __attribute__ ((noreturn)); +extern int EXPORT_VAR (end_of_grub_multiboot_real_boot ); +void EXPORT_FUNC (grub_multiboot2_real_boot ) (grub_addr_t entry,struct grub_multiboot_info *mbi) __attribute__ ((noreturn));
kern/i386/pc/startup.S +41 -5
64 lines not on this page · raw message
loader/i386/pc/multiboot.c +61 -21
141 lines not on this page · raw message