# Odd Serial Console Behaviour



## jeremyj84 (Jan 29, 2011)

I seem to be running into an issue when attempting to use serial console.

The remote machine is configured with the follow parameters:

/boot/loader.conf:

```
boot_multicons="YES"
boot_serial="YES"
console="vidconsole,comconsole"
```

/etc/ttys:

```
ttyu0  "/usr/libexec/getty std.9600"   vt100   on  secure
```


```
FreeBSD 8.2-PRERELEASE #1: Thu Dec 23 22:31:11 MST 2010
```


```
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart0: console (9600,n,8,1)
```

During the boot phase I do see the boot loader and kernel loader, when getty comes up I see no login prompt on the serial console.


----------



## _martin (Jan 30, 2011)

maybe I'm shooting blanks here but did you try to set the terminal type to a dialup in /etc/ttys for ttyu0 ?


----------



## jeremyj84 (Jan 30, 2011)

Nope, its vt100 which works fine on my amd64 machine, but neither of my i386 machines will display the login prompt, getty shows its up and I have done everything I can think of to gain further information on the problem.


----------



## _martin (Jan 30, 2011)

jeremyj84 said:
			
		

> Nope, its vt100 which works fine on my amd64 machine


mhm, might be so .. I was just saying because /etc/ttys on my amd64 says:

```
ttyu0   "/usr/libexec/getty std.9600"   dialup  on secure
```

and works fine - FreeBSD <--> FreeBSD connection


----------



## jeremyj84 (Jan 30, 2011)

Just tested with it as dialup and the issue still exists.

Its worth noting I am using minicom on Gentoo


----------



## _martin (Jan 30, 2011)

Maybe a stupid question from my side but what speed settings are you using on gentoo side - 9600,n,8,1 ?

Can you see the getty process forked for ttyu0 ?

`# ps ax |grep ttyu0`

```
foxi:(~)# ps ax |grep ttyu0
2979  u0  Is+    0:00.00 /usr/libexec/getty std.9600 ttyu0
foxi:(~)#
```


----------



## jeremyj84 (Feb 1, 2011)

getty is forked for ttyu0


```
# ps awux | grep getty

root    29459  0.0  0.2  3352  1112  u0- IEs+ Sat07PM   0:00.01 /usr/libexec/getty std.9600 ttyu0
```

speed settings on the gentoo side are 9600,n,8,1


----------



## gus3 (Mar 8, 2011)

I've seen the same behavior, on my AMD Athlon (32-bit) with a Via 686 chipset. I ran truss on the getty process, and this is what I got:


```
1040: read(0,"\r",1)				 = 1 (0x1)
 1040: sigaction(SIGINT,{ SIG_IGN SA_RESTART ss_t },{ 0x8049710 SA_RESTART ss_t }) = 0 (0x0)
 1040: write(1,"\r\n",2)			 = 2 (0x2)
 1040: setitimer(0,{0.000000, 0.000000 },{0.000000, 0.000000 }) = 0 (0x0)
 1040: sigaction(SIGALRM,{ SIG_DFL SA_RESTART ss_t },{ SIG_DFL SA_RESTART ss_t }) = 0 (0x0)
 1040: ioctl(0,TIOCFLUSH,0xbfbfedb0)		 = 0 (0x0)
 1040: ioctl(0,FIONBIO,0xbfbfeddc)		 = 0 (0x0)
 1040: ioctl(0,FIOASYNC,0xbfbfeddc)		 = 0 (0x0)
 1040: ioctl(0,TIOCSETA,0x804fb40)		 = 0 (0x0)
 1040: sigprocmask(SIG_BLOCK,0x0,0x0)		 = 0 (0x0)
 1040: sigprocmask(SIG_BLOCK,0x0,0x0)		 = 0 (0x0)
 1040: sigaction(SIGINT,{ 0x8049710 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
 1040: write(1,"\r\nFreeBSD/i386 (andrew.localdo"...,54) = 54 (0x36)
 1040: ioctl(0,TIOCSETA,0x804fb40)		 = 0 (0x0)
```

The first line is where I pressed Enter. The next-to-last line shows that getty thinks it's sending to the serial port, but that output disappears before it reaches my "dumb terminal" (Linux laptop running minicom).

Without 
	
	



```
console="comconsole"
```
 in /boot/loader.conf, I do get a login prompt, but no console output. If I add that line to /boot/loader.conf, I get console output, but no login prompt, even though the getty process tries.

(I've also tried logging in "blind", without seeing what I type or any prompts, but that attempt hangs sometime after getty exec()'s login.)


----------



## gus3 (Mar 8, 2011)

Sorry for the double-post, but I just found this from last year:

http://lists.freebsd.org/pipermail/freebsd-questions/2010-March/214126.html

This may be related, or not. The "kldload uart" fix is worth a try.


----------

