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

rename platforms/ -> os/ (PX4 layers discussion) #11232

Closed
wants to merge 1 commit into from
Closed

Conversation

dagar
Copy link
Member

@dagar dagar commented Jan 17, 2019

As part of an ongoing effort to structure this project in well defined layers I'd like to consider renaming the top level platforms directory. This came up during the dev call yesterday to remove potential confusion with src/platforms and better establish what these layers are, or at least should be.

Next I'd like to establish src/platforms (renamed -> src/platform) as the "PX4 platform" layer.

Highlevel PX4 layers

  • PX4 Modules (src/modules)
    • uORB pub/sub and parameters
    • controllers, estimators, state machines, mavlink, etc
  • PX4 Drivers (src/drivers)
    • modules that access hardware
    • sensors, outputs, etc
    • platform agnostic drivers
  • PX4 Libraries (src/lib)
    • used by modules and drivers
    • have access to uORB, parameters, etc
    • non-px4 libraries also exist that aren't allowed to use anything in the px4 platform (px4_add_library vs add_library)
  • PX4 platform layer (src/platform)
    • uORB, parameters, hrt, work queue, task creation, px4 logging
    • defines everything in the PX4 platform layer, and implements all generic code. Depends on a significant amount of OS specific code (does it make sense for that to live under the top level os/)?
  • PX4 OS support layer (os/)
    • nuttx, posix (probably linux separately), qurt
    • contains non-px4 drivers
    • should not use anything in the PX4 platform layer (parameters, logging, hrt, etc).

The original intention was to relayer everything such that the OS specific layer could be cleanly extracted into a separate repository. An alternative would be merging the OS support layer with the platform layer.

Related

@dagar dagar requested a review from davids5 January 17, 2019 14:58
@LorenzMeier
Copy link
Member

I think that makes a lot of sense.

@hamishwillee
Copy link
Contributor

Sounds good - so boards still live at even higher level? https://github.com/PX4/Firmware/tree/master/boards

Can/should we document the source code organisation under concepts? Perhaps in a topic "PX4 Source Code Organisation"?

Also re-verify https://dev.px4.io/en/concept/architecture.html as there has been a bit of churn since it was done.

@dagar
Copy link
Member Author

dagar commented Jan 18, 2019

Sounds good - so boards still live at even higher level? https://github.com/PX4/Firmware/tree/master/boards

Yes, boards/ is a place where you can optionally supply a wide range of board specific pieces at any level of the system. Certain types of boards (eg NuttX) have different required pieces that plug in to the OS level.

Can/should we document the source code organisation under concepts? Perhaps in a topic "PX4 Source Code Organisation"?

Yes, but let's let it settle a bit and do that corresponding with v1.9.0. There's another change coming shortly.

@dagar
Copy link
Member Author

dagar commented Jan 18, 2019

Merge after #11013

@dagar dagar changed the title [RFC] rename platforms/ -> os/ (PX4 layers discussion) rename platforms/ -> os/ (PX4 layers discussion) Jan 18, 2019
@dagar dagar mentioned this pull request Jan 22, 2019
@dagar
Copy link
Member Author

dagar commented Feb 11, 2019

I'll pause on this and propose something larger.

Basically I'd like to establish a more explicit OS abstraction layer (OSAL) for PX4 that includes the various pieces like task management, semaphores, build hooks, etc.

Overall we need to figure out how that interface is defined, implemented, and where those OS pieces should live (headers and each OS). Then separately how to define the "PX4 platform" in a way that isn't mixed with the OS pieces (or does it matter).

To be continued...

@dagar dagar closed this Feb 11, 2019
@dagar dagar deleted the pr-px4_platform branch February 11, 2019 19:21
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.

3 participants