Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephyr system init functional requirements #29

Conversation

gregshue
Copy link

Fix #26

@gregshue gregshue force-pushed the gregshue/zep_system_initialization_reqs branch from 1bc3e58 to 48deb4f Compare February 28, 2024 00:26
Copy link
Collaborator

@stanislaw stanislaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of my comments depend on what we discuss and agree with the group. For example, the use of RATIONALE fields or a more active use of FREETEXT that provides context for each section's requirements.

docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
docs/zephyr_02_functional_requirements.sdoc Outdated Show resolved Hide resolved
STATUS: Draft
TYPE: Functional
COMPONENT: System Initialization
TITLE: System Init finished notification to MMU component
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section has many optional requirements some of which build related groups. It would be great to see them nested in the sections, such as SMP configurations, MMU configurations, etc. A plain list is harder to follow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related groupings make sense for simple enable/disable. I expect many requirements will have multiple independent conditions. That seems to make document organization less predictable.

I welcome suggestions!

COMPONENT: System Initialization
TITLE: Top-Level Application Return Value Ignored
STATEMENT: >>>
Zephyr shall explicitly ignore the return value of the call to `main()`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore not understood.

Needs an explanation (COMMENT?) and a justification.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone else will have to justify why the code is implemented as (void)main();.

@gregshue
Copy link
Author

gregshue commented Mar 9, 2024

Please reformat the statements so that the web page shows each condition on a separate line.

@gregshue gregshue force-pushed the gregshue/zep_system_initialization_reqs branch from 48deb4f to 1fb03f4 Compare March 9, 2024 04:40
@gregshue
Copy link
Author

Please remove the Where conditionals. The 3/14/24 Focus Group decided to postpone dealing with configuration items.

@gregshue gregshue force-pushed the gregshue/zep_system_initialization_reqs branch from 1fb03f4 to 992945a Compare March 14, 2024 18:48
Summary of the changes:

- Add empty sections for Interface, Functional, Non-Functional
  requirements.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add interface requirement for build-time registration for
  notifications of the following system initialization events:

    - Pre-CPU Architecture Initialization
    - Pre-Kernel Initialization
    - Post-Kernel Initialized
    - Application Initialization

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for sustaining an inherited
  active, non-reconfigurable HW watchdog.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization using
  no more than the published limit of the initial CPU stack.
  This phrasing allows for previous executables to:
    - pass data on the inherited stack;
    - design a maximum size for the inherited stack that
      will support Zephyr RTOS initialization.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to allow
  read access during initialization to data from preceding executable.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  follow component dependecy order.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for the Pre-CPU-Architecture init
  event.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for the Pre-Kernel initialization
  event.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for the Post-Kernel initialization
  event.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for the Application initialization
  event.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for the SMP Initialized
  event.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  notify components registered for an event based on the
  notification priority indicated in the event registration.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add functional requirement for System Initialization to
  end with the call to `main(void)`.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add System Initialization:Notifications section

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add requirement to ignore the return value of `main()`

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add requirement to dump code coverage data upon return from `main()`
  and before beginning the Zephyr RTOS shutdown sequence.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add requirement to disable interrupts during system shutdown.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add requirement to end system shutdown in an empty infinte loop.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add requirement for interface for registration for SMP-INit
  notification.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
@gregshue gregshue force-pushed the gregshue/zep_system_initialization_reqs branch from 992945a to 25707e3 Compare April 12, 2024 01:26
@gregshue gregshue requested a review from stanislaw April 12, 2024 01:34
- Pre-Kernel Initialization
- Post-Kernel Initialized
- Application Initialization
<<<
Copy link
Author

@gregshue gregshue Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhancement Request: This needs a notification that System Initialization is compete. This notification needs to be given immediately before the call to main(void).

This event is needed by components that change behavior upon initialization complete (e.g., user interfaces, allowing communication). Providing this through the System Initialization component allows independence from the implementation of main() (whether defined by the test framework or the default implementation in the kernel).

- Pre-Kernel Initialization
- Post-Kernel Initialized
- Application Initialization
<<<
Copy link
Author

@gregshue gregshue Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhancement Request: There needs to be a symmetric set of events for system shutdown.

The shutdown event registration is needed to enable a bootloader to register a handler for handing off execution to the loaded image while still allowing a controlled, clean shutdown of the RTOS.

Where the Zephyr RTOS inherits an active hardware watchdog that cannot be reconfigured,

the Zephyr RTOS shall sustain the active hardware watchdog.
<<<
Copy link
Author

@gregshue gregshue Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This STATEMENT is an enhancement request: This requirement is needed to handle conditions that will likely occur with some existing SOCs.

This also needs another requirement to start a HW watchdog if one is not active.

TITLE: Initial CPU stack usage kept within published limits
STATEMENT: >>>
The Zephyr RTOS shall use no more than the published amount of the initial CPU stack.
<<<
Copy link
Author

@gregshue gregshue Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This STATEMENT is an enhancement request: This requirement is desired to allow users to determine the size of the initial stack provided by the bootloader.

This also needs a related requirement for Zephyr Project to specify, per CPU architecture, the amount initial stack space consumed before transitioning to an internally-allocated stack.

- each SMP context has been initialized; and
- each System Initialization notification has been published; and
- each memory access protection has been established.
<<<
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referring specifically to the C function int main(void) imposes a design constraint. This needs to be traced to a higher-level Architecture Definition statements to:

  • Provide a C ABI to the kernel;
  • Only support the function signature int main(void);

- each System Initialization notification has been published; and
- each memory access protection has been established.
<<<

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which sdoc fragment should hold the requirements for the default implementation of int main(void);?

@gregshue gregshue closed this Apr 12, 2024
@gregshue gregshue reopened this Apr 12, 2024
Summary of the changes:

- Add System Requirements section for System Initialization with
  - Parent requirement for extensibility.
  - Child requirements for build time registration of init hooks
    and initialization time execution of registered init hooks.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
Summary of the changes:

- Add relationships for System Requirements:System Initialization
  notification requirements.

Verified by:

1. Visual verification of strictdoc server web page using firefox.

Signed-off-by: Gregory Shue <[email protected]>
STATEMENT: >>>
The Zephyr RTOS shall expose an interface to build-time registration for the following system initialization notifications:

- Pre-CPU Architecture Initialization
Copy link
Author

@gregshue gregshue May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the Init level INIT_LEVEL_EARLY.

While the Zephyr RTOS is in any system initialization phase,

the Zephyr RTOS shall allow read access to the data provided by the preceding executable.
<<<
Copy link
Author

@gregshue gregshue May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This STATEMENT is an enhancement request.

TITLE: Initialization Notifications given in Registration Priority Order
STATEMENT: >>>
The Zephyr RTOS shall publish notifications for an event following the notification priority indicated in the event registration.
<<<
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this STATEMENT reflect the current implementation?

TITLE: Extensible System Initialization
STATEMENT: >>>
The Zephyr RTOS initialization sequence shall be extensible.
<<<
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This STATEMENT is an enhancement request.

@gregshue
Copy link
Author

gregshue commented May 2, 2024

Withdrawing.

@gregshue gregshue closed this May 2, 2024
@gregshue gregshue deleted the gregshue/zep_system_initialization_reqs branch May 2, 2024 20:33
@gregshue gregshue restored the gregshue/zep_system_initialization_reqs branch May 3, 2024 16:16
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.

System Initialization Requirements
3 participants