Conectando a uma porta serial com VMWare ESXi e Ubuntu

1

Usando o VMWare ESXi 5.0.0, tendo um sistema operacional convidado Ubuntu 12.04.3, atualizado para a data 05 de janeiro de 2014.

Eu adicionei "Serial port 1" ao sistema operacional Ubuntu 12.04 (vamos chamá-lo "MyUbuntuPC ").
A porta serial 1 é definida para usar uma porta serial física do caminho: /dev/char/serial/uart0 (é a única opção disponível na lista suspensa)
A porta serial é definida como "Conectada" e "conectada ao ligar".

As configurações do BIOS para o sistema operacional convidado , referentes à porta serial, são válidas (IMHO): "Porta serial A" e "Porta serial B" estão configuradas para "Auto". O "Modo" da porta serial B está configurado para "Normal" (outras opções são "IrDA", "ASK-IR" e "FIR").

Algumas informações adicionais via linha de comando, executadas no sistema operacional convidado / Ubuntu:

root@MyUbuntuPC:~# dmesg | grep ttyS
[    0.621913] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.693788] 00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    4.887004] ttyS2: LSR safety check engaged!
[    4.887466] ttyS2: LSR safety check engaged!
[    4.888102] ttyS3: LSR safety check engaged!
[    4.888557] ttyS3: LSR safety check engaged!

root@MyUbuntuPC:~# ll /dev/ttyS{0,1}
crw-rw---- 1 root dialout 4, 64 Jan  5 18:29 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Jan  5 18:29 /dev/ttyS1

root@MyUbuntuPC:~# groups root
root : root dialout

root@MyUbuntuPC:~# setserial -g /dev/ttyS{0..3}
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 3

root@MyUbuntuPC:~# stty -F /dev/ttyS0 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

root@MyUbuntuPC:~# stty -F /dev/ttyS0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc
-ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl
echoke

root@MyUbuntuPC:~# stty -F /dev/ttyS1 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

root@MyUbuntuPC:~# stty -F /dev/ttyS1 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc
-ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl
echoke

root@MyUbuntuPC:~# cu -d -l /dev/ttyS0 -s 115200
cu: fconn_open: Opening port /dev/ttyS0 (speed 115200)
cu: fconn_set: Changing setting to 0, 0, 2
Connected.
~.cu: Exit status 0
cu: fconn_close: Closing connection

Disconnected.

Eu separei cada comando & é a saída correspondente com um novo caractere de linha para melhor legibilidade. Como pode ser visto, o processo cu escreve "Conectado", mas posso esperar por horas e nada acontecerá.

Eu tenho outro PC com o Ubuntu 12.04.2 LTS (vamos chamá-lo de "nonVirtual Ubuntu"). Não é executado em uma máquina virtual. Ele executa um processo de ser2net que permite que meu Ubuntu virtual ( com sucesso ) se conecte à porta serial do "nonVirtual Ubuntu" através da rede. O arquivo de configuração de ser2net contém a linha:

3000:telnet:1800:/dev/ttyS0:115200 8DATABITS NONE 1STOPBIT banner

Informações adicionais com a linha de comando:

root@nonVirtual Ubuntu:~# dmesg | grep ttyS
[    0.443093] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.464725] 00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.484971] 0000:00:16.3: ttyS4 at I/O 0xf0e0 (irq = 19) is a 16550A
[    0.507168] 0000:02:00.0: ttyS5 at I/O 0xe030 (irq = 16) is a ST16650V2
[    0.529410] 0000:02:00.1: ttyS6 at I/O 0xe020 (irq = 17) is a ST16650V2
[    0.551638] 0000:02:00.2: ttyS7 at I/O 0xe010 (irq = 18) is a ST16650V2
[    0.573873] 0000:02:00.3: ttyS8 at I/O 0xe000 (irq = 19) is a ST16650V2

Eu não entendo porque o processo cu não pode fazer uma conexão com a placa que está conectada à porta serial na máquina virtual. (Eu também tentei conectar usando /dev/ttyS1 ).
Eu acho que tem algo a ver com a interação do Linux com o VMWare ESXi?

    
por Dor 05.01.2014 / 18:21

0 respostas