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

DO NOT MERGE: ukvm backend for OSX #173

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

djwillia
Copy link
Member

This is sort of an update to #150, but will not exist in its current form for long as it will be changed to work with #171.

The big difference between this and #150 is that this version builds natively on OSX, solving some of the toolchain issues from #150 . One implication of this is that the .ukvm image produced is not an ELF, but a Mach-O, and the monitor now includes a loader for Mach-O. I also moved (or eliminated) a bunch of arch-specific Solo5 code to avoid issues with using the OSX assembler.

To try this out with MirageOS a few other packages need to be built differently, requiring OPAM pins or (in the case of gmp) an OPAM remote. Here are the steps to run it:

opam remote add gmp-mac git://github.com/djwillia/opam-gmp-mac.git
opam update && opam upgrade

opam pin add solo5-kernel-ukvm git://github.com/djwillia/solo5#monitors-mach-o-load-merge
opam pin add mirage git://github.com/djwillia/mirage.git#monitors
opam pin add ocaml-freestanding git://github.com/djwillia/ocaml-freestanding#mac

Then the mirage-skeleton examples should be able to run as usual:

[djwillia@dans-mbp hello]$ uname -v
Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64[djwillia@dans-mbp hello]$ mirage configure -t ukvm
[djwillia@dans-mbp hello]$ make depend
[djwillia@dans-mbp hello]$ make 
[djwillia@dans-mbp hello]$ ./ukvm-bin hello.ukvm 
tsc_freq=0x94aadf95(2494226325)
            |      ___|
  __|  _ \  |  _ \ __ \
\__ \ (   | | (   |  ) |
____/\___/ _|\___/____/
Solo5: Memory map: 512 MB addressable:
Solo5:       heap >= 0x363000 < stack < 0x20000000
Solo5: Clock source: ukvm, frequency estimate is 2494226325 Hz
Solo5: new bindings
STUB: getenv() called
2017-03-27 20:05:22 -00:00: INF [application] hello
2017-03-27 20:05:23 -00:00: INF [application] hello
2017-03-27 20:05:24 -00:00: INF [application] hello
2017-03-27 20:05:25 -00:00: INF [application] hello
Solo5: solo5_app_main() returned with 0

Again, this isn't intended to be merged, just as a reference as we move together for #171

@mato mato added the pr/historic Needs work to bring up to date, feel free to take it label Feb 20, 2019
@mato mato mentioned this pull request Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/historic Needs work to bring up to date, feel free to take it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants