tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to make character devices in non spec-fs file systems

>> Eh?  I don't understand.  Your character devices should be VCHR.
> Yes, but if I do that, the VFS code in the kernel will call specfs
> functions on my vnode, because there are hardcoded checks like:

>       if (vn->v_type == VCHR)
>               call into specfs code(vn);

Yes.  That's how device special files work.

> And because my vnode is not initialised by specfs, it panics.  I am
> not using specfs for my character device.  I am using a separately
> mounted filesystem called "FreeBSD devfs".

specfs is not a filesystem in the sense of something mountable.  It's a
collection of code for implementing various special things, such as
device special files, which othewise would mean a bunch of relatively
complicated code duplicated in every device-supporting filesystem.  I'd
suggest you look at how existing filesystems, like ffs and nfs,
implement VCHR and VBLK vnodes; that should be able to guide you in
when and how you need to make calls into the specfs code.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index