Discussion:
Put a getty on the serial port
Dmytro Bablinyuk
2005-10-11 23:17:57 UTC
Permalink
The kernel has command line:
Kernel command line: console=ttyCPM0,115200 root=31:01 rw
rootfstype=jffs2
mtdparts=phys_mapped_flash:1024k(Linux),4096k(FS),2048k(Unused),512k(U-Boot),-()

In inittab I put

# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100

I does not show anymore "Bummer, can't open ttyS0" but it's not opening
serial console either.
I am using latest snapshot of busybox.
Does anybody know what shall I do to open serial console?

Thank you
Dmytro Bablinyuk
2005-10-11 23:40:29 UTC
Permalink
Post by Dmytro Bablinyuk
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I got console working
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
But since I have '/bin/sh: can't access tty; job control turned off'
I would like to move to a terminal

I have these devices
/ # ls /dev/
console hda3 hdb14 loop1 ptmx ram0 tty5
ttyp2
fb0 hda4 hdb2 mem pts ram1 tty6
ttyp3
fb1 hda5 hdb3 mtd0 ptyp0 ram2 tty7
ttyp4
fb2 hda6 hdb4 mtd1 ptyp1 ram3 ttyP0
ttyp5
fb3 hda7 hdb5 mtd2 ptyp2 random ttyP1
ttyp6
hda hda8 hdb6 mtd3 ptyp3 rtc ttyP2
ttyp7
hda1 hda9 hdb7 mtdblock0 ptyp4 shm ttyP3
ttyp8
hda10 hdb hdb8 mtdblock1 ptyp5 tty ttyS0
ttyp9
hda11 hdb1 hdb9 mtdblock2 ptyp6 tty0 ttyS1
urandom
hda12 hdb10 input mtdblock3 ptyp7 tty1 ttyS2
zero
hda13 hdb11 kmem net ptyp8 tty2 ttyS3
hda14 hdb12 log null ptyp9 tty3 ttyp0
hda2 hdb13 loop0 psaux ram tty4 ttyp1

I tried ttyS0, tty0 but console is not working on any of these. So far
it works only with 'console' device.
Can anybody please suggest what device shall I use or at least try?

Thank you
Dmytro Bablinyuk
2005-10-12 00:02:36 UTC
Permalink
So, you need a CPM0 device with major number 204 and minor number 46,
then tell inittab to use ttyCPM0.
Thank you!! It's working now!
Chris Kottaridis
2005-10-12 00:15:29 UTC
Permalink
Well, since you previously stated:

Kernel command line: console=ttyCPM0,115200 root=31:01 rw
^^^^^^^

You should probably create a CPM0 device in /dev. According to the linux
Documentation/devices.txt:
===================================================================
204 char Low-density serial ports
0 = /dev/ttyLU0 LinkUp Systems L72xx
UART - port
0
1 = /dev/ttyLU1 LinkUp Systems L72xx
UART - port
1
2 = /dev/ttyLU2 LinkUp Systems L72xx
UART - port
2
3 = /dev/ttyLU3 LinkUp Systems L72xx
UART - port
3
4 = /dev/ttyFB0 Intel Footbridge (ARM)
5 = /dev/ttySA0 StrongARM builtin serial
port 0
6 = /dev/ttySA1 StrongARM builtin serial
port 1
7 = /dev/ttySA2 StrongARM builtin serial
port 2
8 = /dev/ttySC0 SCI serial port (SuperH)
- port
0
9 = /dev/ttySC1 SCI serial port (SuperH)
- port
1
10 = /dev/ttySC2 SCI serial port (SuperH)
- port
2
11 = /dev/ttySC3 SCI serial port (SuperH)
- port
3
12 = /dev/ttyFW0 Firmware console - port
0
13 = /dev/ttyFW1 Firmware console - port
1
14 = /dev/ttyFW2 Firmware console - port
2
15 = /dev/ttyFW3 Firmware console - port
3
16 = /dev/ttyAM0 ARM "AMBA" serial port 0
...
31 = /dev/ttyAM15 ARM "AMBA" serial port
15
32 = /dev/ttyDB0 DataBooster serial port
0
...
39 = /dev/ttyDB7 DataBooster serial port
7
40 = /dev/ttySG0 SGI Altix console port
41 = /dev/ttySMX0 Motorola i.MX - port 0
42 = /dev/ttySMX1 Motorola i.MX - port 1
43 = /dev/ttySMX2 Motorola i.MX - port 2
44 = /dev/ttyMM0 Marvell MPSC - port 0
45 = /dev/ttyMM1 Marvell MPSC - port 1
46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) -
^^^^^^^
port 0
...
49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) -
port 5
======================================================================

