New Horizons






<< November 2006 >>
Sun Mon Tue Wed Thu Fri Sat
 01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30


Table of content

New Horizons
What's new
Starting a blog
Writing a blog
I got a job

SystemC
SystemC from scratch. Part 1
SystemC from scratch. Part 2
SystemC from scratch. Part 3

ASIC/FPGA Design
Table of content
Index
FPGA design from scratch. Part 1
FPGA design from scratch. Part 2
FPGA design from scratch. Part 3
FPGA design from scratch. Part 4
FPGA design from scratch. Part 5
FPGA design from scratch. Part 6
FPGA design from scratch. Part 7
FPGA design from scratch. Part 8
FPGA design from scratch. Part 9
FPGA design from scratch. Part 10
FPGA design from scratch. Part 11
FPGA design from scratch. Part 12
FPGA design from scratch. Part 13
FPGA design from scratch. Part 14
FPGA design from scratch. Part 15
FPGA design from scratch. Part 16
FPGA design from scratch. Part 17
FPGA design from scratch. Part 18
FPGA design from scratch. Part 19
FPGA design from scratch. Part 20
FPGA design from scratch. Part 21
FPGA design from scratch. Part 22
FPGA design from scratch. Part 23
FPGA design from scratch. Part 24
FPGA design from scratch. Part 25
FPGA design from scratch. Part 26
FPGA design from scratch. Part 27
FPGA design from scratch. Part 28
FPGA design from scratch. Part 29
FPGA design from scratch. Part 30
FPGA design from scratch. Part 31
FPGA design from scratch. Part 32
FPGA design from scratch. Part 33
FPGA design from scratch. Part 34
FPGA design from scratch. Part 35
FPGA design from scratch. Part 36
FPGA design from scratch. Part 37
FPGA design from scratch. Part 38
FPGA design from scratch. Part 39
FPGA design from scratch. Part 40
FPGA design from scratch. Part 41
FPGA design from scratch. Part 42
FPGA design from scratch. Part 43
FPGA design from scratch. Part 44
FPGA design from scratch. Part 45
FPGA design from scratch. Part 46
FPGA design from scratch. Part 47
FPGA design from scratch. Part 48
FPGA design from scratch. Part 49
FPGA design from scratch. Part 50
Links
Acronyms and abbreviations
XCell Journals
CAD
A hardware designer's best friend
Zoo Design Platform
Linux
Installing Ubuntu Linux on a MacBook
Customizing Ubuntu Linux 1
Customizing Ubuntu Linux 2
Upgrading to Ubuntu 7.04
Install Ubuntu 7.04 with VMware
Making the virtual machine run faster
Ubuntu Links
A processor benchmark
Mac
Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true
Wireless freedom
Running
The New York City Marathon
Skiing/Skating
Kittelfjäll Lappland
Tour skating in Sweden and around the world
Top
Introduction
SSSK
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Calendar
Links
Books, photos, films and videos
Weather forecasts
Travel
38000 feet above see level
A trip to Spain
Florida the sunshine state


Example Files
Verilog Testbench Body
Verilog Testcase
Verilog Setup
Simulation Result File
Simulation Report File




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


Favorites
Adventures in ASIC
ChipHit
Computer History Museum
Community of Sweden
DeepChip
Design & Reuse
Dilbert
EDA Cafe
EDA DesignLine
Embedded.com
EmbeddedRelated.com
FPGA Arcade
FPGA Blog
FPGA Central
FPGA Journal
FPGA World
MacApper
Mac geekery
Mac 2 Ubuntu
Get Perpendicular
Programmable Logic DesignLine
History of Linux
OpenCores
ORSoC
Simplehelp
SOCcentral
World of ASIC



New York City Marathon




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



rss feed



 
Nov 19, 2006
Customizing Ubuntu Linux 1
After installing Ubuntu Linux on my MacBook I need to add more software and to fix a number of setups to make everything run smoothly. In this chapter I will describe the process to make this Linux installation perfect for my needs. I had much help from reading the book Ubuntu Hacks by Jonathan Oxer, Kyle Rankin and Bill Childers. Here is a link to the Unofficial Ubuntu 7.04 Starter Guide.

Look for help

There are many places where you can look for help when you have a problem with Ubuntu Linux. Here are some places:
Software packages

One of Ubuntu's key strengths is the quality of the software packages that are included in the main distribution. They have been relentlessly tested, and come together to form a rock-solid Linux distribution. Although the main Ubuntu distribution is integrated and very solid, that stability comes at a price. Many of the optional packages you may want have been excluded from the main distribution. There are several ways to download and install packages. The most common way is to use the command <apt-get>. The use of <apt-get> and other ways of managing packages are well described in the book Ubuntu Hacks (see Package Management).
To install a new package use the following command :
sudo apt-get install <package-name> or use the use the Synaptic package manager found in the menu: System->Administration->
Synaptic Package Manager

Here is a list of packages I have added and a description of what they are for:

 Package  Description
