From: Gleb Natapov <gleb@redhat.com>
To: bochs-developers@lists.sourceforge.net
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v5 3/5] Execute rombios32 code from rom address 0xe0000.
Date: Thu, 27 Nov 2008 13:02:35 +0200 [thread overview]
Message-ID: <20081127110235.25353.98209.stgit@dhcp-1-237.tlv.redhat.com> (raw)
In-Reply-To: <20081127110220.25353.83454.stgit@dhcp-1-237.tlv.redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
bios/Makefile.in | 1 +
bios/rombios.c | 17 +----------------
bios/rombios32.ld | 10 ++++------
bios/rombios32start.S | 9 ++++++++-
4 files changed, 14 insertions(+), 23 deletions(-)
diff --git a/bios/Makefile.in b/bios/Makefile.in
index b055910..af674b4 100644
--- a/bios/Makefile.in
+++ b/bios/Makefile.in
@@ -106,6 +106,7 @@ rombios32.o: rombios32.c acpi-dsdt.hex
ifeq ("1", "0")
acpi-dsdt.hex: acpi-dsdt.dsl
iasl -tc -p $@ $<
+ sed -i -e's/^unsigned/const unsigned/' $@
endif
rombios32start.o: rombios32start.S
diff --git a/bios/rombios.c b/bios/rombios.c
index a34c6b2..4e555a9 100644
--- a/bios/rombios.c
+++ b/bios/rombios.c
@@ -10036,13 +10036,6 @@ rombios32_05:
mov gs, ax
cld
- ;; copy rombios32 code to ram (ram offset = 1MB)
- mov esi, #0xfffe0000
- mov edi, #0x00040000
- mov ecx, #0x10000 / 4
- rep
- movsd
-
;; init the stack pointer
mov esp, #0x00080000
@@ -10051,17 +10044,9 @@ rombios32_05:
push #0x04b2
;; call rombios32 code
- mov eax, #0x00040000
+ mov eax, #0x000e0000
call eax
- ;; reset the memory (some boot loaders such as syslinux suppose
- ;; that the memory is set to zero)
- mov edi, #0x00040000
- mov ecx, #0x40000 / 4
- xor eax, eax
- rep
- stosd
-
;; return to 16 bit protected mode first
db 0xea
dd rombios32_10
diff --git a/bios/rombios32.ld b/bios/rombios32.ld
index c7f6066..ff765c8 100644
--- a/bios/rombios32.ld
+++ b/bios/rombios32.ld
@@ -3,14 +3,12 @@ OUTPUT_ARCH(i386)
ENTRY(_start);
SECTIONS
{
- . = 0x00040000;
+ . = 0x000e0000;
.text : { *(.text) }
- .rodata : { *(.rodata) }
- . = ALIGN(4096);
- .data : { *(.data) }
- __bss_start = . ;
- .bss : { *(.bss) *(COMMON) }
+ .rodata : { *(.rodata*) }
_end = . ;
+ .data 0x700 : AT (_end) { __data_start = .; *(.data); __data_end = .;}
+ .bss : { __bss_start = .; *(.bss) *(COMMON); __bss_end = .;}
/DISCARD/ : { *(.stab)
*(.stabstr)
*(.comment)
diff --git a/bios/rombios32start.S b/bios/rombios32start.S
index 601e2b0..1900261 100644
--- a/bios/rombios32start.S
+++ b/bios/rombios32start.S
@@ -32,10 +32,17 @@ _start:
/* clear bss section */
xor %eax, %eax
mov $__bss_start, %edi
- mov $_end, %ecx
+ mov $__bss_end, %ecx
sub %edi, %ecx
rep stosb
+ /* copy data section */
+ mov $_end, %esi
+ mov $__data_start, %edi
+ mov $__data_end, %ecx
+ sub %edi, %ecx
+ rep movsb
+
jmp rombios32_init
.code16
next prev parent reply other threads:[~2008-11-27 11:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 11:02 [Qemu-devel] [PATCH v5 0/5] Support for S3 ACPI state (suspend to memory) in BIOS Gleb Natapov
2008-11-27 11:02 ` [Qemu-devel] [PATCH v5 1/5] Add S3 state to DSDT. Handle resume event in the BIOS Gleb Natapov
2008-12-07 2:57 ` [Qemu-devel] Re: [Bochs-developers] " Kevin O'Connor
2008-12-07 9:20 ` Gleb Natapov
2008-12-07 15:10 ` Kevin O'Connor
2008-12-07 16:31 ` Gleb Natapov
2008-12-09 22:26 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v5 1/5] Add S3 state to DSDT.Handle " Sebastian Herbszt
2008-12-10 0:06 ` Kevin O'Connor
2008-12-10 10:22 ` Gleb Natapov
2008-12-09 13:38 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v5 1/5] Add S3 state to DSDT. Handle " Gleb Natapov
2008-12-09 15:12 ` [Qemu-devel] " Stanislav
2008-12-14 22:02 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v5 1/5] Add S3 state to DSDT.Handle " Sebastian Herbszt
2008-11-27 11:02 ` [Qemu-devel] [PATCH v5 2/5] Preserve memory content during SMM init Gleb Natapov
2008-11-27 11:02 ` Gleb Natapov [this message]
2008-11-27 11:02 ` [Qemu-devel] [PATCH v5 4/5] Don't use unreserved memory in BIOS Gleb Natapov
2008-11-27 11:02 ` [Qemu-devel] [PATCH v5 5/5] Don't power down vga card on entering S3 state Gleb Natapov
2008-11-27 12:17 ` [Qemu-devel] [PATCH v5 0/5] Support for S3 ACPI state (suspend to memory) in BIOS Carl-Daniel Hailfinger
2008-11-27 12:35 ` Gleb Natapov
2008-11-27 18:59 ` [Bochs-developers] " Stanislav
2008-11-27 19:07 ` Carl-Daniel Hailfinger
2008-11-27 20:04 ` Stanislav
2008-11-27 21:04 ` Carl-Daniel Hailfinger
2008-11-29 19:42 ` Stanislav
2008-12-04 10:04 ` Carl-Daniel Hailfinger
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=20081127110235.25353.98209.stgit@dhcp-1-237.tlv.redhat.com \
--to=gleb@redhat.com \
--cc=bochs-developers@lists.sourceforge.net \
--cc=qemu-devel@nongnu.org \
/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 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).