General TC > Remasters / Remixes - Unofficial

getty: Set up for high-speed serial UART communication

(1/1)

nick65go:
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

--- Code: ---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;
--- End code ---


--- Code: ---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
--- End code ---


--- Code: ---# /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
--- End code ---
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.

curaga:
The speed only affects serial consoles. It's a no-op for linux consoles.

Rich:
Hi nick65go

--- Quote from: nick65go on August 14, 2020, 03:26:04 PM --- ...
--- Code: ---# /etc/inittab: init configuration for busybox init.

 ...
# data flow rate as 38.4k 115.2k 230.4k 460.8k. 921.6k 1152000

 ...
--- End code ---
...
--- End quote ---

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.

nick65go:
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:

--- Code: ---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:~$
--- End code ---

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.

mocore:

just ftr , see also 
TC Max Serial Port Baudrate  - https://forum.tinycorelinux.net/index.php?topic=15436.0

Navigation

[0] Message Index

Go to full version