qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2


From: Gleb Natapov
Subject: Re: [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2
Date: Thu, 18 Jun 2009 14:15:03 +0300

On Wed, Jun 17, 2009 at 06:41:09PM +0200, Alexander Graf wrote:
> This patch implements support for Multiboot on x86 for -kernel.
> Multiboot is a "new" approach to get rid of different bootloaders, providing
> a unified interface for the kernel. It supports command line options and
> kernel modules.
> 
> The two probably best known projects using multiboot are Xen and GNU Hurd.
> 
> This implementation should be mostly feature-complete. It is missing VBE
> extensions, but as no system uses them currently it does not really hurt.
> 
> To use multiboot, specify the kernel as -kernel option. Modules should be 
> given
> as -initrd options, seperated by a comma (,). -append also works.
> 
> Please bear in mind that grub also does gzip decompression, which qemu does
> not do yet. To run existing images, please ungzip them first.
> 
> The guest multiboot loader code is implemented as option rom using int 19.
> Parts of the work are based on efforts by Rene Rebe, who originally ported
> my code to int 19.
> 
> Also, Kevin Wolf helped a lot whenever I had a new version of this patch
> around.
> 
With this small patch it also works for me in KVM


diff --git a/pc-bios/multiboot/multiboot.S b/pc-bios/multiboot/multiboot.S
index 5a2acba..943c381 100644
--- a/pc-bios/multiboot/multiboot.S
+++ b/pc-bios/multiboot/multiboot.S
@@ -156,9 +156,6 @@ mmap_store_entry:
 
 mmap_done:
 real_to_prot:
-       /* get us to protected mode now */
-       movl            $1, %eax
-       movl            %eax, %cr0
 
        /* Load the GDT before going into protected mode */
        xor             %bx, %bx
@@ -166,12 +163,9 @@ real_to_prot:
 lgdt:
        addr32 data32 lgdt      (gdt_desc)
 
-       /* the LJMP sets CS for us and gets us to 32-bit */
-ljmp:
-       addr32 data32 ljmp      *(prot_jump)
-
-prot_mode:
-.code32
+       /* get us to protected mode now */
+       movl            $1, %eax
+       movl            %eax, %cr0
 
        /* initialize all other segments */
        movl            $0x10, %eax
@@ -181,6 +175,12 @@ prot_mode:
        movl            %eax, %fs
        movl            %eax, %gs
 
+       /* the LJMP sets CS for us and gets us to 32-bit */
+ljmp:
+       addr32 data32 ljmp      *(prot_jump)
+
+prot_mode:
+.code32
        /* Jump off to the kernel */
        read_fw         FW_CFG_KERNEL_ADDR
 mov_pj:
--
                        Gleb.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]