Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2005 01:32:26 -0800
From:      "Ted Mittelstaedt" <tedm@toybox.placo.com>
To:        "Rob" <spamrefuse@yahoo.com>, "FreeBSD questions" <freebsd-questions@freebsd.org>
Subject:   RE: /dev/io , /dev/mem : only used by Xorg?
Message-ID:  <LOBBIFDAGNMAMLGJJCKNGEIOFAAA.tedm@toybox.placo.com>
In-Reply-To: <20050228022622.46627.qmail@web54003.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org
> [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Rob
> Sent: Sunday, February 27, 2005 6:26 PM
> To: FreeBSD questions
> Subject: /dev/io , /dev/mem : only used by Xorg?
> 
> 
> 
> Hello,
> 
> This is on 5.3-STABLE.
> 
> On my desktop FreeBSD PC:
> 
>   $ fstat /dev/io /dev/mem
> 
> only shows that Xorg is using these devices.
> 
> Googling on /dev/io and /dev/mem, finds only Xorg
> related discussions and problems.
> 
> 
> I now also have Server PC, that does not run X at all.
> I'm about to remove the devices io and mem
> in the kernel configuration. Is that OK?
> 
> How about the /dev/random device? Could that go too?
> 
> Thanks,
> Rob.
> 

Rob, you are very mistaken about that the devices in /dev are.

These devices, /dev/mem, /dev/io, /dev/random and the like, do
not in fact actually reside in the /dev directory.

Instead, they are part of the kernel itself.

All the /dev files are, /dev/random, /dev/ad0 and so on, are simple
files that take up only a few bytes of space.  They are convenient
"hook points" to use to get to these devices.  That is, when a program
accesses /dev/random, it isn't actually opening that file.  Instead,
the kernel intercepts that call and supplies the program opening
that device with the output of the actual device.

This is why these device files are created with the mknod utility,
rather than just copying a file to /dev/random - since doing that is
accessing the device, not creating the device file.

So, deleting these /dev devices saves you practically no space at
all, and does not in fact delete the devices - it only deletes the
access point to them.  The devices are still there in the kernel.

Ted



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?LOBBIFDAGNMAMLGJJCKNGEIOFAAA.tedm>