Re: PATCH: devfs mkIII test & review please.

2000-08-27 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Boris Popov
 writes:
>On Fri, 18 Aug 2000, Poul-Henning Kamp wrote:
>
>> Missing:
>> Rename
>> Subdirs.
>> Close some race conditions using guaranteed atomic operations.
>> Mountoption (ro ?) to prevent new devices from appearing in an instance.
>> All uses of cdevsw_add() needs to be use devfs_clone() instead.
>
>   How should 3rd party KLDs implement cloning function ? For now it
>seems to be impossible to use a single binary for DEVFS and non-DEVFS
>case.

Once the code has been shaken out, the cloning stuff will be standard.

Right now I prefer to keep as much as possible under #ifdef DEVFS.

See kern/vfs_conf.c for another good reason (besides KLD) to make
the cloning stuff standard.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-26 Thread Boris Popov

On Fri, 18 Aug 2000, Poul-Henning Kamp wrote:

> Missing:
> Rename
> Subdirs.
> Close some race conditions using guaranteed atomic operations.
> Mountoption (ro ?) to prevent new devices from appearing in an instance.
> All uses of cdevsw_add() needs to be use devfs_clone() instead.

How should 3rd party KLDs implement cloning function ? For now it
seems to be impossible to use a single binary for DEVFS and non-DEVFS
case.

--
Boris Popov
http://www.butya.kz/~bp/



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-22 Thread Mark Murray

> They can also be made by the driver using make_dev_alias().

Cool!

Man page please?

M
--
Mark Murray
Join the anti-SPAM movement: http://www.cauce.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-21 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Sheldon Hearn writes:
>
>
>On Sat, 19 Aug 2000 21:26:24 +0200, Poul-Henning Kamp wrote:
>
>> Ahh, right, this is something else than I thought:  These are
>> symlinks in the normal case, for instance:
>> 
>>  /dev/audio -> /dev/audio0
>
>What's the plan for things like these?  Are we going to take the soft
>option and teach /etc/rc to create symlinks for device nodes found on
>startup and require folks to make the rest themselves?  Or can this be
>handled gracefully in the kernel?

DEVFS supports symlinks.

Symlinks can be made from userland with the normal "ln -s"

They can also be made by the driver using make_dev_alias().

Who makes the symlinks and when should be decided by the driver writer.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Robert Drehmel writes:
>In <86054.966696645@critter>, Poul-Henning Kamp wrote:
>
>> Ok, I belive this one is fixed now, please try again.
>
>Yes, it boots.  But when using a kernel with ``options DEVFS'',
>there is no /dev/audio or /dev/mouse, for example; devfs has
>mounted itself to /dev.

Ahh, right, this is something else than I thought:  These are
symlinks in the normal case, for instance:

/dev/audio -> /dev/audio0

I have not coded the solution for the automagic for these yet,
for now you can create them by hand using the standard "ln -s ..."
command.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Robert Drehmel writes:
>In <86054.966696645@critter>, Poul-Henning Kamp wrote:
>
>> Ok, I belive this one is fixed now, please try again.
>
>Yes, it boots.  But when using a kernel with ``options DEVFS'',
>there is no /dev/audio or /dev/mouse, for example; devfs has
>mounted itself to /dev.

Yes, I expected such issues.  This means that the respective
drivers don't use make_dev() to generate a proper dev_t
for their use.

I will look at thost two drivers tonight, I'm just finishing
the floppy drivers clone() function.

If you want to take a shot at it yourself it's quite simple:
you need to call make_dev() somewhere, typically in *_attach
to generate and name the dev_t for the function.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Robert Drehmel

In <86054.966696645@critter>, Poul-Henning Kamp wrote:

> Ok, I belive this one is fixed now, please try again.

Yes, it boots.  But when using a kernel with ``options DEVFS'',
there is no /dev/audio or /dev/mouse, for example; devfs has
mounted itself to /dev.

