8-bit text VGA driver

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
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

8-bit text VGA driver

Post by catOS »

I am creating an operating system: https://github.com/caelwithcats/ackOS. I've followed the bare bones tutorial and have a working VGA text driver. I am trying to make it display all the colours of the rainbow, to see if I can do ASCII art with it. The problem is, there is no colours like orange and purple. This website lists the colours that VGA can display https://www.fountainware.com/EXPL/vga_c ... lettes.htm. It looks like I need 8-bit graphics if I want to use more colours. Is there a 8-bit colour driver?

Image
The closest colour to orange is light red or cyan
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
klange
Member
Member
Posts: 679
Joined: Wed Mar 30, 2011 12:31 am
Libera.chat IRC: klange
Discord: klange

Re: 8-bit text VGA driver

Post by klange »

It's time to move to a graphics mode. VGA text mode is a legacy thing you should not invest a lot of time in. Useful for debugging, but if you're worried about not having enough colors it's time to move on.
Octocontrabass
Member
Member
Posts: 5572
Joined: Mon Mar 25, 2013 7:01 pm

Re: 8-bit text VGA driver

Post by Octocontrabass »

catOS wrote:Is there a 8-bit colour driver?
How old is the physical hardware you want to run your OS on? If it's less than 20 years old, forget about VGA. Have your bootloader set up a linear frame buffer with 24-bit or 32-bit color and never worry about which colors you can use again.

If you do happen to have such antiques, though, it is possible to replace the 16 colors you're using now with any 16 colors you like.
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

Re: 8-bit text VGA driver

Post by catOS »

Octocontrabass wrote:
catOS wrote:Is there a 8-bit colour driver?
How old is the physical hardware you want to run your OS on? If it's less than 20 years old, forget about VGA. Have your bootloader set up a linear frame buffer with 24-bit or 32-bit color and never worry about which colors you can use again.

If you do happen to have such antiques, though, it is possible to replace the 16 colors you're using now with any 16 colors you like.
No I'm not developing for an old machine, but other ways of drawing to screen sound too difficult and there is no tutorial on how do it :x
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: 8-bit text VGA driver

Post by bzt »

catOS wrote:No I'm not developing for an old machine, but other ways of drawing to screen sound too difficult and there is no tutorial on how do it :x
First, it is not difficult. You just plot pixels, and you need to draw a bitmap for each character, that's all. Second, there are lots of tutorials. Check out the wiki:

VGA Fonts - explains how the VGA BIOS stores the bitmaps, and has example code how to retrieve that bitmap from VGA ROM and display them yourself in protected mode using C. It even has some optimized code for 8-bit VGA modes.
PC Screen Font - explains how the Linux kernel stores those bitmaps on disk, and also has example C code how to display those.
Scalable Screen Font - is an MIT licensed ANSI C library that displays the fonts for you (both bitmaps and vector fonts), you just have to call the library's functions. The wiki page has example code on how to do that.

Cheers,
bzt
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

Re: 8-bit text VGA driver

Post by catOS »

bzt wrote:First, it is not difficult. You just plot pixels, and you need to draw a bitmap for each character, that's all. Second, there are lots of tutorials. Check out the wiki:

VGA Fonts - explains how the VGA BIOS stores the bitmaps, and has example code how to retrieve that bitmap from VGA ROM and display them yourself in protected mode using C. It even has some optimized code for 8-bit VGA modes.
PC Screen Font - explains how the Linux kernel stores those bitmaps on disk, and also has example C code how to display those.
Scalable Screen Font - is an MIT licensed ANSI C library that displays the fonts for you (both bitmaps and vector fonts), you just have to call the library's functions. The wiki page has example code on how to do that.

Cheers,
bzt
Thank you for your help
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
Post Reply