So, you need a CPM0 device with major number 204 and minor number 46,
then tell inittab to use ttyCPM0.

Chris Kottaridis (***@quietwind.net)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
Post by Dmytro Bablinyuk
Post by Dmytro Bablinyuk
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I got console working
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
But since I have '/bin/sh: can't access tty; job control turned off'
I would like to move to a terminal
I have these devices
/ # ls /dev/
console hda3 hdb14 loop1 ptmx ram0 tty5
ttyp2
fb0 hda4 hdb2 mem pts ram1 tty6
ttyp3
fb1 hda5 hdb3 mtd0 ptyp0 ram2 tty7
ttyp4
fb2 hda6 hdb4 mtd1 ptyp1 ram3 ttyP0
ttyp5
fb3 hda7 hdb5 mtd2 ptyp2 random ttyP1
ttyp6
hda hda8 hdb6 mtd3 ptyp3 rtc ttyP2
ttyp7
hda1 hda9 hdb7 mtdblock0 ptyp4 shm ttyP3
ttyp8
hda10 hdb hdb8 mtdblock1 ptyp5 tty ttyS0
ttyp9
hda11 hdb1 hdb9 mtdblock2 ptyp6 tty0 ttyS1
urandom
hda12 hdb10 input mtdblock3 ptyp7 tty1 ttyS2
zero
hda13 hdb11 kmem net ptyp8 tty2 ttyS3
hda14 hdb12 log null ptyp9 tty3 ttyp0
hda2 hdb13 loop0 psaux ram tty4 ttyp1
I tried ttyS0, tty0 but console is not working on any of these. So far
it works only with 'console' device.
Can anybody please suggest what device shall I use or at least try?
Thank you
_______________________________________________
busybox mailing list
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Dmytro Bablinyuk
2005-10-12 02:02:10 UTC
Permalink
So, you need a CPM0 device with major number 204 and minor number 46,
then tell inittab to use ttyCPM0.
Thank you!! It's working now!
Chris Kottaridis
2005-10-12 02:05:14 UTC
Permalink
Well, since you previously stated:

Kernel command line: console=ttyCPM0,115200 root=31:01 rw
^^^^^^^

You should probably create a CPM0 device in /dev. According to the linux
Documentation/devices.txt:
===================================================================
204 char Low-density serial ports
0 = /dev/ttyLU0 LinkUp Systems L72xx
UART - port
0
1 = /dev/ttyLU1 LinkUp Systems L72xx
UART - port
1
2 = /dev/ttyLU2 LinkUp Systems L72xx
UART - port
2
3 = /dev/ttyLU3 LinkUp Systems L72xx
UART - port
3
4 = /dev/ttyFB0 Intel Footbridge (ARM)
5 = /dev/ttySA0 StrongARM builtin serial
port 0
6 = /dev/ttySA1 StrongARM builtin serial
port 1
7 = /dev/ttySA2 StrongARM builtin serial
port 2
8 = /dev/ttySC0 SCI serial port (SuperH)
- port
0
9 = /dev/ttySC1 SCI serial port (SuperH)
- port
1
10 = /dev/ttySC2 SCI serial port (SuperH)
- port
2
11 = /dev/ttySC3 SCI serial port (SuperH)
- port
3
12 = /dev/ttyFW0 Firmware console - port
0
13 = /dev/ttyFW1 Firmware console - port
1
14 = /dev/ttyFW2 Firmware console - port
2
15 = /dev/ttyFW3 Firmware console - port
3
16 = /dev/ttyAM0 ARM "AMBA" serial port 0
...
31 = /dev/ttyAM15 ARM "AMBA" serial port
15
32 = /dev/ttyDB0 DataBooster serial port
0
...
39 = /dev/ttyDB7 DataBooster serial port
7
40 = /dev/ttySG0 SGI Altix console port
41 = /dev/ttySMX0 Motorola i.MX - port 0
42 = /dev/ttySMX1 Motorola i.MX - port 1
43 = /dev/ttySMX2 Motorola i.MX - port 2
44 = /dev/ttyMM0 Marvell MPSC - port 0
45 = /dev/ttyMM1 Marvell MPSC - port 1
46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) -
^^^^^^^
port 0
...
49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) -
port 5
======================================================================

