my first run and some noob Q's
Posted: Wed Oct 05, 2011 5:38 am
after spending some time searching on google, i found this site and i was amazed to see how wrong I was about operating systems.
I came to know about some new concepts such as kernels, scheduling etc.
Then with some courage, i thought of following the example program http://wiki.osdev.org/Bare_bones
after nearly 3 hours of fiddling, I got the desired output. I was so happy that i literally danced on my bed. although the ouput was a single character 'A'.
after some more fiddling, i was able to print a given string on the monitor. (I am sure there is a better implementation than my code below)
So the next thing that i wanted to know was how many characters i could print horizontally and vertically. i wanted to know the size of 'videoram'.
so i thought of asking it here in the forum, but i could not even answer the "human or not" question while registering since it asked me a question related to OS. I din't know what to do so i called up some of my friends but none of them could answer. Then google came to the rescue
and as you can see i was able to register.
So my question is , how many characters can i print vertically and horizontally, is there any way i could calculate this size?
is there any noob friendly(and probably small) OS source code which i can hack through?
I am not even sure whether the questions i have framed are correct... so please give some advice
I came to know about some new concepts such as kernels, scheduling etc.
Then with some courage, i thought of following the example program http://wiki.osdev.org/Bare_bones
after nearly 3 hours of fiddling, I got the desired output. I was so happy that i literally danced on my bed. although the ouput was a single character 'A'.
after some more fiddling, i was able to print a given string on the monitor. (I am sure there is a better implementation than my code below)
Code: Select all
unsigned char *videoram = (unsigned char *) 0xb8000;
void wrtie_string(char *str)
{
int i=0;
int j=0;
for(i=0;str[j]!='\0';i=i+2){
videoram[i]=str[j];
videoram[i+1]=0x04;
j++;
}
}
so i thought of asking it here in the forum, but i could not even answer the "human or not" question while registering since it asked me a question related to OS. I din't know what to do so i called up some of my friends but none of them could answer. Then google came to the rescue
and as you can see i was able to register.
So my question is , how many characters can i print vertically and horizontally, is there any way i could calculate this size?
is there any noob friendly(and probably small) OS source code which i can hack through?
I am not even sure whether the questions i have framed are correct... so please give some advice