I'm trying to add a simple calculator (like the basic calculator we all made when starting out with c or c++) in a Kernel i made from following the Bare Bones tutorial. I've managed to display whatever the user is typing perfectly fine. But I can't figure out how to store the complete string of characters that the user is typing.
Can somebody like tell me how to go about storing whatever the user is typing?
I tried making an array and storing values inside it but didn't work :S
Here is what i'm using-
Code: Select all
terminal_writestring(" First Number:");
unsigned char c = 0, a = 0;
init_pics(0x20, 0x28);
do
{
if(inb(0x60)!=c) //PORT FROM WHICH WE READ
{
c = inb(0x60);
if(c>0){
terminal_putchar(lowercase[c]); //print on screen
a = lowercase[c];
if(lowercase[c] == 0x08){
break;
}
}
}
}while(c!=1);
terminal_putchar(a); // print again