NMDM(4)

πŸ’– NMDM(4) πŸ’–

okay bestie, gather round, because today we're talking about nmdm β€” the nullmodem terminal driver, straight out of the Kernel Interfaces Manual. yes it's a kernel driver, yes it's giving unbothered, and yes you're gonna understand it. periodt. πŸŽ€


✨ NAME ✨

nmdm β€” nullmodem terminal driver πŸ¦‹


✨ SYNOPSIS ✨

so like, you wanna compile this driver into the kernel? iconic. drop this line into your kernel configuration file:

device nmdm

or, alternatively, if you're more of a "load it as a module at boot time" kind of girlie, put this in loader.conf(5) instead:

nmdm_load="YES"

pick your lane, both slay. πŸ’…


✨ DESCRIPTION ✨

okay so here's the whole vibe: the nmdm driver hands you two tty(4) devices, and it wires them together with a virtual β€œnull modem” cable. that's it. that's the whole thing. a fake cable. no cap. πŸ”₯

now, the ✨interesting✨ part. if either of those two tty devices has the CDSR_OFLOW bit set in their line discipline β€” that's the β€œstty dsrflow” thing btw, iykyk β€” then the nmdm device will emulate the speed that's configured in the termios(4) settings. speed match, but make it virtual. πŸ’«

and the way that this speed emulation works? it runs independently in the two directions, and it's controlled by the slower end's termios settings β€” specifically c_ispeed, c_ospeed, CS5 ... CS8, CSTOPB and PARENB. slowest one sets the tempo, fr fr. the way the slower end is literally the main character. πŸ‘‘


✨ FILES ✨

  • /dev/nmdmN[AB] β€” nullmodem device nodes. where the A node has a matching B node 🫢

also! the nmdm driver implements β€œon-demand device creation”, which is exactly as cute as it sounds: you just access a given instance in /dev and boom, it creates it. no setup, no ceremony, it just shows up for you. ✨


✨ DIAGNOSTICS ✨

None. πŸ’€

like genuinely. nothing. no drama, no errors, no nothing. it's that chill.


✨ SEE ALSO ✨


✨ HISTORY ✨

the nmdm driver first appeared in FreeBSD 4.4. a legend from day one, honestly. 🌈


and that's the whole page bestie!! this one came from the Debian side of things, dated January 23, 2018 β€” so like, a little vintage, but she still ate. πŸ’– go forth and null-modem responsibly. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from