Skip to content

examples/fbcon: Do not require a builtin registry to spawn the shell. - #3708

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fishwaldo:upstream-fbcon-builtin
Aug 8, 2026
Merged

examples/fbcon: Do not require a builtin registry to spawn the shell.#3708
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fishwaldo:upstream-fbcon-builtin

Conversation

@Fishwaldo

Copy link
Copy Markdown
Contributor

Summary

  • examples/fbcon does not build in a kernel build. It asks the registry
    of built-in applications for the stack size and priority to spawn its
    shell with, and a kernel build has no such registry, so the reference
    does not resolve.
  • A kernel build's programs are ELF files in a filesystem, which is
    exactly what the posix_spawn() below already handles, PATH search and
    all. There is nothing for the registry to tell it.
  • fbcon now consults the registry only where there is one, and takes the
    stack size and priority from this example's own configuration otherwise.
  • Companion to import: Link libnx for graphics applications in a kernel build. #3707, which puts libnx on the kernel-build
    link line. Both are needed for fbcon specifically; this one is fbcon's
    own defect, that one affects every NX application. Neither depends on the
    other to be correct, but fbcon needs both to link.
  • No related issue filed.

Impact

  • Is new feature added? Is existing feature changed? NO. Build fix.
  • Impact on user? YES, positive, and confined to this example. Where a
    builtin registry exists the behaviour is byte-for-byte what it was; the
    new path is reached only where the registry does not exist, which is
    where fbcon previously did not compile.
  • Impact on build? NO beyond fbcon compiling where it did not.
  • Impact on hardware? NO.
  • Impact on documentation? NO.
  • Impact on security? NO.
  • Impact on compatibility? NO.
  • Build-mode dependence? YES, CONFIG_BUILD_KERNEL only, in the sense
    that the guarded path is reached only where CONFIG_BUILTIN is unset,
    which is the kernel-build case. Flat and protected builds keep the
    registry lookup unchanged.

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host: macOS 26.5.1, arm64 (Apple Silicon), xPack riscv-none-elf-gcc
    15.2.0
  • Target: RISC-V, ESWIN EIC7700X EVB (downstream board port, not yet
    upstream), kernel build, HDMI framebuffer at 1080p60

Testing logs before change, linking examples/fbcon with
#3707 already applied so that libnx is no longer the
obstacle:

/Users/fish/github/nuttx/libs/libc/builtin/lib_builtin_forindex.c:56:(.text.builtin_for_index+0x0): undefined reference to `g_builtin_count'
riscv-none-elf-ld: /Users/fish/github/nuttx/libs/libc/builtin/lib_builtin_forindex.c:58:(.text.builtin_for_index+0x12): undefined reference to `g_builtins'
make[3]: *** [/Users/fish/github/apps/bin/fbcon] Error 1

Testing logs after change: fbcon builds, starts, and renders its console on
the framebuffer, spawning a shell whose prompt appears on the monitor:

[CPU0] display: /dev/fb0 1080p60
##### CMD 1: fbcon &
fbcon [0:100]
##### END 1 (ok, 1.57s)

With glyph rendering traced, showing it drawing to the framebuffer:

##### CMD 1: fbcon
[CPU2] fbcon_renderglyph: ch=H [48]
[CPU2] fbcon_renderglyph: ch=e [65]
[CPU2] fbcon_renderglyph: ch=l [6c]
[CPU2] fbcon_renderglyph: ch=o [6f]

PR verification Self-Check

  • This PR introduces only one functional change.
  • I have updated all required description fields above.
  • My PR adheres to Contributing Guidelines and Documentation.
  • My PR is still work in progress (not ready for review).
  • My PR is ready for review and can be safely merged into a codebase.

Claude (claude-opus-5) assisted with diagnosing this and with authoring the
code comment and this PR description. The commit carries an Assisted-by: tag
per CONTRIBUTING.md §1.5.

fbcon asked the registry of built-in applications for the stack size and
priority to spawn its shell with.  A kernel build has no such registry:
its programs are ELF files in a filesystem, which is exactly what the
posix_spawn() below already handles, PATH search and all.  The lookup
therefore fails to compile there.

Ask the registry only where there is one, and take the numbers from this
example's own configuration otherwise.

Tested on an EIC7700 EVB in a kernel build: fbcon renders its console on
a 1080p HDMI framebuffer and spawns a shell whose prompt appears on the
monitor.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
@xiaoxiang781216
xiaoxiang781216 merged commit a65a537 into apache:master Aug 8, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants