writting strings in vesa

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

writting strings in vesa

Post 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.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: writting strings in vesa

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: writting strings in vesa

Post by Combuster »

2b) use a scaling filter :)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: writting strings in vesa

Post 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
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: writting strings in vesa

Post 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?
Gizmic OS
Currently - Busy with FAT12 driver and VFS
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: writting strings in vesa

Post by Combuster »

And BGI was said to be slow compared to direct access to video memory.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: writting strings in vesa

Post 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
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Re: writting strings in vesa

Post 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? #-o Nah, BGI is too old to do that. :)

Regards
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: writting strings in vesa

Post 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
Gizmic OS
Currently - Busy with FAT12 driver and VFS
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: writting strings in vesa

Post 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
Post Reply