Re: /dev/one - why not /dev/repeat?

Jason Burrell (jburrell@crl.com)
Wed, 23 Dec 1998 17:44:47 -0600


--O5XBE6gyVG5Rl6Rj
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 23, 1998 at 07:23:56PM +0100, jens@pinguin.conetix.de wrote:
> On Tue, Dec 22, 1998 at 11:52:40PM +0100, Lars Marowsky-Br=E9e wrote:
>=20
> >> Are there advantages in having something like /dev/repeat?
> > I suggest we implement a /dev/calculator, so everyone who needs to solve
> > an equation can do it just by using cat/echo:
> > echo 2+3*4 >/dev/calculator
> > cat /dev/calculator
> > 14
> > Maybe we could make it understand RPN!
>=20
> What about an X server as a device?
>=20
> while true ; do
> cat /dev/x-display | svgalib_pixmap_viewer
> kill svgalib_pixmap_viewer
> done
>=20

Personally, I think we ought to code the entire contents of /usr/bin
and /bin into the kernel. We also need the all known GNU tools in the
kernel, along with awk, sed, and grep.

Seriously, folks, this is totally ridiculous. (Yes, I realize that
responses like "Let's code the X server as a device" are jokes. :)

/dev/zero exists so that people can mmap it. It does not exist to
provide an endless stream of null bytes. Those are easy enough to
produce on your own. The same goes with ones, repeated patterns,
and alternating bits.

/dev/random and /dev/urandom exist because they use privlidged state
information to seed the random number generator.

Repeated patterns can be done using 'yes', a version of 'yes' hacked
to remove newlines and spaces, a statically linked version of 'yes',
PERL, C, Python, and other such things.

If platform compatability is a concern, this isn't the way to go
anyway. Since it obviously isn't a concern if something like
/dev/repeat is going to be used, write a cheap little program in C and
use it instead of reading from /dev/repeat if you need an efficient
way to do this in PERL or other "slow" interpreted language.

This perhaps should be implemented a lot of ways, but implementing=20
it as a kernel device isn't one of them.

--=20
-----BEGIN GEEK CODE BLOCK-----
GMD/CS/S d-(++) s: a? C++++ UL++++ P+>+++ L+++(++++) E- W-- N+ o>++ K w---
!O M-- V-- PS+(+++) PE+(+++) Y++ PGP+++ t+ 5++ X+@ R+++ tv++ b+ DI D--- G++
e++>+++++ h* r y?=20
-----END GEEK CODE BLOCK-----

--O5XBE6gyVG5Rl6Rj
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: Jc1W5uROz+uf0uV/jzKUkqF9GF9ActXI

iQA/AwUBNoFyB+st32QKzeTmEQJhdwCgh8EMpTRt3gLipef/bigpgAA0oyYAn1zi
AWkcuQWZ8dJu2syOv/qBtjXe
=m7ap
-----END PGP SIGNATURE-----

--O5XBE6gyVG5Rl6Rj--

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