solo5
solo5 copied to clipboard
DO NOT MERGE: ukvm backend for OSX
This is sort of an update to https://github.com/Solo5/solo5/pull/150, but will not exist in its current form for long as it will be changed to work with https://github.com/Solo5/solo5/pull/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