summaryrefslogtreecommitdiff
path: root/Source/Kernel/Devices
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-08 18:32:36 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-08 18:32:36 +0100
commit4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2 (patch)
tree3e0a5981eed78336bbd5baf7c6be50cd518be1fa /Source/Kernel/Devices
parent699a1497a4eb432f41d643a18f2ac6ba10a66518 (diff)
downloadMelon-4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2.tar.gz
Melon-4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2.zip
Switching to text mode now really switches to text mode.
Diffstat (limited to 'Source/Kernel/Devices')
-rw-r--r--Source/Kernel/Devices/Display/VGATextOutput.class.cpp12
-rw-r--r--Source/Kernel/Devices/Display/vga-vesa.wtf.asm11
2 files changed, 20 insertions, 3 deletions
diff --git a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp
index 8840080..3265a7d 100644
--- a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp
+++ b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp
@@ -1,6 +1,10 @@
#include "VGATextOutput.class.h"
#include <DeviceManager/Disp.ns.h>
+#include <TaskManager/V86/V86.ns.h>
+
+extern v86_function_t setvgamode;
+
//Virtual address in higher half
#define RAM_ADDR 0xC00B8000
@@ -19,7 +23,7 @@ void VGATextOutput::getModes(Vector<mode_t> &to) {
mode_t m;
m.textCols = 80;
m.textRows = 25;
- m.identifier = 0;
+ m.identifier = 3;
m.graphWidth = 0;
m.graphHeight = 0;
m.device = this;
@@ -27,8 +31,10 @@ void VGATextOutput::getModes(Vector<mode_t> &to) {
}
bool VGATextOutput::setMode(mode_t& mode) {
- if (mode.device == this && mode.identifier == 0) {
- //TODO : switch for real to mode 0.
+ if (mode.device == this && mode.identifier == 3) {
+ registers_t r;
+ r.eax = 3; //3 = text 80x25 16color, just what we want
+ V86::run(setvgamode, r, 0);
clear();
return true;
}
diff --git a/Source/Kernel/Devices/Display/vga-vesa.wtf.asm b/Source/Kernel/Devices/Display/vga-vesa.wtf.asm
new file mode 100644
index 0000000..c7b6bb5
--- /dev/null
+++ b/Source/Kernel/Devices/Display/vga-vesa.wtf.asm
@@ -0,0 +1,11 @@
+[BITS 16]
+
+[GLOBAL setvgamode]
+setvgamode:
+ dw setvgamode_end - setvgamode_start
+setvgamode_start:
+ int 60
+ int 10h
+ int 3
+setvgamode_end:
+ db 0