-- 
Robert S. F. Drehmel <[EMAIL PROTECTED]>

FreeBSD i386 5.0-CURRENT #50: Sat Aug 19 19:08:04 CEST 2000
^^^^^^^^^^^^^^


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Robert Drehmel writes:

>I also noticed that top and ps are unusable since I first
>booted the kernel that was built from the sys tree patched 
>with ``devfsIII.patch''.
> 
>"""
>$ top
>kvm_open: proc size mismatch (32736 total, 1048 chunks)
>top: out of memory
>$ ps
>ps: proc size mismatch (8448 total, 1048 chunks)
>$ 
>"""

This is the usual excercise with recompiling libkvm, ps, top and
friends when certain central kernel structures changes size.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Robert Drehmel

In <85506.966672378@critter>,
Poul-Henning Kamp <[EMAIL PROTECTED]> wrote:

> Please configure DDB and INVARIANTS in your kernel when you 
> use this patch, and send me output from the "trace" command
> in DDB when it panics.

"""
Stopped at  i586_bz2+0x2:   fstl0(%edx)

i586_bz2(c0b32b80,3,2000,c65fa440,c7554eb8) at i586_bz2+0x2
spec_open(c7554eb8,c7554ecc,c021d154,c7554eb8,c6f5ad80) at spec_open+0x145
spec_vnoperate(c7554eb8,c6f5ad80,c65fa440,c02cde50,0) at spec_vnoperate+0x15
swapon(c65fa440,c7554f80,8055000,8051cfb,8051c0c) at swapon+0x7b
syscall2(2f,2f,2f,8051c0c,8051cfb) at syscall2+0x166
Xint0x80_syscall() at Xint0x80_syscall+0x25
"""

I also noticed that top and ps are unusable since I first
booted the kernel that was built from the sys tree patched 
with ``devfsIII.patch''.
 
"""
$ top
kvm_open: proc size mismatch (32736 total, 1048 chunks)
top: out of memory
$ ps
ps: proc size mismatch (8448 total, 1048 chunks)
$ 
"""

-- 
Robert S. F. Drehmel <[EMAIL PROTECTED]>

FreeBSD i386 5.0-CURRENT #43: Sat Aug 19 07:16:51 CEST 2000
^^^^^^^^^^^^^^


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Poul-Henning Kamp


Ok, I belive this one is fixed now, please try again.

Poul-Henning

In message <[EMAIL PROTECTED]>, Robert Drehmel writes:
>
>In <84513.966631292@critter>, Poul-Henning Kamp <[EMAIL PROTECTED]>
>wrote:
>
>> Please look at, test and review:
>> 
>> http://phk.freebsd.dk/patch/devfsIII.patch
>[...]
>
>When booting the kernel built from a sys tree patched with
>the above patch, i get the following: (dmesg.out is attached)
>
>"""
>Mounting root from ufs:/dev/ad0s1a
>devfs_mount(mp = 0xc0b2be00)
>devfs_mount: root vp = 0xc6f66b00
>devfs_statfs(mp = 0xc0b2be00)
>devfs_mount: at /dev
>cloned ad0s1b -> 0xc0b31b80
>
>
>Fatal trap 12: page fault while in kernel mode
>fault virtual address   = 0xe8
>fault code  = supervisor write, page not present
>instruction pointer = 0x8:0xc024176c
>stack pointer   = 0x10:0xc7560e3c
>frame pointer   = 0x10:0xc7560e54
>code segment= base 0x0, limit 0xf, type 0x1b
>= DPL 0, pres 1, def32 1, gran 1
>processor eflags= interrupt enabled, resume, IOPL = 0
>current process = 16 (swapon)
>interrupt mask  = none
>trap number = 12
>panic: page fault
>"""
>
>-- 
>Robert S. F. Drehmel <[EMAIL PROTECTED]>
>
>FreeBSD i386 5.0-CURRENT #39: Thu Aug 17 16:57:57 CEST 2000
--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-19 Thread Poul-Henning Kamp


