Wednesday, February 8, 2012

My life with Coherent, part 1

In the early 1990ies my company switched from an S/36 system to a Unix system. No one had any knowledge of that "alien" platform, so I became the expert to be. It was not entirely voluntary: I either made it work or I was fired.

Needless to say I spend lots of time behind the terminal, but it just wasn't enough. Working behind a $100,000 machine on a root account while barely knowing what you were doing was kind of intimidating. I was simply too reluctant to perform the necessary experiments.

In order to get more time and a less intimidating environment I started looking for alternatives, but I quickly found out there were few options. There were some MS-DOS based products that allowed me to write shell scripts, but that just wasn't the real deal. Xenix and SCO were too expensive. And then I found out about Coherent.

Coherent is a full fledged Unix that runs on a simple 386 with a few megabytes of memory - incredible, but true. The kernel is just a few hundred KB, so it boots in an instant. It lived happy together with MS-DOS in its own 40 MB partition. But the best thing was its price: only $100. Needless to say I spend a lot of hours with that little beast, porting my C programs and UUCPing with that "monster" machine back at work.

But every machine comes to a grinding halt at some moment in time. Getting a new PC wasn't a problem, but when I tried to reinstall Coherent I found that it didn't support my new IDE drive. Too bad, but since I had become a proficient Unix system admin I really didn't need it anymore.

Still, with every new release of QEMU or VMware I tried to reinstall it - with little result. That is, until QEMU 0.14 was released. After the arduous task of installing Coherent it bombed out just before the final reboot. But the Dutch don't throw away things that easily. I didn't delete the image, instead I simply waited for the next iteration of QEMU.

When I started it, it seemed it hang right away, but the QEMU monitor told another story. It was still alive. It was reading the disk, but very, very slowly.

Hours later the login prompt appeared and I logged in. The whole thing worked, but it was very sluggish. After having worked with it for a little while it became a bit more responsive. It didn't take me too long to figure out it was the IDE emulation that was slowing it down, reading about 1K a second. But once a file was in cache there were hardly any performance issues.

However, when starting up Coherent performed an 'fsck', which made booting a bit tiresome - I assure you that reading 7 megs at 1 KB/s is no fun. The easiest thing was to remove the 'fsck' check, which was easy enough. A quick edit of 'brc' was sufficient. Now I could login after Coherent had read only 150 KB, which was a significant improvement.

But I still wasn't happy. Every time I rebooted I had an empty cache. There had to be another way. Yes, there was, but for that I had to turn to QEMU. QEMU allows you to make a snapshot of the whole virtual machine - memory, CPU, the whole shebang. That not only allowed me to "boot" instantly, but also with the disk cache intact. Ok, now we're talking!



Since the standard Coherent C compiler only supports K&R C, almost all my C programs have a "-DARCHAIC" switch, which enables K&R prototypes. Even after 15 years I still maintain them, so porting my 4tH compiler shouldn't be very difficult. It wasn't. In these 15 years after more than doubling the code base I had only made about 10 syntax errors, which were quickly fixed.

But still there was a problem. Sure, I could use a raw floppy image to exchange files between the host and the VM, but since you can't make a snaphot of a raw floppy I had to reboot the VM after each and every transfer, which kind of defeated the sense of making snapshots.

The solution was to startup the VM with a QCOW2 floppy, which served no other purpose than to define a floppy device in the VM. You can not easily mount a QCOW2 image and so it is consequently not very well suited for file transfer.

Once the VM is up and running you can exchange this virtual floppy for a raw version by switching to the QEMU monitor and issuing:
change floppy0 fat16.img

When you want to take a snapshot you simply return to the dummy floppy by issuing:
change floppy0 dummy.dsk

And subsequently save the snapshot by issuing:
savevm test0

After that I was ready to rock 'n roll. It took me about an hour or so to port my compiler and transfer the executables back to the host. Furthermore, I installed another more modern kernel, applied some Y2K patches and customized my Coherent 4.2 installation.

In the next part of this series I will describe this in more detail and - even better - give you the opportunity to try it for yourself. All perfectly legal, that is..!

Wednesday, February 1, 2012

Venn diagrams: the intersection of morons and judges

Few people know it, but the Internet as we know it, has its roots in military technology. It's predecessor was called ARPANET, which was funded by the Defense Advanced Research Projects Agency of the United States Department of Defense. Some of its design objectives were:
  • Providing for host-to-host "pipelining" so that multiple packets could be rerouted from source to destination at the discretion of the participating hosts, if the intermediate networks allowed it.
  • Gateway functions to allow it to forward packets appropriately. This included interpreting IP headers for routing, handling interfaces, breaking packets into smaller pieces if necessary, etc.
  • Each distinct network would have to stand on its own and no internal changes could be required to any such network to connect it to the Internet.
  • Communications would be on a best effort basis. If a packet didn't make it to the final destination, it would shortly be retransmitted from the source.
  • There would be no global control at the operations level.
During the Gulf war the US army wondered why it was so difficult to take out the Iraqi network. What were these guys using? Later they found it were just off the shelf hardware and software components, stuff any ordinary consumer could get his hands on.

A few years later politicians thought it was a good idea to unleash this military grade technology onto the world, just like they thought it was a good idea to introduce the Euro. In both cases, without thinking about the consequences. The impact of a decentralized, open architecture has become clear now - and they don't like it. And worse, they are unable to keep up.

