linux-mips-fnet
[Top] [All Lists]

RE: /dev/console

To: linux-mips@fnet.fr
Subject: RE: /dev/console
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
Date: Mon, 14 Sep 1998 19:12:31 +0200 (MEST)
In-reply-to: <Pine.LNX.3.96.980913174201.30105A-100000@apt4g.a3nyc.com>
Organization: none
Reply-to: "Harald Koerfgen" <harald.koerfgen@netcologne.de>
Sender: harry@franz.no.dom
Hi Tom,

On 13-Sep-98 Thomas Riemer wrote:
> I've narrowed down my problem to the dz driver - dz_write routine -
> Its actually being called with the correct text...
> 
> (This is after cludging line 0 to point to line 3 in all cases 
>   - that one I can undo once I can see something working)
> 
> The full text I believe (It scrolls off the screen pretty quick)
> should say something like:
> Static Shell Version 1.0.

Stand alone shell (Version 1.0), available from sunsite.

> I'm getting that printed out of printk routines - unfortunately
> not over the serial device /dev/console.  I'm in the process of 
> testing through to figure out which of the variables I haven't 
> defined correctly.
> 
> And somehow I believe my printks are getting in the way -

That may definitely be the case. Printing debugging output over the same serial
line you want to debug is, uhmmm..., suboptimal (Trust me, I am there and doing
it, with the same problems :-)).

> I haven't
> quite figured out how to turn off the hardware interrupts yet.

If the DZ chip doesn't have the ability to turn it's interrupts off, you'll have
to disable it's interrupt line in the CP0 status register. Something like:

extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);

        ...
        disable_irq(SERIAL);
        /*
         * Do what you have to do with serial interrupts off
         */
        enable_irq(SERIAL);
        ...

might do what you want. Probably even safer may be:

unsigned long flags;

        ...
        save_and_cli(flags);
        /*
         * Do what you have to do with *all* interrupts off
         */
        restore_flags(flags);

which is shorter and faster than the previous code.

---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>