question about MINIX3 terminal driver
In driver/tty/tty.c, before enter main loop, it call printf("\n");
This uses printf() routine in libsysutil, which in turn call to
kputc(), finally send a message to tty driver
to print the message.
My question is the method kputc() used is sendrec(), which would block
tty driver ifself(since tty driver
is not ready to receive.), and removed from ready queue.
This means TTY driver have no chance to run again, and other routines
using TTY serives
would block subsequently.
But MINIX3 runs well. I must ignore something...
Any helps welcomed.
Regard
Sheng-yu
Re: question about MINIX3 terminal driver
Minix 3 has completely changed the structures into "true michro kernel"
It does not call sendrec() to the driver since it would cause a
deadlock as you know.
Therefore Minix 3 uses a notification mecanism to the dirver
Please refer to the module kputc() in Minix 3
I hope it helps
Tyson M Kim
Re: question about MINIX3 terminal driver
Thanks for your help...
But as I know, tty driver is linked with libsysutil.a (I didn't see any
definition
of printf in tty driver). This version of printf using sendrec()
finally.
I know in-kernel procedure kprintf() in kernel/utility.c using
notification mechanism,
so it's safe to print something before tty driver is fully initialized
and
ready to receive. But. it seems all drivers and servers using printf in
libsysutil.
Any suggestion futher?
[email]ma777x@hotmail.com[/email] schrieb:
[color=blue]
> Minix 3 has completely changed the structures into "true michro kernel"
>
> It does not call sendrec() to the driver since it would cause a
> deadlock as you know.
> Therefore Minix 3 uses a notification mecanism to the dirver
> Please refer to the module kputc() in Minix 3
>
> I hope it helps
>
> Tyson M Kim[/color]
Re: question about MINIX3 terminal driver
All,
[color=blue]
> I know in-kernel procedure kprintf() in kernel/utility.c using
> notification mechanism,
> so it's safe to print something before tty driver is fully initialized
> and
> ready to receive. But. it seems all drivers and servers using printf in
> libsysutil.
>
> Any suggestion futher?[/color]
tty redefines its own kputc().
=Ben
Re: question about MINIX3 terminal driver
Oh....I got the point.
Thanks!!
Ben Gras schrieb:
[color=blue]
> All,
>[color=green]
> > I know in-kernel procedure kprintf() in kernel/utility.c using
> > notification mechanism,
> > so it's safe to print something before tty driver is fully initialized
> > and
> > ready to receive. But. it seems all drivers and servers using printf in
> > libsysutil.
> >
> > Any suggestion futher?[/color]
>
> tty redefines its own kputc().
>
> =Ben[/color]
Re: question about MINIX3 terminal driver
Thanks !
Good point ! (Almost unnoticable)
I think Jorrit paper has a good explanation about this. I just skimmed
through it before.
My review on it reminds me of it now.
Tyson M Kim
Re: question about MINIX3 terminal driver
Thanks Ben !
Good point ! (Almost unnoticable)
What I said is just kernel message while user-level systems use
msg-passing and user processes request the service from FS, which
delivers it to tty.
I think Jorrit paper has a good explanation about this. I just skimmed
it through before.
A review on it refreshes my memory out of it now.
Can I have a quick question regarding it ?
So when the tty redefines kputc(), Is the previously-defined kputc() in
/lib/sysutil/kputc.c overloaded with the redefined kputc() in tty.c by
the compiler according to the chain of header files ?
Thanks in advance.
Tyson M Kim
Ben Gras wrote:[color=blue]
> All,
>[color=green]
> > I know in-kernel procedure kprintf() in kernel/utility.c using
> > notification mechanism,
> > so it's safe to print something before tty driver is fully initialized
> > and
> > ready to receive. But. it seems all drivers and servers using printf in
> > libsysutil.
> >
> > Any suggestion futher?[/color]
>
> tty redefines its own kputc().
>
> =Ben[/color]
Re: question about MINIX3 terminal driver
Yes I think I got this.
This is a language scoping matter. So the compiler takes care of it.
Thanks for paying attention.