ECE472/572 (UCLX) Assignment 1

Prepare for the lab

Answer these questions while doing this lab – they will help you understand the procedure and better prepare for the tests.

Activity (30pts.)

This Assignment task has been reviewed and enhanced by Mr. Jonathon Taylor, class of 2009.

You do not have to set up a virtual machine; you can set up a dual boot system, or simply use the existing Ubuntu setup in the computer lab. However, you still need to get familiar with the setup procedure one way or another. You will find it convenient to do all the lab exercises using your computer except for testing Microcontroller Linux on the embedded system in the lab. As for this lab, you need to turn in only a proof that you are able to use Linux, open a terminal window, edit, compile and run a simple program written either in C or C++, and capture a screen shot.

Setting up Ubuntu inside a virtual machine

  1. Skip this step if you do your work in the computer lab as the VM is already installed:
    Download and install Oracle's Virtual Machine - Virtual Box from https://www.virtualbox.org/. It is a desktop application. Alternatively use VmWare's Virtual Machine - VMWare Player from http://www.vmware.com/
  2. The guest OS will be a lightweight distribution of Ubuntu 16, so start downloading now
    http://cdimage.ubuntu.com/xubuntu/releases/16.04.1/release/xubuntu-16.04.1-desktop-amd64.iso or
    http://cdimage.ubuntu.com/xubuntu/releases/16.04.1/release/xubuntu-16.04.1-desktop-i386.iso
    to have it handy for later step. To make your future life easier make sure that you download the desktop version and not server version of Ubuntu.
    In the computer lab: Ubuntu *.iso files are already in folder C:\UBUNTU.
  3. Mean while before your download is being completed start working on the virtual machine. Choose "Create a new Virtual Machine"
    1. "I will install OS later".
    2. "Linux" type of OS, Version "Ubuntu" or "Ubuntu64" (ubuntu64 only if you are running a 64-bit OS as a host.)
      • If you cannot choose 64-bit operating systems you need to restart your computer, run BIOS setup before starting your operating system, and enable virtualization support.
    3. Pick a name for your virtual machine, and remember the location so that you could later inspect the files supporting your machine.
      If you are experimenting in the lab, place the files in a folder on the Desktop.
    4. Hard drive
      • you need at least 8GB total hard drive space for playing with Linux, and for the first four labs, and to do only the first parts of Lab 8 through 12.
      • you need at least 20GB plan to complete Lab 5 (recompile Kernel for your OS)
      • you need 16GB to 20GB to do Lab 6, and continue full development related to microcontroller Linux in the second parts of Lab 7 through 12 even if you delete your Lab 5 work.
        If your hard drive space is a problem then you could do these in the lab instead as you would eventually need to test your work on the embedded system there.
      • Your hard drive will not be expanded immediately (unless you request to do so for the sake of faster performance). It will grow as necessary. Because of that do run disk defragmentation program on your host machine every now and then.
    5. Customize hardware
      • Memory size is NOT the amount of RAM in your PC! This is the amount of RAM you want to dedicate to the Virtual installation. It is recommended to leave a minimum of 512MB for the host operating system use (i.e. for Windows) and allow the guest system (i.e. Ubuntu Linux) to use the reminder if necessary.
        For our purposes (software and operating system development) we need at least 1024MB, preferably 2048MB or more RAM for smooth operation and to get away without a memory swap file.
      • Remove printer, floppy, e.t.c.
      • Consider disconnecting the real DVD drive, and connect to the *.ISO file as necessary.
    6. By the way, have your Ubuntu *.ISO file download that you started a while ago complete by the time you read this?
    7. You can always customize the virtual machine later as long as it is not running. It would be hard to change the hard drive though, especially to shrink it.
  4. Start the virtual machine. Start the Ubuntu install process. You can use the automatic install process. At some point you will be asked about the destination hard drive. Choose "other" solution and then configure the hard disk space manually: select no swap file, and the whole space as one ext4 partition mounted as / ..
  5. Reboot the virtual machine computer and log in into Ubuntu.
  6. In case of problems with screen resolution when running inside VirtualBox: (Similar solutions are available for VmWare.)
    1. Open terminal window and run:
       sudo apt-get install virtualbox-guest-dkms
    2. Restart the machine and test if the screen can be enlarged after logging in.
      In case the procedure above did not work:
      1. sudo apt-get purge virtualbox-*
      2. In the virtual box MENU → devices → Inser guest additions CD image
      3. cd /media/your_user_id/<hit TAB>
      4. sudo ./VBoxLinuxAdditions.run
      5. and restart the virtual machine.
  7. In case your OS GUI responds slowly inside of the virtula machine install a lightweight user interface. Run the update below, log out, select a different GUI and log in again:
    sudo apt-get install gnome-session-fallback
  8. Update the OS. You will see a pop up box alerting you to probably just two updates available. If only that were all. After you complete the first updates, check again for updates. Select and update all. This will take a significant amount of time, and does not need to be attended. Find something to keep you busy for a while.
  9. Under the application menu, select Add/Remove. Find the Gnome Partition Manager and install it. (This package is an application so it can be installed from the console, but you should explore the graphical interface as well.)
  10. To clean up cached installation files open a terminal window and run: sudo apt-get clean.
  11. If you're having problems with the screen size, The default is 800x600. It won't stretch. Use Menu → Settings → Display → screen resolution to change the window size, then maximize the window.

Additional configuration that needs to be applied to the system

Attention. In case your update fails due to an unrecognized package name, or package unavailable, repeat the command with that particular package name removed. Then inspect the spelling of the failed package name and try to install it separately. In case of error message stating that one (or more) package cannot be found, repeat the installation command without listing that package. This request applies to all future lab instructions as well until the end of the semester.

  1. sudo apt-get update
  2. sudo apt-get install grub2 gparted
  3. sudo apt-get install gedit gedit-plugins
  4. sudo apt-get install build-essential gcc g++ gcc-doc
  5. sudo apt-get install git git-gui
  6. Did you remember to download and apply the system updates? It can be done from the console:
    sudo apt-get update
    sudo apt-get upgrade

Proof of work

As a proof of work please write a simple program in C or C++ that prints your first and last name to the standard output (printf/cout). Open the program source code in a text editor, recompile the program again and run it in the console window, rearrange windows that both of them are visible at the same time, and capture the entire Linux desktop screen and save as PNG or JPG file. You can either capture the screen using Ubuntu screen capture, or if you run a virtual machine, you could use Windows PrintScreen feature.

Submission

Drop off the screen shot image in PNG or JPG file format in the corresponding assignment drop box on Sakai.

Thank you.

web site front local main page local list page general bookmarks software bookmarks go back copyright info