Skip to content

Kernel mode support - #13

Closed
raiden00pl wants to merge 8 commits into
apache:mainfrom
raiden00pl:kernel-mode-support
Closed

Kernel mode support#13
raiden00pl wants to merge 8 commits into
apache:mainfrom
raiden00pl:kernel-mode-support

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

changes required for testing nuttx in kernel build

@raiden00pl raiden00pl linked an issue Aug 10, 2026 that may be closed by this pull request
@raiden00pl
raiden00pl force-pushed the kernel-mode-support branch 3 times, most recently from beb9b3e to 38d33ba Compare August 11, 2026 13:43
@raiden00pl

Copy link
Copy Markdown
Member Author

this patchset is too big, I'll break it into smaller PRs

@raiden00pl
raiden00pl force-pushed the kernel-mode-support branch 4 times, most recently from 81b32f0 to cb413d8 Compare August 25, 2026 11:44
@raiden00pl
raiden00pl force-pushed the kernel-mode-support branch from cb413d8 to 7123112 Compare August 31, 2026 09:43
Kernel-mode CMake builds install applications to <build>/bin. On qemu
arm/riscv the target mounts them over a semihosting hostfs relative to
the spawned process working directory. When the generated .config
selects CONFIG_BUILD_KERNEL=y, register app_bindir=<build>/bin and
exec_cwd=<build>, keeping values set in YAML.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
With app_bindir configured, cmd_check resolves commands against the
application binary directory first and falls back to symbol lookups
over bin_debug for names that are not applications (NSH builtins like
cmd_df, cmocka entries). Flat-mode behavior is unchanged.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
Runtime checks searched the core ELF or the NSH help output, neither of
which lists kernel-mode applications. Route check_cmd through
CoreConfig.cmd_check when the core is a kernel build with a known
application directory, so runtime checks agree with collection-time
filtering.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
With exec_cwd set, QEMU resolved a relative '-kernel' path against the
spawn directory instead of the NTFC working directory it is expressed
in, so boot timed out. Absolutize the image path in the qemu and sim
start paths when a custom spawn directory is configured.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
Real hardware has no hostfs, so kernel-mode applications must be
shipped as a filesystem image. Add the per-core apps_image option,
which generates a ROMFS image from app_bindir with genromfs after the
build, and the $APPS_BINDIR and $APPS_IMG flash command placeholders.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
Prebuilt kernel-mode images have no host application directory, so
check_cmd could not resolve commands. List CONFIG_PATH_INITIAL (default
/system/bin) once on the running target, cache it, and match cmd_check
patterns against it with the matcher shared with AppBinDir. A failed
listing is not cached and is retried.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
CMake registers application targets at configure time from .config, but
kv overrides are applied after configuring, so an override enabling a
new application changed .config without ever creating its build target:
code-level options took effect through the .config -> config.h rule
while the application never appeared in the image. Overrides can also
unlock suboptions (e.g. *_PROGNAME) whose missing defaults make cmake
drop the application silently. Run olddefconfig and configure again
after applying overrides.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
add kernel-mode reference configs

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
@raiden00pl

Copy link
Copy Markdown
Member Author

all moved to separate PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kernel build support

1 participant