my first run and some noob Q's

Programming, for all ages and all languages.
Post Reply
User avatar
evnix
Posts: 2
Joined: Wed Oct 05, 2011 4:49 am

my first run and some noob Q's

Post by evnix »

after spending some time searching on google, i found this site and i was amazed to see how wrong I was about operating systems. #-o
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 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 :D
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 [-o<
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: my first run and some noob Q's

Post by Combuster »

Then google came to the rescue
That was meant to be a lesson :wink:

To answer your specific questions:
http://wiki.osdev.org/Category:Video and http://wiki.osdev.org/Resources - You may also want to try the forum rules since I have the idea you skipped it.
"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 ]
User avatar
evnix
Posts: 2
Joined: Wed Oct 05, 2011 4:49 am

Re: my first run and some noob Q's

Post by evnix »

thanks a lot Combuster. =D>
I must say this site is better than going through Tanenbaums book with a huge pile of minix source code(I was so excited that i bought it today).

I found a lot of examples by exploring your links. i wouldn't find them if i had googled them because i would usually end with results pointing me towards an API(or some libraries for a language) already implemented by some OS.

is there a particular way i should be searching when it comes to searching OS development terms(any keywords that i should include)??

PS:
for anyone who wants some basic kernels(without the feature bloat) being implemented http://files.osdev.org/mirrors/geezer/osd/code/
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: my first run and some noob Q's

Post by Solar »

Actually, and trying not to boast about it,

Code: Select all

keyword keyword site:osdev.org
is usually a good way to go about it. 8)
Every good solution is obvious once you've found it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: my first run and some noob Q's

Post by Love4Boobies »

Solar wrote:Actually, and trying not to boast about it,

Code: Select all

keyword keyword site:osdev.org
is usually a good way to go about it. 8)
He's talking about Google queries, in case that made no sense :wink:
evnix wrote:I must say this site is better than going through Tanenbaums book with a huge pile of minix source code(I was so excited that i bought it today).
Textbooks will give you the neccessary theory, our wiki takes more of a hands-on approach, but it's no substitute for doing your own research. I suggest you keep at it. Good luck! :)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: my first run and some noob Q's

Post by VolTeK »

evnix wrote:after spending some time searching on google
Already have set a milestone for having 2 posts, wanting to osdev, and searching google without being told to.
evnix wrote:I must say this site is better than going through Tanenbaums book with a huge pile of minix source code(I was so excited that i bought it today).
Sometimes your own ideas dont come from other's source code. Concepts build code. Others code examples give you concepts, but in my opinion doesnt make the programmers creativity any better.

Without knowing how something works, building an alternative that works just like it builds creativity and when you do look at the code, you may find that your alternative is faster, or badly designed.


To me, design, creativity, and logic (along with your favorite programming language) is key and the life of a project.
Post Reply