Browse Source

Capable of starting a multiboot kernel (albeit without the multiboot

information table yet).
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
dc51af59a4
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      src/arch/i386/image/multiboot.c

+ 15
- 2
src/arch/i386/image/multiboot.c View File

@@ -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
 /**

Loading…
Cancel
Save