serial console stuff

This commit is contained in:
cinap_lenrek 2011-08-16 10:15:36 +02:00
parent 828f63711b
commit f682600440
3 changed files with 21 additions and 19 deletions

View file

@ -5,15 +5,19 @@ bind /root /mnt/broot
unmount /root unmount /root
bind -q '#p' /proc bind -q '#p' /proc
for(i in S f k æ t m) for(i in S f k æ t b m)
bind -a '#'^$i /dev >/dev/null >[2=1] bind -qa '#'^$i /dev
# make variables settable by copying them from #ec # bind in an ip interface
for(i in I l^(0 1 2 3))
bind -qa '#'$i /net
# reparse #ec variables, move to #e
for(i in init service sysname user nvram rootdir cfs bootdisk bootargs \ for(i in init service sysname user nvram rootdir cfs bootdisk bootargs \
nobootprompt debugfactotum fs fsaddr auth authaddr){ nobootprompt debugfactotum fs fsaddr auth authaddr console){
a=$$i a=`{echo $$i}
$i=() $i=()
rm -f '#e'/$i '#ec'/$i /env/$i rm -f '#e'/$i '#ec'/$i
if(! ~ $#a 0) if(! ~ $#a 0)
$i=$a $i=$a
} }
@ -56,7 +60,7 @@ fn main{
if(~ $#nobootprompt 0){ if(~ $#nobootprompt 0){
echo echo
showlocaldevs showlocaldevs
ask bootargs ' is (tcp, local!device)' $bootargs ask bootargs ' is (tcp, local!device)' $"bootargs
} }
if not bootargs=$nobootprompt if not bootargs=$nobootprompt
nobootprompt=() nobootprompt=()
@ -144,19 +148,17 @@ fn main{
exec $init exec $init
} }
if(test -e '#b' && test -x /bin/aux/kbdfs){ # keyboard and serial console
bind -a '#b' /dev if(test -x /bin/aux/kbdfs){
a=$console(1) a=$console(1)
if(! ~ $#a 0) if(! ~ $#a 0)
a=/dev/eia^$a a=/dev/eia^$a
aux/kbdfs -s cons $a aux/kbdfs -s cons $a
} }
# usb devices
nusbrc nusbrc
# bind in an ip interface
for(i in I l^(0 1 2 3))
bind -qa '#'$i /net
# add partitions and binds # add partitions and binds
configlocal configlocal
@ -202,5 +204,5 @@ while(){
# cleanup so it can be restarted # cleanup so it can be restarted
nobootprompt=() nobootprompt=()
user=() user=()
rm -f /srv/cfs /srv/boot /srv/slashn /srv/cs /srv/dns rm -f /srv/^(cfs boot slashn cs dns)
} </dev/cons >/dev/cons >[2]/dev/cons } </dev/cons >/dev/cons >[2]/dev/cons

View file

@ -474,11 +474,10 @@ uartctl(Uart *p, char *cmd)
break; break;
case 'X': case 'X':
case 'x': case 'x':
if(p->enabled){ ilock(&p->tlock);
ilock(&p->tlock); p->xonoff = n;
p->xonoff = n; p->blocked = 0;
iunlock(&p->tlock); iunlock(&p->tlock);
}
break; break;
} }
} }

View file

@ -431,6 +431,8 @@ consproc(void *)
while(p < x && fullrune(p, x - p)){ while(p < x && fullrune(p, x - p)){
p += chartorune(&r, p); p += chartorune(&r, p);
if(r){ if(r){
if(r == 021 || r == 023) /* XON/XOFF */
continue;
if(r == '\n' && cr){ if(r == '\n' && cr){
cr = 0; cr = 0;
continue; continue;
@ -1232,7 +1234,6 @@ elevate(void)
} }
close(fd); close(fd);
} }
void void