I've gotten my interrupts(software+hardware)+exc.'s working. and my k_printf + getch + keytable + putc + strings working.
but this is where my os freezes....
< CODE BELOW >
void getstring(char *buffer, unsigned int color)
{
char string[256];
char ascii_key = '\0';
int i=0;
unsigned int startpos = charpos;
while(ascii_key != '\n')
{
ascii_key = getch();
if(ascii_key != '\n')
{
if(ascii_key == '\0')
{
// do nothing
} else {
if(ascii_key == '\b')
{
if(charpos > startpos)
{
putc(ascii_key, color); // putc handles the backspace
string[--i]='\0';
i--;
}
} else {
putc(ascii_key, color);
string[i] = ascii_key;
}
}
} else {
string[i] = '\0';
}
i++;
}
strcpy(buffer, string);
}
< END CODE >
any ideas? i really need help on this one.