I am building an operating system, and I would like the resolution to be 640x480 16 colors. The video mode is set correctly to 0x12, the 32-bit bootloader works fine, and the kernel function in the C file is being called, but I'm not sure how to go about writing text to the screen in C?
I am aware it has something to do with ports and indexes and planes but I have no clue what everything I read is on about. Could someone please show me how it could be done?
You can either use BIOS interrupts to tell the BIOS what you want to be output. In this case you indirectly use the graphics driver of the BIOS.
Or you can write a VGA driver of your own. In this case you are going to handle the ports and the planes.
Writing a VGA driver is like going through hell and back. But it is possible and I wrote one for Windows recently. But it took me many months.
If you know which path you like to go, you might want to start a new and more specific question.