{"id":122,"date":"2013-03-07T12:40:19","date_gmt":"2013-03-07T20:40:19","guid":{"rendered":"http:\/\/www.mirandabanda.org\/cogblog\/?page_id=122"},"modified":"2018-03-07T09:23:44","modified_gmt":"2018-03-07T17:23:44","slug":"build-image","status":"publish","type":"page","link":"http:\/\/www.mirandabanda.org\/cogblog\/build-image\/","title":{"rendered":"Building a Cog Development Image"},"content":{"rendered":"<div>The Cog VM source is in a Squeak Smalltalk <a href=\"http:\/\/www.wiresong.ca\/monticello\/\">Monticello<\/a> package at\u00c2\u00a0<a href=\"http:\/\/source.squeak.org\/VMMaker\" target=\"_blank\">http:\/\/source.squeak.org\/<wbr \/>VMMaker<\/a>. \u00c2\u00a0Load the newest version of \u00c2\u00a0VMMaker.oscog, e.g.\u00c2\u00a0VMMaker.oscog-eem.2345 (*).<\/div>\n<p>Building the image manually is tedious. \u00c2\u00a0Fortunately an automated build using\u00c2\u00a0the current Squeak release is provided in the image subdirectory of\u00c2\u00a0<a href=\"http:\/\/www.github.com\/OpenSmalltalk\/opensmalltalk-vm\">http:\/\/www.github.com\/OpenSmalltalk\/opensmalltalk-vm<\/a>.<\/p>\n<div>$ git\u00c2\u00a0clone http:\/\/www.github.com\/OpenSmalltalk\/opensmalltalk-vm<\/div>\n<div>$ cd opensmalltalk-vm\/image<\/div>\n<div>$ cat README # this may be\u00c2\u00a0more up-to-date than this blog page<\/div>\n<div>$ .\/buildspurtrunkvmmakerimage.sh \u00c2\u00a0 \u00c2\u00a0# or\u00c2\u00a0buildspurtrunkvmmaker64image.sh<\/div>\n<p>&nbsp;<\/p>\n<div>This almost works perfectly; but&#8230;<\/div>\n<div>\n<ul>\n<li>on Windows you&#8217;ll need to use Cygwin and install wget, e.g. from\u00c2\u00a0from http:\/\/gnuwin32.sourceforge.net\/packages\/wget.htm, probably as http:\/\/downloads.sourceforge.net\/gnuwin32\/wget-1.11.4-1-setup.exe<\/li>\n<li>the second part of the build loads VMMaker.oscog and the support packages. \u00c2\u00a0During this you&#8217;ll get prompted for your initials. \u00c2\u00a0Supply some to proceed.<\/li>\n<\/ul>\n<\/div>\n<div>Once you&#8217;ve built a VMMaker image, read the class comments of\u00c2\u00a0StackInterpreterSimulator and\u00c2\u00a0CogVMSimulator for running the simulator. \u00c2\u00a0Alternatively use the example expressions in\u00c2\u00a0VM Simulation Workspace.text. \u00c2\u00a0Slang test expressions are provided in\u00c2\u00a0Slang Test Workspace.text. \u00c2\u00a0 Test expressions that run the JIT to produce machine code disassembly from methods in the image are provided in In-image Compilation Workspace.<\/div>\n<div><\/div>\n<div>Cl\u00c3\u00a9ment has done a lovely screen cast showing how the simulator is used to develop the VM. \u00c2\u00a0In this case he debugs a code generation error in the speculative inlining JIT.\u00c2\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=hctMBGAXVSs\">https:\/\/www.youtube.com\/watch?v=hctMBGAXVSs<\/a>. \u00c2\u00a0And here&#8217;s <a href=\"https:\/\/clementbera.wordpress.com\/2018\/03\/07\/sista-vm-screencast\/\">his accompanying\u00c2\u00a0blog post<\/a>.<\/div>\n<div>\n<p>The VM source is generated from as VMMaker.oscog image whenever required. \u00c2\u00a0For the official source tree, which resides on github (see\u00c2\u00a0<a href=\"http:\/\/www.mirandabanda.org\/cogblog\/compiling-the-vm\/\">http:\/\/www.mirandabanda.org\/cogblog\/compiling-the-vm\/<\/a>) this is done by core developers on an as-needed basis. \u00c2\u00a0For one&#8217;s own development, generate the source as and when you see fit. \u00c2\u00a0For much of the time one can develop a VM using there simulator, but soon enough one will want to generate a real VM or have to debug the real VM because while the simulator is powerful, it is slow and of necessity incomplete (for example, the simulator cannot yet simulate FFI calls).<\/p>\n<\/div>\n<div>\n<p>(*)\u00c2\u00a0The VMMaker package is for the Interpreter VM and the VMMaker-oscog package is an obsolete version of the <a href=\"http:\/\/www.pharo-project.org\/home\">Pharo<\/a> version of Cog.<\/p>\n<\/div>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKbDS1y8vL9fLzSxKzEtJTAIRevlF6frJ+elJOfnpAA==\" \/><input type=\"hidden\" name=\"blogName\" value=\"c85PV3DKyU8HAA==\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"MzQyAgA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"cyrNzEnJzEtXSFRwzk9XcEktS83JL8hNzStR8MxNTE8FAA==\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKbDS1y8vL9fLzSxKzEtJTAIRevlF6frJ+elJOfnp+kmlmTkpupm5iemp+gA=\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"S0zJzcwDAA==\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwNNY1ACJzBUMjKwNjK0NLAA==\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"nVbbjts2EH3vVxCbIkgKW9pL2gRdx8XmVmxRI0V3selbQUlji12KVEjKil\/bH+lrfyP5sZ4h5cvaGyDti2WJnOHMmTNnOKnUcnpdk3hpF+JmJrztXElCeaGMkOLqfUfyVlw1Uusg9a2YSFE7mj8\/qkNov8\/zvu+zXjny1iyyUuaNNUGVpLXNj6azzcskl1PRyvJWLkjI8OnPj3\/ve0onZz6emFm3yG9mM3lL7kgE6RYUnh\/9Xmhpbo+mn7WY9IUT+XQw5EMzwWf9bGUlArI01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Aa+cPN24F6gBWtyNBDfi4OzS00MX4E0MmhdFSseHZ8enzzLj8\/y46e5VxApaPw4QcqI4loRVbLE1laa1TAyk3ZDOIcJtKuQbbzg3LncDPhxozNV5L6EJE70NbbhroD2fN9huFabMR7BtvO5KqENa78BMY5gpMoaFh4UQwMbkUadeOSJPjeVG+XQybLgn3iRQQycUV5GViLHMQ7kYXdnLH+5GaPyOBFKDXQtVqCSozX5cCPiYPla4sc8M\/haIlGAbc6w2tQTur625DKONogmGiZAACtrMcPIKggVJzFXYeux6QDVoOdBQVM5sFJuXEehTPci3uN2+mfEAxEHcQcY2y3qaNsrHmkSbYm22oQkWV81u8KZtVxSajo0VDx5vVhQKVkNUUFNh93a2h7TuNMjoQK\/e42e5vyQgKGSBSvgzmcYfA2ZFo9YhwdZHe35Q5LGBrHCzBk+knjz5hLftfaPhyvUHotx8WTgEpnT+FhfqRHOfGDlzpzgpNbDcLAYJ37v2AFtW3gbI965F7PNfVRta+nsGBL6B+4lkXQ1huHR9Bf+Hq\/5O04wl+6k8i8=\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"http:\/\/www.mirandabanda.org\/cogblog\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"<p>The Cog VM source is in a Squeak Smalltalk Monticello package at\u00c2\u00a0http:\/\/source.squeak.org\/VMMaker. \u00c2\u00a0Load the newest version of \u00c2\u00a0VMMaker.oscog, e.g.\u00c2\u00a0VMMaker.oscog-eem.2345 (*). Building the image manually is tedious. \u00c2\u00a0Fortunately an automated build using\u00c2\u00a0the current Squeak release is provided in the image subdirectory of\u00c2\u00a0http:\/\/www.github.com\/OpenSmalltalk\/opensmalltalk-vm. $ git\u00c2\u00a0clone http:\/\/www.github.com\/OpenSmalltalk\/opensmalltalk-vm $ cd opensmalltalk-vm\/image $ cat README # this may be\u00c2\u00a0more up-to-date [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/pages\/122"}],"collection":[{"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":24,"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/pages\/122\/revisions"}],"predecessor-version":[{"id":385,"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/pages\/122\/revisions\/385"}],"wp:attachment":[{"href":"http:\/\/www.mirandabanda.org\/cogblog\/wp-json\/wp\/v2\/media?parent=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}