[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MirageOS-devel] Purpose of CAML_ENTRYPOINT, "OS.Main.run"?



Looking through the mirage-xen code, I'm wondering what the purpose of
CAML_ENTRYPOINT is. The code seems to work as follows:

1. main.c calls caml_startup(), which runs main.ml.
2. main.ml calls OS.Main.run, which registers the callback
"OS.Main.run" and returns.
3. main.c looks up this callback and calls it in a loop until it returns true.

Why do we go back to C for this? Why doesn't the OCaml OS.Main.run
just run the main loop itself? I tried it, and it seemed to work:

https://github.com/talex5/mirage-platform/commit/f4fede966ab4f0f9fb7f9ae4db5b9e09efdc9a4f


-- 
Dr Thomas Leonard        http://0install.net/
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.