summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-08-16 10:15:36 +0200
committercinap_lenrek <cinap_lenrek@centraldogma>2011-08-16 10:15:36 +0200
commitf682600440d21589cae2fba1d715b8552bc78d0d (patch)
tree0880ac074c2f695678b45ae24b70f853efd39a4f /sys/src
parent828f63711b7fd0c735d083e4b06b8937e846a830 (diff)
serial console stuff
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/9/boot/bootrc28
-rw-r--r--sys/src/9/port/devuart.c9
-rw-r--r--sys/src/cmd/aux/kbdfs/kbdfs.c3
3 files changed, 21 insertions, 19 deletions
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index 9d102c566..ef699ab9d 100644
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -5,15 +5,19 @@ bind /root /mnt/broot
unmount /root
bind -q '#p' /proc
-for(i in S f k æ t m)
- bind -a '#'^$i /dev >/dev/null >[2=1]
+for(i in S f k æ t b m)
+ 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 \
- nobootprompt debugfactotum fs fsaddr auth authaddr){
- a=$$i
+ nobootprompt debugfactotum fs fsaddr auth authaddr console){
+ a=`{echo $$i}
$i=()
- rm -f '#e'/$i '#ec'/$i /env/$i
+ rm -f '#e'/$i '#ec'/$i
if(! ~ $#a 0)
$i=$a
}
@@ -56,7 +60,7 @@ fn main{
if(~ $#nobootprompt 0){
echo
showlocaldevs
- ask bootargs ' is (tcp, local!device)' $bootargs
+ ask bootargs ' is (tcp, local!device)' $"bootargs
}
if not bootargs=$nobootprompt
nobootprompt=()
@@ -144,19 +148,17 @@ fn main{
exec $init
}
-if(test -e '#b' && test -x /bin/aux/kbdfs){
- bind -a '#b' /dev
+# keyboard and serial console
+if(test -x /bin/aux/kbdfs){
a=$console(1)
if(! ~ $#a 0)
a=/dev/eia^$a
aux/kbdfs -s cons $a
}
+# usb devices
nusbrc
-# bind in an ip interface
-for(i in I l^(0 1 2 3))
- bind -qa '#'$i /net
# add partitions and binds
configlocal
@@ -202,5 +204,5 @@ while(){
# cleanup so it can be restarted
nobootprompt=()
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
diff --git a/sys/src/9/port/devuart.c b/sys/src/9/port/devuart.c
index e534fa1c3..fbf9a80d3 100644
--- a/sys/src/9/port/devuart.c
+++ b/sys/src/9/port/devuart.c
@@ -474,11 +474,10 @@ uartctl(Uart *p, char *cmd)
break;
case 'X':
case 'x':
- if(p->enabled){
- ilock(&p->tlock);
- p->xonoff = n;
- iunlock(&p->tlock);
- }
+ ilock(&p->tlock);
+ p->xonoff = n;
+ p->blocked = 0;
+ iunlock(&p->tlock);
break;
}
}
diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c
index 397eba9e8..862479870 100644
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
@@ -431,6 +431,8 @@ consproc(void *)
while(p < x && fullrune(p, x - p)){
p += chartorune(&r, p);
if(r){
+ if(r == 021 || r == 023) /* XON/XOFF */
+ continue;
if(r == '\n' && cr){
cr = 0;
continue;
@@ -1232,7 +1234,6 @@ elevate(void)
}
close(fd);
-
}
void