Skip to content

Commit db3b382

Browse files
committed
Add runtime banner
This PR adds a simple banner that shows basic info from the host system and the container, for example_ ~~bash ═══════════════════════════════════════════════════════ Ocre Runtime v0.99.0-dev ═══════════════════════════════════════════════════════ Zephyr: 4.2.0 Board: native_sim/native SoC: native (undefined) Arch: posix RAM: 64 KB heap WAMR: 500 KB ═══════════════════════════════════════════════════════ ~~ Signed-off-by: Federico Roux <rouxfederico@gmail.com>
1 parent 533f2f5 commit db3b382

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

Kconfig

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ config OCRE_LOG_INF
8282
help
8383
Enable Ocre debug logging
8484

85+
config OCRE_PRINT_BANNER
86+
bool "Print Ocre runtime banner at startup"
87+
default y
88+
help
89+
Enable printing of the Ocre runtime banner with version and system information
90+
at application startup.
91+
8592
if OCRE
8693

8794
module = OCRE
@@ -93,7 +100,7 @@ endif
93100
config OCRE_SENSORS
94101
bool "Enable OCRE Sensors support"
95102
default n
96-
depends on SENSOR
103+
depends on SENSOR
97104
help
98105
Enable support for OCRE sensors
99106

@@ -121,13 +128,13 @@ config OCRE_CONTAINER_DEFAULT_STACK_SIZE
121128
default 2048
122129
help
123130
The default value used for a container's stack size.
124-
131+
125132
config MAX_CONTAINERS
126133
int "Maximum concurrent containers"
127134
default 10
128135
help
129136
The default value for maximum number of container's.
130-
137+
131138
config MAX_TIMERS
132139
int "Maximum number of timers"
133140
default 5
@@ -159,8 +166,8 @@ config OCRE_GPIO
159166
help
160167
Enable the OCRE GPIO driver that provides a portable API layer
161168
for GPIO operations across different hardware platforms.
162-
163-
169+
170+
164171
config OCRE_TIMER
165172
bool "OCRE Timer Driver"
166173
default y
@@ -192,7 +199,7 @@ config OCRE_CONTAINER_MESSAGING
192199
default n
193200
help
194201
Enable support for OCRE Container Messaging
195-
202+
196203
config MESSAGING_MAX_SUBSCRIPTIONS
197204
int "Number of maximum subscriptions for Container Messaging"
198205
default 10

prj.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CONFIG_DYNAMIC_THREAD_ALLOC=y
2222

2323
# File system
2424
CONFIG_FILE_SYSTEM=y
25-
#CONFIG_DISK_ACCESS=y
25+
#CONFIG_DISK_ACCESS=y
2626
CONFIG_FILE_SYSTEM_LITTLEFS=y
2727

2828
# Settings support
@@ -88,3 +88,4 @@ CONFIG_OCRE_MEMORY_CHECK_ENABLED=n
8888
CONFIG_OCRE_GPIO=y
8989

9090
CONFIG_OCRE_LOG_INF=y
91+
CONFIG_OCRE_PRINT_BANNER=y

src/samples-mini/zephyr/main.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,26 @@ int main(int argc, char *argv[])
4848
ocre_container_runtime_status_t ret = ocre_container_runtime_init(&ctx, &args);
4949

5050
if (ret == RUNTIME_STATUS_INITIALIZED) {
51-
printf("\n\nOcre runtime started\n");
51+
52+
#ifndef CONFIG_SOC_SERIES
53+
#define CONFIG_SOC_SERIES "undefined"
54+
#endif
55+
56+
#ifdef CONFIG_OCRE_PRINT_BANNER
57+
printf("\n\n");
58+
printf("═══════════════════════════════════════════════════════\n");
59+
printf(" Ocre Runtime v%s\n", APP_VERSION_STRING);
60+
printf("═══════════════════════════════════════════════════════\n");
61+
printf(" Zephyr: %s\n", KERNEL_VERSION_STRING);
62+
printf(" Board: %s\n", CONFIG_BOARD_TARGET);
63+
printf(" SoC: %s (%s)\n", CONFIG_SOC, CONFIG_SOC_SERIES);
64+
printf(" Arch: %s\n", CONFIG_ARCH);
65+
printf(" RAM: %d KB heap\n", CONFIG_HEAP_MEM_POOL_SIZE / 1024);
66+
printf(" WAMR: %d KB\n", CONFIG_OCRE_WAMR_HEAP_BUFFER_SIZE / 1024);
67+
printf("═══════════════════════════════════════════════════════\n\n");
68+
#else
69+
-printf("\n\nOcre runtime started\n");
70+
#endif
5271

5372
create_sample_container(container_filename);
5473

0 commit comments

Comments
 (0)