All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: kwolf@redhat.com, rene@exactcode.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2
Date: Thu, 18 Jun 2009 14:15:03 +0300	[thread overview]
Message-ID: <20090618111503.GC20289@redhat.com> (raw)
In-Reply-To: <1245256873-8010-1-git-send-email-agraf@suse.de>

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.

      parent reply	other threads:[~2009-06-18 11:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 16:41 [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2 Alexander Graf
2009-06-17 16:41 ` [Qemu-devel] [PATCH 1/4] Change bochs bios init order Alexander Graf
2009-06-17 16:41   ` [Qemu-devel] [PATCH 2/4] Expose fw_cfg v2 Alexander Graf
2009-06-17 16:41     ` [Qemu-devel] [PATCH 3/4] Multiboot support v2 Alexander Graf
2009-06-17 16:41       ` [Qemu-devel] [PATCH 4/4] Multiboot build system Alexander Graf
2009-06-18  9:56       ` [Qemu-devel] [PATCH 3/4] Multiboot support v2 Avi Kivity
2009-06-18 10:22         ` Alexander Graf
2009-06-18 11:19           ` Avi Kivity
2009-06-17 17:10 ` [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2 François Revol
2009-06-17 17:59   ` Anthony Liguori
2009-06-18  8:25     ` François Revol
2009-06-18  9:09       ` Kevin Wolf
2009-06-18 11:44         ` François Revol
2009-06-18 11:55           ` Alexander Graf
2009-06-18 12:13             ` François Revol
2009-06-18 12:01           ` Kevin Wolf
2009-06-18 12:17             ` François Revol
2009-06-18 12:23               ` Alexander Graf
2009-06-18 12:34                 ` François Revol
2009-06-18 12:29               ` Kevin Wolf
2009-06-18 12:35                 ` François Revol
2009-06-18 11:15 ` Gleb Natapov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090618111503.GC20289@redhat.com \
    --to=gleb@redhat.com \
    --cc=agraf@suse.de \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rene@exactcode.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.