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?
The closest colour to orange is light red or cyan
8-bit text VGA driver
Re: 8-bit text VGA driver
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.
-
- Member
- Posts: 5572
- Joined: Mon Mar 25, 2013 7:01 pm
Re: 8-bit text VGA 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.catOS wrote:Is there a 8-bit colour driver?
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.
Re: 8-bit text VGA driver
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 itOctocontrabass wrote: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.catOS wrote:Is there a 8-bit colour driver?
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.
Re: 8-bit text VGA driver
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: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
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
Re: 8-bit text VGA driver
Thank you for your helpbzt 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