build-essential GNU C compiler gcc, g++, make
libx11-dev Makes it possible to run X11 applications
libdb-4.1 Needed by Xilinx Coregen
alien Convert rpm package to debian package
sun-java5-jre
Latest version of Java from SUN
sun-java5-plugin
Latest version of Java plugins
mdns-scan
Browse Zeroconf services
avahi-discover
Zeroconf support
avahi-utils
Zeroconf support

libdb-4.1 is an old package not easily found. I downloaded the file libdb4.1-4.1.25-9mdk.i586.rpm and then used the program alien to convert the rpm package to a debian package using the command: sudo alien -c libdb4.1-4.1.25-9mdk.i586.rpm. To install the debian package I used the command: sudo dpkg -i libdb4.1-4.1.25-10_i386.deb.

To install the latest version of Java use the following command:
sudo apt-get install sun-java5-jre sun-java5-plugin
To install Limewire read
Torrentfreak.

Other must-have tools and programs.


Ubuntu Linux comes standard with the gedit text editor. My favorite text editor for many years is nedit. To download nedit go to  Nedit home page. Click the download tab and in the download page click stable binaries and download nedit-5.5-Linux-x86.tar.gz

Just found out about a new text editor called
jEdit. It is written in Java and runs on Mac OS X, Linux, Unix and Windows. I am going to try it.

Portable Document Format (PDF) is an open file format created and controlled by Adobe Systems, for representing two-dimensional documents in a device independent and resolution independent fixed-layout document format.
Xpdf is an open source PDF viewer for the X Window System and Motif. Xpdf runs on practically any Unix-like operating system. To download Xpdf go to the Xpdf download page. Ubuntu comes with the Evince pdf reader installed.


 Program  Decription  Download
 nedit Text editor
 www.nedit.org
 jEdit Text editor   www.jedit.org
 Xpdf PDF reader
 http://www.foolabs.com/xpdf/download.html
 Inkscape Vector Graphics Editor
http://www.inkscape.org

Default shell

In Ubuntu the default shell for /bin/sh is
dash. If you want to use bash in your script files use /bin/bash.

Keyboard mapping

The MacBook keyboard is setup to run Mac OS X and many keys are not defined the way Unix keyboards are setup. It is possible to map the keys any way you want and there is not one standard setup. I will show my setup and you can modify it to fit your needs.

The xmodmap program is used to edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms. It is usually run from the user's session startup script to configure the keyboard according to personal tastes. To map a key to a symbol you have to find the keycode and the keysum. To every key you can map up to four different symbols. To map key "9" to the four symbols : 9 ) }] you use the following command:

keycode 18 = 9 parenright braceright bracketright

To find out the keycode for a key you can use the program xev. Start xev and click in the small window, then hit a key and you will see the keycode and keysum displayed. Put all the mapping commands in a file called .Xmodmap and place this file in your home directory. When you login next time you will be asked to include the .Xmodmap file. You can also setup the mapping by running the command: xmodmap ~/.Xmodmap. To see the current mapping execute : xmodmap -pk. The keysum names can be found in the file keysumdef.h. Remove XK_ before you use the name.

Here is my keyboard mapping for my MacBook (I have a Swedish keyboard):

 Keycode  Default  Shift  Alt  Alt shift
64 (Alt left)
Mode_switch



113 (Alt right)
Mode_switch



11
2
quotedbl "at @
12 3 numbersign #
asciitilde ~  
13 4 EuroSign €
dollar $
 
17
8 parenleft (
bracketleft [
braceleft {
18
9
parenright )
bracketright ]
braceright }
35 (¨^)
backslash
bar |


This is what my .Xmodmap file will look like:

! Map left alt key as mode switch
keycode 64   = Mode_switch
! Map right alt key as mode switch
keycode 113 = Mode_switch
keycode 11    = 2 quotedbl at
keycode 12    = 3 numbersign asciitilde
keycode 13    = 4 EuroSign dollar
keycode 17    = 8 parenleft bracketleft braceleft
keycode 18    = 9 parenright bracketright braceright
keycode 35    = backslash bar

Changing screen resolution

In the latest release of Parallels Desktop (build 3150) this problems has been fixed. Parallels will now set the screen resolution to match the display connected.

When you boot Ubuntu Linux for the first time on your MacBook the maximum screen resolution is set to 1024x768. What happens if you connect an external display with a higher resolution. I have a 23 inch Cinema display (1920x1200) hooked up to my MacBook and without changing the resolution I can't use the fullscreen mode.
It is not possible to set the resolution higher than 1024x768 from the menu System->Preferences->Screen Resolution.
To change the maximum resolution you have to run the program:
sudo dpkg-reconfigure -phigh xserver-xorg.
After starting the program a window will be displayed and ask you for a video card driver, leave the vesa marked and then hit Return. In the next window you can enter the video modes to be used . Go down using the arrow down key and when you reach the resolution you would like to use mark it with the space key and then hit Return. The setup will be written to the file /etc/X11/xorg.conf. Next time you boot Ubuntu Linux you will have the maximum resolution changed.

File sharing between Mac OS X and Ubuntu

