Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions k-ahci.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ void ahcistate::handle_error_interrupt() {
pr_->serror = ~0U;
pr_->command |= pcmd_start;
// XXX must `READ LOG EXT` to clear error
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
panic("SATA disk error");
}

Expand Down
2 changes: 2 additions & 0 deletions k-hardware.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ void __cxa_guard_release(long long* arg) {
// __cxa_pure_virtual()
// Used as a placeholder for pure virtual functions.
void __cxa_pure_virtual() {
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
panic("pure virtual function called in kernel!\n");
}

Expand Down
2 changes: 2 additions & 0 deletions k-proc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ void proc::init_kernel(pid_t pid, void (*f)()) {
// Called when `k-exception.S` tries to run a non-runnable proc.

void proc::panic_nonrunnable() {
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
panic("Trying to resume proc %d, which is not runnable\n"
"(proc state %d, last user %%rip %p)",
id_, pstate_.load(), last_user_rip_);
Expand Down
2 changes: 2 additions & 0 deletions k-vmiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ void vmiter::down() {
pep_ = &pt->entry[pageindex(va_, level_)];
}
if ((*pep_ & PTE_PAMASK) >= 0x100000000UL) {
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
panic("Page table %p may contain uninitialized memory!\n"
"(Page table contents: %p)\n", pt_, *pep_);
}
Expand Down
2 changes: 2 additions & 0 deletions lib.hh
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ assert_memeq_fail(const char* file, int line, const char* msg,

// panic(format, ...)
// Prints the message determined by `format` and fails.
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
void __attribute__((noinline, noreturn, cold))
panic(const char* format, ...);

Expand Down
2 changes: 2 additions & 0 deletions p-testkalloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ void process_main() {
// Running `testkalloc` should cause the kernel to run buddy allocator
// tests. How you make this work is up to you.

// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)
panic("testkalloc not implemented!\n");
}
2 changes: 2 additions & 0 deletions u-lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ int printf(const char* format, ...) {

// panic, assert_fail
// Call the SYSCALL_PANIC system call so the kernel loops until Control-C.
// Note that panic() will prouce a page fault if there is no console
// (https://github.com/CS161/chickadee/issues/14)

void panic(const char* format, ...) {
va_list val;
Expand Down