<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abort, Retry, Hack? &#187; Hacks</title>
	<atom:link href="http://marcansoft.com/blog/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://marcansoft.com/blog</link>
	<description>[ marcan&#039;s blog ]</description>
	<lastBuildDate>Sat, 14 Jan 2012 19:32:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>OpenLase hardware and simulator</title>
		<link>http://marcansoft.com/blog/2011/01/openlase-hardware-and-simulator/</link>
		<comments>http://marcansoft.com/blog/2011/01/openlase-hardware-and-simulator/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 19:48:00 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=324</guid>
		<description><![CDATA[I apologize for taking this long to post this! I&#8217;ve been busy non-stop since 27c3 and never got a chance to get around to it. Finally, though, here it is: the description of the Mark 1 laser projector that I use with OpenLase. But wait, there&#8217;s more! If you don&#8217;t have the hardware and don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I apologize for taking this long to post this! I&#8217;ve been busy non-stop since 27c3 and never got a chance to get around to it. Finally, though, here it is: the description of the <a href="/blog/openlase/hardware-mark-1/">Mark 1 laser projector</a> that I use with OpenLase.</p>
<p>But wait, there&#8217;s more! If you don&#8217;t have the hardware and don&#8217;t want to build it, or you want to try out OpenLase, or you want to be able to mess around with it on the go, you can now do that. There&#8217;s a new OpenGL-based simulator in the OpenLase tree. It works off of the JACK data (so you still need JACK) and it tries to simulate the dynamics of my laser scanner, including brightness effects and some of the physical limitations of the galvos. Here&#8217;s a comparison of the simulator vs. the real thing:</p>
<p><iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/hoWCNKhZCbk" frameborder="0"><br />
</iframe></p>
<p>I&#8217;m aware that documentation on the software is still sorely lacking. Please bear with me while I get my act together and write that up <img src='http://marcansoft.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2011/01/openlase-hardware-and-simulator/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>OpenLase: open realtime laser graphics</title>
		<link>http://marcansoft.com/blog/2010/11/openlase-open-realtime-laser-graphics/</link>
		<comments>http://marcansoft.com/blog/2010/11/openlase-open-realtime-laser-graphics/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 02:25:52 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=241</guid>
		<description><![CDATA[Update: see this post for hardware info and also a new GL laser simulator for those without hardware. First of all, as I&#8217;m sure everyone knows by now, I&#8217;ve been working on hacking the Kinect and writing open drivers for it. There&#8217;s a website for the community and a Git repo with the code, and [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update</b>: see <a href="/blog/2011/01/openlase-hardware-and-simulator/">this post</a> for hardware info and also a new GL laser simulator for those without hardware.</p>
<p>First of all, as I&#8217;m sure everyone knows by now, I&#8217;ve been working on hacking the Kinect and writing open drivers for it. There&#8217;s a <a href="http://openkinect.org">website</a> for the community and a <a href="https://github.com/OpenKinect/libfreenect">Git repo</a> with the code, and it&#8217;s working fairly nicely by now.</p>
<p>With that out of the way, here&#8217;s a project that I&#8217;ve been working on on-and-off for the past year or so. I&#8217;ve been interested in laser scanning and DIY laser projectors, but I couldn&#8217;t find any good open source software to drive them. Specifically, I was interested in the realtime aspect: rendering and showing dynamically generated images and responding to events, not just making and preprocessing laser shows. So I set out to write my own set of software to do real-time rendering. This was the result:</p>
<p><iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/m_CHXwXvWvs" frameborder="0"><br />
</iframe><br />
<span id="more-241"></span><br />
DIY laser projectors commonly use sound cards as DACs. This shifts most of the processing over to the PC, but also lets us get very fine control over the realtime aspects of projection, which is what I want. Thus, my laser projector is based on a bog-standard USB soundcard, modified to pass DC. I&#8217;ll probably write a detailed article on the hardware later, but suffice it to say that it&#8217;s a galvo kit, a hacked chinese laser pointer, my own laser driver and monitoring circuitry, and some other minor parts. Total cost is about €200, if you play your cards right.</p>
<p>Since we&#8217;re converting laser images to audio data, why not just treat the laser data as audio in the first place? After all, laser samples are audio-rate data, and 16-bit multichannel 48kHz fits the requirements for laser projection very well. So that is what I did. OpenLase isn&#8217;t really a monolithic framework. Instead, it&#8217;s a series of stand-alone applications and chunks built on the excellent <a href="http://jackaudio.org/">JACK audio connection kit</a>, which serves to pipe realtime laser data around the different bits.</p>
<p>On a typical setup, you&#8217;d have two processes running on top of JACK. On one hand, there&#8217;s the output processor, which is responsible for formatting the idealized laser data to suit the peculiarities of the hardware. This includes things like brightness scaling, the obvious X/Y inversion settings, the final output perspective transform (to fit the screen), and minor filters to try to compensate for hardware imperfections. It also generates a 1kHz square wave on one channel &#8211; this is a peculiar safety feature of my laser hardware. I have a microcontroller monitoring this signal, such that if the software hangs or crashes for some reason, the laser shuts down immediately (to avoid having a static dot which would be a serious eye hazard). The OpenLase output processor has a simple <a href="http://marcansoft.com/transf/laser_output.png">Qt GUI</a> that lets you tweak these settings on the fly.</p>
<p>On the other hand, you have whatever picture source you want to use. You can have bare JACK applications, such as two examples: &#8216;<a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=examples/circlescope.c;hb=master">circlescope</a>&#8216;, a circular oscilloscope that takes realtime audio data from a media player, and &#8216;<a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=tools/playilda.c;hb=master">playilda</a>&#8216;, a bare-bones ILDA file player (ILDA / .ild is the standard file format for laser graphics). The circlescope is particularly good for showing off the real-time aspect (note that the input can come from the laser DAC&#8217;s line-in with only the small JACK buffering delay):</p>
<p><iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/teJAOHFj1E4" frameborder="0"><br />
</iframe></p>
<p>However, the other big part of OpenLase is <a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=include/libol.h;hb=master">libol</a>, a realtime rendering library loosely modeled on OpenGL which lets you produce 2D and 3D graphics on the fly. This is what I used for the LASE demo above. The demo itself isn&#8217;t currently open source (and the code is utterly horrid &#8211; I wrote half of it at Euskal Encounter and finished it mere minutes before the deadline), but if there&#8217;s demand I might open source it too, just please don&#8217;t expect pretty code! However, keep in mind that most features used by the demo (text rendering, 3D, &#8220;shaders&#8221;, ILDA file loading, etc.) were implemented as part of libol, so you aren&#8217;t missing out on much. There are two libol-based examples: <a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=examples/simple.c;hb=master">some rotating cubes</a>, and <a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=examples/pong.c;hb=master">Pong</a>.</p>
<p>There&#8217;s one part of the demo made it into the OpenLase distribution as a separate example: <a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=tools/trace.c;hb=master">tools/trace.c</a>. This used to be some tracing code that I used for the metaballs and fire effects (I kind of cheated there, as those are rendered as bitmaps and then traced in realtime into laser vectors). It&#8217;s a terribly naive algorithm (check the source out for details), but it worked surprisingly well for certain kinds of video, so I hacked it and tacked on more heuristics in order to attempt to make it work better. It now lives next to <a href="http://git.marcansoft.com/?p=openlase.git;a=blob;f=tools/playvid.c;hb=master">tools/playvid.c</a>, which is a simple video player using libavcodec. <a href="http://www.youtube.com/watch?v=uJaAYD0YT44">Here&#8217;s</a> what it looks like (<a href="http://marcansoft.com/transf/badapple4.mkv">improved version (mkv)</a>, <a href="http://www.youtube.com/watch?v=G3C-VevI36s">original YouTube video</a>). More complex videos are hit and miss, but some things turn out <a href="http://marcansoft.com/transf/laser_minami_kiss.mkv">surprisingly well</a> for such a silly algorithm.</p>
<p>You can also add filters between the output and the image generator. This is what I did for my <a href="http://www.youtube.com/watch?v=Q1heqFVrQGU">Kinect + OpenCV + OpenLase</a> demo, which projects anything projectable by OpenLase onto a moving screen, with a dynamic perspective transform (in this case the perspective transform happens in the filter, not in the output processor). That code currently doesn&#8217;t even build with current libfreenect, but again, if someone is interested, drop me a line and I&#8217;ll make it work again and publish it.</p>
<p>OpenLase doesn&#8217;t have any facilities to patch together these JACK apps. Instead, you should just use existing JACK tools, such as QJackCtl, to connect all the input and output ports together. QJackCtl has a patchbay feature that automagically connects the ports when applications start up, so it&#8217;s quite seamless.</p>
<p>Right now there is pretty much no documentation, but I&#8217;d like to know if people are interested. If you have (or want to build) this kind of DIY hardware, you run Linux or some other UNIX that can run JACK, and you&#8217;re interested in hacking on the code or using it for something, please let me know! <a href="http://git.marcansoft.com/?p=openlase.git">Here&#8217;s</a> the git repo.</p>
<p><b>Update</b>: Three more videos, musically themed. A laser visualization of MIDI data (MIDI to laser):<br />
<iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/qDNNFM9ghIY" frameborder="0"><br />
</iframe></p>
<p>And the other way around, a laser harp (laser to MIDI):<br />
<iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/24lQ-736viw" frameborder="0"><br />
</iframe><br />
<iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/iY6927rSBdQ" frameborder="0"><br />
</iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2010/11/openlase-open-realtime-laser-graphics/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
<enclosure url="http://marcansoft.com/transf/laser_minami_kiss.mkv" length="24651242" type="video/x-matroska" />
<enclosure url="http://marcansoft.com/transf/badapple4.mkv" length="30073105" type="video/x-matroska" />
		</item>
		<item>
		<title>AsbestOS: Running Linux as GameOS</title>
		<link>http://marcansoft.com/blog/2010/10/asbestos-running-linux-as-gameos/</link>
		<comments>http://marcansoft.com/blog/2010/10/asbestos-running-linux-as-gameos/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 23:31:19 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PS3]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=222</guid>
		<description><![CDATA[As most of you will probably already know, I&#8217;ve been working on a project recently which aims to run Linux on the PS3 (including the PS3 Slim) using the PSJailbreak exploit, effectively replacing GameOS on the fly. I think it&#8217;s gotten to the point where it&#8217;s useful enough for other people to be interested, so [...]]]></description>
			<content:encoded><![CDATA[<p>As most of you will probably already know, I&#8217;ve been working on a project recently which aims to run Linux on the PS3 (<b>including the PS3 Slim</b>) using the PSJailbreak exploit, effectively replacing GameOS on the fly. I think it&#8217;s gotten to the point where it&#8217;s useful enough for other people to be interested, so here&#8217;s something resembling an official announcement.</p>
<p>Obligatory demo video:<br />
<iframe class="youtube-player" width="440" height="360" src="//www.youtube.com/embed/zQ4Q_mqwxpA" frameborder="0"><br />
</iframe><br />
<span id="more-222"></span><br />
AsbestOS (a <a href="http://en.wikipedia.org/wiki/Asbestos">mineral</a>, and meaning &#8220;inextinguishable&#8221; in Greek) is a bootloader to run PS3 Linux without OtherOS. It runs using the USB GameOS exploit (on PS3 version 3.41) from any compatible device, and any reprogrammable devices currently running the PS3 exploit can be used as long as they have enough free internal or external storage (40kB or so) to hold the loader. It is general enough that it should be useful to boot Linux given any other GameOS exploit in the future. It has been tested to work on the PS3 Slim too.</p>
<p>Currently, it only supports netbooting a kernel and no initrd (mostly due to bootmem limitations). This is enough to run a Linux system booting from an NFS share or from USB storage media. Almost everything that works under OtherOS is working. As additional perks of running as GameOS, you also get access to a seventh SPE (needs a <a href="http://git.marcansoft.com/?p=ps3-linux.git;a=commitdiff;h=d4b9d3b8a61cc0f89d92cd8151839f30c1bdd6ee">kernel patch</a> to enable) and there is clearly full access to the RSX including 3D support, although we still need to learn a few details about how that works to be able to use it.</p>
<p>AsbestOS is a fully independent open source payload and does not contain any code from the original PSJailbreak payload or derivatives. It is licensed under the GPLv2. Compiling it does not require any SDK tools, and it includes a script to build a fully vanilla GNU toolchain for the PS3.</p>
<p>If you&#8217;re interested, check out the <a href="http://git.marcansoft.com/?p=asbestos.git">git repository</a>. The <a href="http://git.marcansoft.com/?p=asbestos.git;a=blob;f=README">README file</a> contains information on how to run AsbestOS and how to set up kernels. Currently, ports exist for software USB AVRs (Arduino etc.), iPods, and the reference implementation for devices with a TI OMAP3, but anything currently running PSGroove or similar can be adapted with only a few lines of new code.</p>
<p>For the impatient or lazy folks, here&#8217;s a <a href="http://marcansoft.com/transf/dtbImage-20101020.bin">kernel</a> that you can use <i><b>Update:</b> and a <a href="http://marcansoft.com/transf/stage1-20101020.bin">stage1 binary</a> and a <a href="http://marcansoft.com/transf/stage2-20101020.bin">stage2 binary</a></i>. You&#8217;ll probably want to change the kernel commandline options to set up your NFS root partition. This will eventually be handled by AsbestOS, but for now, open it up in a hex editor, search for HEXEDIT_THIS, and change the commandline to suit your needs (without changing the total length, of course). Do note that this kernel does not have built-in USB support, so it can only be used for NFS booting (the USB stuff is built as a module).</p>
<p>You can use <a href="http://marcansoft.com/transf/gentoo-ps3-20101020.tar.bz2">this</a> filesystem as a starting point. It&#8217;s a Gentoo stage3 updated to date and with PS3-specific tools installed. Keep in mind that there&#8217;s no Portage tree included, so be sure to either <code>emerge --sync</code> or NFS mount your server&#8217;s Portage tree (which is what I do). At the very minimum, you&#8217;ll want to edit the following files to configure your NFS and networking settings (or to specify USB device partitions, if you want to go that route &#8211; but you need to compile your own kernel then): <code>/etc/fstab</code>, <code>/etc/hosts</code>, <code>/etc/resolv.conf</code>, and quite likely a few others. This filesystem includes kernel modules for the above kernel. The root password is &#8216;ps3&#8242;.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2010/10/asbestos-running-linux-as-gameos/feed/</wfw:commentRss>
		<slash:comments>118</slash:comments>
		</item>
		<item>
		<title>Enabling Intel VT on the Aspire 8930G (and other InsydeH2O-based laptops)</title>
		<link>http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/</link>
		<comments>http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 16:30:49 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[acer]]></category>
		<category><![CDATA[bios]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[intelvt]]></category>
		<category><![CDATA[reveng]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=71</guid>
		<description><![CDATA[It seems the ongoing trend for laptops is to integrate and hide as much as possible from the user. We&#8217;re all used to minimalistic crappy BIOS setups with two or three configuration options. However, things go way too far when OEMs remove options related to features that the hardware is capable of but which are [...]]]></description>
			<content:encoded><![CDATA[<p>It seems the ongoing trend for laptops is to integrate and hide as much as possible from the user. We&#8217;re all used to minimalistic crappy BIOS setups with two or three configuration options. However, things go way too far when OEMs remove options related to features that the hardware is capable of but which are disabled by default. This happens with Intel VT on many laptops &#8211; even if the CPU supports it, you may not be able to find the BIOS setup option to turn it on. </p>
<p>I certainly wanted to use a feature that I <b>paid for</b>, so I started investigating the BIOS and here&#8217;s what I found out.</p>
<p><b>Update:</b> There&#8217;s a 1.21 BIOS floating around that seems to have VT enabled natively. See below.<br />
<span id="more-71"></span></p>
<h3>Under the hood</h3>
<p>The InsydeH2O BIOS is no ordinary old-style BIOS. Instead, it&#8217;s based around the <a href="http://www.uefi.org/">UEFI</a> platform. This goes way beyond the old BIOS paradigm and turns system firmware into practically its own separate OS, that even runs in full 64-bit mode on 64-bit machines. Unfortunately, they make no effort to expose any of this to the user. The firmware has support for booting EFI executables, there&#8217;s an EFI shell, there&#8217;s an EFI boot manager&#8230; but I haven&#8217;t been able to figure out how to access any of this.</p>
<p>If you want to reverse engineer EFI stuff, downloading <a href="https://www.tianocore.org/">TianoCore&#8217;s EDK2</a> is a must. It contains source code for a lot of Intel&#8217;s framework, which is what most vendors use as a base for their EFI support. A lot of the code is exactly the same as what&#8217;s in the Insyde BIOS (read the spec <a href="http://download.intel.com/technology/framework/docs/HII_9_2.pdf">here</a>). </p>
<p>As for the Setup tool, it does indeed have a huge Advanced menu with even more options than your average desktop. There&#8217;s also a hidden Power menu. EFI defines a &#8220;form browser&#8221; protocol and formats for user input, which is what Insyde uses for their setup utility (spec <a href="http://download.intel.com/technology/framework/docs/HII_9_2.pdf">here</a>). I found these tables when disassembling the Setup binary and wrote a little dump utility to turn them into text. The result is a complete dump of the Setup hierarchy, including the Advanced menu, which also includes the offsets in the non-volatile storage corresponding to each setting. Insyde stores this configuration blob into an EFI variable named <code>Setup</code>. <a href="/uploads/insydehacks/setup.txt">Here&#8217;s</a> my dump: the first part is the hierarchy, while at the end I added a rough auto-calculated mapping from configuration offsets to setting names (grep for <code>[0xOFFSET</code> in the top section for better context - the format is <code>[0xOFFSET&lt;FIELD_WIDTH&gt;]</code> for all references to the storage blob). You&#8217;ll find the tools I used <a href="/uploads/insydehacks">here</a>, if you&#8217;re interested, but they&#8217;re rough and need quite a bit of manual help too.</p>
<p>I wasn&#8217;t able to find out how to enable the hidden menus, other than that their form Subclass is 5 instead of 0 (but I haven&#8217;t found what, if anything, checks for this and whether its behavior can be altered). However, manually enabling VT support in the <code>Setup</code> variable is easy enough, now that we have the offset of the VT Enable byte.</p>
<h3>Enabling Intel VT</h3>
<p>The easiest way to enable the setting as far as I can see is to dump out the entire BIOS, patch the setting into the Setup variable (which is part of the data storage section &#8211; we aren&#8217;t modifying any actual BIOS code, as this is the equivalent of changing a CMOS setting on other BIOSes), and then flash the resulting image. These laptops use a weird flash-behind-EC hardware solution for which there is no open flasher, so instead we can just use the normal BIOS flashing tool. In short, we&#8217;ll flash the existing BIOS back on, but in the process also modify a Setup setting.</p>
<p><b>FAIR WARNING:</b> This might apply to other similar laptops, or it might not. It might work, it might do nothing, or it might brick your expensive laptop. Even if you own an Aspire 8930G, I take no responsiblity if your laptop dies, turns into an expensive brick, melts into a pool of slag, blows up, flicks you off, develops self-awareness, or becomes Skynet. You have been warned. I have only tested this on an Aspire 8930G with BIOS Version 1.10. If you want to try this on another system or BIOS you should make sure you understand EXACTLY what is going on and are prepared to spot any problems or fix things yourself.</p>
<p>First, dump the exiting BIOS out. It resides at the top of the 32-bit address space, and is 2MB in size. You can use dd to dump it out of /dev/mem:</p>
<pre>$ dd if=/dev/mem of=original_bios.fd bs=1024 count=2048 skip=4192256</pre>
<p>It is a <i>very</i> good idea to back up this BIOS somewhere safe outside the laptop. Note that it not only contains your existing BIOS code, but also all your settings and manufacturer data (serial number, software license if you run an OEM version of Vista, etc).</p>
<p>Next, run <a href="/uploads/insydehacks/vtenable.py">vtenable.py</a>. This will attempt to locate the <b>Setup</b> EFI variable on the non-volatile storage section and patch the VT byte to one.</p>
<pre>$ python vtenable.py original_bios.fd vt_bios.fd</pre>
<p>You can edit the source code to make other changes to the variable, but make sure you know what you&#8217;re doing. It&#8217;s worth reiterating that <b>this does not patch your BIOS code</b>. It only makes a setting change, just as if you&#8217;d turned on the VT option in the BIOS had it been there. In fact, there are two variables: <code>Setup</code> and <code>Custom</code>, and <code>Setup</code> is the one that changes are committed to when you use the setup utility. Restoring defaults should turn VT back off (untested). It also appears that <code>Custom</code> is probably what the setup defaults are, so changing that should semi-permanently enable VT.</p>
<p>I highly recommend performing a sanity diff between the original and modified images using vbindiff:</p>
<pre>$ vbindiff original_bios.fd vt_bios.fd</pre>
<p>Only two or three bytes should change: one or two adjacent bytes for the checksum (they should be decremented by one when you look at them as a 16-bit unsigned integer), and the VT enable byte should change from <code>00</code> to <code>01</code>. Right after the checksum bytes you should be able to see the <code>Setup</code> name in UTF-16 (something like <code>S.e.t.u.p.</code>).</p>
<p>Finally, flash <code>vt_bios.fd</code> using the vendor-supplied flash utility. I use the DOS version (<code>FLASHIT.EXE</code>) with FreeDOS and a grub menu option so I don&#8217;t need to mess around with external media. Grab a base image <a href="/uploads/insydehacks/freedos_flashit.img.bz2">here</a>, then you can use <a href="http://mtools.linux.lu/">mtools</a> to copy the bios into it:</p>
<pre>$ bunzip2 freedos_flashit.img.bz2
$ mcopy -i freedos_flashit.img vt_bios.fd ::/vt_bios.fd</pre>
<p>To boot it using GRUB, get <a href="http://syslinux.zytor.com/wiki/index.php/MEMDISK">MEMDISK</a>, part of <a href="http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project">SYSLINUX</a>, and put something like this in your grub.conf:</p>
<pre>title=BIOS Update
root (hd0,0)
kernel (hd0,0)/boot/memdisk
initrd (hd0,0)/boot/freedos_flashit.img</pre>
<p>Of course, copy memdisk and the boot image to your boot partition, and change <code>(hd0,0)</code> to your boot (or root) partition everywhere and remove the <code>/boot</code> part if you have a dedicated boot partition.</p>
<p>Once you&#8217;re in FreeDOS, just type <code>FLASHIT vt&lt;tab&gt;</code> and be happy that FreeDOS supports tab-completion <img src='http://marcansoft.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Caveat: by doing this, you&#8217;re flashing the entire BIOS image. The flash tool makes no attempt to flash only the parts that changed, and the &#8220;flash only variables&#8221; commandline option seems to have no effect. You&#8217;re effectively reflashing your entire BIOS back on, so the usual BIOS flashing caveats apply: don&#8217;t turn the power off, etc. This could be accomplished a lot more cleanly if we had drivers for the flash chip / EC, since then we could use the normal EFI variable store procedure to atomically update the variable, which is completely safe.</p>
<p>You can use the <a href="http://www.linux-kvm.org/page/Enable_VT-X_on_Mac_Pro_(Early_2008)">MSR Magic</a> tool to check whether VT is indeed enabled on your CPU.</p>
<p><b>Update</b>: Several people are working on improved, more general tools to perform this hack across a broader range of InsydeH2O-based BIOSes. Read the comments and check them out, they&#8217;ve done some very good work.<br />
<b>Update 2</b>: There&#8217;s a 8930G 1.21 BIOS version floating around (not on Acer&#8217;s site yet) with build date 3/3/2011. This version seems to have VT enabled without any hacking required (I&#8217;ve checked the contents and everything seems to be kosher and a real update, not some hack). I haven&#8217;t come across an official update file, but I did find a dump made by someone. I&#8217;ve manually cleaned it up to remove the variables and serial numbers so it should be identical to an official 1.21 update file (it will keep your current config and serials). You can find it <a href="http://marcansoft.com/transf/1.21-clean.fd">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/feed/</wfw:commentRss>
		<slash:comments>511</slash:comments>
		</item>
		<item>
		<title>More SPMP goodness: now with pseudo-3D</title>
		<link>http://marcansoft.com/blog/2009/06/more-spmp-goodness-now-with-pseudo-3d/</link>
		<comments>http://marcansoft.com/blog/2009/06/more-spmp-goodness-now-with-pseudo-3d/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 01:06:28 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[reveng]]></category>
		<category><![CDATA[spmp]]></category>
		<category><![CDATA[sunplus]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=52</guid>
		<description><![CDATA[After a few days of reading very, very weird disassembled code and poking registers, the odd 2D hardware finally works (for the most part). It can draw lines, so I threw in a software 3D transform. Here&#8217;s the Stanford Bunny in a glorious 448 vertices and 1416 lines of jaggy wireframe awesomeness. The chip has [...]]]></description>
			<content:encoded><![CDATA[<p>After a few days of reading very, very weird disassembled code and poking registers, the odd 2D hardware finally works (for the most part). It can draw lines, so I threw in a software 3D transform. Here&#8217;s the <a href="http://en.wikipedia.org/wiki/Stanford_Bunny">Stanford Bunny</a> in a glorious 448 vertices and 1416 lines of jaggy wireframe awesomeness.</p>
<p><iframe class="youtube-player" width="440" height="360" src="http://www.youtube.com/embed/3tg7KSSUl8Q" frameborder="0"><br />
</iframe><br />
<span id="more-52"></span><br />
The chip has hardware line styling (stippling), and you can see 4 different settings (solid, &#8220;10&#8243; dashed, &#8220;100&#8243; dashed, &#8220;1000&#8243; dashed) in sequence. At the higher setting it starts to look more like a point cloud with many more points than it has real vertices.</p>
<p>Also of note: I&#8217;m working inside a framework that drives operation of the SPMP from the PC. While the entire bunny transformation and rendering is happening inside the SPMP, the PC sends it the rotation matrix and tells it to go each frame (and also when to switch stippling and whatnot). So it&#8217;s slower than it would be in pure standalone hardware, because there&#8217;s still at least two serial port ping-pong commands each frame (one memory download for the matrix and one command to tell it to render the bunny with it).</p>
<p>You can grab the (ugly as hell) code in the <a href="http://git.marcansoft.com/?p=spmp.git;a=summary">Git repo</a>.</p>
<p>Fun stuff: the projection is orthographic, so there&#8217;s no depth information rendered. This makes the rotation ambiguous. Do you see it rotating clockwise or anticlockwise (looking at it from above)? Can you make your brain switch between them?</p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2009/06/more-spmp-goodness-now-with-pseudo-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunplus SPMP305x media player hacking</title>
		<link>http://marcansoft.com/blog/2009/06/sunplus-spmp305x-media-player-hacking/</link>
		<comments>http://marcansoft.com/blog/2009/06/sunplus-spmp305x-media-player-hacking/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 03:23:59 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[reveng]]></category>
		<category><![CDATA[spmp]]></category>
		<category><![CDATA[sunplus]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/2009/06/sunplus-spmp305x-media-player-hacking/</guid>
		<description><![CDATA[I&#8217;ve joined a bunch of friends in a quest to reverse engineer and write custom software for Sunplus SPMP305x chips. These chips are inside all sorts of chinese media players, particularly the fairly powerful kind with a camera, video playback, etc. The chip is based around an ARM926EJ-S core, but the peripherals around it are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve joined a bunch of friends in a quest to reverse engineer and write custom software for Sunplus SPMP305x chips. These chips are inside <a href="http://spmp305x.spritesserver.nl/wiki/index.php/List_of_units">all sorts of chinese media players</a>, particularly the fairly powerful kind with a camera, video playback, etc. The chip is based around an ARM926EJ-S core, but the peripherals around it are completely custom &#8211; check out the <a href="http://www.sunplusmm.com/products/dsc/spmp.asp">marketing blurb</a>. Most current work is on reverse engineering the hardware interface so we can completely replace the default firmware.</p>
<p>If you&#8217;re interested and you have one of these or don&#8217;t mind spending <a href="http://www.dealextreme.com/details.dx/sku.21968">$33</a> to get an interesting ARM machine, check out the <a href="http://spmp305x.spritesserver.nl/wiki/index.php">wiki</a>, <a href="http://code.google.com/p/libspmp3050/">Google Code project</a> for the Prex port and other stuff, and my <a href="http://git.marcansoft.com/?p=spmp.git;a=summary">Git repository</a> with a port of MINI and a bunch of client utilities for reverse engineering and testing the hardware stuff. Most importantly, however, come visit us at #spmpdev on the EFNet network! Most of the work and chitchat happens in the IRC channel.</p>
<p><img src="http://marcansoft.com/uploads/spmp/spmp_lcd.jpg" alt="sunplus test image" /></p>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2009/06/sunplus-spmp305x-media-player-hacking/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using Amarok and other iTunesDB compatible software with the iPhone 2.x</title>
		<link>http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-iphone-2x/</link>
		<comments>http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-iphone-2x/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 19:52:31 +0000</pubDate>
		<dc:creator>marcan</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[iPhone on Linux]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[fairplay]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[stupid]]></category>

		<guid isPermaLink="false">http://marcansoft.com/blog/?p=22</guid>
		<description><![CDATA[With newer iPods and the iPhone 2.x firmware, Apple decided to implement a new hash scheme for iTunesDB to prevent third-party apps from managing the iPod database. Stupid. They decided to make it part of the FairPlay codebase, including its obfuscation. Very Stupid. But just in case that weren&#8217;t enough, then they went ahead and [...]]]></description>
			<content:encoded><![CDATA[<p>With newer iPods and the iPhone 2.x firmware, Apple decided to implement a new hash scheme for iTunesDB to prevent third-party apps from managing the iPod database. Stupid. They decided to make it part of the FairPlay codebase, including its obfuscation. Very Stupid. But just in case that weren&#8217;t enough, then they went ahead and tried to take down the <a href="http://bluwiki.com/go/Ipodhash">iPodHash</a> project which was attempting to reverse engineer the (annoyingly obfuscated) algorithm. Completely Stupid.</p>
<p>I had previously patched the check out in the MusicLibrary binary, and forgot to write it up. However, I just looked at it again, and it turns out that you can get it to work just by changing a simple XML file. I guess they didn&#8217;t really care if jailbroken iPhone users used third-party software.<br />
<span id="more-22"></span><br />
Here&#8217;s how: Edit <b>/System/Library/Lockdown/Checkpoint.xml</b>, find the <b>DBVersion</b> key, and change its value from <b>4</b> to <b>2</b>. Save and reboot. Voila! I haven&#8217;t tested this extensively, but it seems to work at least on 2.1 and 2.2. You can then use Amarok or any other libgpod app to transfer data to the device (using the usual sshfs mount trick which is documented elsewhere for 1.x iPhones)</p>
<p><b>Update</b>: abu from <a href="http://forums.winamp.com/forumdisplay.php?forumid=69">ml_ipod</a> pointed out that DBVersion 3 also works. This version includes the old hash which was already present in older versions. I have tested this to work on version 2.1 of the iPhone software.<br />
<b>Update 2</b>: DBVersion 3 works only on some devices, better stick with DBVersion 2.</p>
<div class="wp-caption aligncenter" style="width: 330px"><img alt="MobileMusicPlayer synced via Amarok" src="http://marcansoft.com/uploads/images/iphone-musicdb.png" title="MobileMusicPlayer synced via Amarok" width="320" height="480" /><p class="wp-caption-text">MobileMusicPlayer synced via Amarok</p></div>
]]></content:encoded>
			<wfw:commentRss>http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-iphone-2x/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>

