Index: hatari/rem.py
===================================================================
--- hatari/rem.py	(revision 698a58ad9c96f02db4ed4305ab72cb88c9ff6297)
+++ hatari/rem.py	(revision a6f5b952e80b43751c6e71c39b103f7d314f8e4e)
@@ -172,5 +172,157 @@
     "rom/romp.c",
     "rom/bios.s",
+    "rom/lowram.s",
     "rom/timeint.s"
+]
+
+mod_ram = [
+    "ram/addfpu.c",
+    "ram/adfield.c",
+    "ram/adselbx.c",
+    "ram/asgdsp.c",
+    "ram/asgvce.c",
+    "ram/barbadj.c",
+    "ram/chgsef.c",
+    "ram/chksec.c",
+    "ram/cminit.c",
+    "ram/ctcpos.c",
+    "ram/curset.c",
+    "ram/dbentr.c",
+    "ram/dcopy.c",
+    "ram/dec2fr.c",
+    "ram/delnote.c",
+    "ram/delpnts.c",
+    "ram/dformat.c",
+    "ram/dopatch.c",
+    "ram/enterit.c",
+    "ram/etaccn.c",
+    "ram/etadep.c",
+    "ram/etadyn.c",
+    "ram/etagch.c",
+    "ram/etagpt.c",
+    "ram/etains.c",
+    "ram/etaint.c",
+    "ram/etaopt.c",
+    "ram/etaprg.c",
+    "ram/etarat.c",
+    "ram/etatab.c",
+    "ram/etatun.c",
+    "ram/etavgr.c",
+    "ram/etdyn.c",
+    "ram/etiact.c",
+    "ram/eticnf.c",
+    "ram/etidin.c",
+    "ram/etimlt.c",
+    "ram/etinst.c",
+    "ram/etioas.c",
+    "ram/etiosc.c",
+    "ram/etipnt.c",
+    "ram/etires.c",
+    "ram/etitim.c",
+    "ram/etival.c",
+    "ram/etivce.c",
+    "ram/etiwsn.c",
+    "ram/etloc.c",
+    "ram/etmcfn.c",
+    "ram/etrel.c",
+    "ram/etres1.c",
+    "ram/etscor.c",
+    "ram/etsnbt.c",
+    "ram/etstrn.c",
+    "ram/ettpch.c",
+    "ram/ettrns.c",
+    "ram/etttab.c",
+    "ram/ettval.c",
+    "ram/etvel.c",
+    "ram/etwavs.c",
+    "ram/etwhar.c",
+    "ram/etwhrv.c",
+    "ram/etwoff.c",
+    "ram/etwpnt.c",
+    "ram/etwslt.c",
+    "ram/etwvce.c",
+    "ram/fcnote.c",
+    "ram/frfind.c",
+    "ram/gcurpos.c",
+    "ram/idfield.c",
+    "ram/idselbx.c",
+    "ram/im700.c",
+    "ram/infield.c",
+    "ram/initi.c",
+    "ram/instdsp.c",
+    "ram/itcpos.c",
+    "ram/kbobj.c",
+    "ram/lcdlbls.c",
+    "ram/ldfield.c",
+    "ram/ldselbx.c",
+    "ram/libdsp.c",
+    "ram/librw.c",
+    "ram/localkb.c",
+    "ram/m7menu.c",
+    "ram/midas.c",
+    "ram/msl.c",
+    "ram/msm.c",
+    "ram/nedacc.c",
+    "ram/pix2mid.c",
+    "ram/ptdisp.c",
+    "ram/ptdkey.c",
+    "ram/ptfield.c",
+    "ram/ptread.c",
+    "ram/ptselbx.c",
+    "ram/ptwrite.c",
+    "ram/puteq.c",
+    "ram/rscript.c",
+    "ram/scadv.c",
+    "ram/scfield.c",
+    "ram/scgoto.c",
+    "ram/scinit.c",
+    "ram/scope.c",
+    "ram/scordsp.c",
+    "ram/scread.c",
+    "ram/scselbx.c",
+    "ram/sctrak.c",
+    "ram/scwrite.c",
+    "ram/seccpy.c",
+    "ram/sedump.c",
+    "ram/select.c",
+    "ram/sendval.c",
+    "ram/setgc.c",
+    "ram/setv2gi.c",
+    "ram/setwq.c",
+    "ram/showcfg.c",
+    "ram/smscrl.c",
+    "ram/sqdisp.c",
+    "ram/sqdkey.c",
+    "ram/sqexec.c",
+    "ram/sqfield.c",
+    "ram/sqread.c",
+    "ram/sqscan.c",
+    "ram/sqselbx.c",
+    "ram/sqwrite.c",
+    "ram/stcpos.c",
+    "ram/stmproc.c",
+    "ram/swinit.c",
+    "ram/tdfield.c",
+    "ram/tdselbx.c",
+    "ram/ttcpos.c",
+    "ram/tundsp.c",
+    "ram/ucslice.c",
+    "ram/uslice.c",
+    "ram/vtyper.c",
+    "ram/wdfield.c",
+    "ram/wdselbx.c",
+    "ram/wheel.c",
+    "ram/wscalc.c",
+    "ram/wsdsp.c",
+    "ram/execins.s",
+    "ram/execkey.s",
+    "ram/fpuint.s",
+    "ram/procpfl.s",
+    "ram/sedisp.s",
+    "ram/seexec.s",
+    "ram/serintr.s",
+    "ram/sreset.s",
+    "ram/timeint.s",
+    "ram/tofpu.s"
 ]
 
