tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
err.h File Reference
#include "../lib/types.h"
Include dependency graph for err.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define assert   __assert
#define panic   __panic
#define __assert(cond, msg)

Functions

void __panic (const char *txt)
 panic halts the system with a kernel panic message

Macro Definition Documentation

◆ __assert

#define __assert ( cond,
msg )
Value:
do { if (!(cond)) { panic(msg); } } while(0)
#define panic
Definition err.h:5

Definition at line 9 of file err.h.

◆ assert

#define assert   __assert

◆ panic

#define panic   __panic

Definition at line 5 of file err.h.

Referenced by ___init(), ___kmain(), __alc(), and __shell().

Function Documentation

◆ __panic()

void __panic ( const char * txt)

panic halts the system with a kernel panic message

panic is a function that clears the screen to red, displays a kernel panic banner with the provided message, and halts forever

Parameters
txt,theerror message to display

when panic is called the system becomes unrecoverable, it will always halt, so use it only for fatal unrecoverable errors

using panic is done with

#include "../lib/err.h" //or just err.h
panic("something went wrong");
See also
assert()

Definition at line 25 of file err.c.

References NORETURN, and vga.