Please configure DDB and INVARIANTS in your kernel when you 
use this patch, and send me output from the "trace" command
in DDB when it panics.

Poul-Henning

In message <[EMAIL PROTECTED]>, Robert Drehmel writes:
>This is a multi-part message in MIME format.
>--CD4992067B057DE3DC660AE0
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>In <84513.966631292@critter>, Poul-Henning Kamp <[EMAIL PROTECTED]>
>wrote:
>
>> Please look at, test and review:
>> 
>> http://phk.freebsd.dk/patch/devfsIII.patch
>[...]
>
>When booting the kernel built from a sys tree patched with
>the above patch, i get the following: (dmesg.out is attached)
>
>"""
>Mounting root from ufs:/dev/ad0s1a
>devfs_mount(mp = 0xc0b2be00)
>devfs_mount: root vp = 0xc6f66b00
>devfs_statfs(mp = 0xc0b2be00)
>devfs_mount: at /dev
>cloned ad0s1b -> 0xc0b31b80
>
>
>Fatal trap 12: page fault while in kernel mode
>fault virtual address   = 0xe8
>fault code  = supervisor write, page not present
>instruction pointer = 0x8:0xc024176c
>stack pointer   = 0x10:0xc7560e3c
>frame pointer   = 0x10:0xc7560e54
>code segment= base 0x0, limit 0xf, type 0x1b
>= DPL 0, pres 1, def32 1, gran 1
>processor eflags= interrupt enabled, resume, IOPL = 0
>current process = 16 (swapon)
>interrupt mask  = none
>trap number = 12
>panic: page fault
>"""

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PATCH: devfs mkIII test & review please.

2000-08-18 Thread Robert Drehmel

In <84513.966631292@critter>, Poul-Henning Kamp <[EMAIL PROTECTED]>
wrote:

> Please look at, test and review:
> 
> http://phk.freebsd.dk/patch/devfsIII.patch
[...]

When booting the kernel built from a sys tree patched with
the above patch, i get the following: (dmesg.out is attached)

"""
Mounting root from ufs:/dev/ad0s1a
devfs_mount(mp = 0xc0b2be00)
devfs_mount: root vp = 0xc6f66b00
devfs_statfs(mp = 0xc0b2be00)
devfs_mount: at /dev
cloned ad0s1b -> 0xc0b31b80


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xe8
fault code  = supervisor write, page not present
instruction pointer = 0x8:0xc024176c
stack pointer   = 0x10:0xc7560e3c
frame pointer   = 0x10:0xc7560e54
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 16 (swapon)
interrupt mask  = none
trap number = 12
panic: page fault
"""

-- 
Robert S. F. Drehmel <[EMAIL PROTECTED]>

