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

Re: [MiNT] /dev/tty to CON:



On Tue, 2010-04-20 at 17:12 +0200, Vincent Rivière wrote:
> Paul forgot to reply to the list.
> 
> 2010/4/19 Vincent Rivière <vincent.riviere@freesbee.fr>:
>  > Hello.
>  >
>  > Some standard programs use open("/dev/tty") to write directly to the
>  > terminal, in case of redirections. This feature is especially used by the
>  > -fstack-protector function of GCC.
>  >
>  > Of course this fails with TOS, but if I'm not wrong the special filename
>  > "CON:" is exactly the same.
>  >
>  > Would it be wise to make a special case in open() inside the MiNTLib, and
>  > transparently replace /dev/tty to CON: when running on single TOS ?
>  >
>  > The alternative is to patch all the programs using /dev/tty and expected to
>  > run on single TOS.
>  >
>  > --
>  > Vincent Rivière
>  >
> This is single TOS specific, right? ie not an issue with MiNT

Right. The MiNT kernel will translate for us.

> The first question I would ask:
> "is MiNTLib TOS aware?"

Yes. __mint is 0 when we're TOS only, otherwise it's the MiNT version.

> can it tell weather or not it is being run under single TOS or MiNT? I
> mean this
> in a general sense, as from what I have gathered from previous posts, some
> functions already need to know, and therefore have appropriate detection code.

Right. There are some fallback paths that try to do TOS calls to achieve
the same thing that MiNT would do for us. It's not implemented in a lot
of calls though for obvious reasons.

> Would the "/dev/tty to CON" affect MiNTLib portability? (is it portable?)

If mintlib is doing the translation it doesn't affect the source package
at all.

> And lastly, maybe similar to above, would it be affected by running under Magic.

I don't think so, but I don't have Magic.

> It maybe that the last 2 questions are irrelavent, they are just
> related queries. Is
> there any other OS/kernel that MiNTLib can be used with that may only show up
> as TOS when queried.
> 
> The main reason I ask, being, is there anything else similar to this
> transparency
> that could or should also be done. If so, does a coordinated approach need to
> be add (if not already present), and does any detection code adversely affect
> memory footprint, load times, or speed, particularly on low spec machines.
> 
> or ar these concerns unfounded?

Doing a translation from "/dev/tty" to "CON:" is pretty trivial. 

Alan.