@@ -340,7 +492,5 @@
     remove_archive(a_base)
 
-def link_rom():
-    print("Linking ROM")
-
+def link(com_file):
     fetch_archive("prolog")
     fetch_archive("libcio")
@@ -350,11 +500,5 @@
     fetch_archive("lib700")
 
-    fetch_file("bios.o")
-    fetch_file("romp.o")
-    fetch_file("booter.o")
-    fetch_file("timeint.o")
-    send_line("")
-
-    run_command("aln -w -l -c rom.lnk")
+    run_command("aln -w -l -c {}".format(com_file))
     send_line("")
 
@@ -366,4 +510,15 @@
     remove_archive("lib700")
 
+def link_rom():
+    print("Linking ROM")
+
+    fetch_file("bios.o")
+    fetch_file("romp.o")
+    fetch_file("booter.o")
+    fetch_file("timeint.o")
+    send_line("")
+
+    link("rom.lnk")
+
     remove_file("bios.o")
     remove_file("romp.o")
@@ -376,4 +531,29 @@
     send_line("")
 
+def link_ram():
+    print("Linking RAM")
+
+    for path in mod_ram:
+        (dir, file) = path.split("/")
+        (base, ext) = file.split(".")
+        fetch_file("{}.o".format(base))
+
+    fetch_file("lowram.o")
+    send_line("")
+
+    link("ram.lnk")
+
+    for path in mod_ram:
+        (dir, file) = path.split("/")
+        (base, ext) = file.split(".")
+        remove_file("{}.o".format(base))
+
+    remove_file("lowram.o")
+    send_line("")
+
+    store_file("midas.abs")
+    remove_file("midas.abs")
+    send_line("")
+
 print("Waiting for Hatari to connect to {}.".format(lis_path))
 hatari_connect()
@@ -384,8 +564,10 @@
 send_line("PATH=\\bin")
 send_line("cd \\work")
+send_line("")
 
 start_at = None
 
-for mod in [mod_prolog, mod_iolib, mod_libcio, mod_libsm, mod_lib700, mod_vlib, mod_rom]:
+for mod in [mod_prolog, mod_iolib, mod_libcio, mod_libsm, mod_lib700, mod_vlib,
+            mod_rom, mod_ram]:
     for path in mod:
         if start_at != None:
@@ -413,2 +595,3 @@
 
 link_rom()
+link_ram()
