Re: Making a kmod

From: Milan Obuch <freebsd-hackers_at_dino.sk>
Date: Sat, 18 Oct 2025 21:17:25 UTC
On Sat, 18 Oct 2025 17:05:00 -0400
Aryeh Friedman <aryeh.friedman@gmail.com> wrote:

> I need to make a kernel mod that connects to a Vantech 2S1P PCIe
> serial/par. combo card that has a 74LS02 hooked up to in roughly the
> same way that I2C is interfaced to in lpbb(4) is for bit banging on
> the LS02.   I got /dev/lpt0, etc. on the bhyve host I am used and have
> passed it through and the guest sees the 2S1P but thats where I stand
> and to farther it appears I neeed a kmod since the guest is seeing the
> device but not attaching a driver:
> 
> pci0: <simple comms, UART> at device 3.0 (no driver attached)
> pci0: <simple comms, UART> at device 5.0 (no driver attached)
> pci0: <simple comms, parallel port> at device 6.0 (no driver attached)
> 
> none0@pci0:0:3:0:    class=0x070002 rev=0x00 hdr=0x00 vendor=0x9710
> device=0x9912 subvendor=0xa000 subdevice=0x1000
>     vendor     = 'MosChip Semiconductor Technology Ltd.'
>     device     = 'PCIe 9912 Multi-I/O Controller'
>     class      = simple comms
>     subclass   = UART
> none1@pci0:0:5:0:    class=0x070002 rev=0x00 hdr=0x00 vendor=0x9710
> device=0x9912 subvendor=0xa000 subdevice=0x1000
>     vendor     = 'MosChip Semiconductor Technology Ltd.'
>     device     = 'PCIe 9912 Multi-I/O Controller'
>     class      = simple comms
>     subclass   = UART
> none2@pci0:0:6:0:    class=0x070103 rev=0x00 hdr=0x00 vendor=0x9710
> device=0x9912 subvendor=0xa000 subdevice=0x2000
>     vendor     = 'MosChip Semiconductor Technology Ltd.'
>     device     = 'PCIe 9912 Multi-I/O Controller'
>     class      = simple comms
>     subclass   = parallel port
>

Did you looked at puc driver? Off my head, MosChip devices are there,
among other ones, some time ago I was able to add new board with simple
addition of its description. I do not have the details of the board and
necessary modification. I think it is really worth of some test, puc
driver is designed for such cards.

Regards,
Milan