A Haskell program needs three supporting pieces: Haskell runtime system (RTS), base Haskell libraries (e.g. Prelude definitions), and C libraries (libc, libm, libgmp, etc). The RTS and the Haskell libs have to be patched to run on bare metal, and the tiny C libraries under support/ replace real ones. Compared to the original monolithic patch file, the updated version divides the patch into a set of individual patch files. This is good, but the division itself is done in a somewhat confusing way. The Makefile first applies a set of patches in "halvm" and then applies patches in "house" that depends on "halvm". It looks like the halvm patches are there to port ghc to Xen, so we shouldn't be concerned. Also, some of the patches seem unnecessary. I tried to figure out the minimal patches required to support House:
House is compiled by ghc stage1. It would be really interesting to bootstrap ghc and make ghci runnable on House. Think about it: House's shell is ghci, and House's editor is Yi. Native APIs are Haskell functions. All processes share the RTS code. How exciting it will be! It's like the Lisp Machine resurrected! The boot process is rougly: Vbe-patched GRUB -> start (cbits/start.S) -> c_start (cbits/c_start.c) -> main (ghc-6.8.2/rts/Main.c in libHSrts.a) -> ... -> main (House.hs) |