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:
parent
6ece9a8440
commit
60164d9252
6 changed files with 459 additions and 337 deletions
|
@ -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
|
// 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 {
|
pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
|
||||||
@setCold(true);
|
@setCold(true);
|
||||||
arch.disableInterrupts();
|
|
||||||
panic_root(error_return_trace, "{}", msg);
|
panic_root(error_return_trace, "{}", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ const log = @import("log.zig");
|
||||||
|
|
||||||
pub fn panic(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
|
pub fn panic(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
|
||||||
@setCold(true);
|
@setCold(true);
|
||||||
|
arch.disableInterrupts();
|
||||||
log.logInfo("KERNEL PANIC\n");
|
log.logInfo("KERNEL PANIC\n");
|
||||||
log.logInfo(format, args);
|
log.logInfo(format, args);
|
||||||
log.logInfo("HALTING\n");
|
log.logInfo("HALTING\n");
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
||||||
const builtin = @import("builtin");
|
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);
|
@setCold(true);
|
||||||
panic(format, args);
|
std.debug.panic(format, args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,11 @@ pub fn init() void {
|
||||||
|
|
||||||
// User defined mocked functions
|
// 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;
|
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;
|
return u16(uc) | u16(c) << 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ def get_post_archinit_cases():
|
||||||
TestCase("VGA init", [r"Init vga", r"Done"]),
|
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("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 init", [r"Init tty", r"Done"]),
|
||||||
|
TestCase("TTY tests", [r"TTY: Tested globals", r"TTY: Tested printing"]),
|
||||||
TestCase("Init finishes", [r"Init done"])
|
TestCase("Init finishes", [r"Init done"])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue