Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ build:_common --@score_logging//score/datarouter/build_configuration_flags:enabl
build:_common --@score_logging//score/datarouter/build_configuration_flags:file_transfer=False
build:_common --@score_logging//score/datarouter/build_configuration_flags:use_local_vlan=True

# ─── QNX common flags (shared by all QNX configs) ────────────────────────────
build:_qnx_common --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
build:_qnx_common --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:_qnx_common --incompatible_enable_cc_toolchain_resolution

build:qnx-x86_64 --config=_common
build:qnx-x86_64 --noexperimental_merged_skyframe_analysis_execution
build:qnx-x86_64 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
Expand All @@ -41,6 +46,16 @@ build:qnx-x86_64 --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp
build:qnx-x86_64 --extra_toolchains=@score_qnx_x86_64_ifs_toolchain//:ifs-x86_64-qnx-sdp_8.0.0
build:qnx-x86_64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800

# ─── QNX aarch64 cross-compilation config ────────────────────────────────────
# Usage: bazel build --config=qnx-aarch64 //target
build:qnx-aarch64 --config=_common
build:qnx-aarch64 --config=_qnx_common
build:qnx-aarch64 --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
build:qnx-aarch64 --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0
build:qnx-aarch64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800
build:qnx-aarch64 --extra_toolchains=@score_qnx_aarch64_ifs_toolchain//:ifs-aarch64-qnx-sdp_8.0.0


