|
#define WHITE_SPACE 0x07
#define VIDEO_MEMORY 0xb8000
char *videoMemory = (char*) VIDEO_MEMORY;
void clrscr()
{
int i;
for(i=0;i < (80*25*2);i+=2)
{
videoMemory[i]=' ';
videoMemory[i+1]=WHITE_SPACE;
}
}
void printxy(char *message, unsigned int x, unsigned int y)
{
unsigned int i=0;
i=(y*80*2)+x;
while(*message!=0)
{
if(*message=='\n')
{
y++;
i=(y*80*2);
} else {
videoMemory[i++]=*message;
videoMemory[i++]=WHITE_SPACE;
}
*message++;
}
}
kernel_main()
{
clrscr();
printxy("Hello World", 0, 0);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Have completed BSc in Computer Science & Engineering from Shah Jalal University of Science & Technology, Sylhet, Bangladesh (
SUST).
Story books (specially Masud Rana series), tourism, songs and programming is most favorite.
Blog:
Maruf Notes
http://blog.kuashaonline.com