[eros-cvs] cvs commit: eros/src/base/sys/console cons_VESA.cxx

shap@eros.cs.jhu.edu shap@eros.cs.jhu.edu
Thu, 23 Aug 2001 13:44:01 -0400


shap        01/08/23 13:44:01

  Modified:    src/base/sys/arch/i486/kernel Machine.cxx
               src/base/sys/console cons_VESA.cxx
  Log:
  Now drawing in post-gdt mode, though slowly. Fixed character redraw issue.

Revision  Changes    Path
1.125     +6 -4      eros/src/base/sys/arch/i486/kernel/Machine.cxx

Index: Machine.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/arch/i486/kernel/Machine.cxx,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- Machine.cxx	2001/08/22 17:38:35	1.124
+++ Machine.cxx	2001/08/23 17:44:01	1.125
@@ -126,6 +126,8 @@
     /* Now try it at the linear address, before we load the GDT: */
     Machine::frameBuffer = KVTOL(Machine::mappedFrameBuffer);
 
+    MsgLog::printf("Redraw at KVTOL(fb-vp)\n");
+
     animate();
     redrawLogos();
   }
@@ -582,13 +584,13 @@
   if (BootInfoPtr->consInfo) {
     ConsoleInfo *ci = BootInfoPtr->consInfo;
  
-    kpa_t pbase = align_down(ci->frameBuffer, EROS_PAGE_SIZE);
+    kpa_t pbase = ci->frameBuffer;
     kpa_t ptop = ((kpa_t)ci->frameBuffer) + ci->bytesPerScanLine * ci->Ylimit;
     ptop = align_up(ptop, EROS_PAGE_SIZE);
 
-    kpa_t paddr = pbase;
+    kpa_t paddr = align_down(pbase, EROS_PAGE_SIZE);
 
-    kpa_t fb_len = ptop - pbase;
+    kpa_t fb_len = ptop - paddr; /* length of bracketing page range */
 
     assert((fb_len % EROS_PAGE_SIZE) == 0);
 
@@ -602,7 +604,7 @@
 
       assert((paddr & EROS_PAGE_MASK) == 0);
     
-      uint32_t mode = PTE_W|PTE_V /* |PTE_WT */;
+      uint32_t mode = PTE_W|PTE_V |PTE_WT;
 
       MapPageAt(vaddr, paddr, mode | globalPage);
 



1.11      +20 -19    eros/src/base/sys/console/cons_VESA.cxx

Index: cons_VESA.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/console/cons_VESA.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- cons_VESA.cxx	2001/08/22 23:10:51	1.10
+++ cons_VESA.cxx	2001/08/23 17:44:01	1.11
@@ -41,6 +41,7 @@
 
 #define CURSOR 177 /* hash */
 /*#define CURSOR 1 smiley*/
+
 #define cursor() Put(CURSOR, col, row)
 
 #ifdef OLD_SCREEN
@@ -98,10 +99,6 @@
 Console::InitVESA()
 {
 #ifdef OPTION_VESA_CONSOLE
-#if 0
-  uint8_t a = 0;
-#endif
-
   /* hack: make logos work correctly */
   /* Gimp macro resets the header_data pointers each time it uses it. */
   /* Thus, pointer needs to be reset each time the logo is redrawn. */
@@ -111,15 +108,6 @@
   if (!BootInfoPtr->useGraphicsFB)
     return false;
 
-  TheConsVESA.baseCol = 1;
-  TheConsVESA.baseRow = 1;
-  TheConsVESA.maxCol = TheConsVESA.xres/8;
-  TheConsVESA.maxRow = TheConsVESA.yres/16;
-
-  /* TheConsVESA.offset = 0; */
-  TheConsVESA.col = TheConsVESA.baseCol;
-  TheConsVESA.row = TheConsVESA.baseRow;
-
   /* set the screen parameters */
 #ifdef OLD_SCREEN
   screen = (unsigned char *) TheConsVESA.base;
@@ -131,16 +119,29 @@
   TheConsVESA.bpsl = BootInfoPtr->consInfo->bytesPerScanLine;
 #endif
 
+  TheConsVESA.baseCol = 1;
+  TheConsVESA.baseRow = 1;
+  TheConsVESA.maxCol = TheConsVESA.xres/8;
+  TheConsVESA.maxRow = TheConsVESA.yres/16;
+
+  /* TheConsVESA.offset = 0; */
+  TheConsVESA.col = TheConsVESA.baseCol;
+  TheConsVESA.row = TheConsVESA.baseRow;
+
+
   TheConsVESA.Clear();
 
   drawHeader();
 
 #if 0
-  /* run through the entire font */
-  for (a = 0; a < 0xff; a++)
-    {
+  {
+    unsigned a;
+
+    /* run through the entire font */
+    for (a = 0; a < 0xff; a++) {
       TheConsVESA.Put(a);
     }
+  }
 #endif
 
   MsgLog::RegisterSink(&TheConsVESA);
@@ -242,11 +243,11 @@
 
   signed long int l;
 
-  if(col < TheConsVESA.baseCol || col > TheConsVESA.maxCol ||
-     row < TheConsVESA.baseRow || row > TheConsVESA.maxRow)
+  if(cl < TheConsVESA.baseCol || cl > TheConsVESA.maxCol ||
+     rw < TheConsVESA.baseRow || rw > TheConsVESA.maxRow)
     return; /* out of bounds */
 
-  /* remember that col & row use 1-based indexing */
+  /* remember that cl & rw use 1-based indexing */
   x = (cl - 1) * 8;
   y = (rw - 1) * 16;