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.
#define VIDEO_POINTER 0xb8000 //Indirizzo della della memoria video (modalità testo colorato)
#define SCREEN_BYTE (80*25) //Byte totali della memoria video
#define COLOR 0x0700 //Grigio chiaro su sfondo nero
#include "Kvideo.h"
volatile unsigned int *videoMem = (volatile unsigned int *) VIDEO_POINTER;
void KvideoClean()
{
unsigned int i = 0;
//Ciclo che scrive spazi nella memoria video per cancellare tutto
while(i < SCREEN_BYTE) {
i++;
videoMem[i] = COLOR | ' ';
}
}
void KvideoWrite(char ch)
{
//Scrive un carattere nella memoria video
*videoMem = COLOR | ch;
}
void KvideoPrint(const char * string)
{
//Itero la stringa e scrivo tutti i char nella memoria video
while(*string != 0)
{
KvideoWrite(*string);
string++;
}
}
The -kernel option is intended for a linux kernel and generally does not do what you expect (which as far as forum history goes, includes not doing what the documentation says), so try to avoid it. And unless you want to stick with qemu forever, you'll have to learn to live without it at some point anyway.
"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 ]
I do not see Multiboot header anywhere in your code.
Qemu's -kernel switch somewhat works with Multiboot compliant kernels, but it's not very reliable. Assuming you use recent enough Qemu, it should work with something this simple, however. But without Multiboot header it does $deity (and Qemu devs) knows what.
I'd suggest to switch to more stable bootloader, GRUB for example.
And when you'll finally get it to boot, it will print only single character 'd' in top-left corner of your screen. But I'll leave it up to you to figure out what's wrong with printing routines.
If something looks overcomplicated, most likely it is.