input from keyboard
Posted: Fri Aug 29, 2014 12:32 am
I write a very small kernel.and how can I get input from keyboard.
this is my kernel source code
main.c
stdio.h
this is my kernel source code
main.c
Code: Select all
#include "M_include/stdio.h"
void main(void){
clear_screen();
k_print("Welcome to persianOS", 0x07);
}
Code: Select all
int k_print(const char *str, int color){
char *video = (char*) 0xB8000;
unsigned int i = 0;
unsigned int i2 = 0;
while(str[i2] != '\0'){
video[i] = str[i2];
video[i + 1] = color;
++i2;
i = i + 2;
}
}
int clear_screen(){
char *video = (char*) 0xB8000;
unsigned int i = 0;
unsigned int i2 = 0;
while(i2 <(80*25*2)){
video[i2] = ' ';
video[i2+1] = 0x02;
i2= i2 + 2;
}
}