grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: status grub2 port of grub-legasy map command


From: Javier Martín
Subject: Re: status grub2 port of grub-legasy map command
Date: Sun, 31 May 2009 22:13:52 +0200

El dom, 31-05-2009 a las 21:35 +0200, Christian Franke escribió:
> Vladimir 'phcoder' Serbinenko wrote:
> >>
> >> Do not do this. Some BIOS functions (like ah=08h) return data in dl.
> >> Clients should not expect data in registers to be preserved across
> >> interrupt calls. I don't know if there is something like a 8086/PC-BIOS
> >> ABI document that we can find to confirm the non-preservation of dl, but
> >> the FreeDOS MBR should be fixed then.
> >>     
> > Thank you for pointing ah=8 function
> > AFAIK there is no normative reference. The source which was mainly
> > used for long years is helppc and it states following:
> >     - registers DS, BX, CX and DX are preserved
> > (http://heim.ifi.uio.no/~stanisls/helppc/int_13.html)
> > But now this reference is terribly outdated.
> > SeaBIOS preserves %dl too
> >   
> 
> T13 EDD provides a probably more up to date documentation of int13.
> 
> There was no requirement to preserve registers is in EDD (2000) and 
> EDD-2 (2002). It appeared in EDD-3 (2004) and is still in first EDD-4 
> draft (2009):
> 
> "The values in all registers that are not explicitly defined in the 
> following sections shall be preserved at the completion of each function 
> call"
>  From Section 8 of: BIOS Enhanced Disk Drive Services - 3 (T13/1572D 
> Revision 3)
> 
> Fortunately, T13 docs are (unlike T10 and SATA-IO) still publicly available:
> http://www.t13.org/Documents/MinutesDefault.aspx?DocumentType=4&DocumentStage=2
> 

Hmm... from those docs, and accepting that we ignore TSRs, we need to
save %ah and %dl at handler entry, then check the saved %ah at exit,
like the old handler from GRUB Legacy did - by the way, when writing the
new handler, I asked what that code did and noone was able to tell me ¬¬

The only functions in the standard that return in %dl are 08h and 15h,
so the check should be simple. If we want to be even more extensible, we
could have a 32-byte bitmap, one bit per %ah function, and restore %dl
depending on the value of the particular bit. However, I think that
would be going too far.

-- 
-- Lazy, Oblivious, Recurrent Disaster -- Habbit

Attachment: signature.asc
Description: Esto es una parte de mensaje firmado digitalmente


reply via email to

[Prev in Thread] Current Thread [Next in Thread]