some minor fix

This commit is contained in:
wescande 2018-03-02 18:44:41 +01:00
parent 6e2456d2f8
commit 2ca356340a
3 changed files with 8 additions and 5 deletions

View file

@ -92,6 +92,10 @@ fn print_line(line: &[u8], address: usize) {
for byte in line {
print!("{:02x} ", *byte);
}
let length : usize = 16 - line.len();
for _ in 0..length {
print!(" ");
}
print!("|");
for byte in line {
match is_control(*byte as char) {

View file

@ -37,7 +37,7 @@ pub extern fn kmain(multiboot_information_address: usize) -> ! {
println!("Kernel initialization has failed: {}", msg);
cpuio::halt();
}
unsafe { CONTEXT.current_term().color_code = ColorCode::new(Color::White, Color::Cyan); }
set_color!(White, Cyan);
print!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
format_args!("{: ^80}", r#" ,--, "#),
format_args!("{: ^80}", r#" ,--.'| ,----, "#),
@ -53,7 +53,7 @@ pub extern fn kmain(multiboot_information_address: usize) -> ! {
format_args!("{: ^80}", r#" | : ;| : .' "#),
format_args!("{: ^80}", r#" ' ,/ ; | .' "#),
format_args!("{: ^80}", r#" '--' `---' "#));
unsafe { CONTEXT.current_term().color_code = ColorCode::new(Color::White, Color::Black); }
set_color!();
unsafe { CONTEXT.vga1.prompt();CONTEXT.vga1.flush(); }
unsafe { CONTEXT.vga2.prompt(); }

View file

@ -98,10 +98,9 @@ impl Writer {
b'\n' => {
self.write_byte(b'\n');
if let Err(msg) = console::exec(&self) {
let color_code_save = self.color_code;
self.color_code = ColorCode::new(Color::Red, Color::Black);
set_color!(Red, Black);
println!("Something wrong: {}", msg);
self.color_code = color_code_save;
set_color!();
}
self.command_len = 0;
self.prompt();