<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-313659922933043795</id><updated>2012-01-19T23:13:35.934+01:00</updated><category term='Eclipse CDT'/><category term='Ubuntu'/><category term='ALIX'/><category term='NetworkManager'/><category term='Debian'/><title type='text'>Tinkering Is Fun</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-7288706677894975068</id><published>2012-01-19T23:10:00.002+01:00</published><updated>2012-01-19T23:13:35.939+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetworkManager'/><title type='text'>Using NetworkManager from the command line</title><content type='html'>As much as &lt;a href="http://projects.gnome.org/NetworkManager/"&gt;Network Manager&lt;/a&gt; can be annoying at times, it's often quite useful, especially if your network configuration is not fixed.&lt;br /&gt;&lt;br /&gt;But what if you can't boot into X for whatever reason, or if for some reason you can't start nm-applet or equivalent? If you leave network setup to NetworkManager, you have no network now. This also means no way to google for help. &lt;tt&gt;:-)&lt;/tt&gt;&lt;br /&gt;You can find many guides telling you to just configure the network yourself. If it's a wired network this is quite easy (with &lt;a href="http://en.wikipedia.org/wiki/DHCP"&gt;DHCP&lt;/a&gt; just &lt;tt&gt;dhclient eth0&lt;/tt&gt; would often just do the right thing). But for wireless networks this gets more complicated. So you might be advised to use iwconfig (for open or WEP networks), or wpa_supplicant (for all).&lt;br /&gt;&lt;br /&gt;But if you already have the network configured in NetworkManager (and the NetworkManager service is running, or you manage to start it), I suggest you just use that. There's a command line utility to interact with the NetworkManager, called &lt;tt&gt;nmcli&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;Here are the basic usecases you might need:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;nmcli con list&lt;/pre&gt;lists all the configured networks NetworkManager knows about; notice the columns NAME and UUID.&lt;br /&gt;&lt;br /&gt;To bring up a connection use either:&lt;br /&gt;&lt;pre&gt;nmcli con up id NAME&lt;/pre&gt;&lt;i&gt;yes, I also find it a bit confusing - but you really are supposed to put a value from the name column after the &lt;tt&gt;id&lt;/tt&gt; &lt;tt&gt;:-)&lt;/tt&gt;, e.g. nmcli con up id MyNetwork&lt;/i&gt;&lt;br /&gt;&lt;pre&gt;nmcli con up uuid UUID&lt;/pre&gt;&lt;i&gt;you normally don't need to use this&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;To bring a connection down use &lt;tt&gt;down&lt;/tt&gt; instead of &lt;tt&gt;up&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;For more details see &lt;tt&gt;man nmcli&lt;/tt&gt;, and &lt;tt&gt;nmcli --help&lt;/tt&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-7288706677894975068?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/7288706677894975068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2012/01/using-network-manager-from-command-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7288706677894975068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7288706677894975068'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2012/01/using-network-manager-from-command-line.html' title='Using NetworkManager from the command line'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-4311039453939576585</id><published>2012-01-17T22:38:00.001+01:00</published><updated>2012-01-17T22:39:30.527+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ALIX'/><title type='text'>Linux 3.2.1 on ALIX 2d3</title><content type='html'>It's that time of the year again... Here is a &lt;a href="http://linux.fjfi.cvut.cz/~zub/alix/config-3.2.1-alix2.txt"&gt;linux 3.2.1 config file for ALIX 2&lt;/a&gt;. It's a basic config. It includes upport for the integrated Ethernet, USB, GPIO and watchdog. Also included is WiFi stack + an Atheros card, but you probably want to change this to suit your needs. Compared to the &lt;a href="/2011/07/linux-30-on-alix-2d3.html"&gt;3.0&lt;/a&gt; version, this has working LEDs thanks to the &lt;a href="http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=arch/x86/platform/geode/alix.c;h=ca1973699d3d7002871d8de2a7c3db5a0315c136;hb=02550d61f49266930e674286379d3601006b2893"&gt;new platform driver by Ed Wildgoose&lt;/a&gt;. The button should be accessible via raw gpio, but not via the evdev interface. Hopefully the platform driver will be extended to cover this, but this requires an GPIO evdev driver first.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-4311039453939576585?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/4311039453939576585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2012/01/linux-321-on-alix-2d3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/4311039453939576585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/4311039453939576585'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2012/01/linux-321-on-alix-2d3.html' title='Linux 3.2.1 on ALIX 2d3'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-2574213588307898734</id><published>2011-07-03T23:57:00.001+02:00</published><updated>2011-07-03T23:58:38.231+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>HTTP proxy and apt</title><content type='html'>This might be well-known, but I though I'd mention it anyway, as it seems a bit mysterious at first sight.&lt;br /&gt;If you live behind a HTTP proxy you probably are used to the two ways of making your system use the proxy: by &lt;a href="http://www.w3.org/Daemon/User/Proxies/ProxyClients.html"&gt;http_proxy and no_proxy environment variables&lt;/a&gt; and by the GNOME Network Proxy Preferences (gnome-network-properties). But either way it can happen that simple &lt;tt&gt;sudo aptitude&lt;/tt&gt; or &lt;tt&gt;sudo apt-get install foo&lt;/tt&gt; fail because it tries to access the internet directly, ignoring the proxy setting. So, why is that?&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Both ways end up setting the http_proxy environment variable (and possibly others). But sudo, at least on Ubuntu 11.04, is set up to reset the environment. You can see it in the &lt;tt&gt;/etc/sudoers&lt;/tt&gt; file:&lt;br /&gt;&lt;pre&gt;Defaults env_reset&lt;br /&gt;&lt;/pre&gt;See sudoers(5) for details.&lt;br /&gt;This option causes the http_proxy environment variable to be dropped from the environment of the command that you start, e.g. try:&lt;br /&gt;&lt;pre&gt;$ export http_proxy=test&lt;br /&gt;$ env | grep http_proxy&lt;br /&gt;http_proxy=test&lt;br /&gt;$ sudo env | grep http_proxy&lt;br /&gt;$&lt;br /&gt;&lt;/pre&gt;On the other hand, if you start sudo via &lt;tt&gt;sudo -i&lt;/tt&gt; and are setting the http_proxy variable via &lt;tt&gt;/etc/profile.d/&lt;/tt&gt; then the proxy setting is correctly propagated to the environment, because the newly launched root shell sources &lt;tt&gt;/etc/profile&lt;/tt&gt; (see sudo(8)).&lt;br /&gt;This means you can work around the non-working &lt;tt&gt;sudo aptitude&lt;/tt&gt; by &lt;tt&gt;sudo -i&lt;/tt&gt; followed by &lt;tt&gt;aptitude&lt;/tt&gt;.&lt;br /&gt;But this workaround doesn't solve everything. It seems that &lt;a href="https://code.launchpad.net/~ubuntu-core-dev/jockey/ubuntu"&gt;Jockey&lt;/a&gt; loses the http_proxy variable in the process of installing packages.&lt;br /&gt;So, what is the correct solution?&lt;br /&gt;It turns out you can &lt;a href="http://www.debian-administration.org/articles/177"&gt;explicitly set the http proxy in apt configuration&lt;/a&gt;. Create a file in &lt;tt&gt;/etc/apt/apt.conf.d&lt;/tt&gt; with a name like &lt;tt&gt;http-proxy&lt;/tt&gt; (arbitrary) with the following content:&lt;br /&gt;&lt;pre&gt;Acquire::http::Proxy "http://proxy:8080";&lt;br /&gt;&lt;/pre&gt;See apt.conf(5) for more info.&lt;br /&gt;This way, no matter how is apt fired up (sudo, jockey, ...), it always uses the proxy.&lt;br /&gt;Btw. it would be also possible to whitelist the http_proxy variable in &lt;tt&gt;/etc/sudoers&lt;/tt&gt;, but resetting the environment and setting the proxy via &lt;tt&gt;apt.conf&lt;/tt&gt; seems a (little) bit safer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-2574213588307898734?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/2574213588307898734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/http-proxy-and-apt.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2574213588307898734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2574213588307898734'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/http-proxy-and-apt.html' title='HTTP proxy and apt'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-3008699129101439425</id><published>2011-07-03T00:48:00.001+02:00</published><updated>2011-07-03T11:08:03.189+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse CDT'/><title type='text'>Eclipse CDT: removing non-existent include paths</title><content type='html'>It seems that &lt;a href="http://www.eclipse.org/cdt/"&gt;Eclipse CDT&lt;/a&gt; doesn't like it when you have a non-existent path in the list of project include paths. Fair enough. You can selectively remove the non-existent paths from your project via some mouse-clicking.&lt;br /&gt;&lt;br /&gt;But if you are generating your Eclipse project via, say, &lt;a href="http://cmake.org/"&gt;CMake&lt;/a&gt; and you're unfortunate enough that you can't reasonably change the CMake project files (think of evil upstream and you not wanting to patch their overly complex build system changing with every release), what do you do? After a bunch of project regenerations removing of the include paths by hand becomes annoying.&lt;br /&gt;&lt;br /&gt;As I was experiencing this issue, I decided to hack together an Eclipse plugin to resolve this for me. And here is the result: &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/fixincludes/"&gt;fixincludes Eclipse CDT plugin&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;It's pretty basic. Nevertheless it proved to not to be all that easy to write, as it seems the CDT devel side lacks (good, up-to-date) documentation. Or I have not found it.&lt;br /&gt;&lt;br /&gt;Anyway, there is both a &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/fixincludes/la.lamer.zub.fixincludes_1.0.1.201107022310.jar"&gt;binary archive&lt;/a&gt; and a &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/fixincludes/la.lamer.zub.fixincludes.source_1.0.1.201107022310.jar"&gt;source archive&lt;/a&gt;. It should work with both Eclipse Indigo + CDT 8.0, or Eclipse Helios + CDT 7.0.&lt;br /&gt;&lt;br /&gt;To install the binary one: Just grab the binary jar and put it into the &lt;a href="http://wiki.eclipse.org/Equinox_p2_Getting_Started#Dropins"&gt;&lt;tt&gt;dropins&lt;/tt&gt;&lt;/a&gt; subdirectory inside your Eclipse install directory. After starting Eclipse you should see a new item in the &lt;i&gt;Project&lt;/i&gt; menu: &lt;i&gt;Fix Includes...&lt;/i&gt;. Clicking that should fire up a dialog asing you for CDT projects to operate on. In turn it should remove all non-existent include paths. Or at least most of them. &lt;tt&gt;:-)&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;To get the sources: You need to have the Eclipse Plug-in Development Environment installed. In &lt;tt&gt;File/Import...&lt;/tt&gt; select &lt;i&gt;Plug-in Development/Plug-ins and Fragments&lt;/i&gt;. Then point the import wizard to the directory where you downloaded the source jar (&lt;i&gt;Import From: Directory&lt;/i&gt;). &lt;i&gt;Import As: Project with source folders&lt;/i&gt;. Then select the project in the next screen and you should be ready to go.&lt;br /&gt;&lt;br /&gt;P.S. To install the Plug-in Development Environment click &lt;i&gt;Help/Install New Software...&lt;/i&gt; (Obvious, isn't it? &lt;tt&gt;:-)&lt;/tt&gt;) and then select &lt;i&gt;General Purpose Tools/Eclipse Plug-in Development Environment&lt;/i&gt;. To build the jars, use &lt;i&gt;File/Export...&lt;/i&gt;, &lt;i&gt;Plug-in Development/Deployable plug-ins and fragments&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;P.P.S. While there are some bugs and some TODOs, it works enough for me. I'm putting it here in case someone else finds that useful too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-3008699129101439425?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/3008699129101439425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/eclipse-cdt-removing-non-existent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3008699129101439425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3008699129101439425'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/eclipse-cdt-removing-non-existent.html' title='Eclipse CDT: removing non-existent include paths'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-8636980530540234525</id><published>2011-07-02T22:32:00.001+02:00</published><updated>2011-07-31T17:36:15.733+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ALIX'/><title type='text'>Linux 3.0 on ALIX 2d3</title><content type='html'>&lt;i&gt;Update: Due to the way the current ALIX LEDs driver is implemented it cannot be used at the same time the generic GPIO driver is loaded. &lt;tt&gt;:-/&lt;/tt&gt; Luckily there's some work going on to resolve the issue - see &lt;a href="http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git;a=commit;h=49e8df52c6baac5c43763b0f3e7d7cbb136a4569"&gt;this commit in linux-next&lt;/a&gt;.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Just an update: Here's a &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/alix/config-3.0-rc4-alix2.txt"&gt;linux 3.0-rc4 config file for ALIX 2&lt;/a&gt;, more specifically for the ALIX 2d3.&lt;br /&gt;This should have all the basic things on the board running, including Ethernet, USB, &lt;strike&gt;LEDs&lt;/strike&gt;, GPIO (not tested), watchdog.&lt;br /&gt;You most certainly want to hand-tune it for your particular setup. No WiFi driver is enabled in the referenced config -- if you have one (or two &lt;tt&gt;:-)&lt;/tt&gt;) wireless NICs in your ALIX, you certainly want to add that to your configuration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-8636980530540234525?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/8636980530540234525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/linux-30-on-alix-2d3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8636980530540234525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8636980530540234525'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/07/linux-30-on-alix-2d3.html' title='Linux 3.0 on ALIX 2d3'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-842770930614670247</id><published>2011-05-15T15:33:00.001+02:00</published><updated>2011-05-15T15:36:49.858+02:00</updated><title type='text'>Creating animated SVG plots with GNU Octave and gnuplot</title><content type='html'>It's relatively easy to create an animated plot as either a video (AVI, MPEG, ...) file or an animated GIF file via &lt;a href="http://www.gnu.org/software/octave/"&gt;GNU Octave&lt;/a&gt; or &lt;a href="http://www.gnuplot.info/"&gt;gnuplot&lt;/a&gt; -- one needs only to create a sequence of images and then use a tool like &lt;a href="http://www.mplayerhq.hu/"&gt;mencoder&lt;/a&gt; or &lt;a href="http://www.ffmpeg.org/"&gt;ffmpeg&lt;/a&gt; to combine these into a single video file.&lt;br /&gt;&lt;br /&gt;But how about an animated &lt;a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics"&gt;SVG&lt;/a&gt; file? As plots are vector by nature, an animated vector file sounds cool. Gnuplot is capable of producing output graphs in SVG format, but I was not successful in finding a way of converting these into a single animated SVG.&lt;br /&gt;&lt;br /&gt;So I hacked together something for the task. If you have a recent-enough browser (tested in Firefox 4.0.1 and Chromium 11.0.696.65) you can have a look at a &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/ani-plot/example-animated.svg"&gt;trivial example&lt;/a&gt;.&lt;br /&gt;If you're interested, grab the scripts here: &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/ani-plot/"&gt;ani-plot&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-842770930614670247?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/842770930614670247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/05/creating-animated-svg-plots-with-gnu.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/842770930614670247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/842770930614670247'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/05/creating-animated-svg-plots-with-gnu.html' title='Creating animated SVG plots with GNU Octave and gnuplot'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-2992478548353985005</id><published>2011-02-11T01:47:00.006+01:00</published><updated>2011-02-20T23:37:27.813+01:00</updated><title type='text'>Windows XP both native and in VirtualBox</title><content type='html'>There are several good tutorials about similar topics, namely:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.virtualbox.org/wiki/Migrate_Windows"&gt;How to migrate existing Windows installations to VirtualBox&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://forums.virtualbox.org/viewtopic.php?f=28&amp;amp;t=9697"&gt;HOWTO: Windows XP in both VM and native&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;/ul&gt;but I couldn't find any that would describe what I was trying to achieve.&lt;br /&gt;&lt;br /&gt;What I had: Windows XP installed on a physical partition. What I wanted: Being able to run the installation both inside VirtualBox and also natively. I did not want to reinstall the WinXP installation nor did I want to have to fiddle with any Windows Genuine Disadvantage stuff. And I didn't want to break the native boot in the process. Also, as this was some über-corporate install I didn't want to have to ever use the WinXP install CD + its rescue console.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The second link above (&lt;a href="http://forums.virtualbox.org/viewtopic.php?f=28&amp;amp;t=9697"&gt;[2]&lt;/a&gt;) was almost what I needed, but it expected that you're starting with a new windows installation (and it went the other way round: from VirtualBox to native). Nevertheless, most of what the guide says is applicable here too.&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Btw. I'm not much of a windows person and many things (like the windows boot) are quite opaque to me. Probably some steps are not needed/might be adapted, but the instructions described here worked for me.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I strongly suggest you first read the above mentioned HOWTOs. Also have a look at the &lt;a href="http://www.virtualbox.org/manual/UserManual.html"&gt;VirtualBox User Manual&lt;/a&gt;. Back up your installation. It might be useful in case you're not lucky. Also watch out -- using raw partitions with VirtualBox (or any other virtualization software for that matter) can be dangerous: A typo in the process and your data is history. Also, if you're reading this, read this whole first, before trying anything out on your box.&lt;br /&gt;&lt;br /&gt;The outline is as follows:&lt;br /&gt;&lt;h3&gt;1. Prepare windows for the shock&lt;/h3&gt;Boot into windows (yuck) and prepare the system for the shock. Take inspiration from &lt;a href="http://www.virtualbox.org/wiki/Migrate_Windows"&gt;[1]&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Run &lt;a href="http://www.virtualbox.org/attachment/wiki/Migrate_Windows/MergeIDE.zip"&gt;MergeIDE&lt;/a&gt; (There might be a way to avoid that -- see below, but in general just proceed this way.)&lt;/li&gt;&lt;li&gt;Create a new hardware profile to be used for the VirtualBox boot (My Computer, Properties, Hardware). The idea is to have two profiles -- one for native boot and another for VirtualBox boot. See &lt;a href="http://forums.virtualbox.org/viewtopic.php?t=9697#37935"&gt;[2], section IV, 2&lt;/a&gt;. Turn off timeout so that you don't end up with the wrong profile by accident and give the profiles a reasonable names. &lt;i&gt;I'm not sure how badly would windows suffer if you used the other profile but I was too afraid to try. &lt;tt&gt;:-)&lt;/tt&gt;&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;i&gt;In &lt;a href="http://www.virtualbox.org/wiki/Migrate_Windows"&gt;[1]&lt;/a&gt; there are some rumours that you should watch out for some &lt;tt&gt;.sys&lt;/tt&gt; files (namely &lt;tt&gt;agp440.sys&lt;/tt&gt;, &lt;tt&gt;intelppm.sys&lt;/tt&gt;) and remove/disable these. On the box I was doing this procedure there was intelppm.sys. I moved it away from windows directory. After the process was finished I moved it back and it has not caused any trouble. I don't know if it would have affected the process had I not moved the file away.&lt;/i&gt;&lt;br /&gt;&lt;h3&gt;2. Allow the user who will be running the VirtualBox instance R/W access to the windows partition&lt;/h3&gt;There are several ways how to do this. A way I chose was:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a special group for this:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;addgroup vbox-disk&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;Add myself to the group:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;adduser $USER vbox-disk&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;Create an udev rule to change the group of the right device file to the new group:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;create &lt;tt&gt;/etc/udev/rules.d/vbox-disk.rules&lt;/tt&gt; with the following contents (assuming &lt;tt&gt;sda1&lt;/tt&gt; is the windows partition):&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;KERNEL=="sda1", GROUP="vbox-disk"&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;i&gt;Hm, I yet have to figure out how to make udev actually change the ownership without a reboot. Anyway, a reboot works. &lt;tt&gt;:-)&lt;/tt&gt;&lt;/i&gt;&lt;br /&gt;&lt;h3&gt;3. Create a VMDK file that refers to the real windows partition.&lt;/h3&gt;You could theoretically use a whole-disk &lt;a href="http://en.wikipedia.org/wiki/VMDK"&gt;VMDK&lt;/a&gt; file, but unless the disk is really dedicated to windows I'd advise against that. Restrict the VM to only what it needs to use. You don't want windows to overwrite your linux partition in a fit of rage. &lt;tt&gt;:-)&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;The process is described in the &lt;a href="http://www.virtualbox.org/manual/ch09.html#rawdisk" hrer="http://www.virtualbox.org/manual/ch09.html#rawdisk"&gt;VirtualBox User Manual&lt;/a&gt;. Assuming that windows live on the first partition of the first hard disk (typical scenario) you would do something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1 -relative&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you don't have read access to the whole disk device you need to run this as root. Then change the ownership so that the file is owned by the user who will be running the VirtualBox instance.&lt;br /&gt;&lt;br /&gt;Make sure you're not accessing the windows partition from linux while the VM will be running. While some guides say mounting the partition read-only is ok, I would advice against doing that. I could imagine this resulting in your host oopsing. Use VirtualBox's shared folders to exchange data between host and guest.&lt;br /&gt;&lt;h3&gt;4. Create a new virtual machine&lt;/h3&gt;Mostly follow what &lt;a href="http://forums.virtualbox.org/viewtopic.php?f=28&amp;amp;t=9697"&gt;[2]&lt;/a&gt; has to say. Just watch out: As this is not a new install, you need to have the right setting for the IO APIC. As explained in &lt;a href="http://www.virtualbox.org/wiki/Migrate_Windows"&gt;[1]&lt;/a&gt; windows are quite sensitive to this change. Most probably you will need to enable it.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set IO APIC to match your PC.&lt;/li&gt;&lt;li&gt;Attach the raw VMDK file as the virtual HDD, attach it to &lt;b&gt;IDE controller&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Enable exactly one Ethernet adapter.&lt;/li&gt;&lt;/ul&gt;It might be possible to use SATA adapter instead of the IDE one but then I gather you'd have to have a very similar adapter to the one that VirtualBox is emulating (it seems to work ok with the &lt;a href="http://downloadcenter.intel.com/SearchResult.aspx?lang=eng&amp;amp;ProductFamily=Chipsets&amp;amp;ProductLine=Chipset+Software&amp;amp;ProductProduct=Intel%C2%AE+Rapid+Storage+Technology+%28Intel%C2%AE+RST%29"&gt;Intel Matrix Storage SATA drivers&lt;/a&gt; -- so if you're running with these in the real machine it might just work). &lt;i&gt;On the machine I was doing this procedure there were SATA drivers installed but they did not work with the VirtualBox virtual SATA adapter.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately the Intel Matrix Storage STA driver refuses to install in native environment if you don't have a supported adapter so it seems impossible to prepare the windows installation for the virtual SATA adapter in advance. But with MergeIDE windows can be prepared at least for the VirtualBox IDE adapter. It's possible to move the VMDK to virtual SATA adapter later.&lt;br /&gt;&lt;h3&gt;5. Fine-tune virtual machine settings&lt;/h3&gt;In order to not bump into the ridiculousness of the Windows Genuine Disadvantage thing you (I gather) need to copy the &lt;a href="http://en.wikipedia.org/wiki/Desktop_Management_Interface"&gt;DMI&lt;/a&gt; data from your real PC into the virtual machine. Follow &lt;a href="http://forums.virtualbox.org/viewtopic.php?f=28&amp;amp;t=9697"&gt;[2]&lt;/a&gt; (section I.2 - DMI BIOS settings).&lt;br /&gt;&lt;br /&gt;Furthermore &lt;a href="http://forums.virtualbox.org/viewtopic.php?t=9697#38158"&gt;[2], section VII - Windows activation&lt;/a&gt; suggests:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Make a backup of &lt;tt&gt;%WINDIR%\system32\wpa.dbl&lt;/tt&gt; - hopefully if you bump into the WGA ridiculousness, you can revert and try again.&lt;/li&gt;&lt;li&gt;Set the MAC address of the one emulated Ethernet adapter to that of your real Ethernet adapter. If you've got more of them, you might be in for some fun. See the above-referenced &lt;a href="http://forums.virtualbox.org/viewtopic.php?t=9697#37931"&gt;section VII in [2]&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;6. Restore windows MBR&lt;/h3&gt;If you have Grub in the &lt;a href="http://en.wikipedia.org/wiki/Master_boot_record"&gt;MBR&lt;/a&gt;, booting the VM as it is now, provided you allowed access only to the windows partition, would result in the &lt;a href="http://grub.enbug.org/Manual#head-d782c3ed07197a089c4fdf66abce08744adcc0eb"&gt;rescue prompt of Grub&lt;/a&gt; as it can't access the linux partition with the data it requires.&lt;br /&gt;&lt;br /&gt;Luckily the VMDK file allows for its own MBR. The MBR is not written to the real disk (if it's not a whole-disk file, but a file referencing only partitions) and the data is not discarded either -- it's kept in the VMDK file. So you can have different MBR in the virtual machine and in the real box.&lt;br /&gt;&lt;br /&gt;To boot windows all you need is to overwrite the VMDK's MBR with something that will correctly start &lt;a href="http://en.wikipedia.org/wiki/NTLDR"&gt;NTLDR&lt;/a&gt; on the windows partition. One way to do this is to use &lt;a href="http://ms-sys.sourceforge.net/"&gt;ms-sys&lt;/a&gt;. Luckily &lt;a href="http://sysresccd.org/"&gt;SystemRescueCd&lt;/a&gt; contains ms-sys, so all you need to do is download SystemRescueCd image, attach it to the virtual machine and boot from the ISO image. Once you get the SystemRescueCd prompt, check that the hard drive looks as expected (VirtualBox should not allow you to access any partitions that were not listed when creating the VMDK file) and then do something like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ms-sys -m -w /dev/sda&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This effectively nukes Grub in the VMDK image. Shut down the virtual machine and detach the ISO image. After a fresh start you should see windows trying to boot.&lt;br /&gt;&lt;br /&gt;Note: If you have the right MBR on hand, you could have used the &lt;tt&gt;-mbr&lt;/tt&gt; parameter when creating the VMDK file. &lt;i&gt;I said: read this whole first! &lt;tt&gt;:-)&lt;/tt&gt;&lt;/i&gt;&lt;br /&gt;&lt;h3&gt;7. Making windows boot to the GUI&lt;/h3&gt;You should now see at least the HW profile-selection menu of windows. Select the profile for VirtualBox boot and hope... Depending on how lucky you are or are not, windows will either boot into GUI or will hang/BSOD.&lt;br /&gt;&lt;br /&gt;In my case I saw the following behaviour:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If IO APIC was disabled: The boot would hang up after loading &lt;tt&gt;mup.sys&lt;/tt&gt; -- this is visible in safe mode boot.&lt;/li&gt;&lt;li&gt;If IO APIC was enabled: After loading &lt;tt&gt;mup.sys&lt;/tt&gt; the system would seemingly do nothing for a while and then I'd get a BSOD.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Btw. to ease troubleshooting it might be (moderately) helpful to add the option &lt;tt&gt;/SOS&lt;/tt&gt; into the &lt;tt&gt;boot.init&lt;/tt&gt; file. Just watch out -- don't mount the partition while the VM is running and unmount it before you start the VM again.&lt;br /&gt;&lt;br /&gt;The BSOD made me unsure about the IO APIC setting for my box and I was considering the option should be unchecked on my setup. But it turns out that, as expected, IO APIC on was the right setting, despite the BSOD.&lt;br /&gt;&lt;br /&gt;I'm not exactly sure what caused the BSOD, but the following seems to have helped:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Select different IDE controller type. Setting it to ICH6 worked for me. The default, that was PIIX4, constantly produced bluescreens on startup for me.&lt;/li&gt;&lt;li&gt;Increase VM RAM size. I guess I was too harsh on windows. I increased it from 512M (on the 2G RAM box) to 1G.&lt;/li&gt;&lt;/ul&gt;After I got windows to boot I tried decreasing the memory size back to 512M to see if it would BSOD but it was not reproducible, so I'm not at all sure about the influence of the memory size, but I can't rule that out either.&lt;br /&gt;&lt;br /&gt;If you're lucky then you got windows to boot into the login screen at this point. If not... try to play with the VM setting. Determine (for sure) if windows are using the APIC or PIC HAL and adjust the VM settings accordingly. Check that MergeIDE was ran. Change the IDE adapter type or maybe even try the SATA one. Use Google.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;8. Polishing&lt;/h3&gt;Try native boot. If you're lucky it should still work. (Naturally use the HW profile designated for native boot.) &lt;br /&gt;&lt;br /&gt;If you got that far then most of the work is done. What else can be done:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install the VirtualBox guest additions. It increases the performance and usability of the guest. There are some rumours that this would have negative impact on the native boot of windows. It worked ok for me, but if you wish you can run the additions only inside the VM -- see &lt;a href="http://forums.virtualbox.org/viewtopic.php?t=9697#37935"&gt;[2], section IV, 8&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Enable VirtualBox shared folders to share files between the host and the quest.&lt;/li&gt;&lt;li&gt;Move the VMDK image to virtual SATA controller. Now I'm not sure to what extent is that true, but rumour has it that virtual SATA has superior performance to virtual IDE. To move to virtual SATA proceed like this:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Shut down the VM.&lt;/li&gt;&lt;li&gt;Add a SATA adapter in the VM config. There is no need for any image to be connected to that. &lt;b&gt;Leave the VMDK image hooked to the IDE adapter for now.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Boot the VM. You should see that windows detected new hardware. Dismiss all the dialogs and run the Intell Matrix Storage driver installer instead. &lt;i&gt;Note: This mostly comes from a &lt;a href="http://r3dux.org/2010/01/how-to-switch-a-virtualbox-windows-guest-hard-drive-from-ide-to-sata-mode/"&gt;guide on r3dux.org&lt;/a&gt;.  There's a warning that the current Intel Matrix Storage driver might  not work with VirtualBox any more and a link to an older version is  provided. I used that version and it worked for me. I don't know if the  current one would or would not work.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Shut down the VM.&lt;/li&gt;&lt;li&gt;Now you can move the VMDK image to the SATA adapter.&lt;/li&gt;&lt;li&gt;That's it. Boot the VM again and hope it works. &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;I was lucky and managed all that while the windows installation can still boot natively. (Not that I need it, but it's not my computer, so I didn't want to break it.)&lt;br /&gt;&lt;br /&gt;Good luck!&lt;br /&gt;&lt;br /&gt;Feel free to post correction to comments. Thanks. &lt;tt&gt;:-)&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-2992478548353985005?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/2992478548353985005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/02/windows-xp-both-native-and-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2992478548353985005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2992478548353985005'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2011/02/windows-xp-both-native-and-in.html' title='Windows XP both native and in VirtualBox'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-8429070906092377731</id><published>2010-08-20T00:36:00.002+02:00</published><updated>2011-02-20T23:11:34.841+01:00</updated><title type='text'>Using Glib::RefPtr with STL sorted containers</title><content type='html'>It turns there's a bug in &lt;a href="http://www.gtkmm.org/"&gt;glibmm&lt;/a&gt; that prevents one from using &lt;a href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html"&gt;Glib::RefPtr&amp;lt;T&amp;gt;&lt;/a&gt; with any of the STL sorted containers, e.g. &lt;a href="http://www.sgi.com/tech/stl/Map.html"&gt;std::map&lt;/a&gt; or &lt;a href="http://www.sgi.com/tech/stl/set.html"&gt;std::set&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The issue is a side effect of Glib::RefPtr&amp;lt;T&amp;gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;declaring operators == and !=&lt;/li&gt;&lt;li&gt;declaring operator bool()&lt;/li&gt;&lt;li&gt;not declaring operators &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The operators == and != compare pointers for equality and work as expected. The operator bool() is defined to allow the following usage of a RefPtr:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;if (ref_ptr)&lt;br /&gt;    puts("is non-null");&lt;br /&gt;else&lt;br /&gt;    puts("is null");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;STL sorted containers need operator&amp;lt; on the type they contain. Assuming p1 and p2 are of type Glib::RefPtr&amp;lt;T&amp;gt;, the following compiles just fine:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;p1 &amp;lt; p2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This in turn means that e.g. std::set&amp;lt;Glib::RefPtr&amp;lt;T&amp;gt; &amp;gt; my_map; compiles. Unfortunately, with current version of glibmm, this breaks badly at runtime.&lt;br /&gt;&lt;br /&gt;Why? As there's no custom operator&amp;lt;, the compiler interprets p1 &amp;lt; p2 like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;(bool)p1 &amp;lt; (bool)p2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is true iff p1 is NULL and p2 is non-NULL. The operators &amp;lt;=, &amp;gt;, &amp;gt;= also work on the results of operator bool(). So, depending on the pointers wrapped in p1 and p2, it's possible that the following would be true:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;p1 != p2 &amp;amp;&amp;amp; !(p1 &amp;lt; p2) &amp;amp;&amp;amp; !(p1 &amp;gt; p2)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(this is true iff p1 and p2 wrap two different non-NULL pointers)&lt;br /&gt;&lt;br /&gt;There's a &lt;a href="https://bugzilla.gnome.org/show_bug.cgi?id=626858"&gt;bug report&lt;/a&gt; for the issue.&lt;br /&gt;&lt;br /&gt;A workaround for the time being is to use a custom comparator like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;template&amp;lt;typename T&amp;gt;&lt;br /&gt;class RefPtrLess&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;    bool operator() (const Glib::RefPtr&amp;lt;T&amp;gt; &amp;amp;a,&lt;br /&gt;        const Glib::RefPtr&amp;lt;T&amp;gt; &amp;amp;b)&lt;br /&gt;    {&lt;br /&gt;        const T* const a_ptr = a.operator-&amp;gt;();&lt;br /&gt;        const T* const b_ptr = b.operator-&amp;gt;();&lt;br /&gt;&lt;br /&gt;        return a_ptr &amp;lt; b_ptr;&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;typedef std::set&amp;lt;Glib::RefPtr&amp;lt;MyType&amp;gt;, RefPtrLess&amp;lt;MyType&amp;gt; &amp;gt; TMyTypeSet;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-8429070906092377731?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/8429070906092377731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/08/using-glibrefptr-with-stl-sorted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8429070906092377731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8429070906092377731'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/08/using-glibrefptr-with-stl-sorted.html' title='Using Glib::RefPtr with STL sorted containers'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-5040573303532631489</id><published>2010-07-15T22:58:00.001+02:00</published><updated>2011-02-20T23:45:30.380+01:00</updated><title type='text'>Sending git patches from a different box</title><content type='html'>Here's a solution to a problem that's been bothering me for a while: I wanted to create &lt;a href="http://git-scm.com/"&gt;git&lt;/a&gt; patches from a box where there is no real &lt;a href="http://www.feep.net/sendmail/tutorial/intro/MUA-MTA-MDA.html"&gt;MTA&lt;/a&gt; and so &lt;a href="http://kernel.org/pub/software/scm/git/docs/git-send-email.html"&gt;git send-email&lt;/a&gt; can't be used.&lt;br /&gt;&lt;br /&gt;One option is setting up real mail MTA or something simpler like &lt;a href="http://msmtp.sourceforge.net/"&gt;msmtp&lt;/a&gt; or &lt;a href="http://untroubled.org/nullmailer/"&gt;nullmailer&lt;/a&gt;. While this is the preferable, "true unix" way, I think plenty of  ordinary linux users don't have this either.&lt;br /&gt;&lt;br /&gt;If, for whatever reason, this is not an option, but you have access to another box, where a MTA is set up correctly, you can do this:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;commit the change(s) into the git tree&lt;/li&gt;&lt;li&gt;create the patch emails with: &lt;a href="http://kernel.org/pub/software/scm/git/docs/git-format-patch.html"&gt;git format-patch&lt;/a&gt; --to to@addr ...&lt;/li&gt;&lt;li&gt;transfer the produced patch email files to the box where you can send mails from&lt;/li&gt;&lt;li&gt;send the email(s) with: /usr/sbin/sendmail -oi -t &amp;lt; mail-formatted.patch&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The first time I suggest you send the patch to yourself to verify it's all working as expected.&lt;br /&gt;&lt;br /&gt;This approach has a downside: You don't see the mails you sent in your MUA sent mail folder. Depending on your MUA, there are other ways of sending the mail. If you're using mutt, &lt;a href="http://blog.ndrix.com/2007/05/mutt-and-git-format-patch.html"&gt;you might be in luck&lt;/a&gt;. But in general MUAs tend to mangle the patches. &lt;tt&gt;:-(&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-5040573303532631489?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/5040573303532631489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/sending-git-patches-from-different-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/5040573303532631489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/5040573303532631489'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/sending-git-patches-from-different-box.html' title='Sending git patches from a different box'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-5427253647587884090</id><published>2010-07-11T02:51:00.000+02:00</published><updated>2010-07-11T02:51:12.694+02:00</updated><title type='text'>Configuring linux kernel for use on ALIX 2 -- update</title><content type='html'>Here is a short update on my older post on &lt;a href="http://tinkering-is-fun.blogspot.com/2009/12/configuring-linux-kernel-for-use-on.html"&gt;configuring linux kernel for use on ALIX2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The general points are still valid. The specific locations of the options might have changed. But to provide something more up to date, here is a &lt;a href="http://linux.fjfi.cvut.cz/~zub/alix/config-2.6.34.1-alix2.txt"&gt;working linux 2.6.34.1 configuration for ALIX 2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Use this only as a starting point to get a configuration that works well for you. There are plenty of options that are specific to my setup and you certainly want those changed. But you should be able to boot with this one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-5427253647587884090?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/5427253647587884090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/configuring-linux-kernel-for-use-on.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/5427253647587884090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/5427253647587884090'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/configuring-linux-kernel-for-use-on.html' title='Configuring linux kernel for use on ALIX 2 -- update'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-2193170883523593584</id><published>2010-07-11T02:42:00.000+02:00</published><updated>2010-07-11T02:42:44.387+02:00</updated><title type='text'>Linux kernel configuration -- using configuration from an older version</title><content type='html'>As you probably know if you ever configured the linux kernel yourself (possibly by &lt;tt&gt;make menuconfig&lt;/tt&gt;, or if you've been with linux long enough, by &lt;tt&gt;make config&lt;/tt&gt;), the current kernel configuration that would be used for build is stored in the file &lt;tt&gt;.config&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;The options in the &lt;tt&gt;.config&lt;/tt&gt; file depend on the kernel version the file was produced with. So, you can't directly use a config file from an older kernel with a newer one. But what you can do is use &lt;tt&gt;make oldconfig&lt;/tt&gt;. This way, the config options that are still present in the current kernel keep their values and you are asked to configure only what options were added.&lt;br /&gt;&lt;br /&gt;To use this, just place the old &lt;tt&gt;.config&lt;/tt&gt; file into the new kernel source tree and issue &lt;tt&gt;make oldconfig&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;Yeah, this post was inspired by the comment asking for newer ALIX 2 kernel config. A comment that I missed. Sorry. Mike. &lt;tt&gt;:-(&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-2193170883523593584?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/2193170883523593584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/linux-kernel-configuration-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2193170883523593584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2193170883523593584'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/07/linux-kernel-configuration-using.html' title='Linux kernel configuration -- using configuration from an older version'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-8262787817353977503</id><published>2010-04-11T21:02:00.000+02:00</published><updated>2010-04-11T21:02:15.171+02:00</updated><title type='text'>Soft-float (FPU emulation) with DJGPP</title><content type='html'>If you build a program using floating-point arithmetic with DJGPP and then try to run it on a box without a FPU (such as the &lt;a href="http://en.wikipedia.org/wiki/Intel_80386"&gt;386&lt;/a&gt;, or &lt;a href="http://en.wikipedia.org/wiki/Intel_80486SX"&gt;486SX&lt;/a&gt;), the program will die at the first attemt to use the floats.&lt;br /&gt;&lt;br /&gt;The solution for this is to tell DJGPP to use floating point emulation.&lt;br /&gt;&lt;br /&gt;While there is the &lt;tt&gt;-msoft-float&lt;/tt&gt; GCC option, which seems to be recognized in the DJGPP port too, the option does not work under DJGPP.&lt;br /&gt;&lt;br /&gt;There is a &lt;a href="http://www.delorie.com/djgpp/v2faq/faq11_1.html"&gt;DJGPP FAQ&lt;/a&gt; item about FPU emulation. It turns out the easiest way is to just add &lt;tt&gt;-lemu&lt;/tt&gt; to linker options.&lt;br /&gt;&lt;br /&gt;Also, if you target the 386, add &lt;tt&gt;-march=i386&lt;/tt&gt; to compiler options. Otherwise the program might crash, as DJGPP can use an instruction that is not supported on the 386. (Not sure about 486. Is Pentium is the default target? Or the 486? Either way, it is good practice to specify &lt;tt&gt;-march&lt;/tt&gt; as the lowest CPU the app needs to run on.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-8262787817353977503?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/8262787817353977503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/04/soft-float-fpu-emulation-with-djgpp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8262787817353977503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/8262787817353977503'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/04/soft-float-fpu-emulation-with-djgpp.html' title='Soft-float (FPU emulation) with DJGPP'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-7492058709048315781</id><published>2010-04-11T20:44:00.001+02:00</published><updated>2010-04-11T20:44:36.097+02:00</updated><title type='text'>TurboVision with DJGPP and DOSEMU</title><content type='html'>There's a nice port of the &lt;a href="http://en.wikipedia.org/wiki/Text_user_interface"&gt;TUI&lt;/a&gt; library TurboVision to GCC. &lt;a href="http://tvision.sourceforge.net/"&gt;The port&lt;/a&gt; works on unix-like systems including linux, but it also still supports DOS (with DJGPP toolchain).&lt;br /&gt;&lt;br /&gt;Here's a guide on how to build the DOS version.&lt;br /&gt;&lt;br /&gt;First, grab the sources. I suggest you use the latest CVS version:&lt;br /&gt;&lt;pre&gt;cvs -d:pserver:anonymous@tvision.cvs.sourceforge.net:/cvsroot/tvision login&lt;/pre&gt;(use empty password)&lt;br /&gt;&lt;pre&gt;cvs -z3 -d:pserver:anonymous@tvision.cvs.sourceforge.net:/cvsroot/tvision co -P tvision&lt;/pre&gt;&lt;br /&gt;Then you need a DOS environment with DJGGP in it. DOSEMU + DJGPP worked ok for me (as detailed in my previous posts on the topic: &lt;a href="http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1.html"&gt;1&lt;/a&gt; and &lt;a href="http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1-setting-up.html"&gt;2&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Have a look into &lt;tt&gt;doc/install/djgpp.txt&lt;/tt&gt;. As the file explains, you will need some extra GNU tools installed inside your DJGPP directory. Here is the list of the files that worked for me at the time of this writing:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;tt&gt;djdev203.zip&lt;/tt&gt; - basic DJGPP runtime&lt;/li&gt;&lt;li&gt;&lt;tt&gt;bnu219b.zip&lt;/tt&gt; - GNU Binutils&lt;/li&gt;&lt;li&gt;&lt;tt&gt;gcc442b.zip&lt;/tt&gt; - gcc&lt;/li&gt;&lt;li&gt;&lt;tt&gt;gpp442b.zip&lt;/tt&gt; - g++&lt;/li&gt;&lt;li&gt;&lt;tt&gt;mak3791b.zip&lt;/tt&gt; - GNU Make&lt;/li&gt;&lt;li&gt;&lt;tt&gt;fil41b.zip&lt;/tt&gt; - GNU fileutils&lt;/li&gt;&lt;li&gt;&lt;tt&gt;txt20b.zip&lt;/tt&gt; - GNU textutils&lt;/li&gt;&lt;li&gt;&lt;tt&gt;shl2011b.zip&lt;/tt&gt; - GNU sh-utils&lt;/li&gt;&lt;li&gt;&lt;tt&gt;perl588b.zip&lt;/tt&gt; - Perl&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The TurboVision doc further mentions you will need GNU gettext. This is not a hard requirement -- you can build TurboVision without gettext support. If you do want to use gettext, be warned the procedure of installing GNU gettext is a bit complicated -- see the &lt;tt&gt;doc/install/djgpp.txt&lt;/tt&gt; file and &lt;tt&gt;gnu/gtxt-010.40/djgpp/README&lt;/tt&gt; inside the gettext archive (&lt;tt&gt;gtxt040b.zip&lt;/tt&gt;).&lt;br /&gt;&lt;br /&gt;So now all you need to do is put a copy of the TurboVision sources in a place that can be reached from your DOS environment, change to that directory and fire up configure.bat. (If building without gettext, add the &lt;tt&gt;--no-intl&lt;/tt&gt; option.)&lt;br /&gt;&lt;br /&gt;Unfortunately, you might just get this:&lt;br /&gt;&lt;pre&gt;C:\tvision&amp;gt;configure&lt;br /&gt;Configuring Turbo Vision v2.2.0 library&lt;br /&gt;&lt;br /&gt;Unknown OS, you must do things by yourself at conflib.pl line 903.&lt;br /&gt;Determining OS:&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The reason here is that the "uname" command (part of GNU sh-utils) prints out:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;c:\tvision&amp;gt;uname&lt;br /&gt;??Unknow&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;instead of what the TurboVision configure script expects ("MS-DOS").&lt;br /&gt;&lt;br /&gt;You either have to patch the configure script (hack the test &lt;tt&gt;if ($os=~/MS\-DOS/)&lt;/tt&gt; to always pass, e.g. into &lt;tt&gt;if (1)&lt;/tt&gt;) or change the uname command. (&lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/uname-djgpp/"&gt;Quick and dirty hack to the uname command.&lt;/a&gt; Use the binary to overwrite the original &lt;tt&gt;djgpp\bin\uname.exe&lt;/tt&gt;)&lt;br /&gt;&lt;br /&gt;Either way, now the configure script should pass:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\tvision&amp;gt;configure --no-intl&lt;br /&gt;Configuring Turbo Vision v2.2.0 library&lt;br /&gt;&lt;br /&gt;Determining OS: DOS [djgpp]&lt;br /&gt;Looking for a working gcc: gcc OK&lt;br /&gt;C flags: -O2 -Wno-packed&lt;br /&gt;C++ flags: -O2 -Wno-packed&lt;br /&gt;Looking for the C++ compiler: gpp&lt;br /&gt;Checking Architecture: x86&lt;br /&gt;Looking for pointer size:  32 bits&lt;br /&gt;Looking for prefix: c:/djgpp&lt;br /&gt;Looking for GNU make: make&lt;br /&gt;Looking for GNU ar: ar&lt;br /&gt;Looking for install tool: install&lt;br /&gt;Looking for xgettext: no&lt;br /&gt;Checking DJGPP version: 2.0.3 OK&lt;br /&gt;Checking for international support: disabled by user request.&lt;br /&gt;Looking for allegro library: Bad command or filename - "allegro-config".&lt;br /&gt; no, disabling AlCon&lt;br /&gt;Checking endianess: little endian&lt;br /&gt;&lt;br /&gt;Generating Makefile&lt;br /&gt;Configuring makefiles: intl/dummy/Makefile &lt;br /&gt;Configuring RHIDE: makes/rhide.env compat/rhide.env &lt;br /&gt;Configuring RHIDE: examples/rhide.env &lt;br /&gt;Generating configuration header: no changes&lt;br /&gt;Extracting from makes/librhtv.imk: processing&lt;br /&gt;Extracting from compat/compat.imk: processing&lt;br /&gt;Processing winnt/bccmake.in =&amp;gt; winnt/Makefile&lt;br /&gt;Processing winnt/msvcmake.in =&amp;gt; winnt/Makefile.nmk&lt;br /&gt;Makefiles for examples.&lt;br /&gt;Makefiles for translations.&lt;br /&gt;Processing intl/gnumake.in =&amp;gt; intl/Makefile&lt;br /&gt;Processing redhat/librhtv.spec.in =&amp;gt; redhat/librhtv-2.2.0.spec&lt;br /&gt;Processing qnxrtp/tvision.qpg.in =&amp;gt; qnxrtp/tvision.qpg&lt;br /&gt;&lt;br /&gt;Succesful configuration!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then fire up make. With the default DOSEMU configuration you might end up with this error:&lt;br /&gt;&lt;pre&gt;cc1plus.exe: out of memory allocating 65536 bytes after a total of 6390696 bytes&lt;br /&gt;make.exe[1]: *** [../makes/obj/iffilelen.o] Error 1&lt;br /&gt;make.exe[1]: Leaving directory `c:/tvision/makes'&lt;br /&gt;make.exe: *** [static-lib] Error 2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The solution is to increase the amount of DPMI memory in &lt;tt&gt;/etc/dosemu/dosemu.conf&lt;/tt&gt;, e.g.: &lt;tt&gt;$_dpmi = (0x10000)&lt;/tt&gt; instead of the default 0x5000.&lt;br /&gt;&lt;br /&gt;You can that use &lt;tt&gt;make examples&lt;/tt&gt; to build some sample code. Start up e.g. &lt;tt&gt;examples\demo\demo.exe&lt;/tt&gt; to see if the library compiled and works fine (works best with xdosemu, don't expect it to work in dumb mode &lt;tt&gt;:-)&lt;/tt&gt;).&lt;br /&gt;&lt;br /&gt;To build your own programs with the TurboVision library, just add &lt;tt&gt;-IC:\tvision\include&lt;/tt&gt; to compiler options and &lt;tt&gt;-Lc:\tvision\makes -lrhtv&lt;/tt&gt; to linker options. (Substitute &lt;tt&gt;c:\tvision&lt;/tt&gt; with your TurboVision sources path.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-7492058709048315781?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/7492058709048315781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/04/turbovision-with-djgpp-and-dosemu.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7492058709048315781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7492058709048315781'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/04/turbovision-with-djgpp-and-dosemu.html' title='TurboVision with DJGPP and DOSEMU'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-2154568501267486342</id><published>2010-01-21T00:28:00.003+01:00</published><updated>2010-01-26T23:04:18.963+01:00</updated><title type='text'>Building for DOS, part 2: Setting up DJGPP under DOSEMU</title><content type='html'>First edit your /etc/dosemu/dosemu.conf: bump up the size of the available DPMI memory from the default 0x5000 KiB to something like 0x10000 or even 0x20000, as you might otherwise run out of memory on more complicated source files.&lt;br /&gt;Now you can proceed with DJGPP install. -- I suggest you use the &lt;a href="http://www.delorie.com/djgpp/zip-picker.cgi"&gt;Zip File Picker&lt;/a&gt;, as I already mentioned in the previous post.&lt;br /&gt;&lt;br /&gt;The Zip File Picker suggests you make the zip extracting from inside DOSEMU. But in my experience extracting from linux works ok and it's more comfortable. Do read the &lt;a href="ftp://ftp.fh-koblenz.de/pub/CompilerTools/DJGPP/current/v2/readme.1st"&gt;readme&lt;/a&gt;. But the first part of the installation can be as simple as this (you could pick a different target directory name, as long as it's not dev or dev/something):&lt;br /&gt;&lt;br /&gt;get all the needed ZIP files in a directory&lt;br /&gt;&lt;pre&gt;$ cd ~/.dosemu/drive_c&lt;br /&gt;$ mkdir djgpp&lt;br /&gt;$ for i in /path/to/*.zip; do unzip $i -d djgpp; done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next step is setting the DJGPP environment variable and adding c:\djgpp\bin into the PATH. The easiest way to do this with dosemu is by editing autoexec.bat. A word of warning -- if the file is a symlink and you can't edit the file the symlink points to (as is the case with default Ubuntu install), you have to change the symlink into a (editable) copy first, e.g.:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ cd ~/.dosemu/drive_c&lt;br /&gt;$ cp autoexec.bat autoexec.bat.copy; mv autoexec.bat.copy autoexec.bat&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As the file uses DOS line end characters (CR LF), if might look odd in some linux text editors (like mcedit). The easiest way is to edit the file from within dosemu -- fire up DOSEMU, then type:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;edit autoexec.bat&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The default dosemu autoexec.bat file sets up some environment variables and then plays some DOSEMU-specific tricks. So before the unix and lredir tricks insert these two lines:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;set DJGPP=C:\DJGPP\DJGPP.ENV&lt;br /&gt;set PATH=C:\DJGPP\BIN;%PATH%&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The last step is adapting config.sys (use edit config.sys). Zip File Picker suggests config.sys is to contain these three lines:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;files=40&lt;br /&gt;fcbs=40,0&lt;br /&gt;shell=c:\dos\command.com c:\dos /e:2048 /p&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;On my ubuntu install, the "files=40" line is already present. So just "fcbs=40,0" needs to be added. The file also contains:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;shellhigh=z:\command.com /e:1024 /p&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It worked ok for me if I left it at "shellhigh" and just enlarged the environment size from 1024 to DJGPP-suggested 2048:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;shellhigh=z:\command.com /e:2048 /p&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Restart DOSEMU (exitemu in dosemu, then fire up DOSEMU again). If everything worked ok you should be able to build and run C (and optionally other languages, if you installed those too) programs in DOSEMU:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\test&amp;gt;gcc test1.c -o test1.exe&lt;br /&gt;C:\test&amp;gt;test1&lt;br /&gt;Hello World!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note: On one of my boxes (running Ubuntu 9.10, DOSEMU 1.4.0+svn.1828-2ubuntu2) I was unable to get g++ versions 4.4.1 and 4.4.2 working. -- But 4.4.2 is working fine for me on Gentoo with dosemu-1.4.1_pre20091009. Here is the &lt;a href="https://bugs.launchpad.net/ubuntu/+source/dosemu/+bug/512611"&gt;bug report&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It seems to be possible to work around the issue for the time being: Set $_cpu_emu = "vm86sim" in /etc/dosemu/dosemu.conf and use GCC version 4.3.2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-2154568501267486342?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/2154568501267486342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1-setting-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2154568501267486342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2154568501267486342'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1-setting-up.html' title='Building for DOS, part 2: Setting up DJGPP under DOSEMU'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-3627460515489064262</id><published>2010-01-11T23:38:00.000+01:00</published><updated>2010-01-11T23:38:34.512+01:00</updated><title type='text'>Building for DOS, part 1</title><content type='html'>And now for something completely different. :)&lt;br /&gt;&lt;br /&gt;The unthinkable happened -- I had to build some C++ program of mine for &lt;a href="http://www.freedos.org/"&gt;FreeDOS&lt;/a&gt;. I understand that DOS is by all means a dead platform, but if you happen to have to target DOS, then read on. :)&lt;br /&gt;&lt;br /&gt;The good news is that there is a port of GCC for DOS. It's called &lt;a href="http://www.delorie.com/djgpp/"&gt;DJGPP&lt;/a&gt;. The website pretty much looks like it looked 10 years ago, which might imply it's dead. But in fact DJGPP is still alive, as the &lt;a href="http://www.delorie.com/djgpp/mailing-lists/"&gt;newsgroups and mailing lists&lt;/a&gt; prove.&lt;br /&gt;&lt;br /&gt;There are more ways how you could use DJGPP: You could install it on a real DOS machine (yuck!). Or you could install linux to DJGPP cross-compiler (haven't tried, but doc implies it's tricky). Or you could install DJGGP inside &lt;a href="http://dosemu.org/"&gt;DOSEMU&lt;/a&gt;. That is the way I chose.&lt;br /&gt;&lt;br /&gt;Determining what files you need to download is a bit daunting, but DJGPP offers a handy tool, the &lt;a href="http://www.delorie.com/djgpp/zip-picker.html"&gt;Zip File Picker&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For DOSEMU you want to select "Build and run programs with DJGPP", then "DOSEMU". Select the languages you need. Unless you're feeling adventurous, you don't need any DOS GUI, you can stick to editing the files from linux, and just build in DOSEMU.&lt;br /&gt;&lt;br /&gt;There are in fact more things than what the Zip File Picker offers that you can install. This includes various utilities and libraries. You can even get Perl for DOS. To see what's available, have a look into &lt;a href="http://www.delorie.com/djgpp/getting.html"&gt;Getting djgpp&lt;/a&gt; - pick a mirror, then go to the "current" directory.&lt;br /&gt;&lt;br /&gt;In second part I describe the configuration of DOSEMU for DJGPP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-3627460515489064262?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/3627460515489064262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3627460515489064262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3627460515489064262'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2010/01/building-for-dos-part-1.html' title='Building for DOS, part 1'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-2735412940701061549</id><published>2009-12-14T00:38:00.004+01:00</published><updated>2009-12-14T23:10:39.992+01:00</updated><title type='text'>Debugging non-native programs with QEMU + GDB</title><content type='html'>Here, I expand further on the topic of QEMU user-mode emulation.&lt;br /&gt;You probably noticed that &lt;a href="http://www.qemu.org/qemu-doc.html#SEC72"&gt;QEMU doc&lt;/a&gt; mentions the option "-g port", which mentions &lt;a href="http://www.gnu.org/software/gdb/"&gt;GDB&lt;/a&gt;, without much further info.&lt;br /&gt;&lt;br /&gt;Also, if you've been curious enough, you might have tried running GDB within your (say) ARM Debian chroot. If you have not, let me demonstrate:&lt;br /&gt;&lt;blockquote&gt;This GDB was configured as "arm-linux-gnueabi".&lt;br /&gt;For bug reporting instructions, please see:&lt;br /&gt;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&lt;br /&gt;...&lt;br /&gt;Reading symbols from /root/test...done.&lt;br /&gt;(gdb) break main&lt;br /&gt;Breakpoint 1 at 0x83ac: file test.c, line 5.&lt;br /&gt;(gdb) start&lt;br /&gt;Temporary breakpoint 2 at 0x83ac: file test.c, line 5.&lt;br /&gt;Starting program: /root/test &lt;br /&gt;&lt;b&gt;qemu: Unsupported syscall: 26&lt;/b&gt;&lt;br /&gt;Hello World!&lt;br /&gt;During startup program exited normally.&lt;br /&gt;(gdb)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;So - gdb doesn't work because of unsupported syscall sys_ptrace. But as QEMU supports the GDB remote protocol, you can use that for debugging.&lt;br /&gt;&lt;br /&gt;Apart form QEMU you also need a cross GDB built for your target. You can either &lt;a href="http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&amp;amp;chap=4#doc_chap3"&gt;build your own&lt;/a&gt;, or look here for some tips for &lt;a href="http://en.gentoo-wiki.com/wiki/Crossdev"&gt;Gentoo&lt;/a&gt; or &lt;a href="http://www.emdebian.org/crosstools.html"&gt;Debian&lt;/a&gt;. Or get it from &lt;a href="http://www.codesourcery.com/sgpp/platforms.html"&gt;CodeSourcery&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It might be a good idea to look into the GDB manual for some &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Debugging.html#Remote-Debugging"&gt;remote debugging&lt;/a&gt; background first.&lt;br /&gt;&lt;br /&gt;Start QEMU like this (either on a static binary, or inside foreign chroot):&lt;br /&gt;&lt;blockquote&gt;$ qemu-arm -g 1234 your-binary&lt;br /&gt;&lt;/blockquote&gt;You can use any port number you want (as long as it's not occupied already). Then you have to use the same when telling GDB to connect to this instance of QEMU.&lt;br /&gt;&lt;br /&gt;Launch the cross GDB:&lt;br /&gt;&lt;blockquote&gt;$ armel-unknown-linux-gnu-gdb&lt;br /&gt;GNU gdb (Gentoo 7.0 p1) 7.0&lt;br /&gt;Copyright (C) 2009 Free Software Foundation, Inc.&lt;br /&gt;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;This is free software: you are free to change and redistribute it.&lt;br /&gt;There is NO WARRANTY, to the extent permitted by law.  Type "show copying"&lt;br /&gt;and "show warranty" for details.&lt;br /&gt;This GDB was configured as "--host=x86_64-pc-linux-gnu --target=armel-unknown-linux-gnu".&lt;br /&gt;For bug reporting instructions, please see:&lt;br /&gt;&amp;lt;http://bugs.gentoo.org/&amp;gt;.&lt;br /&gt;(gdb)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now you need to tell GDB a few things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;what file you're debugging: use the &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Files.html#Files"&gt;file&lt;/a&gt; command for that&lt;/li&gt;&lt;li&gt;where to look for dynamic libraries: use the command &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Files.html#Files"&gt;set sysroot&lt;/a&gt; (you can get around this if the binary you're debugging is static; for older gdb use set solib-absolute-prefix)&lt;/li&gt;&lt;li&gt;where to look for sources: use the command &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#Source-Path"&gt;dir&lt;/a&gt; (if it's not in the current directory)&lt;/li&gt;&lt;li&gt;how to connect to QEMU: use &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html#Connecting"&gt;target remote&lt;/a&gt; localhost:1234 (host:port is the general syntax)&lt;/li&gt;&lt;li&gt;it seems GDB doesn't take sysroot into account when looking for debug symbols in case those were separated from the main libraries - so tell GDB explicitly where to look for them with &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files"&gt;set debug-file-directory&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;This implies you need to see (or have a current copy of) the binary and possible libraries the binary uses. In case of the foreign chroot that's easy -- you use the chroot path as the solib-absolute-prefix.  Here's an example: &lt;br /&gt;&lt;blockquote&gt;(gdb) file /mnt/data/debian-armel/root/test&lt;br /&gt;Reading symbols from /mnt/data/debian-armel/root/test...done.&lt;br /&gt;(gdb) set sysroot /mnt/data/debian-armel/&lt;br /&gt;(gdb) set debug-file-directory /mnt/data/debian-armel/usr/lib/debug&lt;br /&gt;(gdb) dir /mnt/data/debian-armel/root/&lt;br /&gt;Source directories searched: /mnt/data/debian-armel/root:$cdir:$cwd&lt;br /&gt;(gdb) target remote localhost:1234&lt;br /&gt;Remote debugging using localhost:1234&lt;br /&gt;warning: Can not parse XML target description; XML support was disabled at compile time&lt;br /&gt;[New Remote target]&lt;br /&gt;[Switching to Remote target]&lt;br /&gt;0x400817e0 in ?? () from /mnt/data/debian-armel/lib/ld-linux.so.3&lt;br /&gt;(gdb) break main&lt;br /&gt;Breakpoint 1 at 0x83ac: file test.c, line 5.&lt;br /&gt;(gdb) c&lt;br /&gt;Continuing.&lt;br /&gt;&lt;br /&gt;Breakpoint 1, main () at test.c:5&lt;br /&gt;5     puts("Hello World!");&lt;br /&gt;(gdb) c&lt;br /&gt;Continuing.&lt;br /&gt;&lt;br /&gt;Program exited normally.&lt;br /&gt;(gdb) quit&lt;br /&gt;&lt;/blockquote&gt;You can automate the set up via a &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Startup.html#Startup"&gt;.gdbinit&lt;/a&gt; file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-2735412940701061549?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/2735412940701061549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/debugging-non-native-programs-with-qemu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2735412940701061549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/2735412940701061549'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/debugging-non-native-programs-with-qemu.html' title='Debugging non-native programs with QEMU + GDB'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-1544153850268807244</id><published>2009-12-12T02:08:00.002+01:00</published><updated>2010-04-11T21:15:04.873+02:00</updated><title type='text'>Running ARM Linux on your desktop PC: The foreign chroot way</title><content type='html'>Here is how you can run a non-native (ARM used here as an example) linux distro on your PC with the help of &lt;a href="http://www.qemu.org/"&gt;QEMU&lt;/a&gt; user emulation and binfmt_misc.&lt;br /&gt;&lt;br /&gt;With QEMU user emulation you can run non-native executables. I.e. with QEMU configured for arm-linux-user you can run arm binaries. Unfortunately, without any further configuration, you can run only static executables. For dynamic executables you need to have all the libraries the executable depends on, built for the same architecture as the main executable (ARM here). This at first sight poses a problem -- you need pretty much the same standard libraries that you already have in your system (glibc, ...), but for a different architecture.&lt;br /&gt;&lt;br /&gt;Such situation (wanting a different set of libraries) can be solved by a chroot. It would also nicely isolate your new ARM linux install. But ordinary chroot must keep the same architecture. Without one more ingredient to the mix you would only get:&lt;br /&gt;&lt;blockquote&gt;chroot: failed to run command `/bin/bash': Exec format error&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;The last magic ingredient is &lt;a href="http://www.kernel.org/doc/Documentation/binfmt_misc.txt"&gt;binfmt_misc&lt;/a&gt;. Binfmt_misc generalizes the classical &lt;a href="http://en.wikipedia.org/wiki/Shebang_%28Unix%29"&gt;shebang&lt;/a&gt;, allowing you to associate custom interpreters to specific file types. Yes, you guessed it -- it allows us to associate ARM (or some other arch) ELF executables with our qemu. After setting up the association the executables can be run the same way as native executables, without specifying QEMU on the command line.&lt;br /&gt;&lt;br /&gt;So, to recap: We use&lt;br /&gt;&lt;ol&gt;&lt;li&gt;qemu user emulation to run the ARM executables&lt;/li&gt;&lt;li&gt;chroot as a place to keep the installed distro including the required dynamic libraries&lt;/li&gt;&lt;li&gt;binfmt_misc to tell the kernel to run ARM ELF executables with the help of qemu&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;There's one last thing to resolve: We need a static build of QEMU, so that QEMU itself doesn't need any libraries. -- With dynamic QEMU, we'd find ourselves with the need of native libraries inside the chroot, which would defeat the purpouse. &lt;br /&gt;&lt;br /&gt;Most distributions nowadays offer QEMU in their repositories, but static QEMU is not so common. But building it from the source is easy. Either &lt;a href="http://www.qemu.org/download.html"&gt;grab a release&lt;/a&gt; (I tested 0.12) or, if you're feeling adventurous, clone &lt;a href="http://savannah.nongnu.org/git/?group=qemu"&gt;QEMU git repo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Configure QEMU with:&lt;br /&gt;&lt;blockquote&gt;$ ./configure --disable-kvm --target-list=arm-linux-user --static&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Invoking make should produce arm-linux-user/qemu-arm. If you want, grab a &lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/foreign-chroot/hello_world/hello_world-arm-static"&gt;trivial ARM static executable&lt;/a&gt; (&lt;a href="http://linux.fjfi.cvut.cz/%7Ezub/blog/foreign-chroot/hello_world/hello_world.c"&gt;source&lt;/a&gt;) to test your qemu:&lt;br /&gt;&lt;blockquote&gt;$ arm-linux-user/qemu-arm hello_world-arm-static &lt;br /&gt;Hello world!&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;You can also check if the resulting QEMU binary is indeed static:&lt;br /&gt;&lt;blockquote&gt;$ file arm-linux-user/qemu-arm&lt;br /&gt;arm-linux-user/qemu-arm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), &lt;b&gt;statically linked&lt;/b&gt;, for GNU/Linux 2.6.9, not stripped&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Let's set up binfmt_misc now. For ARM ELF it is (taken from QEMU's &lt;a href="http://git.savannah.gnu.org/cgit/qemu.git/tree/qemu-binfmt-conf.sh"&gt;qemu-binfmt-conf.sh&lt;/a&gt;):&lt;br /&gt;&lt;blockquote&gt;# echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/PATH/TO/QEMU:' &amp;gt; /proc/sys/fs/binfmt_misc/register&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I find it convenient to put the qemu binary into /usr/local/bin/qemu-arm-static. You can put it anywhere you like, just keep in mind that later you want to use the same path inside your chroot. (Technically you could do with the qemu binary in the chroot only, but at least for this test we need it outside the chroot too.)&lt;br /&gt;&lt;br /&gt;If everything worked well, you should get:&lt;br /&gt;&lt;blockquote&gt;$ ./hello_world-arm-static &lt;br /&gt;Hello world!&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now to the chroot: The easiest way to create one is to get a linux distribution for the target architecture. Here we use Debian, because it supports plenty or architectures, including ARM, and it super-easy to set up in a chroot. All you need is &lt;a href="http://wiki.debian.org/Debootstrap"&gt;debootstrap&lt;/a&gt; -- many (even non-debian) distros have it in their repositories.&lt;br /&gt;&lt;br /&gt;Because we're installing a foreign arch, we ask the installer to do only the first stage of the installation now (substitute $TARGET_PATH with your chosen target path):&lt;br /&gt;&lt;blockquote&gt;# debootstrap --arch=armel --foreign --variant=minbase sid $TARGET_PATH http://ftp.cz.debian.org/debian&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now, we want to chroot to $TARGET_PATH and run the second stage of the install. For that, we need to put the QEMU binary into the chroot, so that the system can find it when starting /bin/bash inside the chroot. In my case I'd do&lt;br /&gt;&lt;blockquote&gt;# mkdir -p debian-armel/usr/local/bin&lt;br /&gt;# cp /usr/local/bin/qemu-arm-static debian-armel/usr/local/bin&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Then we need to do some standard chroot preparations &lt;a href="http://ubuntuforums.org/archive/index.php/t-1156240.html"&gt;[1]&lt;/a&gt;, &lt;a href="http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&amp;amp;chap=2"&gt;[2]&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;# mount --bind /dev $TARGET_PATH/dev&lt;br /&gt;# mount --bind /dev/pts $TARGET_PATH/dev/pts&lt;br /&gt;# mount --bind /dev/shm $TARGET_PATH/dev/shm&lt;br /&gt;# mount --bind /proc $TARGET_PATH/proc&lt;br /&gt;# mount --bind /sys $TARGET_PATH/sys&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now we can finally enter the chroot:&lt;br /&gt;&lt;blockquote&gt;# chroot $TARGET_PATH&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;A word of warning: If the system can't find the interpreting binary (QEMU) inside the chroot, the error message you get is a bit unintuitive (took me a while to figure out what's wrong the first time I ran into it):&lt;br /&gt;&lt;blockquote&gt;chroot: failed to run command `/bin/bash': No such file or directory&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Once you enter the chroot, you should run the second stage of the Debian install:&lt;br /&gt;&lt;blockquote&gt;# /debootstrap/debootstrap --second-stage&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Congratulations! You've got your very own ARM Debian install on your PC! :-)&lt;br /&gt;&lt;br /&gt;Now, there are some more things to do, but they are the same for ordinary chroot environment:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;copy /etc/recolv.conf from your real machine over $TARGET_PATH/etc/resolv.conf to get DNS working&lt;/li&gt;&lt;li&gt;create /etc/apt/sources.list, e.g.: echo "deb http://ftp.cz.debian.org/debian/ unstable main" &amp;gt; /etc/apt/sources.list&lt;br /&gt;&lt;/li&gt;&lt;li&gt;do an apt-get update to make apt happy&lt;/li&gt;&lt;li&gt;install additional packages you want to have inside the chroot&lt;/li&gt;&lt;li&gt;automate the binfmt_misc (un)registration and the chroot entering/leaving: Here are &lt;a href="http://linux.fjfi.cvut.cz/~zub/blog/foreign-chroot/"&gt;scripts&lt;/a&gt; I'm using. You could also find &lt;a href="http://www.debian-administration.org/articles/566"&gt;schroot&lt;/a&gt; helpful.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-1544153850268807244?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/1544153850268807244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/running-arm-linux-on-your-desktop-pc_12.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/1544153850268807244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/1544153850268807244'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/running-arm-linux-on-your-desktop-pc_12.html' title='Running ARM Linux on your desktop PC: The foreign chroot way'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-4397947221446973798</id><published>2009-12-08T23:43:00.002+01:00</published><updated>2010-04-11T21:20:55.033+02:00</updated><title type='text'>Running ARM Linux on your desktop PC</title><content type='html'>It comes as no surprise that you can run entire operating system inside another with the help of &lt;a href="http://en.wikipedia.org/wiki/Platform_virtualization"&gt;virtualization&lt;/a&gt; -- either by some sort of &lt;a href="http://en.wikipedia.org/wiki/Hypervisor"&gt;hypervisor&lt;/a&gt;, or for the more desktop-ish of us, through a virtual machine like &lt;a href="http://en.wikipedia.org/wiki/QEMU"&gt;QEMU&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Bochs"&gt;Bochs&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/VirtualBox"&gt;VirtualBox&lt;/a&gt; or the proprietary &lt;a href="http://en.wikipedia.org/wiki/VMware_Player"&gt;VMware&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But in the typical setup the OS you're running in the virtual machine (guest) is targeted at the same architecture as the host. -- Most typical being host == guest == x86.&lt;br /&gt;&lt;br /&gt;But some of these tools can do more:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Bochs can be used to run x86 or x86_64 code on any reasonable host, because it emulates even the CPU.&lt;/li&gt;&lt;li&gt;QEMU, like Bochs, can also emulate the CPU. QEMU seems to be able to achieve higher emulation speeds and supports more &lt;a href="http://www.qemu.org/status.html"&gt;target architectures&lt;/a&gt;, albeit less host architectures.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So, the point is, with QEMU you can experiment with interesting architectures on your (most probably x86/x86_64) PC. Now, who could resist that? ;-) Ever wanted to know how does &lt;a href="http://www.debian.org/ports/arm/"&gt;Debian for ARM&lt;/a&gt; feel like?&lt;br /&gt;&lt;br /&gt;To make matters even more interesting -- with QEMU's "user emulation" and a little help from &lt;a href="http://en.wikipedia.org/wiki/Binfmt_misc"&gt;binfmt_misc&lt;/a&gt; you can &lt;a href="http://en.wikipedia.org/wiki/Chroot"&gt;chroot&lt;/a&gt; into a non-native distro install.&lt;br /&gt;&lt;br /&gt;More on this interesting subject in a later post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-4397947221446973798?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/4397947221446973798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/running-arm-linux-on-your-desktop-pc.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/4397947221446973798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/4397947221446973798'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/running-arm-linux-on-your-desktop-pc.html' title='Running ARM Linux on your desktop PC'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-965903374301241764</id><published>2009-12-04T00:36:00.001+01:00</published><updated>2009-12-04T00:41:13.362+01:00</updated><title type='text'>Configuring linux kernel for use on ALIX 2</title><content type='html'>I'm a happy owner of two &lt;a href="http://pcengines.ch/alix.htm"&gt;ALIX&lt;/a&gt; boards (&lt;a href="http://pcengines.ch/alix2c3.htm"&gt;2c3&lt;/a&gt; and newer &lt;a href="http://pcengines.ch/alix2d3.htm"&gt;2d3&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Searching the net for info about how to configure the kernel for this sweet device doesn't bring much good, so I thought I'd add my take on it.&lt;br /&gt;&lt;br /&gt;The CPU used is an AMD Geode LX800, so it's x86-compatible. And the board itself is almost PC-compatible. This means you can run stock x86 Debian on it.&lt;br /&gt;&lt;br /&gt;To give you some idea on the insides, here's the output of lspci:&lt;br /&gt;&lt;blockquote&gt;00:01.0 Host bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] Host Bridge (rev 33)&lt;br /&gt;00:01.2 Entertainment encryption device: Advanced Micro Devices [AMD] Geode LX AES Security Block&lt;br /&gt;00:09.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)&lt;br /&gt;00:0a.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)&lt;br /&gt;00:0b.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)&lt;br /&gt;00:0f.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA (rev 03)&lt;br /&gt;00:0f.2 IDE interface: Advanced Micro Devices [AMD] CS5536 [Geode companion] IDE (rev 01)&lt;br /&gt;00:0f.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC (rev 02)&lt;br /&gt;00:0f.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC (rev 02)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you want to customize the kernel yourself (instead of sticking to whatever your distro provides) here are some tips based on my experience:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Turn on General setup/Configure standard kernel features (for small systems). This lets you kill off some features that are useless on the ALIX anyway, like PC-speaker and Virtual Terminal support.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You probably want to disable any sort of namespaces/virtualization support.&lt;/li&gt;&lt;li&gt;In Processor type and features:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Select Geode GX/LX as the Processor family.&lt;/li&gt;&lt;li&gt;There is neither HPET nor MTRR, so turn that off.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;There's no ACPI/APM, so you can turn that off in Power management and ACPI options. But if you intend to use selective USB suspend, you need to keep Power Management support on. (All other options in this submenu can be off.)&lt;/li&gt;&lt;li&gt;In Bus options: There is PCI, so that needs to be enabled. Also turn on NatSemi SCx200 support. But don't turn on NatSemi SCx200 27MHz High-Resolution Timer Support. Enable Geode Multi-Function General Purpose Timer (MFGPT) events. (As the help says this can be use as high-precision timer, turning on Processor type and features/High Resolution Timer Support might be a good idea(?))&lt;/li&gt;&lt;li&gt;In Device drivers:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Decide if you wish to use the legacy ATA way or the newer libata way. I've been using the libata approach for a long time without any problem, so I suggest you use that. But beware -- switching between those two results in the CF card being visible as either /dev/hda or /dev/sda and this can break you boot.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;For the old ATA way choose: ATA/ATAPI/MFM/RLL support/CS5536 chipset support (or AMD CS5535 chipset support in older kernels)&lt;/li&gt;&lt;li&gt;For the libata way choose: Serial ATA (prod) and Parallel ATA (experimental) drivers/ATA SFF support/CS5536 PATA support&lt;/li&gt;&lt;li&gt;Enable Network device support/Ethernet (10 or 100Mbit)/EISA, VLB, PCI and on board controllers/VIA Rhine support. You can also enable Use MMIO instead of PIO for VIA Rhine. (Works fine for me.)&lt;/li&gt;&lt;li&gt;Input device support: Enable if you plan to connect any such thing to your ALIX. If it's just gonna sit on your shelf chewing some network traffic you don't need that.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Character devices: Feel free to disable Virtual terminal as it's of no use on an ALIX 2 anyway. To use the HW random number generator that the Geode contains enable Hardware Random Number Generator Core support/AMD Geode HW Random Number Generator support. Don't forget to enable the serial console: Serial drivers/8250/16550 and compatible serial support and Console on 8250/16550 and compatible serial port.&lt;/li&gt;&lt;li&gt;Enable Hardware Monitoring support/National Semiconductor LM90 and compatibles to be able to see what's going on inside your ALIX. (You also need to enable I2C Support for this.)&lt;/li&gt;&lt;li&gt;There's hadware watchdog too. To use it, enable Watchdog Timer Support/AMD Geode CS5535/CS5536 Watchdog. In debian, look into the package "watchdog" for an app to use it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Graphics support: Feel free to uncheck everything there. :-)&lt;/li&gt;&lt;li&gt;Sound card support: The same, unless you buy some USB sound thingy. :-)&lt;/li&gt;&lt;li&gt;USB support: To get USB functionality enable EHCI HCD (USB 2.0) support and OHCI HCD support.&lt;/li&gt;&lt;li&gt;To get access to the ALIX leds, enable LED Support/LED Support for ALIX.2 and ALIX.3 series and also select some LED Triggers.&lt;/li&gt;&lt;li&gt;You can freely uncheck Real Time Clock. While there's an option to add a battery to the board so that it keeps the time, even if I enable RTC, I don't get /dev/rtc. Either way, without the battery you'll always boot into Jan 1st 2000, so I think RTC support is useless here.&lt;/li&gt;&lt;li&gt;You can enable GPOI Support/AMD CS5535/CS5536 GPIO (Geode Companion Device) -- This can probably used to read the status of the front ALIX button (?) Also I2C Support/I2C Hardware Bus support/Geode ACCESS.bus support seems relevant. But I don't know more and so far was too lazy to look for it. Any info is welcome. :-)&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;To use the hardware AES crypto engine enable Cryptographic API/Hardware crypto devices/Support for the Geode LX AES engine.&lt;/li&gt;&lt;li&gt;I suggest you enable Magic SysRq key (Kernel hacking/Magic SysRq key), as it works also over serial (instead of SysRq, you send a break, see Documentation/sysrq.txt).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;(The menu items are as per the 2.6.31.6 kernel, but they should be reasonably similar for any kernel version that is not too distant.)&lt;br /&gt;&lt;br /&gt;The other options pretty much depend on your specific requirements and there's not anything board-specific that influences them.&lt;br /&gt;&lt;br /&gt;Here is a working &lt;a href="http://linux.fjfi.cvut.cz/~zub/alix/config-2.6.31.6-alix2.txt"&gt;kernel configuration file&lt;/a&gt; for ALIX 2 that can be used as a base for further customization.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-965903374301241764?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/965903374301241764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/configuring-linux-kernel-for-use-on.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/965903374301241764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/965903374301241764'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/configuring-linux-kernel-for-use-on.html' title='Configuring linux kernel for use on ALIX 2'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-7983895667801178070</id><published>2009-12-03T00:09:00.001+01:00</published><updated>2010-07-11T11:11:17.592+02:00</updated><title type='text'>Compiling linux kernel for x86 on x86_64</title><content type='html'>Now, that's nothing overly exotic. Yet a search through the web suggests some wild solutions like setting up a real x86_64 -&amp;gt; x86 cross-compiler or even setting up a 32-bit linux distribution inside a chroot.&lt;br /&gt;&lt;br /&gt;The reasoning is simple:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you have 32-bit chroot environment with a compiler, you can just compile the 32-bit kernel there in the usual fashion.&lt;/li&gt;&lt;li&gt;If you have the right cross-compiler, you can use the standard &lt;a href="http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&amp;chap=4"&gt;kernel cross-compilation procedure&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;The downside is that both options are gonna eat some space off your HDD and take some time to set up.&lt;br /&gt;&lt;br /&gt;But if you're on x86_64, you can install the &lt;a href="http://www.airs.com/ian/configure/configure_8.html"&gt;multilib&lt;/a&gt; version of gcc that adds support for building 32-bit binaries with a simple "-m32" option.&lt;br /&gt;&lt;br /&gt;Then I found this &lt;a href="http://blogs.koolwal.net/2009/06/04/howto-cross-compiling-a-32-bit-i386-linux-kernel-on-64-bit-machine-amd64/#comment-10259"&gt;hint&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;$ (echo ‘#! /bin/sh’; echo ‘exec gcc -m32 “$@”‘) &amp;gt;~/bin/i486-linux-gnu-gcc&lt;br /&gt;$ chmod +x ~/bin/i486-linux-gnu-gcc&lt;br /&gt;$ for i in ar ld nm objcopy strip; do&lt;br /&gt;$   ln -s `which $i` ~/bin/i486-linux-gnu-$i&lt;br /&gt;$ done&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This basically creates a "fake" i486-linux-gnu cross-toolchain out of the multilib x86_64/x86 toolchain. Then it can be used with kernel Makefile like this:&lt;br /&gt;&lt;blockquote&gt;make ARCH=i386 CROSS_COMPILE=i486-linux-gnu- &amp;lt;target&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;That's a way I've been using for some time. But as I was preparing this post, I fired up google once again and discovered this very brief &lt;a href="http://www.pubbs.net/gentoo/200906/41771/"&gt;answer&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;make CROSS-COMPILE=i686-pc-linux-gnu- ARCH=i386 &amp;lt;target&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;And that command works despite me having neither real nor "fake" i686-pc-linux-gnu- cross-toolchain installed. Experimenting further reveals that all that is needed is:&lt;br /&gt;&lt;blockquote&gt;make ARCH=i386 &amp;lt;target&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Just don't forget you need to keep that ARCH=i386 parameter throughout the make invocations (modules_install doesn't seem to need them), e.g.:&lt;br /&gt;&lt;blockquote&gt;make ARCH=i386 menuconfig&lt;br /&gt;make ARCH=i386 bzImage modules&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;In this case of building the kernel on a different machine than the one it's supposed to run on, you certainly don't want to install the built modules into /lib/modules, so invoke the make like this:&lt;br /&gt;&lt;blockquote&gt;make INSTALL_MOD_PATH=prefix modules_install&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Also, don't do any of the steps as root. -- There's no need to. If you build the kernel as root, you risk accidentally overwriting your host modules or causing some other damage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-7983895667801178070?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/7983895667801178070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/compiling-linux-kernel-for-x86-on-x8664.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7983895667801178070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/7983895667801178070'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/compiling-linux-kernel-for-x86-on-x8664.html' title='Compiling linux kernel for x86 on x86_64'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-313659922933043795.post-3628947337322368289</id><published>2009-12-02T23:12:00.000+01:00</published><updated>2009-12-02T23:14:23.891+01:00</updated><title type='text'>You knew it was coming</title><content type='html'>I was never a big fan of blogs. And I'd never think I'd actually start one.&lt;br /&gt;&lt;br /&gt;Anyway, the reason I hopped on is simple. I'm a software engineer who likes to tinker with computers. This quite naturally means I like&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Free_software"&gt;free software&lt;/a&gt;. Specifically, I enjoy fiddling with linux, doing all kinds of odd things with it. I sometimes manage to run into things that I'm not able to find good answers to and figure out stuff in the process. Up to now, the results of my tinkering were staying locked up in my installation of &lt;a href="http://zim-wiki.org/"&gt;Zim&lt;/a&gt;. But I was thinking that maybe someone else might find them useful too.&lt;br /&gt;&lt;br /&gt;So this is the premise. Let's see how this evolves.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/313659922933043795-3628947337322368289?l=tinkering-is-fun.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tinkering-is-fun.blogspot.com/feeds/3628947337322368289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/you-knew-it-was-coming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3628947337322368289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/313659922933043795/posts/default/3628947337322368289'/><link rel='alternate' type='text/html' href='http://tinkering-is-fun.blogspot.com/2009/12/you-knew-it-was-coming.html' title='You knew it was coming'/><author><name>David</name><uri>http://www.blogger.com/profile/13178241043421906804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
