shithub: drawterm

Download patch

ref: 8d356984a0f91ac2a0df4f13218ed4615c010b65
parent: a97255112d90b1c776d610ac360a857af87556f3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 28 20:21:22 EDT 2016

do screeninit() in devdraw at attach time, fix type for setterm() prototype

--- a/cpu.c	Sat May 28 19:55:05 2016
+++ b/cpu.c	Sat May 28 20:21:22 2016
@@ -262,11 +262,10 @@
 		usage();
 
 	if(!nogfx) {
-		screeninit();
-		if(bind("#m", "/dev", MBEFORE) < 0)
-			panic("bind #m: %r");
 		if(bind("#i", "/dev", MBEFORE) < 0)
 			panic("bind #i: %r");
+		if(bind("#m", "/dev", MBEFORE) < 0)
+			panic("bind #m: %r");
 	}
 
 	if(bind("/root", "/", MAFTER) < 0)
--- a/drawterm.h	Sat May 28 19:55:05 2016
+++ b/drawterm.h	Sat May 28 20:21:22 2016
@@ -11,3 +11,4 @@
 extern void cpumain(int, char**);
 extern char *estrdup(char*);
 extern int aanclient(char*);
+
--- a/kern/devcons.c	Sat May 28 19:55:05 2016
+++ b/kern/devcons.c	Sat May 28 20:21:22 2016
@@ -99,6 +99,7 @@
 	if(kbdq == nil)
 		panic("kbdinit");
 	qnoblock(kbdq, 1);
+	setterm(0);
 }
 
 void
--- a/kern/devdraw.c	Sat May 28 19:55:05 2016
+++ b/kern/devdraw.c	Sat May 28 20:21:22 2016
@@ -1000,6 +1000,8 @@
 static Chan*
 drawattach(char *spec)
 {
+	if(gscreen == nil)
+		screeninit();
 	dlock();
 	if(!initscreenimage()){
 		dunlock();
--- a/kern/fns.h	Sat May 28 19:55:05 2016
+++ b/kern/fns.h	Sat May 28 20:21:22 2016
@@ -381,5 +381,5 @@
 void	osinit(void);
 void	screeninit(void);
 extern	void	terminit(void);
-extern	void	settierm(int raw);
+extern	void	setterm(int);