feature: add architecture-agnostic kernel panic (BSOD) engine
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Introduce core.panic, a new architecture-agnostic kernel panic engine
with a pre-allocated LVGL BSOD screen. The screen and all widgets are
created at init time so that zero LVGL allocation occurs at panic time.

Layout features:
- Top banner with decoded teapot TGA image (128x128) and title/subtitle
- Two-column content area with dark semi-transparent cards:
  - Left: Fault Details, CPU Registers, Process Info, System Info
  - Right: Call Stack (full height)
- Pastel red background (#7A2828), monospace text for data sections

Key changes:
- Add core.panic.pas with pre-built BSOD screen, register/trace/system
  info formatting, hex conversion helpers, and syslog fallback
- Add arch.x86.panic.pas as the x86 bridge: packs interrupt registers
  into a TRegisterSnapshot and calls core.panic.panic()
- Simplify all 19 x86 fault handlers to one-liner panic calls
- Remove legacy BSOD code from arch.x86.util.pas
- Add teapot.tga (256x256) embedded via splash_tga.asm
- Add LVGL bindings: lv_refr_now, lv_image_create, lv_image_set_src,
  lv_image_set_scale, lv_image_set_inner_align, and style helpers
- Wire up panic init and test command in asuro.pas
This commit is contained in:
t3hn3rd committed 2026-03-08 16:44:21 +00:00
1 parent 7abb38ccbe
commit e55da49900
29 files changed
+1061 -231

No files matched your search

+3 -3
View File
@@ -44,7 +44,7 @@ uses
arch.x86.memory.physical,
io.syslog,
debug.tracer,
core.util, arch.x86.util,
core.util, arch.x86.util, core.panic,
arch.x86.memory.virtual;
const
@@ -429,7 +429,7 @@ begin
kalloc := klalloc(size);
if kalloc = nil then begin
restore_if(saved_flags);
BSOD('OOM', 'kalloc: large allocation failed');
core.panic.panic('OOM', 'kalloc: large allocation failed', nil);
exit;
end;
zero_mem(Pointer(kalloc), size);
@@ -484,7 +484,7 @@ begin
hp := new_heap_page(hp);
if hp = nil then begin
restore_if(saved_flags);
BSOD('OOM', 'kalloc: out of memory');
core.panic.panic('OOM', 'kalloc: out of memory', nil);
exit;
end;
end else begin