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

Metacompiler overhaul #38

Open
larsbrinkhoff opened this issue Apr 22, 2017 · 2 comments
Open

Metacompiler overhaul #38

larsbrinkhoff opened this issue Apr 22, 2017 · 2 comments

Comments

@larsbrinkhoff
Copy link
Owner

larsbrinkhoff commented Apr 22, 2017

The metacompiler is due for an overhaul.

  • The current implementation is closely tied to building the kernel.

    • The kernel-specific code should be split off.
    • The compiler should be made a generic cross compiler.
  • Everything is written to a single memory space.

    • Many microcontrollers use a Harvard architecture and need separate code and data spaces.
    • Some applications may want to have separate read-only and read-write data spaces.
    • The word headers can be written to a separate area.
  • Building and saving the image is constrained by the single memory space.

    • Must write everything sequentially from start to end.
    • It would be better to be able to write many separate sections and assemble them together in the end.
@pipcet
Copy link
Contributor

pipcet commented Apr 23, 2017

The asm.js target essentially has separate code and data spaces; it gets around the single memory space limitation by compiling to the data space and emitting code directly. The wasm target also has separate code and data spaces, and makes two passes over the nucleus, one for the code and one for the data (it would require a third pass to actually just count the number of defined words, but right now that's hardcoded). So these two targets would benefit a lot from this improvement.

gas has sections and numbered subsections within those. That's sufficient for WebAssembly, while simple sections might not be.

@larsbrinkhoff
Copy link
Owner Author

larsbrinkhoff commented Apr 25, 2017

  • Splitting off code into separate files was a great success

    • Hide complexity in self-contained components.
    • Avoid dependencies.
    • Do more of that?
  • Support for relocation?

    • GEMDOS executables really need this.
    • Also usable for the C target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants