mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Etienne Lorrain <etienne_lorrain@yahoo.fr>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chuck Ebbert <cebbert@redhat.com>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: RE : Re: RE : Re: x86 setup code rewrite in C - revised
Date: Mon, 16 Jul 2007 11:02:01 +0200 (CEST)	[thread overview]
Message-ID: <217644.17566.qm@web26902.mail.ukl.yahoo.com> (raw)
In-Reply-To: <4697EC66.2030404@zytor.com>

--- "H. Peter Anvin" <hpa@zytor.com> wrote:
> >>>>  - Does not save and restore %ds when printing a char on the screen (%ds is
> >>>>  destroyed only when the content of the screen scroll - only for some video cards)
> >> %ds?  Aren't you confusing it with the old bug which would destroy %bp?
> >>  If you have any references to %ds being destroyed I would be very
> >> surprised.  I can guarantee that very little if any assembly code I've
> >> ever seen that deals with INT 10h -- and I've seen a lot of it -- guards
> >> against %ds being randomly trashed.
> >>
> >> However, the trashing of %bp is a well-known bug (although only for
> >> machines older than the ones that can run Linux) -- the Interrupt List has:
> >>
> >> BUGS:   some implementations (including the original IBM PC) have a bug
> >>  	which destroys BP
> > 
> >  That is on Trident cards, old card but may still be used, and BIOS may have
> > been copied to other cards.
> >  Detected and documented on Gujin (boot.c and vgabios.h scroll)
> 
> Are you talking about BP or DS?  As I said, the BP is well-known, and
> the code accounts for it in the form of the INT10 macro.

 Extract of RBIL61:
INT 10 - VIDEO - SCROLL UP WINDOW
	AH = 06h
	AL = number of lines by which to scroll up (00h = clear entire window)
	BH = attribute used to write blank lines at bottom of window
	CH,CL = row,column of window's upper left corner
	DH,DL = row,column of window's lower right corner
Return: nothing
Note:	affects only the currently active page (see AH=05h)
BUGS:	some implementations (including the original IBM PC) have a bug which
	  destroys BP
	the Trident TVGA8900CL (BIOS dated 1992/9/8) clears DS to 0000h when
	  scrolling in an SVGA mode (800x600 or higher)

 Scrolling is only (and automatically) done if the cursor is at bottom right.

> >>>>  Also, I do not know if "m" is right in here:
> >>>> static inline u8 rdfs8(addr_t addr)
> >>>> {
> >>>> 	u8 v;
> >>>> 	asm("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr));
> >>>> 	return v;
> >>>> }
> >> The "m" is correct right there.
> > 
> >  strange, "g" would mean anything can go there - and this assembly instruction
> > should accept every access modes.
> 
> Not with an %fs: prefix.  It would also allow the compiler to do a move
> into a register "on its own", which would be disastrous, since it would
> lack the prefix.  So "m" is correct.

  "mov %fs:(%ebx,%eax,4),%ecx" works for me.

 Etienne.


      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

  reply	other threads:[~2007-07-16  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 14:25 Etienne Lorrain
2007-07-13 16:35 ` Chuck Ebbert
2007-07-13 16:51   ` H. Peter Anvin
2007-07-13 20:10     ` RE : " Etienne Lorrain
2007-07-13 21:19       ` H. Peter Anvin
2007-07-16  9:02         ` Etienne Lorrain [this message]
2007-07-16  9:15           ` RE : " H. Peter Anvin
2007-07-16 10:21             ` Etienne Lorrain
2007-07-13 23:09       ` RE : " Linus Torvalds
2007-07-13 22:23   ` H. Peter Anvin
2007-07-16 13:31     ` Etienne Lorrain
2007-07-16 17:35       ` H. Peter Anvin

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=217644.17566.qm@web26902.mail.ukl.yahoo.com \
    --to=etienne_lorrain@yahoo.fr \
    --cc=cebbert@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®