summaryrefslogtreecommitdiffstats
path: root/src/arch/i386
diff options
context:
space:
mode:
authorMichael Brown2007-01-11 19:41:15 +0100
committerMichael Brown2007-01-11 19:41:15 +0100
commitdc51af59a4630d73add1ceadfdbc8bd780a2850f (patch)
treea5b337495e479f4852d088217fd16618b11e2623 /src/arch/i386
parentAdd PHYS_CODE, for use as in __asm__ ( PHYS_CODE ( ... ) ), comparable (diff)
downloadipxe-dc51af59a4630d73add1ceadfdbc8bd780a2850f.tar.gz
ipxe-dc51af59a4630d73add1ceadfdbc8bd780a2850f.tar.xz
ipxe-dc51af59a4630d73add1ceadfdbc8bd780a2850f.zip
Capable of starting a multiboot kernel (albeit without the multiboot
information table yet).
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/image/multiboot.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c
index cbab6a5c3..cfe4589a2 100644
--- a/src/arch/i386/image/multiboot.c
+++ b/src/arch/i386/image/multiboot.c
@@ -74,8 +74,21 @@ struct multiboot_header_info {
* @v image ELF file
* @ret rc Return status code
*/
-static int multiboot_execute ( struct image *image __unused ) {
- return -ENOTSUP;
+static int multiboot_execute ( struct image *image ) {
+ struct multiboot_info mbinfo;
+
+ /* Populate multiboot information structure */
+ memset ( &mbinfo, 0, sizeof ( mbinfo ) );
+
+
+ /* Jump to OS with flat physical addressing */
+ __asm__ ( PHYS_CODE ( "call *%%edi\n\t" )
+ : : "a" ( MULTIBOOT_BOOTLOADER_MAGIC ),
+ "b" ( virt_to_phys ( &mbinfo ) ),
+ "D" ( image->entry )
+ : "ecx", "edx", "esi", "ebp" );
+
+ return -ECANCELED;
}
/**