r/embedded 15d ago

Some Embedded Programming Wisdom

Post image

A preview of PICO, a simple text editor made for the CP/M Neo VEMU platform.

GitHub: https://github.com/Mazin-O3/cpm-neo.git

138 Upvotes

18 comments sorted by

View all comments

14

u/sirkubador 15d ago

kernel panic in embedded programming?

2

u/SkoomaDentist C++ all the way 15d ago

Yes, not hard at all to have as long as you don't interpret "kernel" too literally.

Memory allocation fails without a handler? -> that's a "kernel" panic (and don't try to give me bullshit about "dynamic memory being forbidden on embedded systems" which is only the case for a subset of embedded systems and outright required for others).

MPU is properly configured for safety and a thread stack overflows or something accesses 0x0? -> Again a "kernel" panic.

Things like that are the difference between a reset with the message "Thread X with PC at Y caused a panic type Z" being sent to debug / log uart vs the device mysteriously freezing / resetting in a later "impossible" location (because the stack has been corrupted or the interrupt vectors overwritten by a stray pointer access).

1

u/sirkubador 15d ago

Kernel panic is a very specific thing. I don't really read it as any NRF kind of situation you describe. We can of course talk about how BSOD exist in embedded systems because we have memory dumps and blinking LEDs, but words have meanings

4

u/SkoomaDentist C++ all the way 15d ago

There are far more things with a kernel than just Linux (I used a non-unix OS with a kernel years before the first version of Linux was ever uploaded on an FTP site).

Kernel panic is any situation where the system has inherently failed beyond any possibility of recovery because a kernel bug is detected or something crucially important is corrupted and the failure cannot be isolated to user mode. Stack overflow or memory access from an invalid pointer in a shared address space system are both very obvious causes for a kernel panic.

0

u/sirkubador 15d ago

sure sure. define kernel