Tiny Core Linux
General TC => Remasters / Remixes - Unofficial => Topic started by: nick65go on August 14, 2020, 03:26:04 PM
-
getty: Set up for high-speed serial UART communication
The limiting factor on the UART speed is that UART Clock. It only allows baudrates of UART_CLK/16
tc@box:~$ sudo cat /sys/class/tty/tty1/subsystem/ttyS0/uartclk
1843200
tc@box:~$ calc 1843200/16
115200
tc@box:~$ sudo stty -F /dev/tty `calc 38400*3`
tc@box:~$ stty | grep speed
speed 115200 baud; line = 0;
tc@box:~$ sudo stty -F /dev/tty `calc 38400*30`
tc@box:~$ stty | grep speed
speed 1152000 baud; line = 0;
tc@box:~$ cat /sbin/autologin
#!/bin/busybox sh
. /etc/init.d/tc-functions
useBusybox
if [ -f /var/log/autologin ] ; then
exec /sbin/getty 1152000 tty1
else
touch /var/log/autologin
exec login -f root
fi
# /etc/inittab: init configuration for busybox init.
# Boot-time system configuration/initialization script.
#
::sysinit:/etc/init.d/rcS
# /sbin/getty respawn shell invocations for selected ttys.
# data flow rate as 38.4k 115.2k 230.4k 460.8k. 921.6k 1152000
tty1::respawn:/sbin/getty -nl /sbin/autologin 1152000 tty1
tty2::respawn:/sbin/getty 38400 tty2
Summary: if you like to experiment with TC scripts, here is how I increased the speed 30 times for login.
Of course double of nothing is nothing, so do not expect more than few milliseconds gain, it was just for fun.
-
The speed only affects serial consoles. It's a no-op for linux consoles.
-
Hi nick65go
... # /etc/inittab: init configuration for busybox init.
...
# data flow rate as 38.4k 115.2k 230.4k 460.8k. 921.6k 1152000
...
...
115.2k is an integer multiple (16) of 1843200. 1152000 is not an integer multiple (1.6) of 1843200. Baud rates need to be an integer
multiple of the clock.
-
i understand. those were the values that allowed me to "see" with grep without errors. So maybe div by 16 is a mistake from where I read this info. samples, try and errors:
tc@box:~$ sudo stty -F /dev/tty `calc 115200*9`
stty: invalid argument '1036800'
tc@box:~$ sudo stty -F /dev/tty `calc 115200*10`
tc@box:~$ stty | grep speed
speed 1152000 baud; line = 0;
tc@box:~$
but as curaga observed, is about ttyS# (serial) not tty# (terminal). basically what i did was to test the parameters that I did not understand.
-
just ftr , see also
TC Max Serial Port Baudrate - https://forum.tinycorelinux.net/index.php?topic=15436.0