Re: Preserving early console output (pre-Copyright stuff)

2010-07-05 Thread David Laight
On Thu, Jul 01, 2010 at 11:44:52AM -0400, Matthew Mondor wrote:
 
 Sometimes I've been thinking about this as more and more hardware don't
 ship with RS232 anymore.  Is there a relatively common BIOS interface
 which would allow, even if non-efficiently, to use a USB port as a
 serial device without too much code?  If so, possibly that a special
 usb-serial bootblock could be using that sometime in the future?

It is probably easier to get the data into ethernet packets than USB!

David

-- 
David Laight: da...@l8s.co.uk


Re: Preserving early console output (pre-Copyright stuff)

2010-07-05 Thread David Holland
On Thu, Jul 01, 2010 at 05:18:36AM -0700, Paul Goyette wrote:
 b) a way to pause long enough to manually transcribe the output?  (A  
 simple timed delay would work, although a Press any key to continue  
 would be easier!)

It may work to do

   printf(Press a key...\n);
   cnpollc(1);
   (void)cngetc();
   cnpollc(0);

... it used to, but that was ~15 years ago.

-- 
David A. Holland
dholl...@netbsd.org


Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Paul Goyette
I'm trying to debug some stuff on a new server, and there are some 
messages of interest that get printf'd on the console very early in 
the system's life, before the Copyright (c)... lines.  There is a 
large amount of info being printed, way more than a screenful and way 
more than can be captured with an eyeball snapshot.  Unfortunately, it 
seems that this information is NOT retained in the kernel's message 
buffer, so it never gets collected by syslog.  (For those who want to 
know details, some of the messages in question are generated by 
add_mem_cluster() in src/sys/arch/x86/x86/x86_machdep.c)


So, is there either

a) a way to capture these messages in the normal message buffer for 
later collection by syslog, or


b) a way to pause long enough to manually transcribe the output?  (A 
simple timed delay would work, although a Press any key to continue 
would be easier!)


Thanks in advance!


-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Allen Briggs
On Thu, Jul 01, 2010 at 05:18:36AM -0700, Paul Goyette wrote:
 a) a way to capture these messages in the normal message buffer for 
 later collection by syslog, or
 
 b) a way to pause long enough to manually transcribe the output?  (A 
 simple timed delay would work, although a Press any key to continue 
 would be easier!)

I don't know of an easy way to do either (although I could see adding
something to pause every N calls if it's not logging yet), but this
is the kind of thing that a serial console can be really handy for.
Do you have serial ports on the system in question?

-allen

-- 
Allen Briggs  -  bri...@ninthwonder.com


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Sad Clouds
On Thu, 1 Jul 2010 05:18:36 -0700 (PDT)
Paul Goyette p...@whooppee.com wrote:

 b) a way to pause long enough to manually transcribe the output?  (A 
 simple timed delay would work, although a Press any key to continue 
 would be easier!)

Get a semi-decent digital camera, set high ISO speed in a well lit room
and take a snapshot of the screen. Might take you a few tries to
capture all data, but it may be quicker than figuring out how to set
up serial console.

If the image is too blurry, increase the ISO + add more light.


lockdebug messages in dmesg (was: Preserving early console output (pre-Copyright stuff))

2010-07-01 Thread Adam Hoka
btw, is this intentional that lockdebug panic messages
dont end up in dmesg?

-- 
NetBSD - Simplicity is prerequisite for reliability


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Allen Briggs
On Thu, Jul 01, 2010 at 06:00:41AM -0700, Paul Goyette wrote:
 There is a serial port, but I haven't figured out yet how to make it 
 work in the BIOS.  And while I do have other machines with serial ports 
 I've never used those ports and don't even have serial cables!  (The 
 last time I used a serial cable was way back in the days of modems and 
 dial-up 'net access!)

Heh.  You do need a serial cable and another computer, but it's not too
hard to set up.  You don't need to find any options in the BIOS if you
install the right boot blocks.

 The pause every N calls is probably over-kill - I'd be happy to pause 
 on every call, if there is an appropriate pause() function that can be 
 called at this early part of the boot process.

You could always do a simple spin-loop.  Assuming this is a temporary
thing you're doing for a single (or limited number of) system(s).

-allen

-- 
Allen Briggs  -  bri...@ninthwonder.com


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Matthew Mondor
On Thu, 1 Jul 2010 06:00:41 -0700 (PDT)
Paul Goyette p...@whooppee.com wrote:

 That's what I thought I'd get for an answer!  :)
 
 There is a serial port, but I haven't figured out yet how to make it 
 work in the BIOS.  And while I do have other machines with serial ports 
 I've never used those ports and don't even have serial cables!  (The 
 last time I used a serial cable was way back in the days of modems and 
 dial-up 'net access!)

Sometimes I've been thinking about this as more and more hardware don't
ship with RS232 anymore.  Is there a relatively common BIOS interface
which would allow, even if non-efficiently, to use a USB port as a
serial device without too much code?  If so, possibly that a special
usb-serial bootblock could be using that sometime in the future?

If there is no BIOS common interface, I can see it's a problem because
of all the driver code that'd be needed at boot time...

Thanks,
-- 
Matt


Re: lockdebug messages in dmesg (was: Preserving early console output (pre-Copyright stuff))

2010-07-01 Thread Andrew Doran
On Thu, Jul 01, 2010 at 04:13:36PM +0200, Adam Hoka wrote:
 btw, is this intentional that lockdebug panic messages
 dont end up in dmesg?

Yes, just because that requires taking additional locks.

 -- 
 NetBSD - Simplicity is prerequisite for reliability


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Paul Goyette

On Thu, 1 Jul 2010, Allen Briggs wrote:


Heh.  You do need a serial cable and another computer, but it's not too
hard to set up.  You don't need to find any options in the BIOS if you
install the right boot blocks.


Yeah, OK, I got a cable, plugged it in, run cu(1) on one end, and added 
a new entry to the /boot.cfg on the other end:


menu=Serial/Single/Verbose/Debug:consdev com0; boot -svx

Then just boot, and things magically work!

Thanks for the clue-by-four


-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: Preserving early console output (pre-Copyright stuff)

2010-07-01 Thread Giles Lean

Matthew Mondor mm_li...@pulsar-zone.net wrote:

 Sometimes I've been thinking about this as more and more hardware don't
 ship with RS232 anymore.  Is there a relatively common BIOS interface
 which would allow, even if non-efficiently, to use a USB port as a
 serial device without too much code?

I doubt it.  All uses of serial-via-USB that I've seen have
required electronics (often buggy electronics) to do the
conversion, and the one or two USB video interfaces I've also
seen have also required electronics _and_ custom kernel
drivers, and (you guessed it) there were bugs galore there too
in the one I tried (hardware, software, or both I don't know).

On the big iron I used to work with that had consoles with
network support, the network connection was a pretty dumb
piece of hardware which spoke ssh or telnet on the network
side ... and RS-232 on the console side. :-(  (OK, it also
offered remote access to the reset and power switches, but the
console was still -- in the 21st century -- based off RS-232.
Maybe that changed in later models, but I wouldn't bet much
on the possibility.)

A USB console is a nice idea, but the industry doesn't seem to
have picked it up(*).  Which with all the EFI, IPMI, and other
overly complex industry standards necessary to build a
modern machine plus the prevalence of notebook PCs all with
USB ports this is amusing, if you have a warped enough sense
of humour ...

(*) Or if there _is_ a USB console standard I've missed the
memo and would welcome someone setting me straight, please.

Regards,

Giles