Add support for \n

This commit is contained in:
Baptiste Wicht 2013-10-29 20:03:24 +01:00
parent 94ff36b850
commit 08ee4d03ac
2 changed files with 9 additions and 6 deletions

View File

@ -76,21 +76,24 @@ void k_print(std::size_t number){
}
void k_print(char key){
if(key == '\n'){
++current_line;
current_column = 0;
return;
}
uint16_t* vga_buffer = (uint16_t*) 0x0B8000;
vga_buffer[current_line * 80 + current_column] = make_vga_entry(key, make_color(WHITE, BLACK));
++current_column;
return;
}
void k_print(const char* string){
for(int i = 0; string[i] != 0; ++i){
k_print(string[i]);
}
return;
}
void wipeout(){

View File

@ -83,7 +83,7 @@ void reboot_command(){
}
void help_command(){
k_print_line("Available commands:");
k_print("Available commands:\n");
for(auto& command : commands){
k_print(" ");
@ -108,7 +108,7 @@ void exec_command(){
k_print("The command \"");
k_print(current_input);
k_print_line("\" does not exist");
k_print("\" does not exist \n");
}
void clear_command(){