diff options
| -rw-r--r-- | sys/src/9/pc/devvga.c | 2 | ||||
| -rw-r--r-- | sys/src/9/pc/screen.c | 22 | ||||
| -rw-r--r-- | sys/src/9/pc/screen.h | 3 |
3 files changed, 26 insertions, 1 deletions
diff --git a/sys/src/9/pc/devvga.c b/sys/src/9/pc/devvga.c index 90ebb140d..e980011d8 100644 --- a/sys/src/9/pc/devvga.c +++ b/sys/src/9/pc/devvga.c @@ -329,6 +329,7 @@ vgactl(Cmdbuf *cb) case CMtextmode: screeninit(); + bootscreenconf(nil); return; case CMsize: @@ -357,6 +358,7 @@ vgactl(Cmdbuf *cb) deletescreenimage(); if(screensize(x, y, z, chan)) error(Egreg); + bootscreenconf(scr); return; case CMactualsize: diff --git a/sys/src/9/pc/screen.c b/sys/src/9/pc/screen.c index c7317dd0a..4ff7a9485 100644 --- a/sys/src/9/pc/screen.c +++ b/sys/src/9/pc/screen.c @@ -586,7 +586,7 @@ bootmapfb(VGAscr *scr, ulong pa, ulong sz) /* * called early on boot to attach to framebuffer - * setup by bootloader or firmware. + * setup by bootloader/firmware or plan9. */ void bootscreeninit(void) @@ -665,3 +665,23 @@ bootscreeninit(void) scr->cur->enable(scr); cursoron(); } + +/* + * called from devvga when the framebuffer is setup + * to set *bootscreen= that can be passed on to a + * new kernel on reboot. + */ +void +bootscreenconf(VGAscr *scr) +{ + char conf[100], chan[30]; + + conf[0] = '\0'; + if(scr != nil && scr->paddr != 0) + snprint(conf, sizeof(conf), "%dx%dx%d %s %#p %d\n", + scr->gscreen->r.max.x, scr->gscreen->r.max.y, + scr->gscreen->depth, chantostr(chan, scr->gscreen->chan), + scr->paddr, scr->apsize); + + ksetenv("*bootscreen", conf, 1); +} diff --git a/sys/src/9/pc/screen.h b/sys/src/9/pc/screen.h index 58aa7f320..762e7803e 100644 --- a/sys/src/9/pc/screen.h +++ b/sys/src/9/pc/screen.h @@ -149,6 +149,9 @@ extern int screenaperture(int, int); extern Rectangle physgscreenr; /* actual monitor size */ extern void blankscreen(int); +extern void bootscreeninit(void); +extern void bootscreenconf(VGAscr*); + extern VGAcur swcursor; extern void swcursorinit(void); extern void swcursorhide(void); |
