mirror of
https://github.com/apache/nuttx.git
synced 2026-08-09 14:35:08 +00:00
The RAM log is the natural home for boot messages, yet writing to it during early boot could crash the system it was meant to describe. ramlog_addbuf took the critical section on every write, and enter_critical_section consults the current task; on ports whose first syslog output happens before the task lists exist, that lookup walks uninitialized state and faults. The notification path was worse still, locking a scheduler that did not exist yet. Guard both. Before the task lists exist, plain interrupt masking protects the buffer just as well, since there is only one thread of control; and readers are only notified once there is an operating system to notify them through. The bytes land in the buffer either way, so nothing logged before the OS is ready is lost. Found on the EIC7700X port, which logs from its start routine before the MMU is up: enabling RAMLOG_SYSLOG there turned the boot into a silent wedge two characters in. With this change the same configuration boots and `dmesg` replays the full early history. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Make.defs | ||
| ramlog.c | ||
| syslog.h | ||
| syslog_channel.c | ||
| syslog_chardev.c | ||
| syslog_console.c | ||
| syslog_consolechannel.c | ||
| syslog_devchannel.c | ||
| syslog_device.c | ||
| syslog_early.c | ||
| syslog_filechannel.c | ||
| syslog_flush.c | ||
| syslog_initialize.c | ||
| syslog_intbuffer.c | ||
| syslog_rpmsg.c | ||
| syslog_rpmsg.h | ||
| syslog_rpmsg_server.c | ||
| syslog_stream.c | ||
| syslog_write.c | ||
| vsyslog.c | ||
| vsyslog_rfc5424.c | ||