Parallels has not implemented the same simple file sharing system they have for Windows in Parallels Desktop. But there is a good substitute which I will show you here, the
SharePoints program. The SharePoints program lets you setup one or more shared folders in Mac OS X that can be accessed in Ubuntu Linux. Here is a short descriptions on how to use SharePoints to setup file sharing. But first we have to enable personal file sharing and Windows file sharing in the Mac OS system settings:


  • In Mac OS X download and install the SharePoints program.
  • Start the program.

  • Select a folder to used as a shared folder. I used the Public folder.
  • Give it a name (ParallelsDesktop)
  • Enable both AppleFileServer sharing and Windows sharing.
  • Set the permissions in the popup window

  • Allow Windows guests and set inheritance of permissions if needed.
  • You may have to set group permissions to r/w to allow writing files to Mac OS X.
  • Save the setup.
  • Start Ubuntu Linux and open the Networks Server window in the Places menu
  • Hopefully you will see the shared folder (SVEN-KE-ANDERSS).
  • If you are using VMware double-click the WIndows Network icon.
  • Double-click to look inside and read or write files from/to this folder. Voila!



File sharing using secure shell (ssh)

Secure Shell or SSH is a set of standards and an associated network protocol that allows establishing a secure channel between a local and a remote computer.
The first thing we have to do on the Mac side is to enable remote login (fjärrinlogging) and to find the ip-address (1x.z.1.y). We should also add the .ssh directory in our home directory.




Here is good
description on how to setup and use ssh. Let's follow it.
  1. Open a terminal in Ubuntu Linux
  2. Generate a new key. Use the command ssh-keygen -d
  3. Copy the key to the Mac OS X host using the secure copy cammand.
  4. scp ~/.ssh/id_dsa.pub 1x.z.1.y:.ssh/authorized_keys2
  5. We are now ready to test the ssh command: ssh -X 1x.z.1.y or use ssh -X userid@1x.z.1.y to connect to user <userid>.
  6. We are now remotely logging in to the Mac OS X host and can do almost anything, copying files, starting programs and much more. The DISPLAY variable is automatically set to display windows in the Ubuntu desktop.
  7. If you execute the command echo $DISPLAY you should see something like this: loacalhost:10.0. If the DISPLAY variable is not set read this link to learn what to do.
  8. To exit the ssh session use the command: exit or logout

Printing using an Airport Express

I use an
Airport Express for wireless printing in Mac OS X. Apple uses a technique they call Bonjour to allow printing using a usb printer connected  to their Airport wlan hub. Bonjour lets you create an instant network of computers and and smart devices just by getting them connected to each other. It uses something called Zeroconf or Zero Configuration Networking to setup everything.
To print from Ubuntu Linux to a USB printer connected to an Airport Express we will ignore the Zeroconf method and use the standard
Common Unix Printing System (CUPS) instead. To use CUPS we first have to find the IP address of the Airport Express unit. When we open the Airport Utility program under Mac OS X and scan the network for Airport Extreme and Airport Express units, we will see the following display:

   


The IP address
of the Airport Express is 10.0.1.200.  When we have the IP address we can scan this address to find all open ports. The port scan function built into the Network Tools (System->Administration->Network Tools) utility didn't display all open ports so I decided to install nmap instead. I downloaded and installed nmap-4.20-1.i386.rpm and here is the print out from the program:

==> nmap 10.0.1.200                                                                                         

Starting Nmap 4.20 ( http://insecure.org ) at 2007-03-05 17:30 CET
Interesting ports on 10.0.1.200:
Not shown: 1693 closed ports
PORT      STATE SERVICE
53/tcp    open  domain
5000/tcp  open  UPnP
9100/tcp  open  jetdirect
10000/tcp open  snet-sensor-mgmt

Nmap finished: 1 IP address (1 host up) scanned in 22.035 seconds

The port 9100 is used for printing and it uses a HP jetdirect printer driver. We are now ready to setup for printing to my Epson Stylus Photo 870. To add a new printer open System->Administration->Printing
. Double-click the New Printer icon and follow the instructions.



  1. Select Network Printer
  2. Select HP JetDirect
  3. Enter IP address of Airport Express or Airport Extreme where the printer is connected.
  4. Port number should be 9100
  5. Click Forward

  1. Select printer manufacturer
  2. Select printer model
  3. Select driver type
  4. Click Forward

  1. Enter printer name or use default name
  2. Enter descriptive text
  3. Enter printer location
  4. Click Apply


Select the Stylus-Photo-870 and make it the default printer (Edit->Make D
Posted at 08:17 am by svenand

Lycosid
November 19, 2007   04:20 PM PST
 
I just made the switch from windows to ubuntu and couldn't do it without excellent tutorials like this. Thank you!
bostoys
May 8, 2007   07:26 PM PDT
 
thank you so very much. you have infinitely simplified the process.
svenand
April 26, 2007   03:44 PM PDT
 
I had this problem before build 3150. Have you tried the method described above in Changing screen resolution.
JR
April 23, 2007   04:47 PM PDT
 
Using Parallels build 3188, I can't get the resolution to display anything other than 1024x768. Any advice?
Rem
March 12, 2007   09:42 AM PDT
 
works like a dream! thanks for the help!!!
 

Leave a Comment:

Name


Homepage (optional)


Comments




Previous Entry Home Next Entry