rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* real driver
@ 2021-07-07 19:18 Geert Stappers
  2021-07-08  6:25 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Stappers @ 2021-07-07 19:18 UTC (permalink / raw)
  To: rust-for-linux

In-Reply-To: <YOXB7FRqldZik2Xn@kroah.com>
Previous-Subject: Re: [PATCH 00/17] Rust support

On Wed, Jul 07, 2021 at 05:02:04PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jul 07, 2021 at 03:07:50PM +0100, Wedson Almeida Filho wrote:
> > > Last I looked at this thing, it was not
> > > feature-complete compared to the in-kernel binder code, has that been
> > > resolved and the needed filesystem changes added?
> > 
> > It is not feature-complete in comparison to the C one just yet, it is missing a
> > few things but not for any fundamental reason -- we were mostly focusing on the
> > kernel crate and tests.
> 
> I love it how you call "binderfs is missing" a "few things" :)
> 
> > Miguel's point is that it does implement the vast majority of binder features
> > and is non-trivial, so it could be used as evidence that useful kernel drivers
> > can be built with Rust; not just "transpiled" from C, but written with the Rust
> > safety guarantees.
> 
> As Christoph said, and I and others have said before, binder is in no
> way shape or form anything that resembles any sort of "driver" at all.
> It is a crazy IPC mechanism that is tacked onto the side of the kernel.
> Not to say that it doesn't have its usages, but the interactions between
> binder and the rest of the kernel are very small and specific.
> Something that almost no one else will ever write again.
> 
> Please work on a real driver to help prove, or disprove, that this all
> is going to be able to work properly.  There are huge unanswered
> questions that need to be resolved that you will run into when you do
> such a thing.

Suggesting virtual null modem drivers.

At userland side are character devices visible.
These /dev/tntX  come in pairs  /dev/tnt0 + /dev/tnt1,
/dev/tnt2 + /dev/tnt3, /dev/tnt4 + /dev/tnt5, etcetera.
They behave like serial ports.
The driver inbetween a /dev/tntX-pair mimicks  UARTs.

Yeah, still no true hardware driver.

Things this driver will bring:
* Providing  character devices
* Interrupts upon recieving / transmitting characters.
* Having transmit / recieve buffers
* Timer knowlege  for emulating baud rate  ( speed in bits per second )


Earlier implementations exist on the Internet. I have salvaged two:
* https://gitlab.com/stappersg/tty0tty
* https://gitlab.com/stappersg/nullmodem

 
May this idea bring this project further.


Regards
Geert Stappers

P.S.
I want the share with you the fun  /  the pun I see in "Subject: real driver"

       driver:  that what pushes forward


:-)
-- 
Silence is hard to parse

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: real driver
  2021-07-07 19:18 real driver Geert Stappers
@ 2021-07-08  6:25 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-07-08  6:25 UTC (permalink / raw)
  To: Geert Stappers; +Cc: rust-for-linux

On Wed, Jul 07, 2021 at 09:18:36PM +0200, Geert Stappers wrote:
> In-Reply-To: <YOXB7FRqldZik2Xn@kroah.com>
> Previous-Subject: Re: [PATCH 00/17] Rust support
> 
> On Wed, Jul 07, 2021 at 05:02:04PM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Jul 07, 2021 at 03:07:50PM +0100, Wedson Almeida Filho wrote:
> > > > Last I looked at this thing, it was not
> > > > feature-complete compared to the in-kernel binder code, has that been
> > > > resolved and the needed filesystem changes added?
> > > 
> > > It is not feature-complete in comparison to the C one just yet, it is missing a
> > > few things but not for any fundamental reason -- we were mostly focusing on the
> > > kernel crate and tests.
> > 
> > I love it how you call "binderfs is missing" a "few things" :)
> > 
> > > Miguel's point is that it does implement the vast majority of binder features
> > > and is non-trivial, so it could be used as evidence that useful kernel drivers
> > > can be built with Rust; not just "transpiled" from C, but written with the Rust
> > > safety guarantees.
> > 
> > As Christoph said, and I and others have said before, binder is in no
> > way shape or form anything that resembles any sort of "driver" at all.
> > It is a crazy IPC mechanism that is tacked onto the side of the kernel.
> > Not to say that it doesn't have its usages, but the interactions between
> > binder and the rest of the kernel are very small and specific.
> > Something that almost no one else will ever write again.
> > 
> > Please work on a real driver to help prove, or disprove, that this all
> > is going to be able to work properly.  There are huge unanswered
> > questions that need to be resolved that you will run into when you do
> > such a thing.
> 
> Suggesting virtual null modem drivers.

That is not a "real" driver that has to deal with hardware as well as
the core kernel apis at the same time.

virtual drivers are simpler in that they only have to handle "one half"
of the problem, not the whole thing, which is what a "real" driver has
to do.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-08  6:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 19:18 real driver Geert Stappers
2021-07-08  6:25 ` Greg KH

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox