Page 1 of 1
writting strings in vesa
Posted: Wed Jul 16, 2008 9:38 am
by System123
I am programming an OS in pascal. My kernel loads vesa but I cant get it to print text out in VESA mode. It prints the text but it is so small it is unreadable. I am printing the text out using the CRT methods that are in Pascal unit files.
Re: writting strings in vesa
Posted: Wed Jul 16, 2008 9:54 am
by AJ
Hi,
As far as I can see, you have three options:
1) If you are in a graphics mode, lower the resolution.
2) If you are in a graphics mode, use a larger font (or simply double the number of pixels printed for a bitmap font - may look ugly).
3) If you are in a text mode, switch to a mode with a larger font size (as specified in the VESA Mode Information Block for a particular mode).
Cheers,
Adam
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 2:17 am
by Combuster
2b) use a scaling filter
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 4:25 am
by jal
AJ wrote:1) If you are in a graphics mode, lower the resolution.
2) If you are in a graphics mode, use a larger font (or simply double the number of pixels printed for a bitmap font - may look ugly).
3) If you are in a text mode, switch to a mode with a larger font size (as specified in the VESA Mode Information Block for a particular mode).
4) If you are in graphics mode,
don't use CRT functions since they are only for text mode!. For graphics, Borland has BGI.
What version of Pascal are you using? Are you writing a real mode OS?
JAL
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 6:54 am
by System123
Yes i am making a real mode os. I use borland pascal 7. Wat functions should i be using from the bgi units?
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 7:53 am
by Combuster
And BGI was said to be slow compared to direct access to video memory.
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 8:38 am
by jal
System123 wrote:Yes i am making a real mode os. I use borland pascal 7. Wat functions should i be using from the bgi units?
Try the help function to find out, it's been a loooooong time since I used BGI (i.e. the Graph unit). Also make sure you find the BGI for svga, otherwise it won't work. Alternatively, you could of course write your own routines for displaying text. Start with bitmapped text, that's the easiest.
A quick Google turns up some usefull links, e.g.
here for SVGA BGI drivers with example PAS files, and
here another one. When you use these, you can probably skip setting up the VESA graphics mode yourself, as there are API calls to switch to graphics mode.
JAL
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 8:50 am
by inflater
Don't use BGI if you intend it for your kernel. You need to have the correct BGI file right in the same directory where your kernel is - plus, you can't modify the BGI loading routine, since it's hardcoded into your application and it uses INT 21h functions, which are completely useless without MS-DOS.
I've heard somewhere about including a BGI file in the application. That maybe would work.
But I recommend to program your own routines. I highly doubt that BGI would work with VESA. BGI works only for modes such as 640x350, 640x480 16 colors and 320x200 256 colors. What if you had to work with 800x600 32-bit colors?
Nah, BGI is too old to do that.
Regards
inflater
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 10:34 am
by System123
I will read up into buildin bitmap displays and so on.. I will see what i can pull off. I have already built a vesa driver so setting up vesa is not such an issue.. Thanks very much
Re: writting strings in vesa
Posted: Thu Jul 17, 2008 1:49 pm
by jal
inflater wrote:I highly doubt that BGI would work with VESA. BGI works only for modes such as 640x350, 640x480 16 colors and 320x200 256 colors. What if you had to work with 800x600 32-bit colors? #-o Nah, BGI is too old to do that. :)
If you post to a thread, please check what others write. I have put up to links to VESA/SVGA BGI drivers. You have a valid point with the loading of BGI (although you could emulate int 21h of course, or load the BGI driver yourself), but you obvioulsy didn't read what I wrote.
JAL