New Horizons

Welcome to my blog

My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
and FPGA.
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company


You are welcome to contact me
and ask questions or make comments
about my blog.


New Horizons
What's new
Starting a blog
Writing a blog
Using an RSS reader

Zynq Design From Scratch
Started February 2014
1 Introduction
Changes and updates
2 Zynq-7000 All Programmable SoC
3 ZedBoard and other boards
4 Computer platform and VirtualBox
5 Installing Ubuntu
6 Fixing Ubuntu
7 Installing Vivado
8 Starting Vivado
9 Using Vivado
10 Lab 1. Create a Zynq project
11 Lab 1. Build a hardware platform
12 Lab 1. Create a software application
13 Lab 1. Connect to ZedBoard
14 Lab 1. Run a software application
15 Lab 1. Benchmarking ARM Cortex-A9
16 Lab 2. Adding a GPIO peripheral
17 Lab 2. Create a custom HDL module
18 Lab 2. Connect package pins and implement
19 Lab 2. Create a software application and configure the PL
20 Lab 2. Debugging a software application
21 Running Linux from SD card
22 Installing PetaLinux
23 Booting PetaLinux
24 Connect to ZedBoad via ethernet
25 Rebuilding the PetaLinux kernel image
26 Running a DHCP server on the host
27 Running a TFTP server on the host
28 PetaLinux boot via U-boot
29 PetaLinux application development
30 Fixing the host computer
31 Running NFS servers
32 VirtualBox seamless mode
33 Mounting guest file system using sshfs
34 PetaLinux. Setting up a web server
35 PetaLinux. Using cgi scripts
36 PetaLinux. Web enabled application
37 Convert from VirtualBox to VMware
38 Running Linaro Ubuntu on ZedBoard
39 Running Android on ZedBoard
40 Lab2. Booting from SD card and SPI flash
41 Lab2. PetaLinux board bringup
42 Lab2. Writing userspace IO device driver
43 Lab2. Hardware debugging
44 MicroZed quick start
45 Installing Vivado 2014.1
46 Lab3. Adding push buttons to our Zynq system
47 Lab3. Adding an interrupt service routine
48 Installing Ubuntu 14.04
49 Installing Vivado and Petalinux 2014.2
50 Using Vivado 2014.2
51 Upgrading to Ubuntu 14.04
52 Using Petalinux 2014.2
53 Booting from SD card and SPI flash
54 Booting Petalinux 2014.2 from SD card
55 Booting Petalinux 2014.2 from SPI flash
56 Installing Vivado 2014.3

Chipotle Verification System

EE Times Retrospective Series
It all started more than 40 years ago
My first job as an electrical engineer
The Memory (R)evolution
The Microprocessor (R)evolution

Four soft-core processors
Started January 2012
Table of contents
OpenRISC 1200
Nios II

Using the Spartan-6 LX9 MicroBoard
Started August 2011
Table of contents
Problems, fixes and solutions

FPGA Design From Scratch
Started December 2006
Table of contents
Acronyms and abbreviations

Actel FPGA design
Designing with an Actel FPGA. Part 1
Designing with an Actel FPGA. Part 2
Designing with an Actel FPGA. Part 3
Designing with an Actel FPGA. Part 4
Designing with an Actel FPGA. Part 5

A hardware designer's best friend
Zoo Design Platform

Installing Cobra Command Tool
A processor benchmark

Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true

Stockholm by bike

The New York City Marathon

Kittelfjall Lappland

Tour skating in Sweden and around the world
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Books, photos, films and videos
Weather forecasts

38000 feet above see level
A trip to Spain
Florida the sunshine state

Photo Albums
Seaside Florida
Ronda Spain
Sevilla Spain
Cordoba Spain
Alhambra Spain
KittelfjÀll Lapland
Landsort Art Walk
Skating on thin ice

100 Power Tips for FPGA Designers

Adventures in ASIC
Computer History Museum
Design & Reuse
d9 Tech Blog
EDA Cafe
EDA DesignLine
Eli's tech Blog
FPGA Arcade
FPGA Central
FPGA developer
FPGA Journal
FPGA World
Lesley Shannon Courses
Mac 2 Ubuntu
Programmable Logic DesignLine
World of ASIC

