Unable to read video memory?
Posted: Sun Jul 29, 2007 9:11 pm
I'm in the middle of writing my memory manager for my kernel, and I've been getting some errors, which I've tracked down to my video code. It's worked fine up to now, but once I have to scroll, I run into trouble. Virtual PC just resets (I guess I'm crashing the "system"), and bochs gives me a message about vetoing memory read from 0xB80A0. The call that causes the problem looks like this:
times is the number of lines to scroll.
This call to memcpy, as far as I can tell, is correct for what I'm trying to do (shift the text on the screen up [times] lines). This means that my problem lies with memcpy. I've written it correctly, though, with a simple implementation:
So... can you guys offer me any clue as to what's going on here?
Code: Select all
memcpy((unsigned char*)VideoMemory, (unsigned char*)(VideoMemory + (80 * times)), ((25 * 80) - (80 * times)) * 2);
This call to memcpy, as far as I can tell, is correct for what I'm trying to do (shift the text on the screen up [times] lines). This means that my problem lies with memcpy. I've written it correctly, though, with a simple implementation:
Code: Select all
unsigned char *memcpy(unsigned char *dest, const unsigned char *src, unsigned int count)
{
unsigned char *ret = dest;
while (count--)
*dest++ = *src++;
return ret;
}