Skip to content

Make the user's app root module of the firmware #465

Open
@tact1m4n3

Description

@tact1m4n3

Currently the root module of the firmware is core/start.zig. This has one upside and one downside. The upside is that we can export the startup logic without requiring the user to do anything. However this can be solved by requiring the user to call a function at comptime like this:

const microzig = @import("microzig");

comptime {
    microzig.cpu.export_startup_logic(); // would export startup logic
}

pub fn main() {

}

The downside is that the user loses the ability to control the root module, which is often used to configure other dependencies (even std). This has been worked around for std but for other deps there is currently no solution that I am aware of.

If the user's module is the root module, then you can specify all the configuration you want directly, like you would do for a normal zig program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions