Clearing the screen?
Posted: Sat Mar 07, 2009 9:44 pm
Hi, I was wondering what's wrong with this code. It compiles fine, but I get the error - kernel.c:(.text+0x1d): undefined reference to `memset'. I'm assuming it has something to do with including libraries..
Code: Select all
#include <string.h>
// Screen dimensions (for default 80x25 console)
#define LINE_PITCH 160 // line width in bytes
#define LINE_COUNT 25
void clear(volatile unsigned char* videoram)
{
memset((void*)videoram, 0, LINE_PITCH*LINE_COUNT);
}
void kmain( void* mbd, unsigned int magic )
{
volatile unsigned char* videoram = (volatile unsigned char *) 0xb8000;
clear(videoram);
}