2003-08-20 02:23:06

by Thomas Molina

[permalink] [raw]
Subject: Console on USB

I have just spent a very frustrating evening trying to get console on USB
working. My laptop does not have regular DB-9 serial connectors, only
USB. So I ordered a USB to serial converter, configured a 2.6.0-test3
kernel, added a console=/dev/ttyUSB0 to the kernel command line and
connected this to my desktop with a null modem adapter. However, I am
unable to get output from this setup on the desktop. On another setup I
can get a normal serial console output, so I am fairly confident I can set
things up correctly.

Googling around and doing a search on lkml archives gave some minimal
help, but I can find very little info past early to mid 2.5 kernels. The
configuration doesn't quite seem to work the way I read documentation.
For instance, the web pages I can find indicate I should be able to build
this modular; however the configuration makes the setting of console on
usb depend on USB being y and EXPERIMENTAL being defined.

In /var/log/messages I can see the USB-to-serial converter being recogized
and the driver being loaded, just before the synaptics touchpad is probed.

It looks like things are correct, but, as I said, I am unable to get
output. Am I headed for frustration, or is there some advice to get good
results?

Is there any advice I might be able to use to get this going? I really
want to be able to catch some oops output.


2003-08-20 04:46:37

by Pete Zaitcev

[permalink] [raw]
Subject: Re: Console on USB

> So I ordered a USB to serial converter, configured a 2.6.0-test3
> kernel, added a console=/dev/ttyUSB0 to the kernel command line and
> connected this to my desktop with a null modem adapter.

What made you think this will work?!

> Is there any advice I might be able to use to get this going?

You'd have to write it. Grep for register_console for starters.
But I do not advise it, see below.

> I really want to be able to catch some oops output.

If oops happens with interrupts closed, forget about it.
USB needs interrupts to work. This is one of the reasons nobody
bothered to implement console over USB serial.

You will have a better chance using Ingo's netconsole, if a patch
for your Ethernet driver exists.

-- Pete

2003-08-20 04:58:48

by Randy.Dunlap

[permalink] [raw]
Subject: Re: Console on USB

>> So I ordered a USB to serial converter, configured a 2.6.0-test3
>> kernel, added a console=/dev/ttyUSB0 to the kernel command line and
>> connected this to my desktop with a null modem adapter.
>
> What made you think this will work?!

Maybe the drivers/usb/serial/Kconfig file?

config USB_SERIAL_CONSOLE
bool "USB Serial Console device support (EXPERIMENTAL)"
depends on USB_SERIAL=y && EXPERIMENTAL

>> Is there any advice I might be able to use to get this going?
>
> You'd have to write it. Grep for register_console for starters.
> But I do not advise it, see below.

usb/serial/console.c:255: register_console(&usbcons);

>> I really want to be able to catch some oops output.
>
> If oops happens with interrupts closed, forget about it.
> USB needs interrupts to work. This is one of the reasons nobody
> bothered to implement console over USB serial.

The call to register_console() also happens very late in the boot
sequence, so if your oops is early, USB console won't help.

> You will have a better chance using Ingo's netconsole, if a patch
> for your Ethernet driver exists.

Certainly, I agree.

~Randy



2003-08-20 05:11:13

by Pete Zaitcev

[permalink] [raw]
Subject: Re: Console on USB

> Date: Tue, 19 Aug 2003 21:58:45 -0700 (PDT)
> From: "Randy.Dunlap" <[email protected]>

> >> Is there any advice I might be able to use to get this going?
> >
> > You'd have to write it. Grep for register_console for starters.
>
> usb/serial/console.c:255: register_console(&usbcons);

Eeek, eating a crow now.

> >> I really want to be able to catch some oops output.
> >
> > If oops happens with interrupts closed, forget about it.
> > USB needs interrupts to work. This is one of the reasons nobody
> > bothered to implement console over USB serial.
>
> The call to register_console() also happens very late in the boot
> sequence, so if your oops is early, USB console won't help.

It's true for many consoles, that's why sparc allows
"-p" in SILO options, for instance. I think either wli or willy
did "early VGA printk" patch.

Interrupts are a major problem. Also, the USB stack is pretty
thick.

-- Pete

2003-08-20 07:15:52

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: Console on USB