build:linux-x86_64 --config=_common
build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0
build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
Expand Down
19 changes: 17 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions bazel_common/score_images.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ imagefs.toolchain(
target_os = "qnx",
type = "ifs",
)
imagefs.toolchain(
name = "score_qnx_aarch64_ifs_toolchain",
sdp_to_import = "@score_qcc_aarch64_toolchain_pkg",
sdp_version = "8.0.0",
target_cpu = "aarch64",
target_os = "qnx",
type = "ifs",
)
use_repo(
imagefs,
"score_qnx_aarch64_ifs_toolchain",
"score_qnx_x86_64_ifs_toolchain",
)
1 change: 1 addition & 0 deletions bazel_common/score_qnx_toolchains.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ qcc.toolchain(
use_repo(
qcc,
"score_qcc_aarch64_toolchain",
"score_qcc_aarch64_toolchain_pkg",
"score_qcc_x86_64_toolchain",
"score_qcc_x86_64_toolchain_pkg",
)
30 changes: 30 additions & 0 deletions images/qnx_aarch64/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")

alias(
name = "image",
actual = "//images/qnx_aarch64/build:init",
visibility = ["//visibility:public"],
)

sh_binary(
name = "run",
srcs = ["//runners/qemu_aarch64/scripts:run_qemu_qnx.sh"],
args = [
"$(location :image)",
],
data = [
":image",
],
)
72 changes: 72 additions & 0 deletions images/qnx_aarch64/build/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@score_rules_imagefs//rules/qnx:ifs.bzl", "qnx_ifs")

filegroup(
name = "scripts",
srcs = [
"//images/qnx_aarch64/configs:startup.sh",
],
visibility = ["//visibility:private"],
)

filegroup(
name = "configs",
srcs = [
"//images/qnx_aarch64/configs:dhcpcd.conf",
"//images/qnx_aarch64/configs:group",
"//images/qnx_aarch64/configs:hostname",
"//images/qnx_aarch64/configs:network_capture.sh",
"//images/qnx_aarch64/configs:network_setup.sh",
"//images/qnx_aarch64/configs:network_setup_dhcp.sh",
"//images/qnx_aarch64/configs:passwd",
"//images/qnx_aarch64/configs:profile",
"//images/qnx_aarch64/configs:qcrypto.conf",
"//images/qnx_aarch64/configs:ssh_host_rsa_key",
"//images/qnx_aarch64/configs:ssh_host_rsa_key.pub",
"//images/qnx_aarch64/configs:sshd_config",
],
visibility = ["//visibility:private"],
)

qnx_ifs(
name = "init",
srcs = [
":configs",
":scripts",
":system.build",
":system_dir",
"//feature_integration_tests/configs:etc_configs",
"//feature_integration_tests/configs/datarouter:etc_configs",
"//showcases",
"@score_logging//score/datarouter",
"@score_persistency//tests/test_scenarios/cpp:test_scenarios",
],
build_file = "init.build",
ext_repo_maping = {
"BUNDLE_PATH": "$(location //showcases:showcases)",
"DATAROUTER_PATH": "$(location @score_logging//score/datarouter:datarouter)",
},
visibility = [
"//visibility:public",
],
)

filegroup(
name = "system_dir",
srcs = [
"init.build",
"system.build",
],
)
98 changes: 98 additions & 0 deletions images/qnx_aarch64/build/init.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************


###############################################################################
#
# Example image built based on minimal configuration from QNX
#
###############################################################################

[-optional]

[image=0x3600000] # Set image size to 56MB (0x3600000 bytes)
[virtual=aarch64le,raw -compress] boot = { # Configure for aarch64le architecture with raw compressed boot
# TODO: replace startup-virt with the actual aarch64 startup binary for the target BSP.
# QNX SDP 8.0.0 ships no generic QEMU-virt startup; source one from the appropriate BSP.
startup-virt -v # Start aarch64 kernel - board-specific startup binary required
PATH=/proc/boot # Set executable search path to boot directory
LD_LIBRARY_PATH=/proc/boot # Set library search path to boot directory
[+keeplinked] procnto-smp-instr # Keep process manager linked and instrumented for SMP
}

[+script] startup-script = { # Define startup script that runs during boot
procmgr_symlink /dev/shmem /tmp # Create symbolic link from shared memory to /tmp
# /tmp will be mounted later as a proper RAM disk

display_msg Welcome to QNX OS 8.0 on aarch64 tweaked for S-CORE! # Display welcome message

# These env variables get inherited by all programs which follow
SYSNAME=nto # Set system name to "nto" (Neutrino)
TERM=qansi # Set terminal type to QNX ANSI

devc-ser8250 & # Start serial driver in background
waitfor /dev/ser1 # Wait for serial device to be available
reopen /dev/ser1 # Reopen serial device for console I/O

display_msg Placeholder for startup script # Display startup message
etc/startup.sh # Execute main startup script

[+session] /bin/sh & # Start shell session in background
}

# Essential utilities - core system commands needed for basic operation
# These binaries provide fundamental system functionality and process management

# Process and system management utilities
on # Command execution utility - runs commands with specific options
[type=link] waitfor=on # Create symbolic link: waitfor -> on (waits for resources to become available)
[type=link] ability=on # Create symbolic link: ability -> on (manages process abilities/privileges)

# Shell and command interpreter
ksh # Korn shell - provides command-line interface and scripting
pidin # Process information display - shows running processes (like 'ps' on Linux)
[type=link] /bin/sh=/proc/boot/ksh # Create symbolic link: sh -> ksh (standard shell link)

# File system utilities
mount # File system mount utility - mounts/unmounts file systems
getconf # System configuration query utility - retrieves system parameters
[type=link] setconf=getconf # Create symbolic link: setconf -> getconf (sets configuration parameters)

# Device drivers for hardware access
devc-ser8250 # Serial port driver for 8250/16550 UART controllers (console access)

# System logging utilities
slog2info # System log viewer - displays logged messages
slogger2 # System logging daemon - collects and manages log messages

# Essential libraries - core runtime libraries required for system operation
# These libraries provide fundamental services like C runtime, networking, and logging

# Standard C library - provides basic C runtime functions
libc.so.6 # Main C library (malloc, printf, file I/O, etc.)

# Dynamic linker/loader - handles dynamic library loading at runtime
/usr/lib/ldqnx-64.so.2=ldqnx-64.so.2 # 64-bit QNX dynamic linker (loads shared libraries)

# Networking library - provides socket and network communication functions
libsocket.so.4 # Socket library (TCP/IP, UDP, network I/O functions)
[type=link] libsocket.so=libsocket.so.4 # Create version-neutral symbolic link

# System logging library - provides logging services for applications
libslog2.so.1 # System logging library (slog2_* functions)
[type=link] libslog2.so=libslog2.so.1 # Create version-neutral symbolic link

# Orchestrator example needed
[type=link] /data=/tmp_ram

[+include] ${MAIN_BUILD_FILE_DIR}/system.build # Include additional system build configurations
Loading
Loading