Skip to content

Commit

Permalink
fb: Make PMON work without VGA
Browse files Browse the repository at this point in the history
Disable output properly.

Signed-off-by: Jiaxun Yang <[email protected]>
  • Loading branch information
FlyGoat committed Dec 22, 2020
1 parent 60103e4 commit b3ece66
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fb/cfb_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,19 @@ static void memcpyl (int *d, int *s, int c);

extern int vga_available;

static int disableoutput=0;
static int disableoutput=1;
void video_disableoutput(void)
{
disableoutput=1;
}
void video_enableoutput(void)
{
if (!vga_available)
return;

if (!video_fb_address)
return;

disableoutput=0;
}
void video_drawchars_xor (int xx, int yy, unsigned char *s, int count)
Expand Down Expand Up @@ -942,6 +948,9 @@ static void console_newline (void)

void video_putc (const char c)
{
if(disableoutput)
return;

switch (c) {
case 13: /* ignore */
CURSOR_OFF
Expand Down Expand Up @@ -1715,6 +1724,8 @@ int fb_init (unsigned long fbbase,unsigned long iobase)
memset (memfb, 0, CONSOLE_ROWS * CONSOLE_COLS);
}
#endif
video_enableoutput();

return 0;
}

0 comments on commit b3ece66

Please sign in to comment.