diff --git a/README b/README deleted file mode 100644 index b8d87b0..0000000 --- a/README +++ /dev/null @@ -1,52 +0,0 @@ - - -tty0tty - linux null modem emulator v1.2 - - -This is the tty0tty directory tree: - - module - linux kernel module null-modem - pts - null-modem using ptys (without handshake lines) - - -pts (unix98): - - When run connect two pseudo-ttys and show the connection names: - - (/dev/pts/1) <=> (/dev/pts/2) - - the connection is: - - TX -> RX - RX <- TX - - - -module: - - The module is tested in kernel 3.10.2 (debian) - - When loaded, create 8 ttys interconnected: - /dev/tnt0 <=> /dev/tnt1 - /dev/tnt2 <=> /dev/tnt3 - /dev/tnt4 <=> /dev/tnt5 - /dev/tnt6 <=> /dev/tnt7 - - the connection is: - - TX -> RX - RX <- TX - RTS -> CTS - CTS <- RTS - DSR <- DTR - CD <- DTR - DTR -> DSR - DTR -> CD - - -Requirements: - - for module build is necessary kernel-headers or kernel source - - -For e-mail suggestions : lcgamboa@yahoo.com diff --git a/README.md b/README.md index 87e521d..5e0fe98 100644 --- a/README.md +++ b/README.md @@ -70,26 +70,37 @@ cd tty0tty-1.2/module make ``` -Copy the new kernel module into the kernel modules directory +Install the new kernel module into the kernel modules directory ``` -sudo cp tty0tty.ko /lib/modules/$(uname -r)/kernel/drivers/misc/ +sudo make modules_install ``` -Load the module +NOTE: if module signing is enabled, in order for depmop to complete, you may +need to create file certs/x509.genkey in the kernel modules include directory +and generate file signing_key.pem using openssl, guides are available online. + +Appropriate permissions are provided thanks to a udev rule located under: ``` -sudo depmod -sudo modprobe tty0tty +/etc/udev/rules.d/50-tty0tty.rules ``` -You should see new serial ports in ```/dev/``` (```ls /dev/tnt*```) -Give appropriate permissions to the new serial ports +NOTE: you need to add yourself to the dialout group (and do a full relog), with: ``` -sudo chmod 666 /dev/tnt* +sudo usermod -a -G dialout ${USER} ``` +Load the module + +``` +sudo udevadm control --reload-rules +sudo depmod +sudo modprobe tty0tty +``` + +You should see new serial ports in ```/dev/``` (```ls /dev/tnt*```) You can now access the serial ports as /dev/tnt0 (1,2,3,4 etc) Note that the consecutive ports are interconnected. For example, /dev/tnt0 and /dev/tnt1 are connected as if using a direct cable. Persisting across boot: diff --git a/module/50-tty0tty.rules b/module/50-tty0tty.rules new file mode 100644 index 0000000..2f4308f --- /dev/null +++ b/module/50-tty0tty.rules @@ -0,0 +1,5 @@ +ACTION!="add", GOTO="default_end" + +KERNEL=="tnt[0-9]", GROUP="dialout" + +LABEL="default_end" diff --git a/module/Makefile b/module/Makefile index 0739ea0..dc42616 100644 --- a/module/Makefile +++ b/module/Makefile @@ -27,6 +27,7 @@ default: modules_install: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install + install -m 644 50-tty0tty.rules /etc/udev/rules.d endif