On Tue, 19 Aug 2003, Randy.Dunlap wrote:

> > You will have a better chance using Ingo's netconsole, if a patch
> > for your Ethernet driver exists.
>
> Certainly, I agree.

I think Matt Mackall has an updated patch which looks frightfully easy to
add device support to, i think he may have even made it generic (he
basically just calls netdriver isrs)

2003-08-20 07:12:32

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: Console on USB

On Tue, 19 Aug 2003, Thomas Molina wrote:

> It looks like things are correct, but, as I said, I am unable to get
> output. Am I headed for frustration, or is there some advice to get good
> results?
>
> Is there any advice I might be able to use to get this going? I really
> want to be able to catch some oops output.

How about forgetting the console= part and just booting and then set the
console log level so that you're able to get oopses to hit the USB
console.

2003-08-20 07:39:13

by stefan.eletzhofer

[permalink] [raw]
Subject: Re: Console on USB

Hi,
AFAIK there was a network console patch on the list recently.

IIRC it sends UDP packets to a receiving daemon (or netcat ;),
and works w/o interrupts. I believe, though, that there are
only certain nics supported.

Cheers,
Stefan E.
--
Eletztrick Computing - Customized Linux Development
Stefan Eletzhofer, Marktstrasse 43, DE-88214 Ravensburg
http://www.eletztrick.de

2003-08-20 16:14:58

by Greg KH

[permalink] [raw]
Subject: Re: Console on USB

On Tue, Aug 19, 2003 at 10:20:51PM -0500, Thomas Molina wrote:
> I have just spent a very frustrating evening trying to get console on USB
> working. My laptop does not have regular DB-9 serial connectors, only
> USB. So I ordered a USB to serial converter,

Which usb to serial converter? Not all of them work with Linux. Does
this device work with Linux _not_ as a serial console device?

> configured a 2.6.0-test3
> kernel, added a console=/dev/ttyUSB0 to the kernel command line and
> connected this to my desktop with a null modem adapter. However, I am
> unable to get output from this setup on the desktop. On another setup I
> can get a normal serial console output, so I am fairly confident I can set
> things up correctly.

Which "serial console" are you trying to get working? The kernel log
console, or a login console?

> Googling around and doing a search on lkml archives gave some minimal
> help, but I can find very little info past early to mid 2.5 kernels. The
> configuration doesn't quite seem to work the way I read documentation.
> For instance, the web pages I can find indicate I should be able to build
> this modular; however the configuration makes the setting of console on
> usb depend on USB being y and EXPERIMENTAL being defined.

What web page says you can build this modular? You have to build it
into the kernel.

> In /var/log/messages I can see the USB-to-serial converter being recogized
> and the driver being loaded, just before the synaptics touchpad is probed.

Can you show us the relevant part of the kernel logs?

> It looks like things are correct, but, as I said, I am unable to get
> output. Am I headed for frustration, or is there some advice to get good
> results?

You are headed for frustration. USB serial console was a neat hack, but
pretty pointless. It has the following problems:
- can't see oopses before USB starts up, and USB starts up
almost last in the system boot process.
- really can not capture oopses very well as USB is interrupt
driven
- most usb-serial converters have a very small buffer, so you
constantly get over-runs in printing out console messages
(meaning that only a few of the devices will even work
properly, you usually have to buy one of the expensive ones to
see all messages.)

> Is there any advice I might be able to use to get this going? I really
> want to be able to catch some oops output.

Buy a machine with a serial port. That's my recommendation :)

Good luck,

greg k-h

2003-08-20 16:57:02

by John Bradford

[permalink] [raw]
Subject: Re: Console on USB

> > Is there any advice I might be able to use to get this going? I really
> > want to be able to catch some oops output.
>
> Buy a machine with a serial port. That's my recommendation :)

That could be difficult in a few years time. What are we going to do
when we start getting bugs that are only reproducable on laptops with
no legacy ports?

John.

2003-08-20 17:08:27

by Greg KH

[permalink] [raw]
Subject: Re: Console on USB

On Wed, Aug 20, 2003 at 06:08:45PM +0100, John Bradford wrote:
> > > Is there any advice I might be able to use to get this going? I really
> > > want to be able to catch some oops output.
> >
> > Buy a machine with a serial port. That's my recommendation :)
>
> That could be difficult in a few years time. What are we going to do
> when we start getting bugs that are only reproducable on laptops with
> no legacy ports?

