C++ Kernel Issues

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.
Post Reply
Sparky81
Posts: 2
Joined: Sun Mar 20, 2011 11:32 am

C++ Kernel Issues

Post by Sparky81 »

Hey everyone, I'm fairly new to OS development and I've gotten a pretty good understanding of how most of it works, so my friend and I decided to start developing an kernel.

Our latest (and not quite working) version is at https://github.com/Sparky81/AlphaOS

I'm having a few problems with the kernel, though:
it won't finish the name of the second person and the bullets.

Image

Can someone look through the code at https://github.com/Sparky81/AlphaOS/tre ... src/kernel for me please?

I'm pretty darn sure the problem is in Video.cpp, I just can't figure out what it is.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: C++ Kernel Issues

Post by NickJohnson »

There are a few things in Video.cpp that seem off: the screen is 80 by 25 characters, not 100 by 45, and you should break after performing the newline operation (that is what the bullet is.) This should be better, although I don't think it will fix your problem entirely:

Code: Select all

void Video::put(char c)
{
    if (c == '\n')
    {
        pos=0;
        off += 80;
        return;
    }
    if (pos>=80)
    {
        pos=0;
        off += 80;
    }
    if (off>=(80*25))
    {
        clear();
        off = 0;
    }
    videomem[off + pos] = (unsigned char)c|0x0700;
    pos++;
}
The part about not printing the entire string probably is due to some sort of corruption elsewhere if fixing the put() function doesn't help.
Sparky81
Posts: 2
Joined: Sun Mar 20, 2011 11:32 am

Re: C++ Kernel Issues

Post by Sparky81 »

It worked! Thanks so much!
:)
Post Reply