All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Santiago Garcia Mantinan <manty@i.am>
Cc: linux-kernel@vger.kernel.org
Subject: Re: why volatile on vgacon.c?
Date: Wed, 29 Nov 2000 18:42:20 +0100	[thread overview]
Message-ID: <20001129184220.A204@suse.cz> (raw)
In-Reply-To: <20001129172415.A2171@mantianito.dyndns.org>
In-Reply-To: <20001129172415.A2171@mantianito.dyndns.org>; from manty@i.am on Wed, Nov 29, 2000 at 05:24:15PM +0100

On Wed, Nov 29, 2000 at 05:24:15PM +0100, Santiago Garcia Mantinan wrote:
> Hi!
> 
> I used to be able to run my 12 ethernet ports pentium based bridge without
> vga card, but with tty1, tty2, ... still working, as the kernel used to
> recognice a kind of a cga card on my machine even though there was none. But
> the kernel could write to the memory were the card was supposed to be, and
> so it worked.
> 
> That was on 2.2 series, but since I moved it to 2.4 series I don't have that
> cga card found anymore. I have looked on the kernel code and followed it to
> the __init function in vgacon.c, more concretely this piece of code...
> 
>         scr_writew(0xAA55, p);
>         scr_writew(0x55AA, p + 1);
>         if (scr_readw(p) != 0xAA55 || scr_readw(p + 1) != 0x55AA) {
> 
> Well, the thing is that this code and the code in this function is almost
> the same in 2.4 as in 2.2, however reading returns the written values on 2.2
> and different ones (0xffff) on 2.4
> 
> This is caused by the volatile declaration of *p on 2.4, so the questions
> are:
> 
> was the old (I have found a CGA) behaviour considered a bug and is the
> volatile declaration its fix?

Yes. The compiler was optimizing too much.

> If so, is there any way to have /dev/tty1 on a no graphic card i386 machine?
> (besides unvolatilizating *p wich works for me)

I think you can use serial console instead, if you have serial ports in
the machine.

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-11-29 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-29 16:24 why volatile on vgacon.c? Santiago Garcia Mantinan
2000-11-29 17:42 ` Vojtech Pavlik [this message]
2000-11-29 17:51 ` Andries Brouwer
2000-12-02 11:20   ` Jeff Garzik

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=20001129184220.A204@suse.cz \
    --to=vojtech@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manty@i.am \
    /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.