So, you need a CPM0 device with major number 204 and minor number 46,
then tell inittab to use ttyCPM0.

Chris Kottaridis (chriskot at quietwind.net)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
Post by Dmytro Bablinyuk
Post by Dmytro Bablinyuk
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I got console working
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
But since I have '/bin/sh: can't access tty; job control turned off'
I would like to move to a terminal
I have these devices
/ # ls /dev/
console hda3 hdb14 loop1 ptmx ram0 tty5
ttyp2
fb0 hda4 hdb2 mem pts ram1 tty6
ttyp3
fb1 hda5 hdb3 mtd0 ptyp0 ram2 tty7
ttyp4
fb2 hda6 hdb4 mtd1 ptyp1 ram3 ttyP0
ttyp5
fb3 hda7 hdb5 mtd2 ptyp2 random ttyP1
ttyp6
hda hda8 hdb6 mtd3 ptyp3 rtc ttyP2
ttyp7
hda1 hda9 hdb7 mtdblock0 ptyp4 shm ttyP3
ttyp8
hda10 hdb hdb8 mtdblock1 ptyp5 tty ttyS0
ttyp9
hda11 hdb1 hdb9 mtdblock2 ptyp6 tty0 ttyS1
urandom
hda12 hdb10 input mtdblock3 ptyp7 tty1 ttyS2
zero
hda13 hdb11 kmem net ptyp8 tty2 ttyS3
hda14 hdb12 log null ptyp9 tty3 ttyp0
hda2 hdb13 loop0 psaux ram tty4 ttyp1
I tried ttyS0, tty0 but console is not working on any of these. So far
it works only with 'console' device.
Can anybody please suggest what device shall I use or at least try?
Thank you
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Dmytro Bablinyuk
2005-10-11 23:48:40 UTC
Permalink
Don't you have to specify which ttyCPM you want to use? From your kernel
command line I would assume '0'
Yep, I spotted this already. But now I have another problem with
--8<---
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
'/bin/sh: can't access tty; job control turned off'
--8<---
So, I should run my shell on a normal tty such as tty1 or ttyS0 - I tried:
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyS0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyCPM0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/tty0 vt100
But none of them works.

Any ideas?
Probably I have again missed something.
Robin Gilks
2005-10-12 00:02:56 UTC
Permalink
Post by Dmytro Bablinyuk
Don't you have to specify which ttyCPM you want to use? From your
kernel command line I would assume '0'
Yep, I spotted this already. But now I have another problem with
--8<---
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
'/bin/sh: can't access tty; job control turned off'
--8<---
So, I should run my shell on a normal tty such as tty1 or ttyS0 - I
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyS0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyCPM0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/tty0 vt100
But none of them works.
Any ideas?
Probably I have again missed something.
Job control gets turned off by using the tty as a kernel console. I
can't remember the magic thats required by init to make it release the
console so that a shell has full control over it off hand. I'm sure
you'll find it at
http://www.uclibc.org/FAQ.html#job_control
--
Robin Gilks
Senior Design Engineer Phone: (+64)(3) 357 1569
Tait Electronics Fax : (+64)(3) 359 4632
PO Box 1645 Christchurch Email : ***@tait.co.nz
New Zealand


=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
Robin Gilks
2005-10-12 02:02:46 UTC
Permalink
Post by Dmytro Bablinyuk
Don't you have to specify which ttyCPM you want to use? From your
kernel command line I would assume '0'
Yep, I spotted this already. But now I have another problem with
--8<---
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
'/bin/sh: can't access tty; job control turned off'
--8<---
So, I should run my shell on a normal tty such as tty1 or ttyS0 - I
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyS0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyCPM0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/tty0 vt100
But none of them works.
Any ideas?
Probably I have again missed something.
Job control gets turned off by using the tty as a kernel console. I
can't remember the magic thats required by init to make it release the
console so that a shell has full control over it off hand. I'm sure
you'll find it at
http://www.uclibc.org/FAQ.html#job_control
--
Robin Gilks
Senior Design Engineer Phone: (+64)(3) 357 1569
Tait Electronics Fax : (+64)(3) 359 4632
PO Box 1645 Christchurch Email : robin.gilks at tait.co.nz
New Zealand


