]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Fix vga-overlay so that it doesn't cause disasters when it does an immediate-flush...
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 5 Oct 2008 07:21:53 +0000 (03:21 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 5 Oct 2008 07:21:53 +0000 (03:21 -0400)
aseg/firstrun.c
aseg/vga-overlay.c
include/vga-overlay.h

index 6df8d7da9dee4e38c1c33f870cc659ef972bd5f7..d3cd16f4a69957b88e6ff8831e82259c95689a95 100644 (file)
@@ -23,6 +23,8 @@ void __firstrun_start() {
        for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
                *bp = 0;
        
+       vga_flush_imm(0);
+       
        outputf("NetWatch running");
 
        /* Try really hard to shut up USB_LEGKEY. */
@@ -47,6 +49,8 @@ void __firstrun_start() {
 
        smi_enable();
        
+       vga_flush_imm(1);
+       
        smram_restore_state(smram);
 }
 
index 913ebc2f4479aabc9c86d25f61ea651866f61371..7d107d71264f20d9ae430f2dd99bbb40b1f5c21d 100644 (file)
@@ -10,6 +10,7 @@
 
 static char logents[LOGLEN][41] = {{0}};
 static int prodptr = 0;
+static int flush_imm = 0;
 
 #define VRAM_BASE              0xA0000UL
 #define TEXT_CONSOLE_OFFSET    0x18000UL 
@@ -18,6 +19,11 @@ static int prodptr = 0;
 
 #define COLOR                  0x1F
 
+void vga_flush_imm(int imm)
+{
+       flush_imm = imm;
+}
+
 static unsigned char vga_read(unsigned char idx)
 {
        outb(CRTC_IDX_REG, idx);
@@ -75,7 +81,8 @@ void dolog(const char *s)
 {
        strcpy(logents[prodptr], s);
        prodptr = (prodptr + 1) % LOGLEN;
-       outlog();
+       if (flush_imm)
+               outlog();
 }
 void (*output)(const char *s) = dolog;
 
@@ -87,7 +94,8 @@ void dologf(const char *fmt, ...)
        vsnprintf(logents[prodptr], 40, fmt, va);
        va_end(va);
        prodptr = (prodptr + 1) % LOGLEN;
-       outlog();
+       if (flush_imm)
+               outlog();
 }
 void (*outputf)(const char *s, ...) = dologf;
 
index f338d49d88a21eb2bcab4e1ffa77b98b8c9179fa..ec9efd5da1045e466f2e2d785c5ec310887a5544 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef VGA_OVERLAY_H
 #define VGA_OVERLAY_H
 
+void vga_flush_imm(int enb);
+
 void strblit(char *src, int row, int col);
 
 void dolog(char *s);
This page took 0.024931 seconds and 4 git commands to generate.