Added runtime tests for TTY

Removed types
Styling
Added printing error and multi line string for logo


Fix panic after rebase
This commit is contained in:
ED 2019-10-01 11:52:23 +01:00
parent 6ece9a8440
commit 60164d9252
6 changed files with 459 additions and 337 deletions

View file

@ -27,7 +27,6 @@ const panic_root = @import("panic.zig").panic;
// Just call the panic function, as this need to be in the root source file
pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
@setCold(true);
arch.disableInterrupts();
panic_root(error_return_trace, "{}", msg);
}

View file

@ -5,6 +5,7 @@ const log = @import("log.zig");
pub fn panic(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
@setCold(true);
arch.disableInterrupts();
log.logInfo("KERNEL PANIC\n");
log.logInfo(format, args);
log.logInfo("HALTING\n");

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
const builtin = @import("builtin");
const panic = @import("std").debug.panic;
const std = @import("std");
pub fn panicFmt(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
pub fn panic(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
@setCold(true);
panic(format, args);
std.debug.panic(format, args);
}

View file

@ -69,11 +69,11 @@ pub fn init() void {
// User defined mocked functions
pub fn mock_entryColour(fg: u4, bg: u4) u8 {
pub fn orig_entryColour(fg: u4, bg: u4) u8 {
return u8(fg) | u8(bg) << 4;
}
pub fn mock_entry(uc: u8, c: u8) u16 {
pub fn orig_entry(uc: u8, c: u8) u16 {
return u16(uc) | u16(c) << 8;
}

View file

@ -29,6 +29,7 @@ def get_post_archinit_cases():
TestCase("VGA init", [r"Init vga", r"Done"]),
TestCase("VGA tests", [r"VGA: Tested max scan line", r"VGA: Tested cursor shape", r"VGA: Tested updating cursor"]),
TestCase("TTY init", [r"Init tty", r"Done"]),
TestCase("TTY tests", [r"TTY: Tested globals", r"TTY: Tested printing"]),
TestCase("Init finishes", [r"Init done"])
]