Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#18719 - 27/09/2000 08:35 How do I use CTRL-C or CTRL-Z on serial console ??
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
I allready asked this in the general forum, with no result.
How do I use CTRL-C or CTRL-Z in a shell started from serial.
I cannot allways connect to ethernet, and I hate rebooting the unit because my program is looping...
I tried all stty-combinations with no result. Could this be due to the fact there is no handshaking involved on the serial line?
I tried in hyperterm and CONEX.
CTRL-C seems to work fine when prepended with CTRL-V.


HELP....

Frank van Gestel
_________________________
Frank van Gestel

Top
#18720 - 28/09/2000 15:22 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
sc400
stranger

Registered: 09/09/2000
Posts: 42
Loc: SC
It is probably due to your windows client software catching the ctrl-C and treating it as a "paste" action. But I don't know why ctrl-Z wouldn't work. What software are you using. I am using hyperterm and haven't had any problems.


Top
#18721 - 28/09/2000 17:22 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: sc400]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
Thanks, a reply...
I have used hyperterm and am using conex (freeware, great emulation) right now under windows 2000. As I said before, CTRL-C works when prepended with CTRL-V, but no running task will respond to it...
I checked all the settings, tried every type of terminal emulation. tried tset and stty, but with no result.
I start the shell from my custom init-script, maybe that is the problem...
Is there anyone who hasn't got the problem in win2000?

Frank van Gestel
_________________________
Frank van Gestel

Top
#18722 - 28/09/2000 18:36 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Don't most Windows terminal programs have a menu command like "Send Break" or something like that? Or am I thinking of something else?

___________
Tony Fabris
_________________________
Tony Fabris

Top
#18723 - 28/09/2000 19:03 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: tfabris]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
A break is a special hardware signal that is sent over the line.
I tried it, no results...

Frank van Gestel
_________________________
Frank van Gestel

Top
#18724 - 03/10/2000 16:08 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
I found out it was the init-script which causes this behaviour; I think I have to hack up init a little to spawn a shell which reads my init-script...

Frank van Gestel
_________________________
Frank van Gestel

Top
#18725 - 04/10/2000 10:56 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi.

Could you give us a little more detail? What was it in init that caused the behaviour? I mean the empeg´s software ignoring CTRL-C.

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#18726 - 04/10/2000 13:38 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: smu]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
I replaced the default /sbin/init by the following shell-script :

#!/bin/bash
#
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/root/bin:/usr/local/root/sbin
TERM=vt100
LINES=50
export PATH TERM LINES
ASCII_IMG=/usr/local/images/ascii.raw
MENU_CFG=/usr/local/menu/menu.cfg
mount -n -o remount,ro /
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
hostname empeg
while :
do
/empeg/bin/player
CMD="1"
while [ -n "$CMD" ]
do
CMD=`blitmenu $ASCII_IMG $MENU_CFG`
eval $CMD
done
echo "Press q to terminate to a shell"
/usr/local/sbin/getkey q && /bin/bash
done


If I quit the player, my personal scrollmenu appears. After I quit this, a program called getkey is started, which waits 5 seconds for the q-key to be pressed.
When this happens in time, a shell is started.
This shell doesn't respond to any signal I send ( CTRL-C, CTRL-Z ).
I tried every stty setting there is, I used tset, set my TERM variable, I wrote some little programs that tried every ioctl found in the original init code, you name it and I tried. It seems bash isn't happy about being started first.


Guys at empeg, did you do anything specific to the empeg in your /sbin/init ?

Frank van Gestel
_________________________
Frank van Gestel

Top
#18727 - 12/10/2000 06:05 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Same deal for me. Ctrl-C and Ctrl-Z both worked for me. After modifying my init, they don't. What's going on?

-Tony
MkII #554
_________________________
- Tony C
my empeg stuff

Top
#18728 - 14/10/2000 14:39 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
So I guess nobody has an answer to this one? Empeg guys? It seems the ability to use Break and Suspend keys is lost when using a custom init. Any idea what would cause this?

For the record, here's my init:

#!/bin/bash
#
# Empeg init

/bin/mount -n -o remount,ro /
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
/bin/mount -n -o nocheck,ro /usr

function domount() { # make sure we're read only
/bin/mount -n -o remount,nocheck,ro /drive0
/bin/mount -n -o remount,nocheck,ro /usr
/bin/mount -n -o remount,nocheck,ro /
}

function ecko() {
echo $1
echo $1 | /usr/local/bin/disp
}

OK=1
if [ ! -f /usr/local/bin/picker ]; then OK=0; fi
if [ ! -f /usr/local/bin/disp ]; then OK=0; fi

if [ $OK -eq 0 ] # we need this for init
then # if we don't have it, run old init
exec /bin/init.orig
fi

while : # loop forever
do
CHOICE=`/usr/local/bin/picker -t 5 1 "player" "inetd" "dispserv"

"tetris" "5" "6" "7" "8" "shell" "10" "11" "12" "13" "14" "15"`
case $CHOICE in
1) # run player
domount
/empeg/bin/player
echo | disp
continue
;;

2) # toggle inetd
continue
;;
3) # toggle display server
continue
;;
4) # let's play Tetris!
/usr/local/bin/tetris
continue
;;
9) # gimme a shell prompt
ecko "*shell on ttyS1*"
. /etc/profile
/bin/bash
domount
continue
;;

esac
done



-Tony
MkII #554

_________________________
- Tony C
my empeg stuff

Top
#18729 - 14/10/2000 17:33 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: tonyc]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Hm, perhaps line discipline details are different. Try issuing stty -a with both stock and your custom init, and see how do they compare.

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#18730 - 14/10/2000 18:59 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: bonzi]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Good thinking, but they're exactly the same...

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke


-Tony
MkII #554

_________________________
- Tony C
my empeg stuff

Top
#18731 - 15/10/2000 09:51 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: tonyc]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi.

I had the very same symptoms on my home linux system (loging in via modem), and a simple "stty sane" called immediately after login fixed it for me. This might be worth a try.

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#18732 - 15/10/2000 10:07 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: tonyc]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
It's probably bash which doesn't see a terminal at the other end. I am thinking of writing a simple init executable which just spawns a shell

Frank van Gestel
_________________________
Frank van Gestel

Top
#18733 - 15/10/2000 14:35 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: smu]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
stty sane didn't work. It's got to be some other weird side effect of exec'ing bash instead of doing it in init... sigh. Only a slight pain but a pain nonetheless.

-Tony
MkII #554
_________________________
- Tony C
my empeg stuff

Top
#18734 - 26/10/2000 15:03 Re: How do I use CTRL-C or CTRL-Z on serial console ?? [Re: fvgestel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
For anyone who is still using serial console and an init shell-script :
I have got a custom init-executable which will spawn an executable or shell-script named /sbin/userinit.
It will solve all CTRL-C, CTRL-V problems.
See attachment or look at http://fvgestel.dyndns.org/empeg/modified_init/
PS source is included...

Frank van Gestel


Attachments
2-20407-modified_init.tgz (163 downloads)

_________________________
Frank van Gestel

Top