diff options
author | Alexis211 <alexis211@gmail.com> | 2009-11-08 18:32:36 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-11-08 18:32:36 +0100 |
commit | 4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2 (patch) | |
tree | 3e0a5981eed78336bbd5baf7c6be50cd518be1fa /Source/Kernel | |
parent | 699a1497a4eb432f41d643a18f2ac6ba10a66518 (diff) | |
download | Melon-4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2.tar.gz Melon-4bbc1baf27573b4ca6fe6d8ed18b236ac3c631d2.zip |
Switching to text mode now really switches to text mode.
Diffstat (limited to 'Source/Kernel')
-rw-r--r-- | Source/Kernel/Devices/Display/VGATextOutput.class.cpp | 12 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/vga-vesa.wtf.asm | 11 | ||||
-rw-r--r-- | Source/Kernel/Makefile | 2 | ||||
-rw-r--r-- | Source/Kernel/TaskManager/V86/V86.ns.h | 4 | ||||
-rw-r--r-- | Source/Kernel/TaskManager/V86/v86.wtf.asm | 11 |
5 files changed, 21 insertions, 19 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 diff --git a/Source/Kernel/Makefile b/Source/Kernel/Makefile index 218ae39..636968d 100644 --- a/Source/Kernel/Makefile +++ b/Source/Kernel/Makefile @@ -30,7 +30,6 @@ Objects = Core/loader.wtf.o \ TaskManager/Thread.class.o \ TaskManager/V86/V86Thread.class.o \ TaskManager/V86/V86.ns.o \ - TaskManager/V86/v86.wtf.o \ TaskManager/Task.ns.o \ TaskManager/Task.wtf.o \ VTManager/VirtualTerminal.proto.o \ @@ -71,6 +70,7 @@ Objects = Core/loader.wtf.o \ SyscallManager/Res.ns.o \ SyscallManager/IDT.wtf.o \ Devices/Display/VGATextOutput.class.o \ + Devices/Display/vga-vesa.wtf.o \ Devices/Keyboard/PS2Keyboard.class.o \ Devices/Floppy/FloppyController.class.o \ Devices/Floppy/FloppyDrive.class.o \ diff --git a/Source/Kernel/TaskManager/V86/V86.ns.h b/Source/Kernel/TaskManager/V86/V86.ns.h index 6e8797a..98f3ead 100644 --- a/Source/Kernel/TaskManager/V86/V86.ns.h +++ b/Source/Kernel/TaskManager/V86/V86.ns.h @@ -22,10 +22,6 @@ inline FARPTR LINEAR_TO_FP(void* ptr) { #define V86_ALLOC_START 0x1000 #define V86_ALLOC_END 0x9000 - -//This sample V86 function switches to graphical mode 13. Useless. -extern "C" v86_function_t v86test; - namespace V86 { void run(v86_function_t& entry, registers_t ®s, u32int data); diff --git a/Source/Kernel/TaskManager/V86/v86.wtf.asm b/Source/Kernel/TaskManager/V86/v86.wtf.asm deleted file mode 100644 index 15e3969..0000000 --- a/Source/Kernel/TaskManager/V86/v86.wtf.asm +++ /dev/null @@ -1,11 +0,0 @@ -[BITS 16] - -[GLOBAL v86test] -v86test: - dw v86test_end - v86test_start -v86test_start: - mov ax, 0013h - int 10h - int 3 -v86test_end: - db 0 |