FreeBSD i386 5.0-CURRENT #39: Thu Aug 17 16:57:57 CEST 2000
^^^^^^^^^^^^^^

Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 5.0-CURRENT #39: Thu Aug 17 16:57:57 CEST 2000
[EMAIL PROTECTED]:/usr/src/sys/compile/GIZMO
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 99967437 Hz
CPU: Pentium/P54C (99.97-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x525  Stepping = 5
  Features=0x1bf
real memory  = 83886080 (81920K bytes)
avail memory = 78176256 (76344K bytes)
Preloaded elf kernel "kernel.old" at 0xc035b000.
Intel Pentium detected, installing workaround for F00F bug
md0: Malloc disk
npx0:  on motherboard
npx0: INT 16 interface
pcib0:  on motherboard
pci0:  on pcib0
pci0:  at 0.0
isic0:  port 0xfce0-0xfcff mem 0xfedffc00-0xfedffc1f irq 11 at 
device 12.0 on pci0
isic0: ISAC 2085 Version A1/A2 or 2086/2186 Version 1.1 (IOM-2)
isab0:  at device 18.0 on pci0
isa0:  on isab0
pci0:  at 19.0
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
isa0: unexpected small tag 1
ata0 at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0
ata1 at port 0x170-0x177,0x376 irq 15 on isa0
atkbdc0:  at port 0x60,0x64 on isa0
atkbd0:  irq 1 on atkbdc0
psm0:  irq 12 on atkbdc0
psm0: model Generic PS/2 mouse, device ID 0
fdc0:  at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0:  at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
plip0:  on ppbus0
ppi0:  on ppbus0
lpt0:  on ppbus0
lpt0: Interrupt-driven port
sbc0:  at port 0x220-0x22f irq 5 drq 1 on isa0
pcm1:  on sbc0
sc0:  on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 on isa0
sio0: type 16550A
vga0:  at port 0x3c0-0x3df iomem 0xa-0xb on isa0
unknown:  can't assign resources
unknown: <16450 compatible COM device> can't assign resources
unknown:  can't assign resources
unknown:  can't assign resources
unknown:  can't assign resources
unknown:  can't assign resources
i4b: ISDN call control device attached
i4btel: 1 ISDN telephony interface device(s) attached
i4brbch: 2 raw B channel access device(s) attached
i4bipr: 1 IP over raw HDLC ISDN device(s) attached (VJ header compression)
i4bctl: ISDN system control port attached
i4btrc: 1 ISDN trace device(s) attached
i4bisppp: 1 ISDN SyncPPP device(s) attached
ad0: 814MB  [1654/16/63] at ata0-master using BIOSPIO
acd0: CDROM  at ata1-slave using BIOSPIO
Mounting root from ufs:/dev/ad0s1a



PATCH: devfs mkIII test & review please.

2000-08-18 Thread Poul-Henning Kamp


Please look at, test and review:

http://phk.freebsd.dk/patch/devfsIII.patch

Do not despair at the size of the patch, the majority of it are
the removal of the old DEVFS.  The kernel shrinks 3000 lines
because of this patch.

Please report the exact patch version in your emails, I will
be updating the patch on my web-server at regular intervals.

I intend to commit this stuff in the next week, and I hope
that we can make DEVFS the default pretty soon after.

Until you have seen a few "this works for me" emails, you
should probably not try this on a machine you don't want
hosed.

I will give a presentation at BSDcon about this entire ball
of wax: DEVFS, dev_t, disk-minilayer, struct bio/buf and
so on.  Be there!

Poul-Henning

README:

devfsIII.patch

Contains the patches needed to add the mkIII devfs in fs/devfs and remove
the mkI in miscfs/devfs.

(This patch includes the "vaccess.patch" as well, I expect that will be 
committed separately before this patch)

Apply patch, add "options DEVFS" to your kernel and tell me what happens.

Status:
Functional (at least on my diskless test box).

Drivers which do real cloning:
md
bpf
tun

Missing:
Rename
Subdirs.
Close some race conditions using guaranteed atomic operations.
Mountoption (ro ?) to prevent new devices from appearing in an instance.
All uses of cdevsw_add() needs to be use devfs_clone() instead.

Patch Version: Fri Aug 18 22:32:54 CEST 2000


Poul-Henning


  -- draft commit message(s) --

  Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)

  Remove old DEVFS support fields from dev_t.

  Make uid, gid & mode members of dev_t and set them in make_dev().

  Use correct uid, gid & mode in make_dev in disk minilayer.

  Use makedev() rather than make_dev() for MFSs magic devices to prevent
  DEVFS from noticing this abuse.

  Add a field for DEVFS inode number in dev_t.

  Add new DEVFS in fs/devfs.

  Add devfs cloning to:
disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) 
md(4), tun(4), bpf(4)

  If DEVFS add -d flag to /sbin/inits args to make it mount devfs.

  Add commented out DEVFS to GENERIC

  -- end --


--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message