* [Qemu-devel] [PATCH] Make -kernel for linux work with bochsbios
@ 2009-11-17 16:49 Alexander Graf
2009-11-30 13:10 ` Alexander Graf
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2009-11-17 16:49 UTC (permalink / raw)
To: qemu-devel
While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized
that I was actually writing data to %es, but only set up %ds to a 32-bit
segment we want to write to.
So at the end of the day the data hasn't actually been copied. Oops.
So here's a fix to set ES instead of DS, which makes -kernel work with
BOCHS bios again (and actually makes the code do the correct thing)!
Signed-off-by: Alexander Graf <agraf@suse.de>
---
pc-bios/optionrom/linuxboot.S | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index 08c1ca6..ecd9cf2 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -102,11 +102,11 @@ copy_kernel:
mov $1, %eax
mov %eax, %cr0
- /* So we can set DS to a 32-bit segment */
+ /* So we can set ES to a 32-bit segment */
mov $0x10, %eax
- mov %eax, %ds
+ mov %eax, %es
- /* We're now running in 16-bit CS, but 32-bit DS! */
+ /* We're now running in 16-bit CS, but 32-bit ES! */
/* Load kernel and initrd */
read_fw_blob(FW_CFG_KERNEL)
@@ -118,9 +118,9 @@ copy_kernel:
mov $0, %eax
mov %eax, %cr0
- /* DS = CS */
+ /* ES = CS */
mov %cs, %ax
- mov %ax, %ds
+ mov %ax, %es
jmp boot_kernel
--
1.6.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Make -kernel for linux work with bochsbios
2009-11-17 16:49 [Qemu-devel] [PATCH] Make -kernel for linux work with bochsbios Alexander Graf
@ 2009-11-30 13:10 ` Alexander Graf
2009-11-30 13:50 ` [Qemu-devel] " Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2009-11-30 13:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori
Alexander Graf wrote:
> While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized
> that I was actually writing data to %es, but only set up %ds to a 32-bit
> segment we want to write to.
>
> So at the end of the day the data hasn't actually been copied. Oops.
>
> So here's a fix to set ES instead of DS, which makes -kernel work with
> BOCHS bios again (and actually makes the code do the correct thing)!
>
ping
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [PATCH] Make -kernel for linux work with bochsbios
2009-11-30 13:10 ` Alexander Graf
@ 2009-11-30 13:50 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2009-11-30 13:50 UTC (permalink / raw)
To: qemu-devel
On 11/30/2009 02:10 PM, Alexander Graf wrote:
> Alexander Graf wrote:
>> While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized
>> that I was actually writing data to %es, but only set up %ds to a 32-bit
>> segment we want to write to.
>>
>> So at the end of the day the data hasn't actually been copied. Oops.
>>
>> So here's a fix to set ES instead of DS, which makes -kernel work with
>> BOCHS bios again (and actually makes the code do the correct thing)!
>>
>
> ping
ACK
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-30 13:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17 16:49 [Qemu-devel] [PATCH] Make -kernel for linux work with bochsbios Alexander Graf
2009-11-30 13:10 ` Alexander Graf
2009-11-30 13:50 ` [Qemu-devel] " Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).