Use the previously mentioned netconsole code.

Or use a firewire debug console, like some of the BSDs and Windows do
today.

Good luck,

greg k-h

2003-08-20 17:17:04

by John Bradford

[permalink] [raw]
Subject: Re: Console on USB

> > > > Is there any advice I might be able to use to get this going? I really
> > > > want to be able to catch some oops output.
> > >
> > > Buy a machine with a serial port. That's my recommendation :)
> >
> > That could be difficult in a few years time. What are we going to do
> > when we start getting bugs that are only reproducable on laptops with
> > no legacy ports?
>
> Use the previously mentioned netconsole code.

Yeah, I guess everything will have Ethernet onboard by then :-).

John.

2003-08-20 17:46:39

by Ian Stirling

[permalink] [raw]
Subject: Re: Console on USB

>
> I have just spent a very frustrating evening trying to get console on USB
> working. My laptop does not have regular DB-9 serial connectors, only
> USB. So I ordered a USB to serial converter, configured a 2.6.0-test3
> kernel, added a console=/dev/ttyUSB0 to the kernel command line and
> connected this to my desktop with a null modem adapter. However, I am
> unable to get output from this setup on the desktop. On another setup I
> can get a normal serial console output, so I am fairly confident I can set
> things up correctly.

For laptops, might console=/dev/irda work?

2003-08-20 17:56:39

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: Console on USB

On Wed, 20 Aug 2003 18:44:58 BST, [email protected] said:

> For laptops, might console=/dev/irda work?

Hmm.... <looks around> Do I have anything handy that will *catch* stuff being
spewed out the irda port? Don't think so, or I'd have built that driver....

Yes, might work, *if* you have hardware handy.


Attachments:
(No filename) (226.00 B)

2003-08-20 18:11:55

by Randy.Dunlap

[permalink] [raw]
Subject: Re: Console on USB

On Wed, 20 Aug 2003 13:56:18 -0400 [email protected] wrote:

| On Wed, 20 Aug 2003 18:44:58 BST, [email protected] said:
|
| > For laptops, might console=/dev/irda work?
|
| Hmm.... <looks around> Do I have anything handy that will *catch* stuff being
| spewed out the irda port? Don't think so, or I'd have built that driver....
|
| Yes, might work, *if* you have hardware handy.

I don't see any console support in the irda drivers...
How is it supposed to work?
or do you just mean that in theory it could be made to work?

--
~Randy [MOTD: Always include kernel version.]
"Everything is relative."

2003-08-20 18:47:15

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: Console on USB

On Wed, 20 Aug 2003 11:07:42 PDT, "Randy.Dunlap" said:

> I don't see any console support in the irda drivers...
> How is it supposed to work?
> or do you just mean that in theory it could be made to work?

Well, in theory.. The problem is that for irda to work, you'd need a *second*
device that did irda to catch the bits - and I don't have a good feel for how
many of the kernel hackers that would use this have a second irda-capable box -
probably a lot less than have a second box that does USB....

Now if that damned RJ-11 for the LoseModem was useful for something... ;)





Attachments:
(No filename) (226.00 B)

2003-08-20 19:42:16

by Ian Stirling

[permalink] [raw]
Subject: Re: Console on USB

>
> On Wed, 20 Aug 2003 13:56:18 -0400 [email protected] wrote:
>
> | On Wed, 20 Aug 2003 18:44:58 BST, [email protected] said:
> |
> | > For laptops, might console=/dev/irda work?
> |
> | Hmm.... <looks around> Do I have anything handy that will *catch* stuff being
> | spewed out the irda port? Don't think so, or I'd have built that driver....
> |
> | Yes, might work, *if* you have hardware handy.
>
> I don't see any console support in the irda drivers...
> How is it supposed to work?
> or do you just mean that in theory it could be made to work?

I last looked at irda, when my laptop was a 486/745, and thought that
the hardware still looked more or less like a 8250 variant.
I had previously used /dev/ttyS1 (where that was an IR port) to dump
debugging data.

Looking at the documentation for more recent hardware, I find this isn't really
the case any more for all hardware.