xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Lin-bao Zhang <zhang.linbao@yahoo.com>
Subject: Re: Re: define BOOT_TRAMPOLINE and stack based on result of probing EBDA area by INT12
Date: Wed, 31 Aug 2011 21:14:25 +0100	[thread overview]
Message-ID: <CA8454B1.20128%keir.xen@gmail.com> (raw)
In-Reply-To: <CA8450CE.20119%keir.xen@gmail.com>

On 31/08/2011 20:57, "Keir Fraser" <keir.xen@gmail.com> wrote:

> On 31/08/2011 20:25, "Alan Cox" <alan@lxorguk.ukuu.org.uk> wrote:
> 
>> On Wed, 31 Aug 2011 09:55:10 +0100
>> Keir Fraser <keir@xen.org> wrote:
>> 
>>> On 31/08/2011 09:47, "Lin-bao Zhang" <zhang.linbao@yahoo.com> wrote:
>>> 
>>>> 1,define a variable named "EBDA_bottom".
>>>> 2, get EBDA_bottom by above method.
>>>> 3, stack should equals EBDA_bottom (or EBDA_bottom -1 safely)
>>>> 4, mov     $(EBDA_bottom -1),%esp
>>>> in most case , EBDA area is 1K,but we define 0x7c000(this is absolutely
>>>> safe),but we will waste too much memory space.
>>>> 
>>>> I did test, it can work .Certainly, I am familiar with assembler code, I
>>>> just
>>>> hard code to test:mov     0x903ff , %esp thanks for your corrections , I
>>>> have
>>>> not read over all histories and stories about them, if I am wrong , I am
>>>> sorry
>>>> first.
>>> 
>>> If you actually tried to implement it you'd realise you're stuck.
>> 
>> Re-read the original. The EBDA is accessible at BIOS segment offset 0E.
>> You don't need to make a BIOS call to read it, just load the location and
>> check it against 0.W in which case one isn't present.
>> 
>> At that point you know where to put your bits.
>> 
>> Obviously once you get into the world of EFI and the like there are
>> different ways all this should occur, but for good old BIOS stuff it
>> works fine.
> 
> Ah, makes sense. And our real-mode code is now relocatable, which was
> implemented as part of support for EFI. That could be used to dynamically
> relocate below EBDA for legacy BIOS too.

That said the original bug was in a very old version of Xen, and we have
since statically moved our real-mode code below 0x80000 which is apparently
below even the largest possible EBDA. So arguably we should leave it alone
now.

 -- Keir

>  -- Keir
> 
> 

  reply	other threads:[~2011-08-31 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31  8:47 define BOOT_TRAMPOLINE and stack based on result of probing EBDA area by INT12 Lin-bao Zhang
2011-08-31  8:55 ` Keir Fraser
2011-08-31 16:09   ` djmagee
2011-08-31 19:25   ` Alan Cox
2011-08-31 19:57     ` Keir Fraser
2011-08-31 20:14       ` Keir Fraser [this message]
2011-08-31  9:52 ` Lin-bao Zhang

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=CA8454B1.20128%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=zhang.linbao@yahoo.com \
    /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).