=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
Robin Gilks
2005-10-12 00:14:10 UTC
Permalink
Post by Dmytro Bablinyuk
Kernel command line: console=ttyCPM0,115200 root=31:01 rw
rootfstype=jffs2
mtdparts=phys_mapped_flash:1024k(Linux),4096k(FS),2048k(Unused),512k(U-Boot),-()
In inittab I put
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I does not show anymore "Bummer, can't open ttyS0" but it's not
opening serial console either.
I am using latest snapshot of busybox.
Does anybody know what shall I do to open serial console?
Don't you have to specify which ttyCPM you want to use? From your kernel
command line I would assume '0'
--
Robin Gilks
Senior Design Engineer Phone: (+64)(3) 357 1569
Tait Electronics Fax : (+64)(3) 359 4632
PO Box 1645 Christchurch Email : ***@tait.co.nz
New Zealand


=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
Dmytro Bablinyuk
2005-10-12 01:48:40 UTC
Permalink
Don't you have to specify which ttyCPM you want to use? From your kernel
command line I would assume '0'
Yep, I spotted this already. But now I have another problem with
--8<---
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
'/bin/sh: can't access tty; job control turned off'
--8<---
So, I should run my shell on a normal tty such as tty1 or ttyS0 - I tried:
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyS0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/ttyCPM0 vt100
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/tty0 vt100
But none of them works.

Any ideas?
Probably I have again missed something.
Dmytro Bablinyuk
2005-10-12 00:05:35 UTC
Permalink
The kernel has command line:
Kernel command line: console=ttyCPM0,115200 root=31:01 rw
rootfstype=jffs2
mtdparts=phys_mapped_flash:1024k(Linux),4096k(FS),2048k(Unused),512k(U-Boot),-()

In inittab I put

# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100

I does not show anymore "Bummer, can't open ttyS0" but it's not opening
serial console either.
I am using latest snapshot of busybox.
Does anybody know what shall I do to open serial console?

Thank you
Dmytro Bablinyuk
2005-10-12 01:39:23 UTC
Permalink
Post by Dmytro Bablinyuk
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I got console working
::wait:/sbin/getty -n -l /bin/sh 115200 /dev/console vt100
But since I have '/bin/sh: can't access tty; job control turned off'
I would like to move to a terminal

I have these devices
/ # ls /dev/
console hda3 hdb14 loop1 ptmx ram0 tty5
ttyp2
fb0 hda4 hdb2 mem pts ram1 tty6
ttyp3
fb1 hda5 hdb3 mtd0 ptyp0 ram2 tty7
ttyp4
fb2 hda6 hdb4 mtd1 ptyp1 ram3 ttyP0
ttyp5
fb3 hda7 hdb5 mtd2 ptyp2 random ttyP1
ttyp6
hda hda8 hdb6 mtd3 ptyp3 rtc ttyP2
ttyp7
hda1 hda9 hdb7 mtdblock0 ptyp4 shm ttyP3
ttyp8
hda10 hdb hdb8 mtdblock1 ptyp5 tty ttyS0
ttyp9
hda11 hdb1 hdb9 mtdblock2 ptyp6 tty0 ttyS1
urandom
hda12 hdb10 input mtdblock3 ptyp7 tty1 ttyS2
zero
hda13 hdb11 kmem net ptyp8 tty2 ttyS3
hda14 hdb12 log null ptyp9 tty3 ttyp0
hda2 hdb13 loop0 psaux ram tty4 ttyp1

I tried ttyS0, tty0 but console is not working on any of these. So far
it works only with 'console' device.
Can anybody please suggest what device shall I use or at least try?

Thank you
Robin Gilks
2005-10-12 01:43:22 UTC
Permalink
Post by Dmytro Bablinyuk
Kernel command line: console=ttyCPM0,115200 root=31:01 rw
rootfstype=jffs2
mtdparts=phys_mapped_flash:1024k(Linux),4096k(FS),2048k(Unused),512k(U-Boot),-()
In inittab I put
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyCPM::respawn:/sbin/getty -L ttyCPM 115200 vt100
I does not show anymore "Bummer, can't open ttyS0" but it's not
opening serial console either.
I am using latest snapshot of busybox.
Does anybody know what shall I do to open serial console?
Don't you have to specify which ttyCPM you want to use? From your kernel
command line I would assume '0'
--
Robin Gilks
Senior Design Engineer Phone: (+64)(3) 357 1569
Tait Electronics Fax : (+64)(3) 359 4632
PO Box 1645 Christchurch Email : robin.gilks at tait.co.nz
New Zealand


=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
Continue reading on narkive:
Search results for 'Put a getty on the serial port' (Questions and Answers)
97
replies
Which party is more racist, democrats or republicans ?
started 2019-08-03 10:55:48 UTC
politics
Loading...