|
@@ -74,8 +74,21 @@ struct multiboot_header_info {
|
74
|
74
|
* @v image ELF file
|
75
|
75
|
* @ret rc Return status code
|
76
|
76
|
*/
|
77
|
|
-static int multiboot_execute ( struct image *image __unused ) {
|
78
|
|
- return -ENOTSUP;
|
|
77
|
+static int multiboot_execute ( struct image *image ) {
|
|
78
|
+ struct multiboot_info mbinfo;
|
|
79
|
+
|
|
80
|
+ /* Populate multiboot information structure */
|
|
81
|
+ memset ( &mbinfo, 0, sizeof ( mbinfo ) );
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+ /* Jump to OS with flat physical addressing */
|
|
85
|
+ __asm__ ( PHYS_CODE ( "call *%%edi\n\t" )
|
|
86
|
+ : : "a" ( MULTIBOOT_BOOTLOADER_MAGIC ),
|
|
87
|
+ "b" ( virt_to_phys ( &mbinfo ) ),
|
|
88
|
+ "D" ( image->entry )
|
|
89
|
+ : "ecx", "edx", "esi", "ebp" );
|
|
90
|
+
|
|
91
|
+ return -ECANCELED;
|
79
|
92
|
}
|
80
|
93
|
|
81
|
94
|
/**
|