Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 26 May 2018, 00:45
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to get a serial console working?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
ldolse

Joined: 23 Oct 2009
Posts: 365

PostPosted: Sat 10 Sep 2011, 08:52    Post subject:  How to get a serial console working?  

Hi, I'm trying to get a serial console working - the last hurdle to being able to properly support Puppy on some embedded motherboards like the PC Engines Alix.

I didn't think it would be too difficult, but it's turned out to be a bit more complicated than I thought. Note my testing thus far is with 4.2, but I'm planning to switch over to a newer version of Puppy soon - though I don't think anything has changed in this department since 4.2.

Some former threads (very old) on the subject:
Long and short is none of those users succeeded in getting it working. Before Puppy 1.0 it did work, and was broken after that. In the 2006 timeframe it was related to a kernel issue, but I have no idea if that still applies 5 years later.

First question is will Puppy's default getty suffice for providing Serial console services, or do I need to add agetty/mgetty? One of the better Serial Console tutorials I found seems to indicate agetty/mgetty are required. mgetty seems to be overkill vs. agetty, but to use agetty I don't know if I need to rebuild everything in util-linux or if I can just copy that one executable over to a Puppy remaster. And then there are a handful of hints that on some platforms plain old getty is enough to provide serial console capabilities.

Beyond that is anything required beyond a properly working getty/agetty/mgetty with the right inittab settings? The one thread seems to indicate syslinux.cfg needs modification.

Anyone have any experience or advice in this department?

Edit, found an partial answer:
http://www.murga-linux.com/puppy/viewtopic.php?t=53704

I'd tried similar approaches already but I guess I hadn't gotten the syntax quite right. I'd like to be able to refine that though, as that doesn't give you any boot messages (as debugging startup/shutdown is a major reason for a serial console). It also requires you to log in. With Puppy's history of not requiring logins for local sessions I think it might make sense.
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3425
Location: Oregon

PostPosted: Sat 10 Sep 2011, 13:26    Post subject:  

I seem to recall an application called "putty" that I used with an older version of Puppy.
Just maybe it would work with Puppy 5.28.

You might want to do a search of the forum for it and see if it fits the bill.
Back to top
View user's profile Send private message 
ldolse

Joined: 23 Oct 2009
Posts: 365

PostPosted: Tue 29 Nov 2011, 22:13    Post subject: Not working on more recent dpup  

I'm trying this out now from a dpup built using Woof (snapshot from a few months back). The inittab changes that worked with 4.x aren't working at all with this build. If I try running getty manually it just hangs for a few seconds and then dies without any error.

It looks like something is screwy with the serial devices, i.e. they don't exist:

# setserial -g /dev/ttyS[0123]
/dev/ttyS0: No such device or address
/dev/ttyS1: No such device or address
/dev/ttyS2: No such device or address
/dev/ttyS3: No such device or address

What aspect of the bootup actually checks for physical com ports and creates the serial devices under /dev ?

Seems like with the work going on to support cross-compiles for ARM that perhaps serial console support should be brought back into upstream...

Edit:
Loading the 8250 module manually created the ttySx devices:
# modprobe 8250
# setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
#

Question is why weren't these modules automatically loaded during system initialization, and how do I get that to happen?

Here's a thread discussing it for Linux in general, not sure which of the suggestions is most applicable for Puppy:
http://www.linuxquestions.org/questions/linux-software-2/how-and-by-what-is-dev-ttys0-made-376569/
Back to top
View user's profile Send private message 
ldolse

Joined: 23 Oct 2009
Posts: 365

PostPosted: Tue 29 Nov 2011, 23:56    Post subject:  

I've got the serial 8250 module auto-loading by adding it to /etc/rc.d/MODULESCONFIG, specifically to the ADDLIST line, but this seems like a hack. Additionally since the modules here are loaded quite late that precludes having a serial console for the initial boot messages.

I'm wondering if moving the serial drivers to initrd would solve the issues.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3431
Location: www.eussenheim.de/

PostPosted: Wed 30 Nov 2011, 07:44    Post subject: How to get a serial console working?
Subject description: init
 

Hi idolse
you wrote:
I'm wondering if moving the serial drivers to initrd would solve the issues.

Why not just try it?

I do not have experiences with set console working but some experience editing initrd in wary52.
http://www.murga-linux.com/puppy/viewtopic.php?t=72321

I could imagine that would help:
edit initrd (there is a pet for this too)
and there
copy (or move?) needed modules from /lib/modules/2.6.32-uni/kernel/drivers/serial
into /lib/modules/2.6.32-smp/kernel/drivers
edit init and add something like (not tested!)
[ `modprobe xxx` ] && echo success on load module xxx >/dev/console|| echo loading module xxx failed >/dev/console

Hope this helps
Back to top
View user's profile Send private message 
ldolse

Joined: 23 Oct 2009
Posts: 365

PostPosted: Wed 30 Nov 2011, 09:21    Post subject: Re: How to get a serial console working?
Subject description: init
 

L18L wrote:
Hi idolse
you wrote:
I'm wondering if moving the serial drivers to initrd would solve the issues.

Why not just try it?


I did try it earlier today, basically exactly what you described - often when I post I'm thinking out loud in case someone more knowledgeable can save me the effort before I dig in. Anyway I moved the serial driver files to the initrd hierarchy and edited the init script to manually modprobe the 8250 driver. No dice, and it actually made matters worse as the drivers in initrd aren't merged cleanly into the final layered filesystem - they go into a separate /lib/modules/<kernel version>/initrd directory instead of their original /lib/modules/<kernel version>/kernel/ directory, so modprobe can't find them after the boot has completed either. This seems to be intentional, but I don't have the background on why.

Debugging this is a bit difficult because there are no messages to debug on an embedded system until after init/sysinit have completed. Syslinux/isolinux both support the serial console, but as soon as it switches over to Puppy it goes dark. I'm not sure if getting it working will require major re-working of the init scripts - right now everything is hard-coded to /dev/console, which I believe only applies to an actual monitor - I think it probably needs to be tee'd to other tty's, but my experimentations in that area have also failed thus far.

Will keep tinkering.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3431
Location: www.eussenheim.de/

PostPosted: Wed 30 Nov 2011, 15:04    Post subject:  

Quote:
everything is hard-coded to /dev/console

Just thinking loud
change
echo "....." >/dev/console
to
echo "..." >/dev/tty0 or 1 or 2 Question
Back to top
View user's profile Send private message 
ldolse

Joined: 23 Oct 2009
Posts: 365

PostPosted: Wed 30 Nov 2011, 21:09    Post subject:  

L18L wrote:
Quote:
everything is hard-coded to /dev/console

Just thinking loud
change
echo "....." >/dev/console
to
echo "..." >/dev/tty0 or 1 or 2 Question


Changing messages to a different tty isn't an issue - that works fine in general (though it won't work in init/sysinit because I still need to figure out why the driver wasn't loaded and tty created.) The problem is figuring out a way that will not screw up Puppy's default behavior but will still support a serial console.

Assuming the tty is working I thought this should work:

echo "....." >/dev/console | tee /dev/ttyS0

Though now that I look at it I suspect my problem is it should have been this:
echo "....." | tee /dev/console | tee /dev/ttyS0

Still not pretty and I wonder if this is the way other distros do it.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0425s ][ Queries: 11 (0.0055s) ][ GZIP on ]