Updating to zig master

Added cpu model


Moved logging to defer done log

Moved mem.init to bottom

Updated again to new zig master
This commit is contained in:
DrDeano 2020-04-12 22:26:34 +01:00
parent d17381c267
commit 1f97a5c6c8
No known key found for this signature in database
GPG key ID: 96188600582B9ED7
21 changed files with 157 additions and 135 deletions

View file

@ -1,23 +1,39 @@
def get_test_cases(TestCase):
return [
TestCase("GDT init", [r"Init gdt", r"Done"]),
TestCase("GDT init", [r"Init gdt"]),
TestCase("GDT tests", [r"GDT: Tested loading GDT"]),
TestCase("IDT init", [r"Init idt", r"Done"]),
TestCase("GDT done", [r"Done gdt"]),
TestCase("IDT init", [r"Init idt"]),
TestCase("IDT tests", [r"IDT: Tested loading IDT"]),
TestCase("PIC init", [r"Init pic", r"Done"]),
TestCase("IDT done", [r"Done idt"]),
TestCase("PIC init", [r"Init pic"]),
TestCase("PIC tests", [r"PIC: Tested masking"]),
TestCase("ISR init", [r"Init isr", r"Done"]),
TestCase("PIC done", [r"Done pic"]),
TestCase("ISR init", [r"Init isr"]),
TestCase("ISR tests", [r"ISR: Tested registered handlers", r"ISR: Tested opened IDT entries"]),
TestCase("IRQ init", [r"Init irq", r"Done"]),
TestCase("ISR done", [r"Done isr"]),
TestCase("IRQ init", [r"Init irq"]),
TestCase("IRQ tests", [r"IRQ: Tested registered handlers", r"IRQ: Tested opened IDT entries"]),
TestCase("Paging init", [r"Init paging", r"Done"]),
TestCase("IRQ done", [r"Done irq"]),
TestCase("Paging init", [r"Init paging"]),
TestCase("Paging tests", [r"Paging: Tested accessing unmapped memory", r"Paging: Tested accessing mapped memory"]),
TestCase("Paging done", [r"Done paging"]),
TestCase("PIT init", [r"Init pit"]),
TestCase("PIT init", [r".+"], r"\[DEBUG\] "),
TestCase("PIT init", [r"Done"]),
TestCase("PIT tests", [r"PIT: Tested init", r"PIT: Tested wait ticks", r"PIT: Tested wait ticks 2"]),
TestCase("RTC init", [r"Init rtc", r"Done"]),
TestCase("PIT done", [r"Done pit"]),
TestCase("RTC init", [r"Init rtc"]),
TestCase("RTC tests", [r"RTC: Tested init", r"RTC: Tested interrupts"]),
TestCase("Syscalls init", [r"Init syscalls", r"Done"]),
TestCase("Syscall tests", [r"Syscalls: Tested no args", r"Syscalls: Tested 1 arg", r"Syscalls: Tested 2 args", r"Syscalls: Tested 3 args", r"Syscalls: Tested 4 args", r"Syscalls: Tested 5 args"])
TestCase("RTC done", [r"Done rtc"]),
TestCase("Syscalls init", [r"Init syscalls"]),
TestCase("Syscalls tests", [r"Syscalls: Tested no args", r"Syscalls: Tested 1 arg", r"Syscalls: Tested 2 args", r"Syscalls: Tested 3 args", r"Syscalls: Tested 4 args", r"Syscalls: Tested 5 args"]),
TestCase("Syscalls done", [r"Done syscalls"]),
]

View file

@ -31,26 +31,40 @@ def test_pass(case, exp, expected_idx, found):
def get_pre_archinit_cases():
return [
TestCase("Serial tests", [r"c", r"123"], ""),
TestCase("Log info tests", [r"Test INFO level", r"Test INFO level with args a, 1", r"Test INFO function", r"Test INFO function with args a, 1"], "\[INFO\] "),
TestCase("Log debug tests", [r"Test DEBUG level", r"Test DEBUG level with args a, 1", r"Test DEBUG function", r"Test DEBUG function with args a, 1"], "\[DEBUG\] "),
TestCase("Log warning tests", [r"Test WARNING level", r"Test WARNING level with args a, 1", r"Test WARNING function", r"Test WARNING function with args a, 1"], "\[WARNING\] "),
TestCase("Log error tests", [r"Test ERROR level", r"Test ERROR level with args a, 1", r"Test ERROR function", r"Test ERROR function with args a, 1"], "\[ERROR\] "),
TestCase("Mem init", [r"Init mem", r"Done"]),
TestCase("PMM init", [r"Init pmm", r"Done"]),
TestCase("Log info tests", [r"Test INFO level", r"Test INFO level with args a, 1", r"Test INFO function", r"Test INFO function with args a, 1"], r"\[INFO\] "),
TestCase("Log debug tests", [r"Test DEBUG level", r"Test DEBUG level with args a, 1", r"Test DEBUG function", r"Test DEBUG function with args a, 1"], r"\[DEBUG\] "),
TestCase("Log warning tests", [r"Test WARNING level", r"Test WARNING level with args a, 1", r"Test WARNING function", r"Test WARNING function with args a, 1"], r"\[WARNING\] "),
TestCase("Log error tests", [r"Test ERROR level", r"Test ERROR level with args a, 1", r"Test ERROR function", r"Test ERROR function with args a, 1"], r"\[ERROR\] "),
TestCase("Mem init", [r"Init mem"]),
TestCase("Mem done", [r"Done mem"]),
TestCase("PMM init", [r"Init pmm"]),
TestCase("PMM tests", [r"PMM: Tested allocation"]),
TestCase("PMM done", [r"Done pmm"]),
TestCase("Arch init starts", [r"Init arch \w+"])
]
def get_post_archinit_cases():
return [
TestCase("Arch init finishes", [r"Arch init done"]),
TestCase("Panic init", [r"Init panic", r"Done"]),
TestCase("VGA init", [r"Init vga", r"Done"]),
TestCase("Panic init", [r"Init panic"]),
TestCase("Panic done", [r"Done panic"]),
TestCase("VGA init", [r"Init vga"]),
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("VGA done", [r"Done vga"]),
TestCase("TTY init", [r"Init tty"]),
TestCase("TTY tests", [r"TTY: Tested globals", r"TTY: Tested printing"]),
TestCase("TTY done", [r"Done tty"]),
TestCase("Init finishes", [r"Init done"]),
TestCase("Panic tests", [r"Kernel panic: integer overflow", r"c[a-z\d]+: panic", r"c[a-z\d]+: panic.runtimeTests", r"c[a-z\d]+: kmain", r"c[a-z\d]+: start_higher_half"], "\[ERROR\] ")
TestCase("Panic tests", [r"Kernel panic: integer overflow", r"c[a-z\d]+: panic", r"c[a-z\d]+: panic.runtimeTests", r"c[a-z\d]+: kmain", r"c[a-z\d]+: start_higher_half"], r"\[ERROR\] ")
]
def read_messages(proc):