mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Add support for \n
This commit is contained in:
parent
94ff36b850
commit
08ee4d03ac
@ -76,21 +76,24 @@ void k_print(std::size_t number){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void k_print(char key){
|
void k_print(char key){
|
||||||
|
if(key == '\n'){
|
||||||
|
++current_line;
|
||||||
|
current_column = 0;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t* vga_buffer = (uint16_t*) 0x0B8000;
|
uint16_t* vga_buffer = (uint16_t*) 0x0B8000;
|
||||||
|
|
||||||
vga_buffer[current_line * 80 + current_column] = make_vga_entry(key, make_color(WHITE, BLACK));
|
vga_buffer[current_line * 80 + current_column] = make_vga_entry(key, make_color(WHITE, BLACK));
|
||||||
|
|
||||||
++current_column;
|
++current_column;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void k_print(const char* string){
|
void k_print(const char* string){
|
||||||
for(int i = 0; string[i] != 0; ++i){
|
for(int i = 0; string[i] != 0; ++i){
|
||||||
k_print(string[i]);
|
k_print(string[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wipeout(){
|
void wipeout(){
|
||||||
|
@ -83,7 +83,7 @@ void reboot_command(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void help_command(){
|
void help_command(){
|
||||||
k_print_line("Available commands:");
|
k_print("Available commands:\n");
|
||||||
|
|
||||||
for(auto& command : commands){
|
for(auto& command : commands){
|
||||||
k_print(" ");
|
k_print(" ");
|
||||||
@ -108,7 +108,7 @@ void exec_command(){
|
|||||||
|
|
||||||
k_print("The command \"");
|
k_print("The command \"");
|
||||||
k_print(current_input);
|
k_print(current_input);
|
||||||
k_print_line("\" does not exist");
|
k_print("\" does not exist \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_command(){
|
void clear_command(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user