If you want to be updated on this weblog Enter your email here:

rss feed

Thursday, April 12, 2012
Installing Cobra Command Tool in Ubuntu 11.10

Is it possible to install and run a more than 20 year old program in the latest version of Ubuntu (11.10 64bits). Let's find out. We will install the smart terminal program Cobra Command Tool which I develop more than 20 years ago. The program can be downloaded from my company web page:

Click the
Zoo Design button and then the Download button.

cobra_10.0ub.tar.gz and select Save Link as.

Use this command to unzip and unpack the downloaded file.

-->tar zxvf cobra_10.0ub.tar.gz

Here is the result.

Copy all the files to the installation directory and edit the startup script (cobra) to match this directory.

Move the startup script (cobra) to the bin directory and start Cobra using the command:

--> cobra &

Absolutly nothing happens, the Cobra.exe file is not found. The explanation is this. Cobra is compiled for a 32 bit Linux operating system and we try to run it in a 64 bit Linux system.

How to make 32-bit applications work on a 64-bit operating system

Here is a
Ubuntu help page describing how we can solve the problem.

Installing 32-bit shared libaries.

We start the Ubuntu Software Center and find the is32-libs and install them.

Installing in Ubuntu 13.10

In Ubuntu 13.10 and newer versions the ia32-libs are not available any longer. Use this command to load the 32 bit libraries we need:

sudo apt-get install libgtk2.0-0:i386

Let's try again.

--> cobra &

We are missing the library The Cobra program was written for the SUN OS 4 using the
xview toolkit. This toolkit is obsolete but it has been converted to the Linux OS and can be downloaded from here. We will download the 32 bit version of the libraries.

Installing the xviewg libraries

We unpack the downloaded package using the following command:

sudo dpkg -x xviewg_3.2p1.4-28_i386.deb tmp

We copy all the files in the lib directory to the cobra install directory. When we start Cobra the next time the program will find the xview library files using the LD_LIBRARY_PATH variable.

Installing the xviewg libraries in Ubuntu 13.10

In Ubuntu 13.10 the xviewg libraries can be installed directly using this command:

sudo dpkg -i xviewg_3.2p1.4-28_i386.deb

Installing font files

The Cobra program uses old xfonts with fixed sizes. xfonts-100dpi provides a set of bitmapped fonts at 100 dots per inch. In most cases it is desirable to have the X font server (xfs) and/or an X server installed to make the fonts available to X clients.

We install the fonts using the following commands:

sudo apt-get install xfonts-100dpi
sudo apt-get install xfonts-75dpi
sudo apt-get install xfonts-utils

To start the font server using the new fonts we have to reboot our system.

Starting Cobra

We are ready to start Cobra.

--> cobra &

This doesn't look so good. We need to fix the font sizes for the buttons and the console.


In the X Window System, the X resources are parameters of computer programs such as the name of the font used in the buttons,the background color of menus, etc. They are used in conjunction with or as an alternative to command line parameters and configuration files.

We add the following .Xresources file in our home directory:

We can use the command: xrdb .Xresources to enable the new settings. The next time we boot our system this command will be executed automatically during start up.

Now let's start Cobra again.

--> cobra &

This time everything looks just perfect. We have demonstrated that we can take a 20 year old program and run it in the latest Linux environment. This shows the power of unix and the X-windows system.

Now when we have Cobra Command Tool running we can learn more about all the features of the program by reading the
User's guide.

Posted at 17:20 by

December 24, 2014   07:19 AM PST
Hi Sven,

Worked for me on Ubuntu 14.04. Just to share.
Merry Christmas.

August 18, 2014   06:36 PM PDT
Ok, got it to work. I had the wrong directory in the text file and then missed the step about copying the cobra text file to ~/bin. Thanks for the tutorials.

August 16, 2014   02:53 AM PDT
I'm attempting to follow your tutorial but cannot start cobra. I am running a fully updated ubuntu 13.10 VM, installed libgtk2.0-0:i386, downloaded the 32 bit xview files and placed the contents of /lib in my cobra directory...

Typing "cobra &" returns
[1] 2840
command not found
[1]+ Exit 127

Any guidance would be appreciated

Leave a Comment:


Homepage (optional)


Previous Entry Home Next Entry