Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 1996 15:32:39 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        phk@critter.tfs.com (Poul-Henning Kamp)
Cc:        hackers@freebsd.org
Subject:   Re: DEVFS
Message-ID:  <199607242232.PAA07400@shrimp.whistle.com>
In-Reply-To: <856.838243900@critter.tfs.com> from "Poul-Henning Kamp" at Jul 24, 96 11:31:40 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> Ok, I made the follwing changes, and now I can boot on devfs.  That
> is, It screws up right after the adjkerntz because the vnode locking
> seems to be hosed, but hey, we're getting further down the road.
> 
> I would love if somebody would help me get us to the point where
> DEVFS can at least be a valid option for the adventurous, anybody
> have a little time on their hands ?
> 
I have good news..
It has just been decided here at whistle by the guy that tells me
what to do next, that we need devfs, and that I should spend some time
on it :) :) :)
> This is to get init to mount DEVFS.  Keep a kernel without DEVFS
> on your disk, in which case this is a no-op and your system still
> works.
 the next thing to do is allow a fifofs node to be added to devfs.
I'll try do that this week.. that fixes
the syslog problem
and also I think it's important to allow symlinks..
they are defined but not implimented in devfs.

> 
now, for the changes....

> Index: init.c
> ===================================================================
> RCS file: /home/ncvs/src/sbin/init/init.c,v
> retrieving revision 1.11
> diff -u -r1.11 init.c
> --- init.c	1995/11/10 07:06:59	1.11
> +++ init.c	1996/07/24 13:53:08
> @@ -45,6 +45,7 @@
>  #endif /* not lint */
>  
>  #include <sys/param.h>
> +#include <sys/mount.h>
>  #include <sys/sysctl.h>
>  #include <sys/wait.h>
>  
> @@ -192,6 +193,9 @@
>  		(void)fprintf(stderr, "init: already running\n");
>  		exit (1);
>  	}
> +
> +	/* Try to mount devfs */
> +	mount(MOUNT_DEVFS, "/dev", MNT_NOEXEC|MNT_RDONLY, 0);
ok, that's a good start. You can even do it later than that.. in 
/etc/fstab is almost good enough..
I was actually wondering if it could be done at the same time
as / is mounted..


>  
>  	/*
>  	 * Note that this does NOT open a file...
> 
> This is because the slice code doesn't register any devices with
> DEVFS until they are opened.  This is pretty damn stupid in my
> oppinion, because I have no way of opening something I dont have
> a device-node for, do I ?
> 
> Index: wd.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/i386/isa/wd.c,v
> retrieving revision 1.112
> diff -u -r1.112 wd.c
> --- wd.c	1996/07/23 21:51:46	1.112
> +++ wd.c	1996/07/24 14:53:47
> @@ -514,6 +514,24 @@
>  			wd_registerdev(dvp->id_unit, lunit);
>  #ifdef DEVFS
>  			mynor = dkmakeminor(unit, WHOLE_DISK_SLICE, RAW_PART);
> +			du->dk_bdev = devfs_add_devswf(&wd_bdevsw, 0x50004,
> +						       DV_BLK, UID_ROOT,
> +						       GID_OPERATOR, 0640,
> +						       "wd%ds4e", unit);
> +			du->dk_bdev = devfs_add_devswf(&wd_cdevsw, 0x50004,
> +						       DV_CHR, UID_ROOT,
> +						       GID_OPERATOR, 0640,
> +						       "rwd%ds4e", unit);
> +
> +			du->dk_bdev = devfs_add_devswf(&wd_bdevsw, 0,
> +						       DV_BLK, UID_ROOT,
> +						       GID_OPERATOR, 0640,
> +						       "wd%da", unit);
> +			du->dk_bdev = devfs_add_devswf(&wd_cdevsw, 0,
> +						       DV_CHR, UID_ROOT,
> +						       GID_OPERATOR, 0640,
> +						       "rwd%da", unit);
> +
>  			du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor,
>  						       DV_BLK, UID_ROOT,
>  						       GID_OPERATOR, 0640,
why not make init try open the raw device
from  which root is mounted?

e.g. if root is the minor that coresponds to wd0a then open the minor
that coresponds to wd0

etc.


> 
> --
> Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
> http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
> whois: [PHK]                | phk@ref.tfs.com       TRW Financial Systems, Inc.
> Future will arrive by its own means, progress not so.
> 




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