[eros-cvs] cvs commit: eros/src/base/sys/kerninc Console.hxx
shap@eros.cs.jhu.edu
shap@eros.cs.jhu.edu
Tue, 14 Aug 2001 18:07:53 -0400
shap 01/08/14 18:07:53
Modified: src/base/sys/arch/i486/conf DEFAULT DEVEL files.pc
src/base/sys/arch/i486/kernel Machine.cxx
src/base/sys/console cons_SVGA.cxx cons_TextMode.cxx
src/base/sys/kerninc Console.hxx
Added: src/base/sys/arch/i486/conf MHILSDALE
src/base/sys/console cons_VESA.cxx
Log:
Add a mode for Mike Hilsdale for VESA supporting build.
Shift NOKBD into DEFAULT configuration now that debugger can take over
anyway.
Revision Changes Path
1.8 +4 -4 eros/src/base/sys/arch/i486/conf/DEFAULT
Index: DEFAULT
===================================================================
RCS file: /cvs/eros/src/base/sys/arch/i486/conf/DEFAULT,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DEFAULT 2001/06/10 19:41:47 1.7
+++ DEFAULT 2001/08/14 22:07:53 1.8
@@ -20,14 +20,14 @@
include("../../../config.common")
+exclude("kbd")
option("ddb")
-option("kern_profile")
-option("kern_timing_stats")
+
+# option("kern_profile")
+# option("kern_timing_stats")
defoption("fast_ipc_stats")
option("fast_ipc_stats")
option("ob_mod_check")
# option("kern_event_tracing")
-
-option("test_procs")
include("ALL")
1.12 +4 -2 eros/src/base/sys/arch/i486/conf/DEVEL
Index: DEVEL
===================================================================
RCS file: /cvs/eros/src/base/sys/arch/i486/conf/DEVEL,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DEVEL 1999/10/13 22:40:32 1.11
+++ DEVEL 2001/08/14 22:07:53 1.12
@@ -20,9 +20,11 @@
include("../../../config.common")
+exclude("kbd")
option("ddb")
-option("kern_profile")
-option("kern_timing_stats")
+
+# option("kern_profile")
+# option("kern_timing_stats")
defoption("fast_ipc_stats")
option("fast_ipc_stats")
option("ob_mod_check")
1.20 +1 -0 eros/src/base/sys/arch/i486/conf/files.pc
Index: files.pc
===================================================================
RCS file: /cvs/eros/src/base/sys/arch/i486/conf/files.pc,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- files.pc 2001/07/24 03:59:30 1.19
+++ files.pc 2001/08/14 22:07:53 1.20
@@ -79,6 +79,7 @@
file("arch/i486/kernel/GDT.cxx")
file("arch/i486/kernel/longjmp.S")
+file("console/cons_VESA.cxx", consfb)
file("console/cons_SVGA.cxx", consfb)
file("console/cons_TextMode.cxx")
1.1 eros/src/base/sys/arch/i486/conf/MHILSDALE
Index: MHILSDALE
===================================================================
#
# Copyright (C) 1998, 1999, Jonathan S. Shapiro.
#
# This file is part of the EROS Operating System.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
include("../../../config.common")
exclude("kbd")
option("ddb")
# option("kern_profile")
# option("kern_timing_stats")
defoption("fast_ipc_stats")
option("fast_ipc_stats")
option("ob_mod_check")
# option("kern_event_tracing")
defoption("vesa_console")
option("vesa_console")
include("ALL")
1.120 +1 -2 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.119
retrieving revision 1.120
diff -u -r1.119 -r1.120
--- Machine.cxx 2001/07/24 03:59:30 1.119
+++ Machine.cxx 2001/08/14 22:07:53 1.120
@@ -98,8 +98,7 @@
* only, so it does not interact at all with the autoconfiguration
* mechanism.
*/
- if (!Console::InitFB())
- Console::Init();
+ Console::InitVESA() || Console::InitSVGA() || Console::InitTextMode();
/* On the 386, this can be done before enabling VM, which
* is helpful.
1.2 +13 -9 eros/src/base/sys/console/cons_SVGA.cxx
Index: cons_SVGA.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/console/cons_SVGA.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cons_SVGA.cxx 2001/07/24 03:59:30 1.1
+++ cons_SVGA.cxx 2001/08/14 22:07:53 1.2
@@ -31,28 +31,32 @@
#include <kerninc/kernel.hxx>
#include <kerninc/Console.hxx>
+#include <kerninc/MsgLog.hxx>
-uint8_t *screen = (uint8_t *) PTOV(0xA0000u);
+static uint8_t *screen = (uint8_t *) PTOV(0xA0000u);
/* The implementation of the console frame buffer is inherently
* video card specific... */
-struct ConsVGA: public Console {
+struct ConsSVGA: public Console {
void Clear();
void Put(uint8_t c);
};
-ConsVGA TheConsVGA;
+ConsSVGA TheConsSVGA;
bool
-Console::InitFB()
+Console::InitSVGA()
{
#if 0
- TheConsVGA.offset = 0;
+ TheConsSVGA.offset = 0;
- TheConsole = &TheConsVGA;
- /* Do something here to set the video mode... */
+ /* Do something here to set the video mode?... */
+ TheConsSVGA.Clear();
+
+ MsgLog::RegisterSink(&TheConsSVGA);
+
return true;
#else
return false;
@@ -61,7 +65,7 @@
/* FIX: This is NOT RIGHT!! */
void
-ConsVGA::Put(uint8_t c)
+ConsSVGA::Put(uint8_t c)
{
unsigned i;
unsigned long line = offset / 80;
@@ -77,7 +81,7 @@
}
void
-ConsVGA::Clear()
+ConsSVGA::Clear()
{
unsigned i;
1.4 +4 -2 eros/src/base/sys/console/cons_TextMode.cxx
Index: cons_TextMode.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/console/cons_TextMode.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cons_TextMode.cxx 2001/08/08 22:23:23 1.3
+++ cons_TextMode.cxx 2001/08/14 22:07:53 1.4
@@ -78,8 +78,8 @@
blank = 0,
};
-void
-Console::Init()
+bool
+Console::InitTextMode()
{
outb(0xc, 0x3d4); /* start address hi register addr */
uint8_t hi = inb(0x3d5);
@@ -92,6 +92,8 @@
TheConsTextMode.Clear();
MsgLog::RegisterSink(&TheConsTextMode);
+
+ return true;
}
static void
1.1 eros/src/base/sys/console/cons_VESA.cxx
Index: cons_VESA.cxx
===================================================================
/*
* Copyright (C) 2001, Jonathan S. Shapiro.
*
* This file is part of the EROS Operating System.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* Implementation of the kernel frame buffer console logic. We make
* the simplifying assumption here that the console is a VGA
* (640x480x256) display. If the machine-specific initialization code
* has somehow placed the display buffer in some other state (e.g. we
* have a large VESA display or some such), then it is the
* responsibility of the machine-specific code to suitably place a
* 640x480 bitmap somewhere on the tube. Remember that this console
* isn't going to get used for very long -- only until the user-mode
* console driver takes over the world.
*/
#include <kerninc/kernel.hxx>
#include <kerninc/Console.hxx>
#include <kerninc/MsgLog.hxx>
static uint8_t *screen = (uint8_t *) PTOV(0xA0000u);
/* The implementation of the console frame buffer is inherently
* video card specific... */
struct ConsVESA: public Console {
void Clear();
void Put(uint8_t c);
};
ConsVESA TheConsVESA;
bool
Console::InitVESA()
{
#ifdef OPTION_VESA_CONSOLE
/* Fix me here! */
TheConsVESA.offset = 0;
/* Do something here to set the video mode?... */
TheConsVESA.Clear();
MsgLog::RegisterSink(&TheConsVESA);
return true;
#else
return false;
#endif
}
/* FIX: This is NOT RIGHT!! */
void
ConsVESA::Put(uint8_t c)
{
unsigned i;
unsigned long line = offset / 80;
unsigned long col = offset % 80;
uint8_t *where = screen + (line * 16) + col;
for (i = 0; i < 16; i++) {
/* FIX: set the color to write! */
*where = console_font[c * 16 + i];
where += 80;
}
}
void
ConsVESA::Clear()
{
unsigned i;
/* This is screamingly inefficient... */
unsigned long old_offset = offset;
offset = 0;
for (i = 0; i < (30 * 80); i++) {
Put(' ');
offset ++;
}
offset = old_offset;
}
1.27 +4 -2 eros/src/base/sys/kerninc/Console.hxx
Index: Console.hxx
===================================================================
RCS file: /cvs/eros/src/base/sys/kerninc/Console.hxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Console.hxx 2001/07/24 03:59:31 1.26
+++ Console.hxx 2001/08/14 22:07:53 1.27
@@ -127,8 +127,10 @@
struct Console {
unsigned long offset;
- static bool InitFB();
- static void Init();
+ static bool InitVESA();
+ static bool InitSVGA();
+ static bool InitTextMode();
+ static bool InitSerial();
virtual void Clear() = 0;
virtual void Put(uint8_t c) = 0;