Page 1 of 1

C++ Kernel Issues

Posted: Sun Mar 20, 2011 11:55 am
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.

Re: C++ Kernel Issues

Posted: Sun Mar 20, 2011 12:10 pm
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.

Re: C++ Kernel Issues

Posted: Sun Mar 20, 2011 12:46 pm
by Sparky81
It worked! Thanks so much!
:)