Fishwaldo commented on PR #19732:
URL: https://github.com/apache/nuttx/pull/19732#issuecomment-5225210947

   Thanks — runtime logs below. Both boots are the same tree, same board and 
the same defconfig; the only difference is `drivers/syslog/ramlog.c` reverted 
to master's version for the "before" run.
   
   **Before (master's `ramlog.c`)** — the boot stops after two characters and 
never recovers:
   
   ```
   Starting kernel ...
   
   A[
   ```
   
   That is the entire output. No prompt, no panic, no further progress.
   
   Those two characters locate the fault exactly. From 
`arch/risc-v/src/eic7700x/eic7700x_start.c`:
   
   ```c
   321:  showprogress('A');                              /* up_putc(), straight 
to the UART */
   333:  _info("Firmware handed off on Hart %d, ...");   /* first syslog write 
*/
   338:  showprogress('B');
   344:  nx_start();
   ```
   
   `A` is `up_putc()` and never touches syslog. `[` is the first character of 
the `_info()` line entering `ramlog_addbuf()`. `B` never appears, so that call 
never returned — the system dies inside the first RAM log write, eleven lines 
before `nx_start()`.
   
   This only bites with `CONFIG_RAMLOG_SYSLOG=y`, which is `default n`. That 
option is what redirects syslog output into the RAM log, and so it is the only 
way `ramlog_addbuf()` is reached this early in boot. Without it the function is 
only entered through writes to `/dev/ramlog`, which by definition happen once 
there are tasks to make them — which is why this has gone unnoticed.
   
   **After (this PR)** — the same board boots to NSH, and `dmesg` replays 418 
lines. The first is the one that used to be fatal:
   
   ```
   [CPU0] eic7700x_start_s: Firmware handed off on Hart 3, NuttX running on 
Hart 0
   ```
   
   That is the line emitted at 333 above: before `nx_start()`, before the MMU 
is enabled, and before the task lists exist — the exact window the patch 
guards. And it is not just that the system survives; the bytes written in that 
window are still in the buffer to be replayed afterwards.
   
   The EIC7700X port updates will start landing once some of these core fixes I 
have opened are merged, one way or another.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to