Yes, Pandora's box is wide open and they are struggling to contain the monster. But they try and manage to make themselves ridiculous and less credible with every step of the way. You can't complain about states censoring the Internet - for different reasons, agreed - and proposing similar legislation at the same time. In the US you have SOPA, PIPA and ACTA and in the Netherlands we have judges like mr. P.H. Blok, mr. R. Kalden and mr. M.P.M. Loos.

They decided not only that IP addresses 194.71.107.15, 194.71.107.18 and 194.71.107.19 had be blocked by ISP's, but also gave BREIN (the Dutch equivalent of the MPAA) the authority to add any IP address they want to that list, which means that in principle they can take out any website at will without ever having to go to court again. Needless to say that these judges not only proved they are completely clueless about the nature of the Internet, but they also violated every rule in the book.

Imagine there was a bookstore selling counterfeit books, would those same judges give a plaintiff the authority to simply close up any bookstore he wants? Of course not! As a matter of fact, they gave BREIN the possibility to change the verdict of the court. Which - by the way - is in conflict with European jurisdiction. Speaking of Europe, Neelie Kroes, the grand lady who got Microsoft on its knees, commented: "Speeding is illegal too: but you don't put speedbumps on the motorway".

That the court came to this decision was no big surprise. One of the judges, P.H. Blok, is also employed (for a fee) by Wolters Kluwer, one of the largest publishing companies in the world. Why he was wasn't substituted by another judge is anybodies guess. If this isn't a conflict of interest, what is?

But we cloggies don't take such violation of our rights laying down. In the days that followed, tutorials popped up on how to install TOR and VPN networks or use proxies and anonymizers. Mirrors were created, proxies installed, by the time the "offical" site went on black there had never been so many ways to reach the Pirate Bay.

Tim Kuik, spokesman of BREIN, commented: "Smart hackers will always find ways to circumvent measures like this." So according to Tim Kuik, if you're able to click this link, you're an accomplished hacker.



What were these guys thinking? Either they knew that their measures were ineffective and consequently merely symbolic or they were completely ignorant of what the Internet is and how its community acts on threats. Either way, it is unworthy of a judge who considers himself to be an expert on the field of IT and law.

So what's next? Outlaw links to proxies and anonymizers? Outlaw access to proxies and anonymizers? Outlaw sites who offer proxies, anonymizers, TOR or VPN? Outlaw technologies like proxies, anonymizers, TOR and VPN? Outlaw writing about proxies, anonymizers, TOR and VPN? Maybe I should emigrate to North-Korea or China. As long as you leave politics alone, you can at least blog about technology!

Of course it doesn't stop there. The weakest link in the current torrent architecture are the centralized torrent repositories. However, other technologies will emerge that eradicate this flaw as well and become completely decentralized. All that is left then is deep packet inspection, a technology that ironically has recently been banned by that same juridical system.

End of story.

Update: One of the blocked IP addresses: a list of computers. The other one: the word "Yeah". This proves how little the verdict has to do with the actual content of a site. There is nothing illegal down there. It has just been taken down because they are in the IP range of the Pirate Bay. And yes, you XS4ALL and Ziggo subscribers can click too..

Friday, January 20, 2012

Fight SOPA/PIPA, change your license

All over the free world, government laws and court decisions are limiting our access to free Internet. Not that these measures are very useful, most of us hackers are able to circumvent them within minutes. But in essence, these counter measures are simply work-arounds - they do not eliminate the root cause.

The root cause are the big media moguls who successfully lobby our governments and judges to adopt unconstitutional new laws and regulations. Consequently, they are by definition an anti-democratic force. No, it's not about the artists (as a matter of fact, most of them can be considered victims of this industry), it's not about IP (they violate IP laws themselves on a daily basis - just count the lawsuits), it's just about MONEY. Think about it: these industries are obviously willing to trade in our most fundamental civil rights just for a little extra cash. No, they're not the kind of people only a mother can love - they already sold their mothers.

Our politicians are no better. Instead of defying the pressure of a dying industry they have chosen to simply sell out their voters. Often without even having any idea which consequences their decisions may have on their citizens, their own information industry or even the very reputation of the nations they should represent. Ignorance may be a bliss, but not in this case.

So far the community has responded in a variety of ways:
  • Shutting down their own websites in protest;
  • Petitioning;
  • Attacking government and industry websites;
  • Educating users on how to circumvent blocks;
  • Developing new ways to make it even more difficult to block free Internet access.
However, there is one card we haven't played yet. The FOSS community has achieved complete independence from proprietary software. I predict the music and movie industry will follow in the next few decades. They won't disappear, but they will have to compete and one day we will win.

In the meantime we will have to ensure that we will continue to have free and unlimited access to the Internet, our information highway. It is no secret that governments and even the music and entertainment industry itself have benefited from everything the FOSS community has produced. And we can stop that.

GPLv3 was created to defeat any attempts to make free software less free. A new license may prevent governments and the industry to make the Internet less free. Simply don't allow them to use our software anymore. Change the license.

I know that it is one of the pillars of Free Software - anyone may use it, no restrictions. But as I said, I don't consider it a permanent measure. Just until every attempt to restrict the Internet has ceased permanently. Just until the right to free access to the Internet is part of every international treaty and constitution.

I don't know about you, but I just don't feel comfortable someone who denies me to exercise one of my most basic rights is happily using my software..