diff options
Diffstat (limited to 'Source/Kernel/Devices/Display')
-rw-r--r-- | Source/Kernel/Devices/Display/Display.proto.h | 1 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/VESADisplay.class.cpp | 37 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/VGATextOutput.class.cpp | 8 | ||||
-rw-r--r-- | Source/Kernel/Devices/Display/vga-vesa.wtf.asm | 22 |
4 files changed, 22 insertions, 46 deletions
diff --git a/Source/Kernel/Devices/Display/Display.proto.h b/Source/Kernel/Devices/Display/Display.proto.h index 8401e0b..26c3696 100644 --- a/Source/Kernel/Devices/Display/Display.proto.h +++ b/Source/Kernel/Devices/Display/Display.proto.h @@ -18,6 +18,7 @@ class Display : public Device { //Text functions virtual void putChar(u16int line, u16int col, WChar c, u8int color) = 0; //Color : <bg 4bits><fg 4bits> virtual void moveCursor(u16int line, u16int col) = 0; + virtual bool textScroll(u16int line, u16int col, u16int height, u16int width, u8int color) { return false; } //Graphic functions, can stay unimplemented for textual displays virtual void putPix(u16int x, u16int y, u32int color) {} diff --git a/Source/Kernel/Devices/Display/VESADisplay.class.cpp b/Source/Kernel/Devices/Display/VESADisplay.class.cpp index 4c3041a..ae64403 100644 --- a/Source/Kernel/Devices/Display/VESADisplay.class.cpp +++ b/Source/Kernel/Devices/Display/VESADisplay.class.cpp @@ -3,8 +3,6 @@ #include <MemoryManager/PhysMem.ns.h> -extern v86_function_t vesa_int; //in vga-vesa.wtf.asm - using namespace Disp; String VESADisplay::getClass() { @@ -16,15 +14,16 @@ String VESADisplay::getName() { } vbe_controller_info_t VESADisplay::getCtrlrInfo() { + V86::map(); vbe_controller_info_t *info = (vbe_controller_info_t*)V86::alloc(sizeof(vbe_controller_info_t)); info->signature[0] = 'V'; info->signature[1] = 'B'; info->signature[2] = 'E'; info->signature[3] = '2'; info->videomodes = 0; - registers_t regs; - regs.eax = 0x00004F00; - regs.esi = LIN_SEG(info); - regs.edi = LIN_OFF(info); - V86::run(vesa_int, regs, 0); - if (regs.eax != 0x004F) PANIC("Something went wrong in detecting VBE modes."); + v86_regs_t regs; + regs.ax = 0x4F00; + regs.es = LIN_SEG(info); + regs.di = LIN_OFF(info); + V86::biosInt(0x10, regs); + if (regs.ax != 0x004F) PANIC("Something went wrong in detecting VBE modes."); if (info->signature[3] != 'A') PANIC("No vesa sinature"); return *info; } @@ -33,12 +32,12 @@ vbe_mode_info_t VESADisplay::getModeInfo(u16int id) { V86::map(); vbe_mode_info_t *mode = (vbe_mode_info_t*)V86::alloc(sizeof(vbe_mode_info_t)); CMem::memset((u8int*)mode, 0, sizeof(vbe_mode_info_t)); - registers_t regs; - regs.eax = 0x00004F01; - regs.ecx = id; - regs.esi = LIN_SEG(mode); - regs.edi = LIN_OFF(mode); - V86::run(vesa_int, regs, 0); + v86_regs_t regs; + regs.ax = 0x00004F01; + regs.cx = id; + regs.es = LIN_SEG(mode); + regs.di = LIN_OFF(mode); + V86::biosInt(0x10, regs); return *mode; } @@ -52,7 +51,7 @@ void VESADisplay::getModes(Vector<mode_t> &to) { if ((mode.attributes & 0x90) != 0x90) continue; if (mode.memory_model != 4 and mode.memory_model != 6) continue; - if (mode.bpp != 24) continue; + //if (mode.bpp != 24) continue; mode_t m; m.device = this; m.textCols = mode.Xres / C_FONT_WIDTH; m.textRows = mode.Yres / C_FONT_HEIGHT; m.identifier = modes[i]; @@ -64,10 +63,10 @@ void VESADisplay::getModes(Vector<mode_t> &to) { bool VESADisplay::setMode(mode_t &mode) { if (mode.device != this) return false; m_currMode = getModeInfo(mode.identifier); - registers_t regs; - regs.eax = 0x00004F02; - regs.ebx = mode.identifier | 0x4000; - V86::run(vesa_int, regs, 0); + v86_regs_t regs; + regs.ax = 0x00004F02; + regs.bx = mode.identifier | 0x4000; + V86::biosInt(0x10, regs); m_fb = (u8int*)0xF0000000; for (u32int i = 0; i < (u32int)(m_currMode.Yres * m_currMode.pitch); i += 0x1000) { diff --git a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp index d307f60..8c687ba 100644 --- a/Source/Kernel/Devices/Display/VGATextOutput.class.cpp +++ b/Source/Kernel/Devices/Display/VGATextOutput.class.cpp @@ -3,8 +3,6 @@ #include <TaskManager/V86/V86.ns.h> -extern v86_function_t setvgamode; - //Virtual address in higher half #define RAM_ADDR 0xC00B8000 @@ -35,10 +33,10 @@ void VGATextOutput::getModes(Vector<mode_t> &to) { bool VGATextOutput::setMode(mode_t& mode) { if (mode.device == this && (mode.identifier == 3 or mode.identifier == 1)) { - registers_t r; - r.eax = mode.identifier; + v86_regs_t r; + r.ax = mode.identifier; m_cols = mode.textCols; - V86::run(setvgamode, r, 0); + V86::biosInt(0x10, r); clear(); return true; } diff --git a/Source/Kernel/Devices/Display/vga-vesa.wtf.asm b/Source/Kernel/Devices/Display/vga-vesa.wtf.asm deleted file mode 100644 index 4a6a1d6..0000000 --- a/Source/Kernel/Devices/Display/vga-vesa.wtf.asm +++ /dev/null @@ -1,22 +0,0 @@ -[BITS 16] - -[GLOBAL setvgamode] -setvgamode: - dw setvgamode_end - setvgamode_start -setvgamode_start: - int 60 - int 10h - int 3 -setvgamode_end: - db 0 - -[GLOBAL vesa_int] -vesa_int: - dw vesa_int_end - vesa_int_start -vesa_int_start: - int 60 - mov es, si - int 10h - int 3 -vesa_int_end: - db 0 |