I would like to write a text editor running on text screen. In modern PC 1280x1024 (160x64 char) screen would be good for flat panel. For safety reason I am working on a i865 based P4 motherboard. VESA bios sets the resolution but in graphics mode; additionally, the VGA registers shows the original DOS screen values. I need help how to program i865 to text mode.
Asked
Active
Viewed 776 times
1
-
I don't think 160x64 text modes are commonly implemented. The best you're you're likely to find is something like 132x60. You can instead draw your own text in 1280x1024 graphics mode, and the BIOS might (should?) support text output in graphics mode like it does for the standard VGA graphics modes. – Ross Ridge Jun 10 '17 at 16:05
-
The video memory is not at E800:0000. It is either at B000:0000 or B800:0000. – Ina Wick Dec 08 '18 at 09:55
1 Answers
6
1280x1024 is not a VGA resolution. You will need to use VESA/VBE if you want to use these high-resolution modes. And, with one exception (that does not meet your requirement), there are no standard modes defined by VESA. You need to interrogate the video card and pick one of the supported modes. Use VBE function 00h to get a full list of supported modes, and function 01h to check the attributes for each of these supported modes to see if it meets your requirements.
Once you've found the mode you want, function 02h will set that mode, and then you are basically done. Well, except for the hard part of writing code that puts text on the screen!
This is all documented in the standard. Sample code in C is available on the OSDev Wiki.

Cody Gray - on strike
- 239,200
- 50
- 490
- 574
-
I am trying to use the VESA mode writing with own graphic code, but I have stuck on putpixel. – brekee12 Jun 12 '17 at 06:55
-
I am trying to use the VESA mode writing with own graphic code, but I have stuck on putpixel. The problem is protected mode. I use DPMI and read out the PhysBuffPtr of VESA which is E800 0000. I am testing 1280x1024:256 with poking four bytes on the screen but I got page fault or nothing visible. Can anyone help me with a code works with pmode addressing the FB and put a pixel. Thank you in advance! – brekee12 Jun 12 '17 at 07:01