ref: 8d356984a0f91ac2a0df4f13218ed4615c010b65
parent: a97255112d90b1c776d610ac360a857af87556f3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 28 22:21:22 EDT 2016
do screeninit() in devdraw at attach time, fix type for setterm() prototype
--- a/cpu.c
+++ b/cpu.c
@@ -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
+++ b/drawterm.h
@@ -11,3 +11,4 @@
extern void cpumain(int, char**);
extern char *estrdup(char*);
extern int aanclient(char*);
+
--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -99,6 +99,7 @@
if(kbdq == nil)
panic("kbdinit");
qnoblock(kbdq, 1);
+ setterm(0);
}
void
--- a/kern/devdraw.c
+++ b/kern/devdraw.c
@@ -1000,6 +1000,8 @@
static Chan*
drawattach(char *spec)
{
+ if(gscreen == nil)
+ screeninit();
dlock();
if(!initscreenimage()){
dunlock();
--- a/kern/fns.h
+++ b/kern/fns.h
@@ -381,5 +381,5 @@
void osinit(void);
void screeninit(void);
extern void terminit(void);
-extern void settierm(int raw);
+extern void setterm(int);