Skip to content

Safety starting scope proposal #57702

@simhein

Description

@simhein

Introduction

To start working on the safety part of zephyr a safety scope needs to be defined in detail. This is a proposal for a minimal scope definition to start with.

Problem description

Safety cannot and will not be applicable to all components of Zephyr, therefore a specific scope must be defined in which work towards safety goals in the project can begin. While an initial scope has been defined, it is too extensive for the start, and the definition of the scope should occur in smaller iterative steps.

Proposed change

The proposal is to start with a very small scope that only includes a few basic functionalities of the RTOS. This small scope should be used to begin working with safety in the project and to gradually expand the scope as needed.

Detailed RFC

In this section of the document the target audience is the dev team. Upon
reading this section each engineer should have a rather clear picture of what
needs to be done in order to implement the described feature.

Proposed change (Detailed)

To get to the following small scope I started with the philosophers sample (samples/philosopher) because it is a classic multi-thread synchronization problem and it includes some basic functionality of a RTOS like scheduling, threads with coop priorities and preemptive priorities as well as synchronization between the threads. Another plus was that mainly kernel components are used in the sample.

After analyzing the compile_commands.json ( sample build with: west build -p auto -b native_posix samples/philosophers/) I came up with following starting scope which I propose to use in the safety working group as well as in the safety committee to start the safety work and extend it as needed.

Zephyr_starting_safety_scope

Note: The Boxes are not in any specific order!

Plain file list:

  • sched.c
  • sched_priq.h
  • ksched.h
  • timeout_q.h
  • idle.c
  • thread.c
  • thread.h
  • thread_stack.h
  • timeout.c
  • errno.c
  • stack.c
  • mempool.c
  • system_work_q.c
  • kheap.c
  • sem.c
  • queue.c
  • mem_slab.c
  • mutex.c
  • mailbox.c
  • work.c
  • timer.c
  • condvar.c
  • device.c
  • device.h
  • fatal.c
  • fatal.h
  • main_weak.c
  • msg_q.c
  • version.c
  • version.h
  • init.c
  • init.h
  • banner.c
  • kernel.h
  • kernel_internal.h
  • kernel_structs.h
  • kernel_version.h
  • kswap.h
  • wait_q.h

The proposed scope and file list is far from completeness but it should be the starting point for further action points like:

  • Analysis of unnecessary dependencies and includes between configurations
  • Requirements
  • Coding guidelines

Another point in favor of the minimal and extensible approach is that architecture diagrams needed can be create in parallel with the dependency analysis.

Concerns and Unresolved Questions

Shall be discussed in this Proposal

Metadata

Metadata

Assignees

Labels

RFCRequest For Comments: want input from the communitySafetyTracked by the Safety WG

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions