From: Gleb Natapov <gleb@redhat.com>
To: Sebastian Herbszt <herbszt@gmx.de>
Cc: bochs-developers@lists.sourceforge.net, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH v2 4/6] Execute rombios32 code from romaddress 0xe0000.
Date: Sat, 8 Nov 2008 09:51:17 +0200 [thread overview]
Message-ID: <20081108075117.GA19237@redhat.com> (raw)
In-Reply-To: <B3159364EEA14CA68F724F6CEF26D67E@FSCPC>
On Sat, Nov 08, 2008 at 12:20:56AM +0100, Sebastian Herbszt wrote:
>> index c7f6066..113a2c0 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) }
>> _end = . ;
>> + .data 0x700 : AT (_end) { __data_start = .; *(.data); __data_end = .;}
>> + .bss : { __bss_start = .; *(.bss) *(COMMON); __bss_end = .;}
>> /DISCARD/ : { *(.stab)
>> *(.stabstr)
>> *(.comment)
>
> The .data section is currently empty because all data is read-only and put
> into .rodata, .rodata.str1.1 and .rodata.str1.4. As soon as we put something
> into .data we get a link error because .data now overlaps .rodata.str1.1.
> The error is gone if we put all .rodata input sections into .rodata output
> section with ".rodata : { *(.rodata*)".
>
Oops. I'll fix that. Worked for me in KVM bios even though its .data is
not empty, but now I see that it worked accidentally because there is ALIGN
after .rodata there.
>> 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
>
> We do overwrite data at 0x700 here. Is this acceptable for S3 resume?
>
First page is reserved for BIOS use.
>> + /* copy data section */
>> + mov $_end, %esi
>> + mov $__data_start, %edi
>> + mov $__data_end, %ecx
>> + sub %edi, %ecx
>> + rep movsb
>> +
>
> As described above this is currently a no-op, because
> __data_start = __data_end = 0x700.
>
I know, but do we want to remember to add this after changing C code?
There is no harm to add it here and let it do nothing, and don't worry
about adding .data variable later.
--
Gleb.
next prev parent reply other threads:[~2008-11-08 7:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 9:26 [Qemu-devel] [PATCH v2 0/6] Support for S3 ACPI state (suspend to memory) in BIOS Gleb Natapov
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 1/6] Move PIC initialization out of line to save space in post code area Gleb Natapov
2008-11-06 21:42 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 1/6] Move PIC initialization out ofline " Sebastian Herbszt
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 2/6] Add S3 state to DSDT. Handle resume event in the BIOS Gleb Natapov
2008-11-06 23:03 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 2/6] Add S3 state to DSDT. Handleresume " Sebastian Herbszt
2008-11-10 8:24 ` Gleb Natapov
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 3/6] Preserve memory content during SMM init Gleb Natapov
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 4/6] Execute rombios32 code from rom address 0xe0000 Gleb Natapov
2008-11-07 23:20 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 4/6] Execute rombios32 code from romaddress 0xe0000 Sebastian Herbszt
2008-11-08 7:51 ` Gleb Natapov [this message]
2008-11-10 19:25 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 4/6] Execute rombios32 code fromromaddress 0xe0000 Sebastian Herbszt
2008-11-10 21:18 ` Gleb Natapov
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 5/6] Don't use unreserved memory in BIOS Gleb Natapov
2008-11-07 0:25 ` [Qemu-devel] Re: [Bochs-developers] " Kevin O'Connor
2008-11-07 0:31 ` Michael Brown
2008-11-09 17:40 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 5/6] Don't use unreservedmemory " Sebastian Herbszt
2008-11-09 19:43 ` Kevin O'Connor
2008-11-10 19:55 ` [Qemu-devel] Re: [Bochs-developers] [PATCH v2 5/6] Don't use unreservedmemory inBIOS Sebastian Herbszt
2008-11-03 9:26 ` [Qemu-devel] [PATCH v2 6/6] Don't power down vga card on entering S3 state Gleb Natapov
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=20081108075117.GA19237@redhat.com \
--to=gleb@redhat.com \
--cc=bochs-developers@lists.sourceforge.net \
--cc=herbszt@gmx.de \
--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 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.