User Tools

Site Tools


journal:spring2011:jr018429:start

John Rine Spring 2011

CSIT 1320 HPC 0

CSIT 2048 HPC 2

CSCS 2650 Computer Organization

Introduction

<font color="red" size="+1"><b><i>Hello! I am John Rine, and you are not!</i></b></font>
<font color="green" size="+1"><b><u>I hope that these color changes will unlock the ALTER journal achievement!</u></b></font>
Like the rest of you, I am interested in computers and software. I also like electronics. I have an FCC GROL license and an Amateur Radio license. Last semester, I graduated from the Electrical Technology-Electronics AAS and General Studies AS programs Cum Laude at Corning. I have one more year to go in the IT-HPC program. This semester is going to be very interesting, nothing but projects in a field that I love. I am, however, a bit apprehensive about these projects as think I am in a little over my head… I usually start the semester this way, but end up doing well. I really enjoy being around professors and students who are enthusiastic about their field of study, and that is the way the professors and students of Computer Science/IT at Corning are. Enthusiasm is infectious! I look forward to meeting and networking with others in these fields of study. Like the rest of you, I hope I will be able to find work in this field when I graduate; hopefully by that time, the economy will have improved enough that we will all find something that is rewarding. I do no claim to be an expert programmer or systems analyst, but I can be of assistance, please feel free to call on me.

My Portfolio is available at: http://www/user/jr018429/portfolio
My Wiki is available at: http://lab46.corning-cc.edu/user/jr018429/start
My Web page is available at: http://lab46.corning-cc.edu/~jr018429/

Week 1 Journal Entry

CSIT 1320-HPC Fundamentals
In order to meet the requirements of the Linux/*BSD Desktop install project described on the Linux/*BSD Desktop Web page ( http://lab46.corning-cc.edu/haas/spring2011/hpc0/projects/desktop_install ), I installed Linux Debian “Squeeze” with kernel version 2.6.32 on the PC labeled “John Rine HPC 2011”. Jesse Short and I are also using this computer to develop a monitoring facility for a hydroponics garden. I will, however, have to verify that the install meets all of the requirements listed on the desktop install project page before asking the instructor to review it.
The install goes like this:

  1. Turn on the PC.
  2. At the prompt, press F12 to go to the BIOS setup screen.
  3. Arrow down to selection #7, “System Setup” and then press enter.
  4. Arrow down to the “Disk Configuration” item and press enter. A popup screen will appear.
  5. On the popup screen, arrow down to “Primary Master Drive” and press enter. A popup screen appears.
  6. On the popup screen, arrow to (if required) “Drive Type”; using the right or left arrow keys, set to the type “Auto”. Press enter to exit the second popup; press escape to exit the first popup.
  7. On the BIOS setup main screen, arrow down to “Boot Sequence” and press enter. A popup screen appears.
  8. On the popup screen, using the +/- arrow keys, move the “Integrated NIC” item to the top of the list. Make sure it is enabled (square root symbol directly to the left of this item). If it isn't enabled, use the space bar to enable it. Press enter to exit the popup window.
  9. On the BIOS setup main screen, arrow down to the “Integrated Devices (LegacySelect Options)” and press enter. A popup screen appears.
  10. On the popup, arrow down to “Network Interface Controller” item. Using the right or left arrow keys, set the network interface controller to “On w/PXE”.
  11. On the same popup screen, arrow down to the “Onboard Video Buffer” item and using the right or left arrow keys, set the video buffer size to 8MB. Press enter to exit the popup.
  12. On the BIOS setup screen, arrow down to the “IDE Hard Drive Acooustics Mode” item. using the right or left arrow keys, select “Quiet”.
  13. Press escape to exit the bios setup screen. Popup appears.
  14. On the popup screen, arrow to (if required) the “Save Changes and Exit” item. Press enter to exit the BIOS setup screen.
  15. Computer reboots.
  16. Next, the Lair Network Boot Menu loads.
  17. Select “Debian/i386 Netboot” and press enter.
  18. Arrow down to “Install Squeeze/testing [text] and press enter.
  19. At this point, the installation begins (defaults were selected throughout the installation).
  20. The “Select a language” screen is displayed. The default is “English”, press enter to select this item.
  21. The “Select a location” screen is displayed. The default is “United States”, press enter this item.
  22. The “Select a keyboard layout” screen is displayed. The default is “American English”, press enter this item.
  23. The “Configure the network” screen is displayed. On this screen, the Host name: “dhcp-175” is entered automatically. press enter to continue.
  24. The “Configure the network” screen is displayed. On this screen, the Domain name: “offbyone.lan” is entered automatically. Press enter to continue.
  25. The “Choose a mirror of the Debian archive” screen is displayed. The default is “United States”. Arrow up to “Enter information manually” item and press enter.
  26. The “Choose a mirror of the Debian archive” screen is displayed. The Debian mirror host name: “mirror” is entered automatically. Press enter to continue.
  27. The “Choose a mirror of the Debian archive” screen is displayed. The Debian archive directory: ”/debian/“ is entered automatically. Press enter to continue.
  28. The “Choose a mirror of the Debian archive” screen is displayed. HTTP proxy information is blank by default. Press enter to continue.
  29. In the first installation od Debian Squeeze, the installation continued from here, however during the second installation, the installation failed because a file could not be insalled from the network archive. This was because there was a newer version that was avalable. When the failure occured, the installer is prompted to either retry or change the mirror. During the second installation the mirror was changed to thr RIT mirror.
  30. Next, the “Set up users and passwords” screen is displayed. The Root password I entered was “bob”.
  31. The “Set up users and passwords” screen is displayed. The installer is prompted to re-enter the password. I entered entered “bob”.
  32. The “Set up users and passwords” screen is displayed. The installer is prompted to enter “The full name for the new user:” I entered “bob” during the second installation. During the first installation, I entered “John T. Rine”.
  33. The “Set up users and passwords” screen is displayed. The installer is prompted to enter the username for the account. I entered “bob” during the second installation. During the first installation, I entered “john”.
  34. The “Set up users and passwords” screen is displayed. The installer is prompted to enter a password for the new user. I entered “bob” for first installation, and something else (secret) for the first installation.
  35. Next, the “Configure the clock” screen is displayed. For Select your time zone: “Eastern” is the default. Press enter to continue.
  36. The “Partition disk” screen is displayed. The default is “Guided-use entire disk”, press enter to continue.
  37. The “Partition disk” screen is displayed. The disk to partition: SCSI 1 (0,0,0) (sda)-80.0GB ATA Maxtor 6y080l0. has been entered automatically. Press enter to continue.
  38. The “Partition disk” screen is displayed. Partitioning scheme: “All files in one partition (recommended for new users)” is the default. Press enter to continue.
  39. The “Partition disk” screen is displayed. The default “Finish partitioning and write changes to disk” is displayed. Press enter to continue.
  40. Partitioning message-“The following partitions are going to be formatted: Partition #1 of SCSI1 (0,0,0) sda as ext3; Partition #5 of SCSI1 (0,0,0) sda as swap.”
  41. Popularity contest message “Configuring popularity contest: Participate in the package usage survey?”. Select <no>.
  42. The “Software selection” screen is displayed. The default is “Graphical desktop environment”. Press enter to continue.
  43. Configuring grub message: “Configuring grub-pc: Install grub boot loader to master boot record”, <yes>.
  44. Installation complete <continue>.
  45. Finishing the installation..
  46. Computer reboots automatically.
  47. Shut down the PC.
  48. Turn on the PC.
  49. At the prompt, press F12 to go to the BIOS setup screen.
  50. Arrow down to selection #7, “System Setup” and then press enter.
  51. On the BIOS setup main screen, arrow down to “Boot Sequence” and press enter. A popup screen appears.
  52. On the popup screen, using the +/- arrow keys, move the “Hard-disk Drive C:” item to the top of the list. Make sure it is enabled (square root symbol directly to the left of this item). If it isn't enabled, use the space bar to enable it. Press enter to exit the popup window.
  53. Press escape to exit the bios setup screen. Popup appears.
  54. On the popup screen, arrow to (if required) the “Save Changes and Exit” item. Press enter to exit the BIOS setup screen.
  55. Computer reboots.


CSIT 2048-HPC Experience II
Tuesday January 25, 1:15pm-I volunteered to participate in the development of sensing and control for a hydroponics garden. I believe this will be one of my HPC Experience II projects. Per a conversation with the instructor, we plan to use LinkUSB 1-wire devices and sensors. OWFS is a Linux file system specifically designed to work with these 1-wire interfaces. Using the instructions posted at http://www.technotes.se/?p=26, my lab partner, Jesse, downloaded OWFS and related items and then installed them. During the configuration process, when the command line, $ sudo owfs -u –allow_other /mnt/1-wire executed, rather than receiving the messages:
DEFAULT: ow_usb_msg.c:DS9490_open(263) Opened USB DS9490 bus master at 6:2. , and
DEFAULT: ow_usb_cycle.c:DS9490_ID_this_master(191) Set DS9490 6:2 unique id to 81 E5 4B 2E 00 00 00 94
instead, we received the following messages:
DEFAULT: owlib.c: SetupSingleInboundConnection (196) Cannot open USB master.
DEFAULT: owlib.c: LibStart (54) No valid 1-wire buses found.

After receiving the error messages, we attempted to troubleshoot the device and configuration. First we checked that the USB port on the computer was actually working by inserting a known good flash drive into it and observing whether or not the operating system would recognize it. It turned out that the operating system did in fact recognize the USB flash drive.

Next, we performed a lsusb command and found that with the 1-wire device plugged into the USB port, lsusb returned the following message: Bus 004 Device 003: ID 0403:6001 Future Technology Devices International Ltd FT USB-Serial (UART) IC. With the devices unplugged, lsusb did not return this information.

I submitted the following e-mailing to the HPC mailing list:

Today in CSIT 2048, my lab partner and I had a problem configuring owfs.
Rather than paste what I have entered in my journal, please visit it at:
http://lab46.corning-cc.edu/journal/spring2011/jr018429/start

Regarding the issue posted in my journal, I found the following
information:
http://automation.binarysage.net/?p=1244
http://comments.gmane.org/gmane.comp.file-systems.owfs.devel/7242

I found these pages by plugging the error strings (including message number)
in to the Google search test box.
Hopefully, We are on our way to resolving this issue.

We received the following reply from the instructor:

 Were you building OWFS from source? Did you install the libusb-dev package?
It may have silently failed on USB support detection while running the
configure script.

 Also, for your reference:

    http://lab46.corning-cc.edu/haas/status/status_201010#october_10th_2010

With this information, Jesse Short was able to get owfs operational-good job!!

CSCS 2650-Computer Organization
I initialized my journal (obviously), joined the #csci IRC channel, read the “Getting Started message” page, and read the instructor's ”[ASM] Welcome to Computer Organization“ e-mailing. I also created, or rather the instructor created for me a Subversion repository for version control of source code. Since the focus of this course will be implementing a CPU simulator from the ground (gate level) up, I wrote a very simple, small class named booleanOps to implement the three basic Boolean operations: and, or, and not. The class is contained in a file called booleanOperations.cpp which also contains a simple program to test the and & or “gate” functions, and is available in the Subversion archive. Generally, CPUs are composed of the following parts:

  • ALU (Arithemtic/Logic Unit)
  • Program counter
  • Instruction decoder, and
  • Memory

I believe that the plan is to use the basic Boolean operations (“gates”) to construct these items.
I took it upon myself to create a very simple boolean class to implement the basic and, or and not functions and then placed a message on the asm class Wiki at: http://lab46.corning-cc.edu/notes/asm . I no longer have the original code for boolOps, but the boolOPs file shown below is essentially the same. The boolOps class was very simple, no contructor, no destructor, and no set and get functions. These functions do not test and then assign a result based on the outcome of the test, but rather return the result of a bit-wise logic function on the inputs A and B, or just A for the not logic function. boolOps had only three public functions.

#include <cstdio>

class boolOps
{
        public:
                bool andGate(bool A, bool B)
                {
                        return(A & B);
                }
                bool orGate(bool A, bool B)
                {
                        return (A | B);
                }
                bool notGate(bool A)
                {
                        return(!A);
                }
};

int main()
{
        bool A;
        bool B;
        boolOps logicOperations;
        printf("\n");
        printf("And Truth Table\n");
        printf("-------------\n");
        printf("| A | B | O |\n");
        printf("-------------\n");
        for (unsigned char i = 0; i <= 3; i++)
        {
                A = i & 0x02;
                B = i & 0x01;
                printf("| %d | %d | %d |\n", A, B, logicOperations.andGate(A, B));
        }
        printf("-------------\n");
        printf("\n");
        printf("Or Truth Table\n");
        printf("-------------\n");
        printf("-------------\n");
        printf("| A | B | O |\n");
        printf("-------------\n");
        for (unsigned char i = 0; i <= 3; i++)
        {
                A = i & 0x02;
                B = i & 0x01;
                printf("| %d | %d | %d |\n", A, B, logicOperations.orGate(A, B));
        }
        printf("-------------\n");
        printf("\n");
        printf("Not Truth Table\n");
        printf("---------\n");
        printf("| A | O |\n");
        printf("---------\n");
        for (unsigned char i = 0; i <= 1; i++)
        {
                A = i & 0x01;
                printf("| %d | %d |\n", A, logicOperations.notGate(A));
        }
        printf("--------\n");

        return(0);
}

Next, I compiled and executed boolOps.cc.

lab46:~$ g++ boolOps.cc -o boolOps
lab46:~$ ./boolOps

And Truth Table
-------------
| A | B | O |
-------------
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
-------------

Or Truth Table
-------------
| A | B | O |
-------------
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
-------------

Not Truth Table
---------
| A | O |
---------
| 0 | 1 |
| 1 | 0 |
--------
lab46:~$

A Basic Boolean Operations Class
I wrote a very simple class, booleanOps, for Boolean operations. As of today (Thursday, January 27), it is located in the Subversion repository. Its file name is booleanOperators.cpp. Please look at the file; besides a very simple class, it also contains a program which creates an instance of the class in order to check the and & or functions.

-John Rine 01/27/2011


Individual gates have been separated and relocated into their own individual sub-directories. Each gate has been assigned it's own class with set functions for one or two inputs, and reset functions, along with get functions. The boolOps directory now includes AND, NAND, NOR, NOT, OR, and XOR directories.

Header files for the individual logic gate classes and compilations are located in the ~/src/cpu/include/ directory.

With working logic gates coded we can now begin to combine them to create more complex circuits. Combining and interconnecting two NOR gates gives us the implementation of the first flip-flop. It has been coded checked added and submitted in the ~/src/cpu/flipflop/ directory. We now have a basic logic circuit which would hold it's state when external inputs are 0. This is the basic memory building block.

For reference,the article below discusses the Z80 microprocessor architecture (TI-8x calculators):
http://www.msxarchive.nl/pub/msx/mirrors/msx2.com/zaks/z80prg02.htm.
Last night, I made revisions 6,7, and 8 to the CPU project. Not only did I add the or, I found a bug in the get function of the and class, and then added the exclusive-or (XOR) class:

--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 0
 0 1 | 1
 1 0 | 1
 1 1 | 1
---------

lab46:~/src/cpu$ svn add include/or.h
A         include/or.h
lab46:~/src/cpu$ svn add boolOps/or
A         boolOps/or
A         boolOps/or/Makefile
A         boolOps/or/or.cc
A         boolOps/or/ortest.cc
A  (bin)  boolOps/or/ortest
lab46:~/src/cpu$ svn commit -m "Created the or gate class, lib, and ap -John Rine"
Adding         boolOps/or
Adding         boolOps/or/Makefile
Adding         boolOps/or/or.cc
Adding  (bin)  boolOps/or/ortest
Adding         boolOps/or/ortest.cc
Adding         include/or.h
Transmitting file data .....
Committed revision 6.


lab46:~/src/cpu/boolOps/and$ make
[B]   and.cc               ... OK
[CC]  andtest              ... SUCCESS
lab46:~/src/cpu/boolOps/and$ ./andtest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 0
 1 0 | 0
 0 1 | 0
 1 1 | 1
---------

lab46:~/src/cpu$ svn commit -m "Fixed AND class get function -JR"
Sending        boolOps/and/and.cc
Transmitting file data .
Committed revision 7.


lab46:~/src/cpu/boolOps/xor$ make
[B]   xor.cc               ... OK
[B]   xortest.cc           ... OK
[CC]  xortest              ... SUCCESS
lab46:~/src/cpu/boolOps/xor$ ./xortest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 0
 0 1 | 1
 1 0 | 1
 1 1 | 0
---------


lab46:~/src/cpu$ svn add include/or.h
A         include/or.h
lab46:~/src/cpu$ svn add boolOps/or
A         boolOps/or
A         boolOps/or/Makefile
A         boolOps/or/or.cc
A         boolOps/or/ortest.cc
A  (bin)  boolOps/or/ortest
lab46:~/src/cpu$ svn commit -m "Created the or gate class, lib, and ap -John Rine"
Transmitting file data .....
Committed revision 8.


<font color="red" size="+2"><b><i>Oh, and last but certainly not least, on Friday, I was introduced to "Charlie the Unicorn"...</i></b></font>

Week 2 Journal Entry

CSIT 1320-HPC Fundamentals
I completed successfully the Linux Debian “Squeeze” install during the first week of class, ( http://lab46.corning-cc.edu/haas/spring2011/hpc0/projects/desktop_install ). As per the requirements on the desktop install page, the following items function as they should:

  • working mouse and keyboard
  • installed to and boots from Linux-formatted drive partition
  • network is operational
  • can browse the Internet with a web browser
  • can log onto Lab46 using ssh

However, I was unsuccessful at attaining the video requirement:
* displays 24+ bit color depth at 1280×1024 on the Dell LCDs
I am still working on this issue.


Besides demonstrating the things listed above, the installer is also supposed to perform one of the items listed below:

  • Dual-head Accelerated graphics with Compiz Desktop effects
  • Working Audio with command-line volume/settings capability
  • Remote desktop w/VNC
  • Ability to play DVD with video and audio
  • Multihead (at least 3) Desktop using Synergy
  • Successfully Runs a Windows-only application using Wine


I selected two items on this list to complete. I wanted to watch the LAIR favorite DVD “Snakes on a Plane” and be able to execute a Windows application on my Linux “box”. Initially, I could not get the DVD to play using the movie player which is part of the Debian install. So I searched the Internet for a solution using the search string “DVDs+debian+Play” with Google and found the following Web page: http://www.debuntu.org/how-to-play-dvd-under-ubuntu-linux .
On this page I found and used the following the Linux commands.

People using Debian based distribution might have to use:
wget http://www.dtek.chalmers.se/groups/dvd/deb/libdvdcss2_1.2.5-1_i386.deb
sudo dpkg -i libdvdcss2_1.2.5-1_i386.deb
NOTE: I logged in as the Super-user so no sudo needed here

After executing these commands as the Super-user I was then able to play the DVD and get both video and audio output.
Next, I researched the Wine install. I searched the Internet by passing the Google search engine the search string “Wine+Windows applications” and found the following Web page:
http://www.winehq.org/
On this page, I selected the “Download” link and was taken to the Download page. On the Download page, since I installed a version of Debian, I selected the “Download Debian packages” link and was taken to the Debian packages page. On the Debian packages page, I chose Method 2 and clicked on the “binary list” link. On the binary packages page, since I installed Debian “Squeeze” on a 32-bit machine, I selected the “Squeeze i386” link and downloaded the wine_1.1.42~winehq1-1_i386.deb file to my home directory.
Next, I followed the directions on the http://www.winehq.org/download/deblenny web page:

Chose a .deb package from binary list and save it in your home directory
Open a terminal
cd ~ #to go to your home directory
su #to log as root
dpkg -i wine_1.1.xxx.deb #change xxx with your chosen package, this will install wine

After installing Wine, I searched the Internet for a freeware hex editor that would run on Windows 95 (no .Net or other dependencies); I found one. I downloaded it, installed it and ran it successfully.
<font color="red" size="+1"><b><i>The instructor inspected the install. He dropped the video requirement listed above. I demonstrated everything on the first list (except the 1280 x 1024 video) and the two items on the second list. He approved the install, so on to the next project!</i></b></font>

CSIT 2048-HPC Experience II
Because Jesse Short works so fast, I wanted a chance to install owfs myself, so I installed it on a second computer so that I wouldn't interfere with Jesse's work. Like Jesse, I used the instructions listed on http://www.technotes.se/?p=26 . Apparently the site was down, however, so I was forced to use a cached copy.
Since I logged in as the Super-user, no need to use sudo here so the steps I actual used to insall owfs are as follows:
According to the web page listed above, the first step in installing owfs is:
$ sudo apt-get install libusb-dev
Since I logged in as the Super-user, however, no sudo needed.

root@dhcp-179:/# apt-get install libusb-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libusb-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@dhcp-179:/#

The second step in installing owfs is to perform the following command line:
$ sudo apt-get install libfuse-dev
Once again, since I was logged in as the Super-user, no sudo needed.

root@dhcp-179:/# apt-get install libfuse-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfuse-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@dhcp-179:/#

The third step in the installation is to perform the following command line:
$ sudo apt-get install checkinstall
Since I was logged in as the Super-user, no sudo needed.

root@dhcp-179:/# apt-get install checkinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
checkinstall is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

According to the web page referenced above, the fourth step in the installation is to edit the /etc/fuse.conf file:
Add the following entry to /etc/fuse.conf:

# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
#
user_allow_other

root@dhcp-17root@dhcp-179:/# cd etc
root@dhcp-179:/etc# nano fuse.conf9:/#

# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#
#mount_max = 1000

# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
#
user_allow_other

According to the instructions, the fifth step in the install is to perform the following command line:
$ wget http://downloads.sourceforge.net/project/owfs/owfs/2.8p2/owfs-2.8p2.tar.gz

root@dhcp-179:/etc# wget http://downloads.sourceforge.net/project/owfs/owfs/2.8p2/owfs-2.8p2.tar.gz
--2011-02-08 10:33:28--  http://downloads.sourceforge.net/project/owfs/owfs/2.8p2/owfs-2.8p2.tar.gz
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://superb-sea2.dl.sourceforge.net/project/owfs/owfs/2.8p2/owfs-2.8p2.tar.gz [following]
--2011-02-08 10:33:28--  http://superb-sea2.dl.sourceforge.net/project/owfs/owfs/2.8p2/owfs-2.8p2.tar.gz
Resolving superb-sea2.dl.sourceforge.net... 209.160.57.180
Connecting to superb-sea2.dl.sourceforge.net|209.160.57.180|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1278053 (1.2M) [application/x-gzip]
Saving to: “owfs-2.8p2.tar.gz.1”

100%[======================================>] 1,278,053    217K/s   in 10s

2011-02-08 10:33:39 (124 KB/s) - “owfs-2.8p2.tar.gz.1” saved [1278053/1278053]

root@dhcp-179:/etc#

The sixth step in the install is to perform the following command line:
$ tar zxvf owfs-2.8p2.tar.gz && cd owfs-2.8p2

root@dhcp-179:/etc# tar zxvf owfs-2.8p2.tar.gz && cd owfs-2.8p2
                 .
                 .
                 .
owfs-2.8p2/module/ownet/c/src/include/ownetapi.h
owfs-2.8p2/module/ownet/c/src/include/Makefile.in
owfs-2.8p2/module/ownet/c/src/include/ow_message.h
owfs-2.8p2/module/ownet/c/src/include/ow_charblob.h
owfs-2.8p2/module/ownet/c/src/include/ow.h
owfs-2.8p2/module/ownet/c/src/include/ow_mutexes.h
owfs-2.8p2/module/ownet/c/src/include/ow_dl.h
owfs-2.8p2/module/ownet/c/src/include/ow_dnssd.h
owfs-2.8p2/module/ownet/c/src/include/ow_localtypes.h
owfs-2.8p2/module/ownet/c/src/include/compat_netdb.h
owfs-2.8p2/module/ownet/c/src/include/ow_functions.h
owfs-2.8p2/module/ownet/c/src/include/sem.h
owfs-2.8p2/module/ownet/c/src/include/Makefile.am
owfs-2.8p2/module/ownet/c/src/include/compat_getopt.h
owfs-2.8p2/module/ownet/c/src/include/compat.h
owfs-2.8p2/module/ownet/c/src/include/ow_debug.h
owfs-2.8p2/module/ownet/c/src/include/ow_stub.h
owfs-2.8p2/module/ownet/c/src/include/ow_server.h
owfs-2.8p2/module/ownet/c/src/include/ow_connection.h
owfs-2.8p2/module/ownet/c/src/include/ow_global.h
owfs-2.8p2/module/ownet/c/Makefile.am
owfs-2.8p2/module/owftpd/
owfs-2.8p2/module/owftpd/Makefile.in
owfs-2.8p2/module/owftpd/src/
owfs-2.8p2/module/owftpd/src/Makefile.in
owfs-2.8p2/module/owftpd/src/Makefile.am
owfs-2.8p2/module/owftpd/src/c/
owfs-2.8p2/module/owftpd/src/c/owftpd.c
owfs-2.8p2/module/owftpd/src/c/Makefile.in
owfs-2.8p2/module/owftpd/src/c/file_cd.c
owfs-2.8p2/module/owftpd/src/c/daemon_assert.c
owfs-2.8p2/module/owftpd/src/c/Makefile.am
owfs-2.8p2/module/owftpd/src/c/ftp_session.c
owfs-2.8p2/module/owftpd/src/c/watchdog.c
owfs-2.8p2/module/owftpd/src/c/ftp_listener.c
owfs-2.8p2/module/owftpd/src/c/file_list.c
owfs-2.8p2/module/owftpd/src/c/ftp_command.c
owfs-2.8p2/module/owftpd/src/c/telnet_session.c
owfs-2.8p2/module/owftpd/src/include/
owfs-2.8p2/module/owftpd/src/include/Makefile.in
owfs-2.8p2/module/owftpd/src/include/owftpd.h
owfs-2.8p2/module/owftpd/src/include/Makefile.am
owfs-2.8p2/module/owftpd/install-sh
owfs-2.8p2/module/owftpd/NEWS
owfs-2.8p2/module/owftpd/TODO
owfs-2.8p2/module/owftpd/Makefile.am
owfs-2.8p2/module/owftpd/COPYING
owfs-2.8p2/module/owftpd/AUTHORS
owfs-2.8p2/module/owftpd/ChangeLog
owfs-2.8p2/module/owftpd/README
owfs-2.8p2/module/owserver/
owfs-2.8p2/module/owserver/Makefile.in
owfs-2.8p2/module/owserver/src/
owfs-2.8p2/module/owserver/src/Makefile.in
owfs-2.8p2/module/owserver/src/Makefile.am
owfs-2.8p2/module/owserver/src/c/
owfs-2.8p2/module/owserver/src/c/to_client.c
owfs-2.8p2/module/owserver/src/c/dir.c
owfs-2.8p2/module/owserver/src/c/Makefile.in
owfs-2.8p2/module/owserver/src/c/handler.c
owfs-2.8p2/module/owserver/src/c/data.c
owfs-2.8p2/module/owserver/src/c/write.c
owfs-2.8p2/module/owserver/src/c/owserver.c
owfs-2.8p2/module/owserver/src/c/from_client.c
owfs-2.8p2/module/owserver/src/c/Makefile.am
owfs-2.8p2/module/owserver/src/c/loop.c
owfs-2.8p2/module/owserver/src/c/dirall.c
owfs-2.8p2/module/owserver/src/c/read.c
owfs-2.8p2/module/owserver/src/c/ping.c
owfs-2.8p2/module/owserver/src/c/dirallslash.c
owfs-2.8p2/module/owserver/src/c/error.c
owfs-2.8p2/module/owserver/src/include/
owfs-2.8p2/module/owserver/src/include/Makefile.in
owfs-2.8p2/module/owserver/src/include/Makefile.am
owfs-2.8p2/module/owserver/src/include/owserver.h
owfs-2.8p2/module/owserver/Makefile.am
owfs-2.8p2/module/Makefile.am
owfs-2.8p2/module/swig/
owfs-2.8p2/module/swig/php/
owfs-2.8p2/module/swig/php/php.m4
owfs-2.8p2/module/swig/php/Makefile.in
owfs-2.8p2/module/swig/php/example/
owfs-2.8p2/module/swig/php/example/load_php_OW.php.in
owfs-2.8p2/module/swig/php/example/owdir.php
owfs-2.8p2/module/swig/php/example/load_php_OW.php
owfs-2.8p2/module/swig/php/Makefile.am
owfs-2.8p2/module/swig/php/php_OW.h
owfs-2.8p2/module/swig/php/ow_wrap.c
owfs-2.8p2/module/swig/python/
owfs-2.8p2/module/swig/python/ow/
owfs-2.8p2/module/swig/python/ow/Makefile.in
owfs-2.8p2/module/swig/python/ow/Makefile.am
owfs-2.8p2/module/swig/python/ow/__init__.py
owfs-2.8p2/module/swig/python/Makefile.in
owfs-2.8p2/module/swig/python/python.m4
owfs-2.8p2/module/swig/python/setup.py.in
owfs-2.8p2/module/swig/python/Makefile.am
owfs-2.8p2/module/swig/python/unittest/
owfs-2.8p2/module/swig/python/unittest/ds2408.py
owfs-2.8p2/module/swig/python/unittest/owload.py
owfs-2.8p2/module/swig/python/unittest/owsensors.py
owfs-2.8p2/module/swig/python/unittest/util.py
owfs-2.8p2/module/swig/python/unittest/owtest_think.ini
owfs-2.8p2/module/swig/python/unittest/owtest_sample.ini
owfs-2.8p2/module/swig/python/unittest/ds1420.py
owfs-2.8p2/module/swig/python/unittest/Readme.txt
owfs-2.8p2/module/swig/python/unittest/owtest.py
owfs-2.8p2/module/swig/python/unittest/ds2409.py
owfs-2.8p2/module/swig/python/examples/
owfs-2.8p2/module/swig/python/examples/tree.py
owfs-2.8p2/module/swig/python/examples/errormessages.py
owfs-2.8p2/module/swig/python/examples/check_ow.py
owfs-2.8p2/module/swig/python/examples/temperature.py
owfs-2.8p2/module/swig/python/examples/xmlrpc_client.py
owfs-2.8p2/module/swig/python/examples/raw_access.py
owfs-2.8p2/module/swig/python/examples/xmlrpc_server.py
owfs-2.8p2/module/swig/Makefile.in
owfs-2.8p2/module/swig/perl5/
owfs-2.8p2/module/swig/perl5/Makefile.in
owfs-2.8p2/module/swig/perl5/example/
owfs-2.8p2/module/swig/perl5/example/owdir.pl
owfs-2.8p2/module/swig/perl5/example/tree.pl
owfs-2.8p2/module/swig/perl5/OW/
owfs-2.8p2/module/swig/perl5/OW/Changes
owfs-2.8p2/module/swig/perl5/OW/META.yml
owfs-2.8p2/module/swig/perl5/OW/t/
owfs-2.8p2/module/swig/perl5/OW/t/OW.t
owfs-2.8p2/module/swig/perl5/OW/Makefile.linux.in
owfs-2.8p2/module/swig/perl5/OW/Makefile.osx.in
owfs-2.8p2/module/swig/perl5/OW/README
owfs-2.8p2/module/swig/perl5/OW/MANIFEST
owfs-2.8p2/module/swig/perl5/Makefile.am
owfs-2.8p2/module/swig/perl5/perl5.m4
owfs-2.8p2/module/swig/Makefile.am
owfs-2.8p2/module/swig/ow.i
owfs-2.8p2/module/owlib/
owfs-2.8p2/module/owlib/Makefile.in
owfs-2.8p2/module/owlib/src/
owfs-2.8p2/module/owlib/src/Makefile.in
owfs-2.8p2/module/owlib/src/Makefile.am
owfs-2.8p2/module/owlib/src/c/
owfs-2.8p2/module/owlib/src/c/ow_zero.c
owfs-2.8p2/module/owlib/src/c/ow_2409.c
owfs-2.8p2/module/owlib/src/c/ow_usb_cycle.c
owfs-2.8p2/module/owlib/src/c/ow_parseshallow.c
owfs-2.8p2/module/owlib/src/c/ow_fs_id.c
owfs-2.8p2/module/owlib/src/c/ow_ds9097.c
owfs-2.8p2/module/owlib/src/c/ow_fs_type.c
owfs-2.8p2/module/owlib/src/c/ow_fs_crc8.c
owfs-2.8p2/module/owlib/src/c/ow_2433.c
owfs-2.8p2/module/owlib/src/c/ow_net_client.c
owfs-2.8p2/module/owlib/src/c/ow_stats.c
owfs-2.8p2/module/owlib/src/c/ow_none.c
owfs-2.8p2/module/owlib/src/c/ow_dl.c
owfs-2.8p2/module/owlib/src/c/Makefile.in
owfs-2.8p2/module/owlib/src/c/ow_2405.c
owfs-2.8p2/module/owlib/src/c/ow_2404.c
owfs-2.8p2/module/owlib/src/c/ow_reconnect.c
owfs-2.8p2/module/owlib/src/c/ow_2436.c
owfs-2.8p2/module/owlib/src/c/ow_fstat.c
owfs-2.8p2/module/owlib/src/c/ow_cache.c
owfs-2.8p2/module/owlib/src/c/ow_1991.c
owfs-2.8p2/module/owlib/src/c/ow_w1_scan.c
owfs-2.8p2/module/owlib/src/c/ow_memory.c
owfs-2.8p2/module/owlib/src/c/ow_net_server.c
owfs-2.8p2/module/owlib/src/c/ow_1821.c
owfs-2.8p2/module/owlib/src/c/ow_tree.c
owfs-2.8p2/module/owlib/src/c/ow_ds2482.c
owfs-2.8p2/module/owlib/src/c/ow_ds9490.c
owfs-2.8p2/module/owlib/src/c/ow_w1_browse.c
owfs-2.8p2/module/owlib/src/c/ow_etherweather.c
owfs-2.8p2/module/owlib/src/c/ow_2438.c
owfs-2.8p2/module/owlib/src/c/ow_eeef.c
owfs-2.8p2/module/owlib/src/c/ow_browse_monitor.c
owfs-2.8p2/module/owlib/src/c/ow_1993.c
owfs-2.8p2/module/owlib/src/c/ow_powerbyte.c
owfs-2.8p2/module/owlib/src/c/ow_w1_send.c
owfs-2.8p2/module/owlib/src/c/ow_fakeread.c
owfs-2.8p2/module/owlib/src/c/ow_usb_monitor.c
owfs-2.8p2/module/owlib/src/c/ow_connect.c
owfs-2.8p2/module/owlib/src/c/ow_w1_print.c
owfs-2.8p2/module/owlib/src/c/ow_testerread.c
owfs-2.8p2/module/owlib/src/c/ow_server_message.c
owfs-2.8p2/module/owlib/src/c/ow_2890.c
owfs-2.8p2/module/owlib/src/c/ow_dir.c
owfs-2.8p2/module/owlib/src/c/ow_fs_address.c
owfs-2.8p2/module/owlib/src/c/ow_max_delay.c
owfs-2.8p2/module/owlib/src/c/ow_ha5.c
owfs-2.8p2/module/owlib/src/c/ow_thermocouple.c
owfs-2.8p2/module/owlib/src/c/ow_reset.c
owfs-2.8p2/module/owlib/src/c/ow_pressure.c
owfs-2.8p2/module/owlib/src/c/ow_charblob.c
owfs-2.8p2/module/owlib/src/c/ow_w1_parse.c
owfs-2.8p2/module/owlib/src/c/ow_generic_read.c
owfs-2.8p2/module/owlib/src/c/ow_bus_data.c
owfs-2.8p2/module/owlib/src/c/ow_visibility.c
owfs-2.8p2/module/owlib/src/c/ow_verify.c
owfs-2.8p2/module/owlib/src/c/ow_browse.c
owfs-2.8p2/module/owlib/src/c/ow_traffic.c
owfs-2.8p2/module/owlib/src/c/ow_devicelock.c
owfs-2.8p2/module/owlib/src/c/ow_iterate.c
owfs-2.8p2/module/owlib/src/c/ow_1963.c
owfs-2.8p2/module/owlib/src/c/ow_fake.c
owfs-2.8p2/module/owlib/src/c/ow_parse_sn.c
owfs-2.8p2/module/owlib/src/c/ow_server_enet.c
owfs-2.8p2/module/owlib/src/c/ow_2804.c
owfs-2.8p2/module/owlib/src/c/ow_w1_monitor.c
owfs-2.8p2/module/owlib/src/c/ow_delay.c
owfs-2.8p2/module/owlib/src/c/ow_add_inflight.c
owfs-2.8p2/module/owlib/src/c/ow_eprom_write.c
owfs-2.8p2/module/owlib/src/c/ow_api.c
owfs-2.8p2/module/owlib/src/c/ow_byte.c
owfs-2.8p2/module/owlib/src/c/ow_badadapter.c
owfs-2.8p2/module/owlib/src/c/ow_util.c
owfs-2.8p2/module/owlib/src/c/ow_avahi_link.c
owfs-2.8p2/module/owlib/src/c/ow_interface.c
owfs-2.8p2/module/owlib/src/c/ow_ha7.c
owfs-2.8p2/module/owlib/src/c/ow_daemon.c
owfs-2.8p2/module/owlib/src/c/ow_select.c
owfs-2.8p2/module/owlib/src/c/ow_2401.c
owfs-2.8p2/module/owlib/src/c/ow_w1_addremove.c
owfs-2.8p2/module/owlib/src/c/ow_alias.c
owfs-2.8p2/module/owlib/src/c/ow_settings.c
owfs-2.8p2/module/owlib/src/c/ow_parsename.c
owfs-2.8p2/module/owlib/src/c/ow_ds9097U.c
owfs-2.8p2/module/owlib/src/c/globals.c
owfs-2.8p2/module/owlib/src/c/ow_1820.c
owfs-2.8p2/module/owlib/src/c/ow_sibling_float.c
owfs-2.8p2/module/owlib/src/c/ow_simultaneous.c
owfs-2.8p2/module/owlib/src/c/ow_presence.c
owfs-2.8p2/module/owlib/src/c/Makefile.am
owfs-2.8p2/module/owlib/src/c/ow_get.c
owfs-2.8p2/module/owlib/src/c/ow_help.c
owfs-2.8p2/module/owlib/src/c/ow_stateinfo.c
owfs-2.8p2/module/owlib/src/c/ow_del_inflight.c
owfs-2.8p2/module/owlib/src/c/owlib.c
owfs-2.8p2/module/owlib/src/c/ow_w1_select.c
owfs-2.8p2/module/owlib/src/c/ow_read_telnet.c
owfs-2.8p2/module/owlib/src/c/ow_tcp_read.c
owfs-2.8p2/module/owlib/src/c/ow_lcd.c
owfs-2.8p2/module/owlib/src/c/getaddrinfo.c
owfs-2.8p2/module/owlib/src/c/ow_lib_setup.c
owfs-2.8p2/module/owlib/src/c/ow_link.c
owfs-2.8p2/module/owlib/src/c/ow_com_read.c
owfs-2.8p2/module/owlib/src/c/ow_baud.c
owfs-2.8p2/module/owlib/src/c/ow_w1_dispatch.c
owfs-2.8p2/module/owlib/src/c/ow_remote_alias.c
owfs-2.8p2/module/owlib/src/c/ow_1923.c
owfs-2.8p2/module/owlib/src/c/ow_specialcase.c
owfs-2.8p2/module/owlib/src/c/ow_1921.c
owfs-2.8p2/module/owlib/src/c/ow_2423.c
owfs-2.8p2/module/owlib/src/c/ow_fs_code.c
owfs-2.8p2/module/owlib/src/c/ow_1954.c
owfs-2.8p2/module/owlib/src/c/ow_parse_address.c
owfs-2.8p2/module/owlib/src/c/ow_sibling_yesno.c
owfs-2.8p2/module/owlib/src/c/ow_avahi_browse.c
owfs-2.8p2/module/owlib/src/c/ow_buslock.c
owfs-2.8p2/module/owlib/src/c/ow_slurp.c
owfs-2.8p2/module/owlib/src/c/ow_offset.c
owfs-2.8p2/module/owlib/src/c/ow_multicast.c
owfs-2.8p2/module/owlib/src/c/ow_parseoutput.c
owfs-2.8p2/module/owlib/src/c/ow_write.c
owfs-2.8p2/module/owlib/src/c/ow_usb_msg.c
owfs-2.8p2/module/owlib/src/c/getline.c
owfs-2.8p2/module/owlib/src/c/ow_fs_alias.c
owfs-2.8p2/module/owlib/src/c/ow_parseobject.c
owfs-2.8p2/module/owlib/src/c/ow_dirblob.c
owfs-2.8p2/module/owlib/src/c/ow_ha7e.c
owfs-2.8p2/module/owlib/src/c/ow_browse_resolve.c
owfs-2.8p2/module/owlib/src/c/getopt.c
owfs-2.8p2/module/owlib/src/c/ow_lib_close.c
owfs-2.8p2/module/owlib/src/c/ow_1977.c
owfs-2.8p2/module/owlib/src/c/ow_avahi_announce.c
owfs-2.8p2/module/owlib/src/c/ow_bus.c
owfs-2.8p2/module/owlib/src/c/ow_com.c
owfs-2.8p2/module/owlib/src/c/ow_2430.c
owfs-2.8p2/module/owlib/src/c/ow_ds1410.c
owfs-2.8p2/module/owlib/src/c/ow_w1.c
owfs-2.8p2/module/owlib/src/c/ow_lib_stop.c
owfs-2.8p2/module/owlib/src/c/ow_date.c
owfs-2.8p2/module/owlib/src/c/ow_sibling.c
owfs-2.8p2/module/owlib/src/c/ow_2408.c
owfs-2.8p2/module/owlib/src/c/ow_2502.c
owfs-2.8p2/module/owlib/src/c/ow_2760.c
owfs-2.8p2/module/owlib/src/c/ow_eds.c
owfs-2.8p2/module/owlib/src/c/ow_server.c
owfs-2.8p2/module/owlib/src/c/ow_w1_list.c
owfs-2.8p2/module/owlib/src/c/ow_rwlock.c
owfs-2.8p2/module/owlib/src/c/ow_sibling_binary.c
owfs-2.8p2/module/owlib/src/c/ow_2413.c
owfs-2.8p2/module/owlib/src/c/ow_search.c
owfs-2.8p2/module/owlib/src/c/ow_temp.c
owfs-2.8p2/module/owlib/src/c/ow_sibling_uint.c
owfs-2.8p2/module/owlib/src/c/ow_2415.c
owfs-2.8p2/module/owlib/src/c/ow_pid.c
owfs-2.8p2/module/owlib/src/c/ow_w1_bind.c
owfs-2.8p2/module/owlib/src/c/ow_memblob.c
owfs-2.8p2/module/owlib/src/c/ow_dnssd.c
owfs-2.8p2/module/owlib/src/c/ow_locks.c
owfs-2.8p2/module/owlib/src/c/error.c
owfs-2.8p2/module/owlib/src/c/ow_com_write.c
owfs-2.8p2/module/owlib/src/c/ow_parseinput.c
owfs-2.8p2/module/owlib/src/c/ow_2505.c
owfs-2.8p2/module/owlib/src/c/compat.c
owfs-2.8p2/module/owlib/src/c/ow_opt.c
owfs-2.8p2/module/owlib/src/c/ow_arg.c
owfs-2.8p2/module/owlib/src/c/ow_locator.c
owfs-2.8p2/module/owlib/src/c/ow_2450.c
owfs-2.8p2/module/owlib/src/c/ow_name.c
owfs-2.8p2/module/owlib/src/c/ow_bae.c
owfs-2.8p2/module/owlib/src/c/ow_transaction.c
owfs-2.8p2/module/owlib/src/c/ow_printparse.c
owfs-2.8p2/module/owlib/src/c/ow_crc.c
owfs-2.8p2/module/owlib/src/c/ow_filelength.c
owfs-2.8p2/module/owlib/src/c/ow_sig_handlers.c
owfs-2.8p2/module/owlib/src/c/ow_udp_read.c
owfs-2.8p2/module/owlib/src/c/ow_read.c
owfs-2.8p2/module/owlib/src/c/ow_alloc.c
owfs-2.8p2/module/owlib/src/c/ow_system.c
owfs-2.8p2/module/owlib/src/c/ow_2406.c
owfs-2.8p2/module/owlib/src/c/ow_programpulse.c
owfs-2.8p2/module/owlib/src/include/
owfs-2.8p2/module/owlib/src/include/ow_2401.h
owfs-2.8p2/module/owlib/src/include/ow_1977.h
owfs-2.8p2/module/owlib/src/include/ow_onewirequery.h
owfs-2.8p2/module/owlib/src/include/ow_arg.h
owfs-2.8p2/module/owlib/src/include/ow_1991.h
owfs-2.8p2/module/owlib/src/include/ow_bae.h
owfs-2.8p2/module/owlib/src/include/ow_2436.h
owfs-2.8p2/module/owlib/src/include/rwlock.h
owfs-2.8p2/module/owlib/src/include/ow_sibling.h
owfs-2.8p2/module/owlib/src/include/ow_detect.h
owfs-2.8p2/module/owlib/src/include/ow_parse_sn.h
owfs-2.8p2/module/owlib/src/include/ow_standard.h
owfs-2.8p2/module/owlib/src/include/ow_none.h
owfs-2.8p2/module/owlib/src/include/ow_interface.h
owfs-2.8p2/module/owlib/src/include/Makefile.in
owfs-2.8p2/module/owlib/src/include/ow_1923.h
owfs-2.8p2/module/owlib/src/include/ow_message.h
owfs-2.8p2/module/owlib/src/include/ow_specialcase.h
owfs-2.8p2/module/owlib/src/include/ow_counters.h
owfs-2.8p2/module/owlib/src/include/ow_pid.h
owfs-2.8p2/module/owlib/src/include/ow_charblob.h
owfs-2.8p2/module/owlib/src/include/ow_2430.h
owfs-2.8p2/module/owlib/src/include/ow.h
owfs-2.8p2/module/owlib/src/include/ow_alloc.h
owfs-2.8p2/module/owlib/src/include/ow_2404.h
owfs-2.8p2/module/owlib/src/include/ow_integer.h
owfs-2.8p2/module/owlib/src/include/ow_mutexes.h
owfs-2.8p2/module/owlib/src/include/ow_2406.h
owfs-2.8p2/module/owlib/src/include/ow_usb_msg.h
owfs-2.8p2/module/owlib/src/include/ow_parse_address.h
owfs-2.8p2/module/owlib/src/include/ow_dl.h
owfs-2.8p2/module/owlib/src/include/ow_2438.h
owfs-2.8p2/module/owlib/src/include/ow_temperature.h
owfs-2.8p2/module/owlib/src/include/ow_generic_write.h
owfs-2.8p2/module/owlib/src/include/ow_codes.h
owfs-2.8p2/module/owlib/src/include/ow_2890.h
owfs-2.8p2/module/owlib/src/include/ow_filetype.h
owfs-2.8p2/module/owlib/src/include/ow_connection_in.h
owfs-2.8p2/module/owlib/src/include/ow_generic_read.h
owfs-2.8p2/module/owlib/src/include/ow_connection_out.h
owfs-2.8p2/module/owlib/src/include/ow_bus_routines.h
owfs-2.8p2/module/owlib/src/include/ow_dnssd.h
owfs-2.8p2/module/owlib/src/include/ow_thermocouple.h
owfs-2.8p2/module/owlib/src/include/ow_dirblob.h
owfs-2.8p2/module/owlib/src/include/netlink.h
owfs-2.8p2/module/owlib/src/include/ow_w1_seq.h
owfs-2.8p2/module/owlib/src/include/ow_2409.h
owfs-2.8p2/module/owlib/src/include/ow_2804.h
owfs-2.8p2/module/owlib/src/include/ow_w1.h
owfs-2.8p2/module/owlib/src/include/ow_localtypes.h
owfs-2.8p2/module/owlib/src/include/compat_netdb.h
owfs-2.8p2/module/owlib/src/include/ow_functions.h
owfs-2.8p2/module/owlib/src/include/ow_avahi.h
owfs-2.8p2/module/owlib/src/include/sem.h
owfs-2.8p2/module/owlib/src/include/ow_1954.h
owfs-2.8p2/module/owlib/src/include/ow_lcd.h
owfs-2.8p2/module/owlib/src/include/ow_fd.h
owfs-2.8p2/module/owlib/src/include/ow_traffic.h
owfs-2.8p2/module/owlib/src/include/Makefile.am
owfs-2.8p2/module/owlib/src/include/ow_eds.h
owfs-2.8p2/module/owlib/src/include/ow_2505.h
owfs-2.8p2/module/owlib/src/include/ow_stats.h
owfs-2.8p2/module/owlib/src/include/compat_getopt.h
owfs-2.8p2/module/owlib/src/include/compat.h
owfs-2.8p2/module/owlib/src/include/ow_visibility.h
owfs-2.8p2/module/owlib/src/include/ow_usb_cycle.h
owfs-2.8p2/module/owlib/src/include/ow_stateinfo.h
owfs-2.8p2/module/owlib/src/include/ow_bitwork.h
owfs-2.8p2/module/owlib/src/include/ow_search.h
owfs-2.8p2/module/owlib/src/include/ow_system.h
owfs-2.8p2/module/owlib/src/include/ow_2760.h
owfs-2.8p2/module/owlib/src/include/connector.h
owfs-2.8p2/module/owlib/src/include/ow_1963.h
owfs-2.8p2/module/owlib/src/include/ow_debug.h
owfs-2.8p2/module/owlib/src/include/i2c-dev.h
owfs-2.8p2/module/owlib/src/include/ow_localreturns.h
owfs-2.8p2/module/owlib/src/include/ow_memblob.h
owfs-2.8p2/module/owlib/src/include/ow_stub.h
owfs-2.8p2/module/owlib/src/include/ow_busnumber.h
owfs-2.8p2/module/owlib/src/include/ow_2433.h
owfs-2.8p2/module/owlib/src/include/ow_simultaneous.h
owfs-2.8p2/module/owlib/src/include/ow_devices.h
owfs-2.8p2/module/owlib/src/include/ow_reset.h
owfs-2.8p2/module/owlib/src/include/ow_transaction.h
owfs-2.8p2/module/owlib/src/include/ow_pressure.h
owfs-2.8p2/module/owlib/src/include/ow_1821.h
owfs-2.8p2/module/owlib/src/include/ow_2408.h
owfs-2.8p2/module/owlib/src/include/ow_master.h
owfs-2.8p2/module/owlib/src/include/ow_1993.h
owfs-2.8p2/module/owlib/src/include/w1_netlink.h
owfs-2.8p2/module/owlib/src/include/ow_cache.h
owfs-2.8p2/module/owlib/src/include/ow_opt.h
owfs-2.8p2/module/owlib/src/include/ow_2413.h
owfs-2.8p2/module/owlib/src/include/ow_settings.h
owfs-2.8p2/module/owlib/src/include/ow_2423.h
owfs-2.8p2/module/owlib/src/include/ow_2450.h
owfs-2.8p2/module/owlib/src/include/ow_connection.h
owfs-2.8p2/module/owlib/src/include/ow_2405.h
owfs-2.8p2/module/owlib/src/include/ow_1921.h
owfs-2.8p2/module/owlib/src/include/ow_device.h
owfs-2.8p2/module/owlib/src/include/ow_eeef.h
owfs-2.8p2/module/owlib/src/include/ow_parsedname.h
owfs-2.8p2/module/owlib/src/include/ow_global.h
owfs-2.8p2/module/owlib/src/include/ow_1820.h
owfs-2.8p2/module/owlib/src/include/ow_2502.h
owfs-2.8p2/module/owlib/src/include/ow_2415.h
owfs-2.8p2/module/owlib/Makefile.am
owfs-2.8p2/module/owhttpd/
owfs-2.8p2/module/owhttpd/Makefile.in
owfs-2.8p2/module/owhttpd/src/
owfs-2.8p2/module/owhttpd/src/Makefile.in
owfs-2.8p2/module/owhttpd/src/Makefile.am
owfs-2.8p2/module/owhttpd/src/c/
owfs-2.8p2/module/owhttpd/src/c/Makefile.in
owfs-2.8p2/module/owhttpd/src/c/owhttpd_dir.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_escape.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_write.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_present.c
owfs-2.8p2/module/owhttpd/src/c/Makefile.am
owfs-2.8p2/module/owhttpd/src/c/owhttpd.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_favicon.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_read.c
owfs-2.8p2/module/owhttpd/src/c/owhttpd_handler.c
owfs-2.8p2/module/owhttpd/src/include/
owfs-2.8p2/module/owhttpd/src/include/Makefile.in
owfs-2.8p2/module/owhttpd/src/include/owhttpd.h
owfs-2.8p2/module/owhttpd/src/include/Makefile.am
owfs-2.8p2/module/owhttpd/Makefile.am
owfs-2.8p2/module/owshell/
owfs-2.8p2/module/owshell/Makefile.in
owfs-2.8p2/module/owshell/src/
owfs-2.8p2/module/owshell/src/Makefile.in
owfs-2.8p2/module/owshell/src/Makefile.am
owfs-2.8p2/module/owshell/src/c/
owfs-2.8p2/module/owshell/src/c/ow_dl.c
owfs-2.8p2/module/owshell/src/c/Makefile.in
owfs-2.8p2/module/owshell/src/c/owread.c
owfs-2.8p2/module/owshell/src/c/ow_browse.c
owfs-2.8p2/module/owshell/src/c/globals.c
owfs-2.8p2/module/owshell/src/c/Makefile.am
owfs-2.8p2/module/owshell/src/c/ow_help.c
owfs-2.8p2/module/owshell/src/c/owpresent.c
owfs-2.8p2/module/owshell/src/c/ow_tcp_read.c
owfs-2.8p2/module/owshell/src/c/getaddrinfo.c
owfs-2.8p2/module/owshell/src/c/ow_net.c
owfs-2.8p2/module/owshell/src/c/owget.c
owfs-2.8p2/module/owshell/src/c/getopt.c
owfs-2.8p2/module/owshell/src/c/ow_server.c
owfs-2.8p2/module/owshell/src/c/ow_dnssd.c
owfs-2.8p2/module/owshell/src/c/owdir.c
owfs-2.8p2/module/owshell/src/c/ow_opt.c
owfs-2.8p2/module/owshell/src/c/owwrite.c
owfs-2.8p2/module/owshell/src/include/
owfs-2.8p2/module/owshell/src/include/Makefile.in
owfs-2.8p2/module/owshell/src/include/Makefile.am
owfs-2.8p2/module/owshell/src/include/owshell.h
owfs-2.8p2/module/owshell/Makefile.am
owfs-2.8p2/module/owmon/
owfs-2.8p2/module/owmon/Makefile.in
owfs-2.8p2/module/owmon/owmon.tcl
owfs-2.8p2/module/owmon/Makefile.am
owfs-2.8p2/module/owfs/
owfs-2.8p2/module/owfs/Makefile.in
owfs-2.8p2/module/owfs/src/
owfs-2.8p2/module/owfs/src/Makefile.in
owfs-2.8p2/module/owfs/src/Makefile.am
owfs-2.8p2/module/owfs/src/c/
owfs-2.8p2/module/owfs/src/c/Makefile.in
owfs-2.8p2/module/owfs/src/c/fuse_line.c
owfs-2.8p2/module/owfs/src/c/Makefile.am
owfs-2.8p2/module/owfs/src/c/owfs.c
owfs-2.8p2/module/owfs/src/c/owfs_callback.c
owfs-2.8p2/module/owfs/src/include/
owfs-2.8p2/module/owfs/src/include/Makefile.in
owfs-2.8p2/module/owfs/src/include/owfs.h
owfs-2.8p2/module/owfs/src/include/Makefile.am
owfs-2.8p2/module/owfs/Makefile.am
owfs-2.8p2/NEWS
owfs-2.8p2/TODO
owfs-2.8p2/Makefile.am
owfs-2.8p2/configure.ac
owfs-2.8p2/COPYING.LIB
owfs-2.8p2/COPYING
owfs-2.8p2/AUTHORS
owfs-2.8p2/acinclude.m4
owfs-2.8p2/ChangeLog
owfs-2.8p2/bootstrap
owfs-2.8p2/README
owfs-2.8p2/aclocal.m4
root@dhcp-179:/etc/owfs-2.8p2#

The seventh step in the owfs install is to perform the following command line:
$ ./configure –prefix=/usr –enable-owfs –enable-usb

root@dhcp-179:/etc/owfs-2.8p2# ./configure --prefix=/usr --enable-owfs --enable-usb
Configuring owfs-2.8p2
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for echo... /bin/echo
checking for test... /usr/bin/test
checking for rm... /bin/rm
checking for rpm... no
checking for rpmbuild... no
checking for swig... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking for gawk... (cached) mawk
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... /bin/rm: cannot remove `conftest*': No such file or directory
yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... /bin/rm: cannot remove `conftest*': No such file or directory
no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking if debian-system is used... no (default)
checking for special host... Other host
checking if compiler supports nested functions... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking asm/types.h usability... yes
checking asm/types.h presence... yes
checking for asm/types.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/types.h... (cached) yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking feature_tests.h usability... no
checking feature_tests.h presence... no
checking for feature_tests.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking features.h usability... yes
checking features.h presence... yes
checking for features.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking resolv.h usability... yes
checking resolv.h presence... yes
checking for resolv.h... yes
checking semaphore.h usability... yes
checking semaphore.h presence... yes
checking for semaphore.h... yes
checking linux/limits.h usability... yes
checking linux/limits.h presence... yes
checking for linux/limits.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for dlfcn.h... (cached) yes
checking if debug-output is enabled... yes (default)
checking if OWSHELL support is enabled... yes (default)
checking if OWLIB support is enabled... yes (default)
checking if OWNETLIB support is enabled... yes (default)
checking if TAI8570 barometer support is enabled... yes (default)
checking if thermocouple support is enabled... yes (default)
checking if multithreading is enabled... yes (default)
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking if i2c(DS2482-x00) is enabled... yes (default)
checking if HA7Net is enabled... yes (default)
checking if W1 is enabled... yes (default)
checking if owhttpd is enabled... yes (default)
checking if owftpd is enabled... yes (default)
checking if owserver is enabled... yes (default)
checking if ownet is enabled... yes (default)
checking if owtap is enabled... yes (default)
checking if owmalloc is enabled... no (default)
checking if bus traffic reports is enabled... no (default)
checking if owmon is enabled... yes (default)
checking if owcapi is enabled... yes (default)
checking if swig is enabled... auto (default)
checking if owperl is enabled... no (swig disabled)
Looking for location of Perl executable
checking for perl... perl
checking for Perl5 header files... /usr/lib/perl/5.10/CORE
checking for Perl5 library... perl.so.5.10.1
checking for Perl5 compiler options... -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector /usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking if owphp is enabled... no (swig disabled)
Looking for location of Php executable
checking for php... no
checking for php5... no
checking for php4... no
checking for php-config... no
checking for php5-config... no
checking for php-config5... no
checking for php4-config... no
checking for php-config4... no
checking for PHP header files... /usr/include/php
/usr/local/include/php
/usr/include/php5
/usr/local/include/php5
/usr/include/php4
/usr/local/include/php4
/usr/local/apache/php
not found
checking for PHP extension-dir... not found
configure: WARNING: Cannot find php binary. Install php or php5 package
configure: WARNING: OWPHP is disabled because php binary is not found
checking if owpython is enabled... no (swig disabled)
Looking for location of Python executable
checking for python-config... no
checking for python2.5-config... no
checking for python2.4-config... no
checking for python2.3-config... no
checking for python... python
checking for Python prefix... /usr
checking for Python exec-prefix... /usr
checking for Python version... python2.6
checking for Python lib dir... lib
checking for Python site-dir... /usr/lib/python2.6/dist-packages
checking for Python header files...
checking for Python library... /usr/lib/python2.6/config
checking for Python LDFLAGS... -lpython2.6
configure: WARNING: Cannot find python include-file. Install python-devel package.
configure: WARNING: OWPYTHON is disabled because python include-file is not found
checking if owtcl is enabled... yes (default)
Looking for tclConfig.sh
checking for Tcl configuration... configure: WARNING: Can't find Tcl configuration definitions
configure: WARNING: OWTCL is disabled because tclConfig.sh is not found
checking if cflag _XOPEN_SOURCE is required... -D_XOPEN_SOURCE=500
checking if cflag _BSD_SOURCE is required... -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L
checking if extra libs are required... -Wl,--rpath -Wl,${exec_prefix}/lib
checking if profiling is enabled... no (default)
configure: WARNING: LD_EXTRALIBS=-Wl,--rpath -Wl,/usr/lib OSLIBS=
checking if owfs is enabled... yes
checking fuse.h usability... yes
checking fuse.h presence... yes
checking for fuse.h... yes
checking for fuse_main in -lfuse... yes
checking For supported FUSE API version... yes
checking For FUSE version ... 2.2 or later
checking if caching is enabled... yes (default)
checking if zeroconf/bonjour is enabled... yes (default)
checking for libusb-config... libusb-config
checking if usb support is enabled... yes
checking if libusb compiles with includes+lib ... ok
checking if usb_interrupt_read is found... yes
checking if parallel port support is enabled... yes (default)
checking linux/ppdev.h usability... yes
checking linux/ppdev.h presence... yes
checking for linux/ppdev.h... yes
checking for struct sockaddr_storage... yes
checking for struct addrinfo... yes
checking for socklen_t... yes
checking for AF_NETLINK... yes
checking for broken glibc with __ss_family... no
checking for core ipv6 support... no
checking if sem_timedwait exists... yes
checking whether string.h and strings.h may both be included... yes
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for strftime... yes
checking for working strtod... yes
checking return type of signal handlers... void
checking for accept... yes
checking for daemon... yes
checking for getaddrinfo... yes
checking for freeaddrinfo... yes
checking for gethostbyname2_r... yes
checking for gethostbyaddr_r... yes
checking for gethostbyname_r... yes
checking for getservbyname_r... yes
checking for getopt... yes
checking for getopt_long... yes
checking for gettimeofday... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for memchr... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for strtoul... yes
checking for twalk... yes
checking for tsearch... yes
checking for tfind... yes
checking for tdelete... yes
checking for tdestroy... yes
checking for vasprintf... yes
checking for strsep... yes
checking for vsprintf... yes
checking for vsnprintf... yes
checking for writev... yes
checking for getline... yes
checking for library containing dlopen... -ldl
checking for library containing lrint... -lm
checking for library containing nanosleep... none required
configure: creating ./config.status
config.status: creating Makefile
config.status: creating module/Makefile
config.status: creating module/owlib/Makefile
config.status: creating module/owlib/src/Makefile
config.status: creating module/owlib/src/include/Makefile
config.status: creating module/owlib/src/c/Makefile
config.status: creating module/owfs/Makefile
config.status: creating module/owfs/src/Makefile
config.status: creating module/owfs/src/include/Makefile
config.status: creating module/owfs/src/c/Makefile
config.status: creating module/owhttpd/Makefile
config.status: creating module/owhttpd/src/Makefile
config.status: creating module/owhttpd/src/include/Makefile
config.status: creating module/owhttpd/src/c/Makefile
config.status: creating module/owserver/Makefile
config.status: creating module/owserver/src/Makefile
config.status: creating module/owserver/src/include/Makefile
config.status: creating module/owserver/src/c/Makefile
config.status: creating module/owftpd/Makefile
config.status: creating module/owftpd/src/Makefile
config.status: creating module/owftpd/src/include/Makefile
config.status: creating module/owftpd/src/c/Makefile
config.status: creating module/ownet/Makefile
config.status: creating module/ownet/php/Makefile
config.status: creating module/ownet/php/examples/ownet_example.php
config.status: creating module/ownet/python/Makefile
config.status: creating module/ownet/perl5/Makefile
config.status: creating module/ownet/c/Makefile
config.status: creating module/ownet/c/src/Makefile
config.status: creating module/ownet/c/src/include/Makefile
config.status: creating module/ownet/c/src/c/Makefile
config.status: creating module/ownet/c/src/example/Makefile
config.status: creating module/owshell/Makefile
config.status: creating module/owshell/src/Makefile
config.status: creating module/owshell/src/include/Makefile
config.status: creating module/owshell/src/c/Makefile
config.status: creating module/owcapi/Makefile
config.status: creating module/owcapi/src/Makefile
config.status: creating module/owcapi/src/include/Makefile
config.status: creating module/owcapi/src/c/Makefile
config.status: creating module/owcapi/src/example/Makefile
config.status: creating module/owcapi/src/example++/Makefile
config.status: creating module/owtap/Makefile
config.status: creating module/owmon/Makefile
config.status: creating module/swig/Makefile
config.status: creating module/swig/perl5/Makefile
config.status: creating module/swig/perl5/OW/Makefile.linux
config.status: creating module/swig/perl5/OW/Makefile.osx
config.status: creating module/swig/php/Makefile
config.status: creating module/swig/php/example/load_php_OW.php
config.status: creating module/swig/python/Makefile
config.status: creating module/swig/python/ow/Makefile
config.status: creating module/swig/python/setup.py
config.status: creating module/owtcl/Makefile
config.status: creating src/Makefile
config.status: creating src/include/Makefile
config.status: creating src/man/Makefile
config.status: creating src/rpm/Makefile
config.status: creating src/rpm/owfs.spec
config.status: creating src/scripts/Makefile
config.status: creating src/scripts/windows/Makefile
config.status: creating src/scripts/windows/owfs.nsi
config.status: creating src/scripts/usb/Makefile
config.status: creating src/scripts/usb/cygwin/Makefile
config.status: creating src/scripts/usb/windows/Makefile
config.status: creating src/include/owfs_config.h
config.status: creating src/include/config.h
config.status: src/include/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
/bin/rm: cannot remove `libtoolT': No such file or directory

Current configuration:

    Deployment location: /usr

Compile-time options:
                  Caching is enabled
                      USB is enabled
                      I2C is enabled
                   HA7Net is enabled
                       W1 is enabled
           Multithreading is enabled
    Parallel port DS1410E is enabled
        TAI8570 barometer is enabled
             Thermocouple is enabled
         Zeroconf/Bonjour is enabled
             Debug-output is enabled
                Profiling is DISABLED
Tracing memory allocation is DISABLED
1wire bus traffic reports is DISABLED

Module configuration:
                    owlib is enabled
                  owshell is enabled
                     owfs is enabled
                  owhttpd is enabled
                   owftpd is enabled
                 owserver is enabled
                    ownet is enabled
                 ownetlib is enabled
                    owtap is enabled
                    owmon is enabled
                   owcapi is enabled
                     swig is DISABLED
                   owperl is DISABLED
                    owphp is DISABLED
                 owpython is DISABLED
                    owtcl is DISABLED

root@dhcp-179:/etc/owfs-2.8p2#

The eighth step in the owfs install is to perform the following command line:
$ make

root@dhcp-179:/etc/owfs-2.8p2# make
Making all in src
make[1]: Entering directory `/etc/owfs-2.8p2/src'
Making all in include
make[2]: Entering directory `/etc/owfs-2.8p2/src/include'
make  all-am
make[3]: Entering directory `/etc/owfs-2.8p2/src/include'
make[3]: Leaving directory `/etc/owfs-2.8p2/src/include'
make[2]: Leaving directory `/etc/owfs-2.8p2/src/include'
Making all in man
make[2]: Entering directory `/etc/owfs-2.8p2/src/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/etc/owfs-2.8p2/src/man'
Making all in rpm
make[2]: Entering directory `/etc/owfs-2.8p2/src/rpm'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/etc/owfs-2.8p2/src/rpm'
Making all in scripts
make[2]: Entering directory `/etc/owfs-2.8p2/src/scripts'
Making all in usb
make[3]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb'
Making all in windows
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
Making all in cygwin
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb'
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb'
Making all in windows
make[3]: Entering directory `/etc/owfs-2.8p2/src/scripts/windows'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts/windows'
make[3]: Entering directory `/etc/owfs-2.8p2/src/scripts'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts'
make[2]: Leaving directory `/etc/owfs-2.8p2/src/scripts'
make[2]: Entering directory `/etc/owfs-2.8p2/src'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/etc/owfs-2.8p2/src'
make[1]: Leaving directory `/etc/owfs-2.8p2/src'
Making all in module
make[1]: Entering directory `/etc/owfs-2.8p2/module'
Making all in owshell
make[2]: Entering directory `/etc/owfs-2.8p2/module/owshell'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owshell/src'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/c'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owshell'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owshell'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owshell'
Making all in ownet
make[2]: Entering directory `/etc/owfs-2.8p2/module/ownet'
Making all in c
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet/c'
Making all in src
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src'
Making all in c
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
Making all in include
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/c'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c'
Making all in perl5
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet/perl5'
cd OWNet; make all
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/perl5/OWNet'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/perl5/OWNet'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet/perl5'
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/ownet'
Making all in owlib
make[2]: Entering directory `/etc/owfs-2.8p2/module/owlib'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owlib/src'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/c'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owlib'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owlib'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owlib'
Making all in owhttpd
make[2]: Entering directory `/etc/owfs-2.8p2/module/owhttpd'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owhttpd'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd'
Making all in owserver
make[2]: Entering directory `/etc/owfs-2.8p2/module/owserver'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owserver/src'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/include'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/c'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owserver'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owserver'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owserver'
Making all in owfs
make[2]: Entering directory `/etc/owfs-2.8p2/module/owfs'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owfs/src'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/c'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owfs'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owfs'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owfs'
Making all in owftpd
make[2]: Entering directory `/etc/owfs-2.8p2/module/owftpd'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/c'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owftpd'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owftpd'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owftpd'
Making all in owcapi
make[2]: Entering directory `/etc/owfs-2.8p2/module/owcapi'
Making all in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src'
Making all in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/c'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/c'
Making all in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owcapi'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owcapi'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owcapi'
Making all in owtap
make[2]: Entering directory `/etc/owfs-2.8p2/module/owtap'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owtap'
Making all in owmon
make[2]: Entering directory `/etc/owfs-2.8p2/module/owmon'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owmon'
make[2]: Entering directory `/etc/owfs-2.8p2/module'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/etc/owfs-2.8p2/module'
make[1]: Leaving directory `/etc/owfs-2.8p2/module'
make[1]: Entering directory `/etc/owfs-2.8p2'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/etc/owfs-2.8p2'
root@dhcp-179:/etc/owfs-2.8p2#

The ninth step in the owfs install is to perform the following command line:
$ sudo checkinstall –pkgname=owfs –pkgversion=owfs-2.8p2 –backup=no –deldoc=yes –default
I was logged in as the Super-user so no sudo required.

root@dhcp-179:/etc/owfs-2.8p2# checkinstall --pkgname=owfs --pkgversion=owfs-2.8p2 --backup=no --deldoc=yes --default
                  .
                  .
                  .root@dhcp-179:/# mkdir mnt
root@dhcp-179:/# cd mnt
root@dhcp-179:/mnt# mkdir 1-wire

make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
make[5]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/windows'
Making install in cygwin
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[5]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[5]: Nothing to be done for `install-exec-am'.
test -z "" || /bin/mkdir -p ""
make[5]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb/cygwin'
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb'
make[5]: Entering directory `/etc/owfs-2.8p2/src/scripts/usb'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb'
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb'
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts/usb'
Making install in windows
make[3]: Entering directory `/etc/owfs-2.8p2/src/scripts/windows'
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts/windows'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts/windows'
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts/windows'
make[3]: Entering directory `/etc/owfs-2.8p2/src/scripts'
make[4]: Entering directory `/etc/owfs-2.8p2/src/scripts'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/src/scripts'
make[3]: Leaving directory `/etc/owfs-2.8p2/src/scripts'
make[2]: Leaving directory `/etc/owfs-2.8p2/src/scripts'
make[2]: Entering directory `/etc/owfs-2.8p2/src'
make[3]: Entering directory `/etc/owfs-2.8p2/src'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/src'
make[2]: Leaving directory `/etc/owfs-2.8p2/src'
make[1]: Leaving directory `/etc/owfs-2.8p2/src'
Making install in module
make[1]: Entering directory `/etc/owfs-2.8p2/module'
Making install in owshell
make[2]: Entering directory `/etc/owfs-2.8p2/module/owshell'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owshell/src'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/c'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
  /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c owget owdir owread owwrite owpresent '/usr/bin'
libtool: install: /usr/bin/install -c owget /usr/bin/owget
libtool: install: /usr/bin/install -c owdir /usr/bin/owdir
libtool: install: /usr/bin/install -c owread /usr/bin/owread
libtool: install: /usr/bin/install -c owwrite /usr/bin/owwrite
libtool: install: /usr/bin/install -c owpresent /usr/bin/owpresent
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/c'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owshell/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owshell/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owshell'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owshell'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owshell'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owshell'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owshell'
Making install in ownet
make[2]: Entering directory `/etc/owfs-2.8p2/module/ownet'
Making install in c
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet/c'
Making install in src
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src'
Making install in c
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
make[6]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
test -z "/usr/lib" || /bin/mkdir -p "/usr/lib"
 /bin/bash ../../../../../libtool   --mode=install /usr/bin/install -c   libownet.la '/usr/lib'
libtool: install: /usr/bin/install -c .libs/libownet-2.8.so.2.0.0 /usr/lib/libownet-2.8.so.2.0.0
libtool: install: (cd /usr/lib && { ln -s -f libownet-2.8.so.2.0.0 libownet-2.8.so.2 || { rm -f libownet-2.8.so.2 && ln -s libownet-2.8.so.2.0.0 libownet-2.8.so.2; }; })
libtool: install: (cd /usr/lib && { ln -s -f libownet-2.8.so.2.0.0 libownet.so || { rm -f libownet.so && ln -s libownet-2.8.so.2.0.0 libownet.so; }; })
libtool: install: /usr/bin/install -c .libs/libownet.lai /usr/lib/libownet.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[6]: Nothing to be done for `install-data-am'.
make[6]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/c'
Making install in include
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[6]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[6]: Nothing to be done for `install-exec-am'.
test -z "/usr/include" || /bin/mkdir -p "/usr/include"
 /usr/bin/install -c -m 644 ownetapi.h '/usr/include'
make[6]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[6]: Entering directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[6]: Nothing to be done for `install-exec-am'.
make[6]: Nothing to be done for `install-data-am'.
make[6]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c/src'
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/c'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet/c'
Making install in perl5
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet/perl5'
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet/perl5'
make[4]: Nothing to be done for `install-exec-am'.
(cd OWNet && make install DESTDIR="")
make[5]: Entering directory `/etc/owfs-2.8p2/module/ownet/perl5/OWNet'
Installing /usr/local/share/perl/5.10.1/OWNet.pm
Installing /usr/local/man/man3/OWNet.3pm
Appending installation info to /usr/local/lib/perl/5.10.1/perllocal.pod
make[5]: Leaving directory `/etc/owfs-2.8p2/module/ownet/perl5/OWNet'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet/perl5'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet/perl5'
make[3]: Entering directory `/etc/owfs-2.8p2/module/ownet'
make[4]: Entering directory `/etc/owfs-2.8p2/module/ownet'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/ownet'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/ownet'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/ownet'
Making install in owlib
make[2]: Entering directory `/etc/owfs-2.8p2/module/owlib'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owlib/src'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/c'
test -z "/usr/lib" || /bin/mkdir -p "/usr/lib"
 /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c   libow.la '/usr/lib'
libtool: install: /usr/bin/install -c .libs/libow-2.8.so.2.0.0 /usr/lib/libow-2.8.so.2.0.0
libtool: install: (cd /usr/lib && { ln -s -f libow-2.8.so.2.0.0 libow-2.8.so.2 || { rm -f libow-2.8.so.2 && ln -s libow-2.8.so.2.0.0 libow-2.8.so.2; }; })
libtool: install: (cd /usr/lib && { ln -s -f libow-2.8.so.2.0.0 libow.so || { rm -f libow.so && ln -s libow-2.8.so.2.0.0 libow.so; }; })
libtool: install: /usr/bin/install -c .libs/libow.lai /usr/lib/libow.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/c'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owlib/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owlib/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owlib'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owlib'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owlib'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owlib'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owlib'
Making install in owhttpd
make[2]: Entering directory `/etc/owfs-2.8p2/module/owhttpd'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/include'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
  /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c owhttpd '/usr/bin'
libtool: install: /usr/bin/install -c .libs/owhttpd /usr/bin/owhttpd
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src/c'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owhttpd'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owhttpd'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owhttpd'
Making install in owserver
make[2]: Entering directory `/etc/owfs-2.8p2/module/owserver'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owserver/src'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/include'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owserver/src/c'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
  /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c owserver '/usr/bin'
libtool: install: /usr/bin/install -c .libs/owserver /usr/bin/owserver
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src/c'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owserver/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owserver/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owserver'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owserver'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owserver'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owserver'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owserver'
Making install in owfs
make[2]: Entering directory `/etc/owfs-2.8p2/module/owfs'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owfs/src'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/c'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
  /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c owfs '/usr/bin'
libtool: install: /usr/bin/install -c .libs/owfs /usr/bin/owfs
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/c'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owfs/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owfs/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owfs'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owfs'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owfs'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owfs'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owfs'
Making install in owftpd
make[2]: Entering directory `/etc/owfs-2.8p2/module/owftpd'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/c'
test -z "/usr/bin" || /bin/mkdir -p "/usr/bin"
  /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c owftpd '/usr/bin'
libtool: install: /usr/bin/install -c .libs/owftpd /usr/bin/owftpd
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/c'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owftpd/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owftpd/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owftpd'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owftpd'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owftpd'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owftpd'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owftpd'
Making install in owcapi
make[2]: Entering directory `/etc/owfs-2.8p2/module/owcapi'
Making install in src
make[3]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src'
Making install in c
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/c'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/c'
test -z "/usr/lib" || /bin/mkdir -p "/usr/lib"
 /bin/bash ../../../../libtool   --mode=install /usr/bin/install -c   libowcapi.la '/usr/lib'
libtool: install: warning: relinking `libowcapi.la'
libtool: install: (cd /etc/owfs-2.8p2/module/owcapi/src/c; /bin/bash /etc/owfs-2.8p2/libtool  --tag CC --mode=relink gcc -I../include -I../../../owlib/src/include -L../../../owlib/src/c -fexceptions -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wredundant-decls -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -pthread -g -O2 -D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -low -version-info 2:0:0 -release 2.8 -L/usr/lib -lusb -Wl,--rpath -Wl,/usr/lib -shared -shrext .so -o libowcapi.la -rpath /usr/lib owcapi.lo -lm -ldl )
libtool: relink: gcc -shared  .libs/owcapi.o   -L/etc/owfs-2.8p2/module/owlib/src/c -L/usr/lib -low -lusb -lm -ldl  -pthread -Wl,--rpath -Wl,/usr/lib   -pthread -Wl,-soname -Wl,libowcapi-2.8.so.2 -o .libs/libowcapi-2.8.so.2.0.0
libtool: install: /usr/bin/install -c .libs/libowcapi-2.8.so.2.0.0T /usr/lib/libowcapi-2.8.so.2.0.0
libtool: install: (cd /usr/lib && { ln -s -f libowcapi-2.8.so.2.0.0 libowcapi-2.8.so.2 || { rm -f libowcapi-2.8.so.2 && ln -s libowcapi-2.8.so.2.0.0 libowcapi-2.8.so.2; }; })
libtool: install: (cd /usr/lib && { ln -s -f libowcapi-2.8.so.2.0.0 libowcapi.so || { rm -f libowcapi.so && ln -s libowcapi-2.8.so.2.0.0 libowcapi.so; }; })
libtool: install: /usr/bin/install -c .libs/libowcapi.lai /usr/lib/libowcapi.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/c'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/c'
Making install in include
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[5]: Nothing to be done for `install-exec-am'.
test -z "/usr/include" || /bin/mkdir -p "/usr/include"
 /usr/bin/install -c -m 644 owcapi.h '/usr/include'
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src/include'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src'
make[5]: Entering directory `/etc/owfs-2.8p2/module/owcapi/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src'
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owcapi/src'
make[3]: Entering directory `/etc/owfs-2.8p2/module/owcapi'
make[4]: Entering directory `/etc/owfs-2.8p2/module/owcapi'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/etc/owfs-2.8p2/module/owcapi'
make[3]: Leaving directory `/etc/owfs-2.8p2/module/owcapi'
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owcapi'
Making install in owtap
make[2]: Entering directory `/etc/owfs-2.8p2/module/owtap'
/usr/bin/install -c -d /usr/bin
/usr/bin/install -c -m 755 owtap.tcl /usr/bin/owtap
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owtap'
Making install in owmon
make[2]: Entering directory `/etc/owfs-2.8p2/module/owmon'
/usr/bin/install -c -d /usr/bin
/usr/bin/install -c -m 755 owmon.tcl /usr/bin/owmon
make[2]: Leaving directory `/etc/owfs-2.8p2/module/owmon'
make[2]: Entering directory `/etc/owfs-2.8p2/module'
make[3]: Entering directory `/etc/owfs-2.8p2/module'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/etc/owfs-2.8p2/module'
make[2]: Leaving directory `/etc/owfs-2.8p2/module'
make[1]: Leaving directory `/etc/owfs-2.8p2/module'
make[1]: Entering directory `/etc/owfs-2.8p2'
make[2]: Entering directory `/etc/owfs-2.8p2'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/etc/owfs-2.8p2'
make[1]: Leaving directory `/etc/owfs-2.8p2'

======================== Installation successful ==========================

Copying documentation directory...
./
./ChangeLog
./AUTHORS
./COPYING.LIB
./NEWS
./INSTALL
./TODO
./COPYING
./README

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting doc-pak directory...OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been installed and saved to

 /etc/owfs-2.8p2/owfs_0-1_i386.deb

 You can remove it from your system anytime using:

      dpkg -r owfs

**********************************************************************

root@dhcp-179:/etc/owfs-2.8p2#

The tenth step in the owfs install is to create the following directory:
$ sudo mkdir /mnt/1-wire
Once again, since I was logged in as the Super-user, no sudo needed.

root@dhcp-179:/#  mkdir /mnt/1-wire
mkdir: cannot create directory `/mnt/1-wire': No such file or directory
root@dhcp-179:/# mkdir mnt
root@dhcp-179:/# cd mnt
root@dhcp-179:/mnt# mkdir 1-wire

The eleventh step in the owfs install is to create the following directory:
$ sudo owfs -u –allow_other /mnt/1-wire
Since I was logged in as the Super-user, no sudo needed.

root@dhcp-179:/# owfs -u --allow_other /mnt/1-wire
DEFAULT: owlib.c:SetupSingleInboundConnection(196) Cannot open USB bus master
DEFAULT: owlib.c:LibStart(54) No valid 1-wire buses found
root@dhcp-179:/#

This step however failed (see the error messages above)
Matt the instructor ran into the same issue. He found a solution and documented it on his journal page:
http://lab46.corning-cc.edu/haas/status/status_201010#october_10th_2010
On this page, Matt mentioned a Web page which may have led him to the solution:
http://automation.binarysage.net/?p=1244&cpage=1
I asked Matt for help at this point, he performed a mount command:

root@dhcp-179:/# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
OWFS on /mnt/1-wire type fuse.OWFS (rw,nosuid,nodev)

Next he changed into the /mnt/1-wire directory:

root@dhcp-179:/# cd /mnt/1-wire/

Next, he checked to see what USB existed by listing /dev/ttyus and performing a tab completion:

root@dhcp-179:/mnt/1-wire# ls -l /dev/ttyUS
NOTE: tab complete-see next line so the device exists
root@dhcp-179:/mnt/1-wire# ls -l /dev/ttyUSB0

Matt then entered the command line that resolved the issue described above:

root@dhcp-179:/# owfs /dev/ttyUSB0 /mnt/1-wire

Next, he changed the directory to /mnt/1-wire and performed a listing of the 1-wire directory:

root@dhcp-179:/# cd /mnt/1-wire/
root@dhcp-179:/mnt/1-wire# ls
26.54538C000000  settings      statistics  system
bus.0         simultaneous  structure   uncached

Here Matt left me (at my request). Since the device directory was present all that one needs to do is to change to it and “cat” whichever sensor file one needs to obtain data from so I changed to the device directory (26.54538C000000) and then “catted” temperature and received its value:

root@dhcp-179:/mnt/1-wire# cd 26.54538C000000
root@dhcp-179:/mnt/1-wire/26.54538C000000# cat temperature
     24.0938root@dhcp-179:/mnt/1-wire/26.54538C000000#

Since 24.0938 isn't room temperature in degrees Fahrenheit, I converted this number to Fahrenheit to see what is its value would be. It turns out, it converts to 75.3688 ºF. I didn't think the LAIR was that hot.

CSCS 2650-Computer Organization
I modified the skeleton cpu/include/xnor.h, as follows:

#ifndef _XNOR_H
#define _XNOR_H
#include "xor.h"
#include "not.h"
class XNOR
{
    public:
           XNOR() ;

           void set();
           void set(bool);
           void set(bool, bool);
           bool get();

    private:
           bool input1;
           bool input2;
           XOR myXORGate;
           NOT myNotGate;
};
#endif

Next, I modified the skeleton cpu/boolops/xnor/xnor.cc, which has become:

#include "xnor.h"
#include "xor.h"
#include "not.h"


XNOR::XNOR()
{
 input1 = input2 = false;
}
void XNOR::set()
{
 input1 = input2 = false;
}

void XNOR::set(bool value)
{
 input1 = input2 = value;
}
void XNOR::set(bool value1, bool value2)
{
 input1 = value1;
 input2 = value2;
}
bool XNOR::get()
{
 myXORGate.set(input1, input2);
 myNotGate.set(myXORGate.get());
 return(myNotGate.get());
}

Next, I modified the skeleton Makefile to have the following contents:

CXX = g++ $(CXXFLAGS) $(INC) $(LIBS)
AR = ar
CXXFLAGS = -Wall
INC = -I ../../include/
LIBS =
SRC = xnor.cc xnortest.cc ../xor/xor.cc ../not/not.cc
OBJ = $(SRC:.cc=.o)
BIN = xnortest
all: $(SRC) $(BIN)

debug: CXX += -DDEBUG -g
debug: DEBUG = debug
debug: $(SRC) $(BIN)

$(BIN): $(OBJ)
ifneq ($(MAKECMDGOALS),debug)
        @printf "[CC]  %-20s ... " "$(BIN)"
        @$(CXX) -o $(BIN) $(OBJ) && echo "SUCCESS" || echo "FAIL"
else
        $(CXX) -o $(BIN) $(OBJ)
endif

.cc.o:
ifneq ($(MAKECMDGOALS),debug)
        @printf "[B]   %-20s ... " "$<"
        @$(CXX) -c $< && echo "OK" || echo "FAIL"
else
        $(CXX) -c $<
endif

clean:
        rm -f *.o $(BIN) core

default: $(BIN)

Lastly, I modified the skeleton xnortest.cc file to be become:

#include <cstdio>
#include "xnor.h"
#include "not.h"
#include "xor.h"

int main()
{
        bool a, b;
        a = true, b = false;

        printf("--------------------\n");
        printf("TRUE is: %d\n", true);
        printf("FALSE is: %d\n", false);
        printf("--------------------\n\n");

        XNOR myXnorGate;

        printf(" a b | x \n");
        printf("-----+---\n");

        for(int temp = 0; temp <=3; temp++)
        {
                if (temp & 0x2) a = true;
                else a = false;
                if (temp & 0x01) b = true;
                else b = false;
                //switch(temp)
                //{
                //      case 0:
        //        a = false;
                //              b = false;
                //              break;
                //      case 1:
                //              a = false;
                //              b = true;
                //              break;
                //      case 2:
                //              a = true;
                //              b = false;
                //              break;
                //      case 3:
                //              a = true;
                //              b = true;
                //              break;
                //}
                myXnorGate.set(a, b);
                printf(" %d %d | %d\n", a, b, myXnorGate.get());
        }
        printf("---------\n");
        return(0);
}

After modifying the skeleton xnor.h, xnor/Makefile, xnor/xnor.cc, and xnortest.cc files, I then attempted to make xnortest, However, the make failed:

lab46:~/src/cpu/boolops/xnor$ make
[B]   ../xor/xor.cc        ... OK
[B]   ../not/not.cc        ... OK
[CC]  xnortest             ... g++: ../xor/xor.o: No such file or directory
g++: ../not/not.o: No such file or directory
FAIL

So I was forced to make both the xor and not before I could successfully compile. Once I built these two items, I made xnortest successfully.

lab46:~/src/cpu/boolops/xnor$ cd ..
lab46:~/src/cpu/boolops$ cd xor
lab46:~/src/cpu/boolops/xor$ make
[B]   xor.cc               ... OK
[B]   xortest.cc           ... OK
[CC]  xortest              ... SUCCESS
lab46:~/src/cpu/boolops/xnor$ cd ..
lab46:~/src/cpu/boolops$ cd not
lab46:~/src/cpu/boolops/not$ make
[B]   not.cc               ...
OK
[B]   nottest.cc           ... OK
[CC]  nottest              ... SUCCESS
lab46:~/src/cpu/boolops/xnor$ make
[CC]  xnortest             ... SUCCESS

I then executed xnortest, and it executed as expected:

lab46:~/src/cpu/boolops/xnor$ ./xnortest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 1
 0 1 | 0
 1 0 | 0
 1 1 | 1
---------

I then committed my changes to the repository:

lab46:~/src/cpu/boolops/xnor$ cd ..
lab46:~/src/cpu/boolops$ cd ..
lab46:~/src/cpu$ svn commit -m "Finished the xnor class -John Rine"
Sending        boolops/xnor/Makefile
Sending        boolops/xnor/xnor.cc
Sending        boolops/xnor/xnortest.cc
Sending        include/xnor.h
Transmitting file data ....
Committed revision 40.


I wasn't happy with the ortest.cc, xortest.cc, and xnortest.cc files that I created and edited, so I streamlined them even more. In each of these files, the comment levels tell the story. The lines commented twice are the first version. The lines commented as once are the second version. The two lines using the bitwise and operator are the third version.
ortest.cc

#include <cstdio>
#include "or.h"

int main()
{
        bool a, b;
        a = true, b = false;

        printf("--------------------\n");
        printf("TRUE is: %d\n", true);
        printf("FALSE is: %d\n", false);
        printf("--------------------\n\n");

        OR myOrGate;

        printf(" a b | x \n");
        printf("-----+---\n");

        for(int temp = 0; temp <=3; temp++)
        {
                a = temp & 0x02;
                b = temp & 0x01;
                //if(temp & 0x02) a = true;
                //else a = false;
                //if(temp & 0x01) b = true;
                //else b = false;
                ////switch(temp)
                ////{
                ////    case 0:
                ////            a = false;
                ////            b = false;
                ////            break;
                ////    case 1:
                ////            a = false;
                ////            b = true;
                ////            break;
                ////    case 2:
                ////            a = true;
                ////            b = false;
                ////            break;
                ////    case 3:
                ////            a = true;
                ////            b = true;
                ////            break;
                ////
    }
                myOrGate.set(a, b);
                printf(" %d %d | %d\n", a, b, myOrGate.get());
        }
        printf("---------\n");
        return(0);
}

lab46:~/src/cpu/boolops/or$ make
[B]   or.cc                ... OK
[B]   ortest.cc            ... OK
[CC]  ortest               ... SUCCESS
lab46:~/src/cpu/boolops/or$ ./ortest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 0
 0 1 | 1
 1 0 | 1
 1 1 | 1
---------

Since the modifications to the file were successful as witnessed in the execution of the program, I committed it to the repository.

lab46:~/src/cpu/boolops/xor$ cd ..
lab46:~/src/cpu/boolops$ cd or
lab46:~/src/cpu/boolops/or$ svn commit -m "Streamlined ortest and xortest -John Rine"
Sending        or/ortest.cc
Transmitting file data .
Committed revision 63.


xortest.cc

#include <cstdio>
#include "xor.h"

int main()
{
        bool a, b;
        a = true, b = false;

        printf("--------------------\n");
        printf("TRUE is: %d\n", true);
        printf("FALSE is: %d\n", false);
        printf("--------------------\n\n");

        XOR myXorGate;

        printf(" a b | x \n");
        printf("-----+---\n");

        for(int temp = 0; temp <=3; temp++)
        {
                a = temp & 0x02;
                b = temp & 0x01;
                //if (temp & 0x2)       a = true;
                //else a = false;
                //if (temp & 0x01) b = true;
                //else b = false;
                ////switch(temp)
                ////{
                ////    case 0:
                ////            a = false;
                ////            b = false;
                ////            break;
                ////    case 1:
                ////            a = false;
                ////            b = true;
                ////            break;
                ////    case 2:
                ////            a = true;
                ////            b = false;
                ////            break;
                ////    case 3:
                ////            a = true;
                ////            b = true;
                ////            break;
                ////
    }
                myXorGate.set(a, b);
                printf(" %d %d | %d\n", a, b, myXorGate.get());
        }
        printf("---------\n");
        return(0);
}

lab46:~/src/cpu/boolops/xor$ make
[B]   xortest.cc           ... OK
[CC]  xortest              ... SUCCESS
lab46:~/src/cpu/boolops/xor$ ./xortest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 0
 0 1 | 1
 1 0 | 1
 1 1 | 0
---------

Since the modifications to the file were successful, I committed it to the repository.

lab46:~/src/cpu/boolops/xor$ svn commit -m "Streamlined ortest and xortest -John Rine"
Sending        xor/xortest.cc
Transmitting file data .
Committed revision 62.


xnortest.cc

#include <cstdio>
#include "xnor.h"
#include "not.h"
#include "xor.h"

int main()
{
        bool a, b;
        a = true, b = false;

        printf("--------------------\n");
        printf("TRUE is: %d\n", true);
        printf("FALSE is: %d\n", false);
        printf("--------------------\n\n");

        XNOR myXnorGate;

        printf(" a b | x \n");
        printf("-----+---\n");

        for(int temp = 0; temp <=3; temp++)
        {
                a = temp & 0x02;
                b = temp & 0x01;
                //if (temp & 0x2)       a = true;
                //else a = false;
                //if (temp & 0x01) b = true;
                //else b = false;
                ////switch(temp)
                ////{
                ////    case 0:
                ////            a = false;
                ////            b = false;
                ////            break;
                ////    case 1:
                ////            a = false;
                ////            b = true;
                ////            break;
                ////    case 2:
                ////            a = true;
                ////            b = false;
                ////            break;
                ////    case 3:
                ////            a = true;
                ////            b = true;
                ////            break;
                ////}
                myXnorGate.set(a, b);
                printf(" %d %d | %d\n", a, b, myXnorGate.get());
        }
        printf("---------\n");
        return(0);
}

lab46:~/src/cpu/boolops/xnor$ make
[B]   xnortest.cc          ... OK
[CC]  xnortest             ... SUCCESS

lab46:~/src/cpu/boolops/xnor$ ./xnortest
--------------------
TRUE is: 1
FALSE is: 0
--------------------

 a b | x
-----+---
 0 0 | 1
 0 1 | 0
 1 0 | 0
 1 1 | 1
---------

Since the modifications to the file were successful as witnessed in the execution of the program, I committed it to the repository.

lab46:~/src/cpu/boolops/xnor$ svn commit -m "Streamlined xnortest.cc -John Rine"
Sending        xnor/xnortest.cc
Transmitting file data .
Committed revision 64.

Week 3 Journal Entry

CSIT 1320 HPC Fundamentals
After successfully completing the first project listed on the HPC Fundamental projects Web page, Linux/*BSD Desktop Install, I proceeded to the next project on the list, the Linux VM Server Install.
Before starting the install, Matt asked me to first replace the ATA hard drive in the machine whose video output is available on button 8 of the KVM switcher used to switch video output and and keyboard input from VM server machine to VM server machine. It is also the machine that is on the VM Server shelf, and is the fourth machine from the far wall.
To replace the hard drive, first, I disconnected the cables from the back of the machine. After disconnecting the cables, I then removed the computer from the shelf. I opened the computer, removed the IDE and power cables from the drive, and removed the drive. Once the drive was removed, I checked the connector used to configure master/slave/CS enable and determined that the old hard drive was configured for CS enable. The new hard drive was already configured for CS Enable so I removed the mounting rails from the old hard drive and installed them on the new one. Next, I then installed the new drive into the conputer's drive bay. I then reconnected the IDE and power connectors to the drive, and closed the computer's case. I replaced the computer on the VM server shelf and reconnected the cables I had disconnected previously.
This is the point where the VM server install begins:

  1. Make sure the VM Server KVM is set to the VM Server machine you are using for the install, make sure the KVM channel is set to 00 (mine VM Server machine was connected to KVM button 8).
  2. Turn on the VM Server computer on which you will install the VM server, Make sure the monitor at the monitor and keyboard station near the VM Server “farm” is turned on.
  3. As it boots, press F2 on the keyboard to bypass the “System Setup” screen and go directly to the cmos setup.
  4. Arrow down to the “Disk Configuration” item and press enter. A popup screen will appear.
  5. On the popup screen, arrow down to “Primary Master Drive” and press enter. A popup screen appears.
  6. On the popup screen, arrow to (if required) “Drive Type”; using the right or left arrow keys, set to the type “Auto”. Press enter to exit the second popup; press escape to exit the first popup.
  7. On the BIOS setup main screen, arrow down to “Boot Sequence” and press enter. A popup screen appears.
  8. On the popup screen, using the +/- arrow keys, move the “Integrated NIC” item to the second item on the list with the hard drive at the top of the list. Make sure it is enabled (square root symbol directly to the left of this item). If it isn't enabled, use the space bar to enable it. Press enter to exit the popup window.
  9. On the BIOS setup main screen, arrow down to the “Integrated Devices (LegacySelect Options)” and press enter. A popup screen appears.
  10. On the popup, arrow down to “Network Interface Controller” item. Using the right or left arrow keys, set the network interface controller to “On w/PXE”.
  11. Press escape to exit the bios setup screen. Popup appears.
  12. On the popup screen, arrow to (if required) the “Save Changes and Exit” item. Press enter to exit the BIOS setup screen.
  13. Computer reboots.
  14. Next, the Lair Network Boot Menu loads.
  15. Select “Debian/i386 Netboot” and press enter.
  16. Arrow to “Install Squeeze/testing [text]” if required and press enter.
  17. At this point, the installation begins (defaults were selected throughout MOST but not all of the installation).
  18. The “Select a language” screen is displayed. The default is “English”, press enter to select this item.
  19. The “Select a location” screen is displayed. The default is “United States”, press enter this item.
  20. The “Select a keyboard layout” screen is displayed. The default is “American English”, press enter this item.
  21. The “Configure the network” screen is displayed. On this screen, the Host name: “dhcp-175” is entered automatically. press enter to continue.
  22. The “Configure the network” screen is displayed. On this screen, the Domain name: “offbyone.lan” is entered automatically. Press enter to continue.
  23. The “Choose a mirror of the Debian archive” screen is displayed. The default is “United States”. Arrow up to “Enter information manually” item and press enter.
  24. The “Choose a mirror of the Debian archive” screen is displayed. The Debian mirror host name: “mirror” is entered automatically. Press enter to continue.
  25. The “Choose a mirror of the Debian archive” screen is displayed. The Debian archive directory: “/debian/” is entered automatically. Press enter to continue.
  26. The “Choose a mirror of the Debian archive” screen is displayed. HTTP proxy information is blank by default. Press enter to continue.
  27. In the first installation od Debian Squeeze, the installation continued from here, however during the second installation, the installation failed because a file could not be insalled from the network archive. This was because there was a newer version that was avalable. When the failure occured, the installer is prompted to either retry or change the mirror. During the second installation the mirror was changed to thr RIT mirror.
  28. Next, the “Set up users and passwords” screen is displayed. The Root password I entered was “bob”.
  29. The “Set up users and passwords” screen is displayed. The installer is prompted to re-enter the password. I entered entered “bob”.
  30. The “Set up users and passwords” screen is displayed. The installer is prompted to enter “The full name for the new user:” I entered “a”.
  31. The “Set up users and passwords” screen is displayed. The installer is prompted to enter the username for the account. I entered “a”.
  32. The “Set up users and passwords” screen is displayed. The installer is prompted to enter a password for the new user. I entered “a”.
  33. Next, the “Configure the clock” screen is displayed. For Select your time zone: “Eastern” is the default. Press enter to continue.
  34. The “Partition disk” screen is displayed. The default is “Guided-use entire disk”, press enter to continue.
  35. The “Partition disk” screen is displayed. The disk to partition: SCSI 1 (0,0,0) (sda)-xxx.xxGB ATA Maxtor. has been entered automatically. Press enter to continue.
  36. The “Partition disk” screen is displayed. Partitioning scheme: “All files in one partition (recommended for new users)” is the default. Press enter to continue.
  37. The “Partition disk” screen is displayed. The default “Finish partitioning and write changes to disk” is displayed. Press enter to continue.
  38. Partitioning message-“The following partitions are going to be formatted: Partition #1 of SCSI1 (0,0,0) sda as ext3; Partition #5 of SCSI1 (0,0,0) sda as swap.”
  39. Popularity contest message “Configuring popularity contest: Participate in the package usage survey?”. Select <no>.
  40. The “Software selection” screen is displayed. The default is “Graphical desktop environment”. Deselect this selection using the spacebar. Using the space bar, select the ssh server. If any other items are selected, deselect them using the space bar. Press enter to continue.
  41. Configuring grub message: “Configuring grub-pc: Install grub boot loader to master boot record”, <yes>.
  42. Installation complete <continue>.
  43. Finishing the installation..
  44. Computer reboots automatically.
  45. Next, at the prompt as root vmserver04 login: root password bob
  46. Now delete user a's account. At the command prompt, enter “userdel -r a” (a in this case is the name of the user)
  47. Now change directory to /etc/apt and list the contents of the directory. At the command prompt, enter “ls”.
  48. rename sources.list because we are going to download a new one into this disrectory. At the command prompt, enter “mv sources.list oldsources.list”.
  49. Now download the replacement sources.list. At the command prompt, enter “wget http://web.offbyone.lan/files/students/sources.list
  50. Next, open sources.list with a text editor and replace all references to “lenny” to “squeeze” (squeeze was release last Sunday). On the command prompt, enter “vi sources.list”. In vi enter “:%s/lenny/squeeze/g”. Next to save the changes and quit vi, Enter “:wq”.
  51. on the command line enter “aptitude update”.
  52. Next on the command line, enter “aptitude upgrade”.
  53. On the commmand line enter “aptitude search xen”.
  54. Next, on the command line, enter “aptitude install xen-linux-system xen-tools”
  55. Now on a remote computer, open a terminal and at the prompt enter “ssh root@vmserver04.student.lab”. When propmted, enter the password “bob”.
  56. Next, edit the file /etc/xen/xend-config.sxp. on the command line enter “nano /etc/xen/xend-config.sxp”. In nano, search for “network-script”. Once this is located, uncomment “(network-script network bridge)”. Make sure you have no leading spaces on this line once you uncomment as Python doesn't like leading spaces. While in nano, make sure that the line “(vif-script vif-bridge)” is uncommented. Save the file and exit nano.
  57. Next, edit the file /etc/xen/scripts/vif-common.sh. On the command line, enter “nano /etc/xen/scripts/vif-common.sh”. Locate the function “frob_iptable()”. Add “–physdev-is-bridge” to the two “iptables” lines so that they become “iptables “$c” FORWARD -m physdev –physdev-is-bridged –physdev-in “$vif” “$@” -j ACCEPT \ 2>/dev/null &&” and “iptables “$c” FORWARD -m state –state RELATED,ESTABLISHED -m physdev \ –physdev-is-bridged –physdev-out “$vif” -j ACCEPT 2>/dev/null”. Once these modifications have been made save and exit nano.
  58. Now edit the file /etc/modules. on the command line enter “nano /etc/modules”. Find the line “loop” and change it to “loop max_loop=255”. Save the file and exit nano.
  59. Edit the file /etc/xen-tools/xen-tool.conf. On the command line, enter “nano /etc/xen-tools/xen-tools/xen-tool.conf”. Delete the entire contents of this file using cntl-k. Next, paste the all of the text from the text field (dowiki code field) labelled “xen-tools…Config file, /etc/xen-tools/xen-tools.conf follows:” located on http://lab46.corning-cc.edu/haas/system/sokraits_halfadder.offbyone.lan. Now change the line “arch = amd64” to “arch = i386”. Once these modifications have been made save and exit nano.
  60. Next, edit the file /etc/default/grub. On the command line, enter “nano /etc/default/grub”. Verify that the line is set as follows, “GRUB_DISABLE_OS_PROBER=true”. If it isn't, edit it so it so that it is. Once these modifications have been made save and exit nano.
  61. From the instructions on http://lab46.corning-cc.edu/haas/system/sokraits_halfadder.offbyone.lan, on the command line, perform the following command “mv /etc/grub.d/10_linux /etc/grub.d/50_linux”
  62. Now run update-grub2. On the command line, enter “update-grub2”.
  63. Now edit the file /etc/default/xendomains. On the command line, enter “nano /etc/default/xendomains”. In this file, make the following modification: change XENDOMAINS_SAVE from “XENDOMAINS_SAVE=/var/lib/xen/save” to “XENDOMAINS_SAVE=”“” (change XENDOMAINS_SAVE to an empty string). Also verify that XENDOMAINS_RESTORE is set to false: “XENDOMAINS_RESTORE=false”. Once these modifications have been made save and exit nano.
  64. On the command line enter the command to reboot: “ reboot” (look across the room at the monitor at the VM server setup station to observe the reboot process).
  65. Once the reboot has taken place, on the command line, enter “xm list”.

The following was displayed during my install:

    root@vmserver04:~# xm list    
    Name                        ID    Mem     VCPUs      State         Time(s)
    Domain-0                    0     1883    1          2_____        18.8

No errors! This concludes the VM server install.

CSIT 2048 HPC Experience II
Last week (see last week's CSIT 2048 journal entry), I did get owfs to execute properly and was able to cat the temperature file successfully in the device directory and get a temperature value. However, I found that if I unplugged the sensor from the USB port, the device directory, 26.54538C000000, disappeared from the /mnt/1-wire directory. The /mnt/1-wire directory, however, still contained files which are part of the owfs (if the term “file system” is used after owfs, a redundancy is created because owfs stands for One Wire File System). If I then reconnected the sensor to the USB port, the device directory did not re-appear in the /mnt/1-wire directory and I was unsuccessful at getting it started again.
Here are the contents of the /mnt/1-wire directory after disconnecting the sensor from the USB port:

root@dhcp-179:/mnt/1-wire# ls
bus.0 settings statistics  system simultaneous  structure   uncached

Next, I executed the owfs mount command:

root@dhcp-179:/mnt/1-wire# owfs /dev/ttyUSB0 /mnt/1-wire

The device directory, 26.54538C000000, however, did not reappear in the /mnt/1-wire directory. I believe that the correct course of action to take to correct this situation was to unmount and then remount the owfs file system as this is what Matt did the first time I got the owfs file system into a “disallowed” state by unplugging the owfs senso from the usb port. Through what turned out to be a “comedy of errors” (not so funny to me), when I performed these steps, they did not work. enter the following on the command line: root@dhcp-179:/mnt/1-wire# unmount /dev/ttyUS [tab complete] to determine which USB device can be attached to the owfs.

root@dhcp-179:/mnt/1-wire# unmount /dev/ttyUSB0 /mnt/1-wire

This action did not work:

root@dhcp-179:/mnt/1-wire# ls
bus.0 settings statistics  system simultaneous  structure   uncached

The directory still was not empty indicating that owfs had been successfully unmounted. Finally, rather than waste anymore time, I called over the instructor, who after looing at what I was doing, pointed out to me that I was in the owfs file system (/mnt/1-wire directory) when I was trying to unmount it, D-U-U-H-H-H! The instructor then changed the working directory so that it was NOT in the /mnt/1-wire directory and then successfully performed an unmount of owfs:

root@dhcp-179:/mnt/1-wire# cd /
root@dhcp-179:/# unmount /mnt/1-wire

The instructor pointed out to me that if the unmount command is used with the -f option (for force) it will perform the unmount command when unmount command without this option will not. With the owfs device plugged into the USB port, the instructor then remounted owfs using the owfs command:

root@dhcp-179:/# owfs /dev/ttyUSB0 /mnt/1-wire

Next, he changed the directory to /mnt/1-wire and performed a listing of the 1-wire directory:

root@dhcp-179:/# cd /mnt/1-wire/
root@dhcp-179:/mnt/1-wire# ls
26.54538C000000  settings      statistics  system
bus.0		 simultaneous  structure   uncached

and boom, batta, bing, there is the device directory, 26.54538C000000!
Next week, because I had so many weird issues with owfs caused primarily by my misunderstanding of the owfs file system and the whole UNIX/Linux “everthing is a file” including data returned from hardware thing coupled with confusion caused by the fact that Jesse mounted the owfs on his computer to a different directory than the one I was using, I will go through the unmount and remount of owfs one more time. Hopefully this time without incident. I learned alot about owfs and UNIX/Linux files systems. Sometimes mistakes turn out to be good things, they can lead to a deeper understanding of something.

CSCS 2650 Computer Organization
I copied and then modified the Makefile from the cpu/boolops/or directory. In order to use the Makfile, I had to change the SRC line from SRC = or.cc ortest.cc to SRC = cpumem.cc memtest.cc. I also had to change the BIN line from BIN = ortest to BIN = memtest. After making these changes, I had some a problem getting the Makefile to find cpu/include/cpumem.h because the or directory is a subdirectory of boolops which in turn is a sub-directory of cpu. The directory I created, cpumemory, however is a subdirectory of cpu, but rather than having a sub-directory for different kinds of memory, I placed the files Makefile, cpumem.cc, and memtest.cc directly into the cpumemory directory itself rather than a sub-directory of it, so the INC line in the Makefile had to be changed from INC = -I ../../include/ to INC = -I ../include/. to compensate for the differing directory levels.

CXX = g++ $(CXXFLAGS) $(INC) $(LIBS)
AR = ar
CXXFLAGS = -Wall
INC = -I ../include/
LIBS =
SRC = cpumem.cc memtest.cc
OBJ = $(SRC:.cc=.o)
BIN = memtest
all: $(SRC) $(BIN)

debug: CXX += -DDEBUG -g
debug: DEBUG = debug
debug: $(SRC) $(BIN)

$(BIN): $(OBJ)
ifneq ($(MAKECMDGOALS),debug)
        @printf "[CC]  %-20s ... " "$(BIN)"
        @$(CXX) -o $(BIN) $(OBJ) && echo "SUCCESS" || echo "FAIL"
else
        $(CXX) -o $(BIN) $(OBJ)
endif

.cc.o:
ifneq ($(MAKECMDGOALS),debug)
        @printf "[B]   %-20s ... " "$<"
        @$(CXX) -c $< && echo "OK" || echo "FAIL"
else
        $(CXX) -c $<
endif

clean:
        rm -f *.o $(BIN) core

default: $(BIN)

The following source code is the complete contents of the cpumem.h file which contains the cpumem class member function prototypes:

#ifndef _CPUMEM_H
#define _CPUMEM_H
class CPUMEM
{
        public:
                CPUMEM();
                CPUMEM(int memLength);
                int& operator[](int address);
                ~CPUMEM();
        private:
                int memlngth;
                int *memadd;
};
#endif

The following source code is the complete contents of the cpumem.cc file which contains the cpumem class member function definitions. Notice that when an object of CPUMEM is instantiatied, the overloaded constructor dynamically allocates an array of the size passed to the overloaded constructor-COOL! Also note that the destructor deallocates (frees up) the memory previously allocated when an object of CPUMEM was instatiated when the object goes out of scope-COOL! Also note that this class mimicks an array because there is a function which overloads operators-COOL!

#include "cpumem.h"

CPUMEM::CPUMEM()
{
        memlngth = 0;
        memadd = 0;
}

CPUMEM::~CPUMEM()
{
        delete[] memadd;
}

CPUMEM::CPUMEM(int memlength)
{
        memadd = new int[memlength];
}

int& CPUMEM::operator[](int address)
{
        return memadd[address];
}

The code listed below is a complete listing of the memtest.cc file. The file first creates an instance of a cpumem object and assigns the value 8192 (8k) as the size of the array to be created through the use of the overloaded constructor, using dynamic memory allocation, called when the object is instantiated. Next, a for loop loops through all of the memory locations (array elements) of the array and assigns them a unique value so that when they are read back later, the memory locations can be verified. Next, a for loop once again loops through all of the memory locations but this time the for loop is used to print the value of each memory location. When the cpumem object goes out of scope, the constructor is called and the memory allocated when the contructor was called is now dealloacted. Then the program returns 0 to the sytem to indicate to it that the program completed successfully.

#include <cstdio>
#include "cpumem.h"
const int MEM_MAX = 8192;
int main()
{
        CPUMEM datamemory(MEM_MAX);
        for(int temp = 0; temp < MEM_MAX; temp++) datamemory[temp] = 8080;
        for(int temp = 0; temp < MEM_MAX; temp++) printf("Memory address %d contains the value %d\n", temp, datamemory[temp]);
        return(0);
}

Next, I made memtest by using make:

lab46:~/src/cpu/cpumemory$ make
[B]   cpumem.cc            ... OK
[B]   memtest.cc           ... OK
[CC]  memtest              ... SUCCESS
lab46:~/src/cpu/cpumemory$

Below is the command line result of running memtest:

lab46:~/src/cpu/cpumemory$ ./memtest
                  .
                  .
                  .
Memory address 8112 contains the value 8080
Memory address 8113 contains the value 8080
Memory address 8114 contains the value 8080
Memory address 8115 contains the value 8080
Memory address 8116 contains the value 8080
Memory address 8117 contains the value 8080
Memory address 8118 contains the value 8080
Memory address 8119 contains the value 8080
Memory address 8120 contains the value 8080
Memory address 8121 contains the value 8080
Memory address 8122 contains the value 8080
Memory address 8123 contains the value 8080
Memory address 8124 contains the value 8080
Memory address 8125 contains the value 8080
Memory address 8126 contains the value 8080
Memory address 8127 contains the value 8080
Memory address 8128 contains the value 8080
Memory address 8129 contains the value 8080
Memory address 8130 contains the value 8080
Memory address 8131 contains the value 8080
Memory address 8132 contains the value 8080
Memory address 8133 contains the value 8080
Memory address 8134 contains the value 8080
Memory address 8135 contains the value 8080
Memory address 8136 contains the value 8080
Memory address 8137 contains the value 8080
Memory address 8138 contains the value 8080
Memory address 8139 contains the value 8080
Memory address 8140 contains the value 8080
Memory address 8141 contains the value 8080
Memory address 8142 contains the value 8080
Memory address 8143 contains the value 8080
Memory address 8144 contains the value 8080
Memory address 8145 contains the value 8080
Memory address 8146 contains the value 8080
Memory address 8147 contains the value 8080
Memory address 8148 contains the value 8080
Memory address 8149 contains the value 8080
Memory address 8150 contains the value 8080
Memory address 8151 contains the value 8080
Memory address 8152 contains the value 8080
Memory address 8153 contains the value 8080
Memory address 8154 contains the value 8080
Memory address 8155 contains the value 8080
Memory address 8156 contains the value 8080
Memory address 8157 contains the value 8080
Memory address 8158 contains the value 8080
Memory address 8159 contains the value 8080
Memory address 8160 contains the value 8080
Memory address 8161 contains the value 8080
Memory address 8162 contains the value 8080
Memory address 8163 contains the value 8080
Memory address 8164 contains the value 8080
Memory address 8165 contains the value 8080
Memory address 8166 contains the value 8080
Memory address 8167 contains the value 8080
Memory address 8168 contains the value 8080
Memory address 8169 contains the value 8080
Memory address 8170 contains the value 8080
Memory address 8171 contains the value 8080
Memory address 8172 contains the value 8080
Memory address 8173 contains the value 8080
Memory address 8174 contains the value 8080
Memory address 8175 contains the value 8080
Memory address 8176 contains the value 8080
Memory address 8177 contains the value 8080
Memory address 8178 contains the value 8080
Memory address 8179 contains the value 8080
Memory address 8180 contains the value 8080
Memory address 8181 contains the value 8080
Memory address 8182 contains the value 8080
Memory address 8183 contains the value 8080
Memory address 8184 contains the value 8080
Memory address 8185 contains the value 8080
Memory address 8186 contains the value 8080
Memory address 8187 contains the value 8080
Memory address 8188 contains the value 8080
Memory address 8189 contains the value 8080
Memory address 8190 contains the value 8080
Memory address 8191 contains the value 8080
lab46:~/src/cpu/cpumemory$

After verifying that the cpumem class functioned as designed, I added and then commited the cpumemory to the repository as shown below:

lab46:~/src/cpu$ svn add cpumemory
A         cpumemory
A         cpumemory/Makefile
A         cpumemory/cpumem.cc
A         cpumemory/memtest.cc
A  (bin)  cpumemory/memtest
lab46:~/src/cpu$ svn commit -m "Srarted CPU memory -John Rine"
Adding         cpumemory
Adding         cpumemory/Makefile
Adding         cpumemory/cpumem.cc
Adding  (bin)  cpumemory/memtest
Adding         cpumemory/memtest.cc
Transmitting file data ....
Committed revision 72.

The cpumem.h file wasn't sent to the repository using the commands listed above, because it is locating in another directory, specifically the cpu/include directory, so I added and then committed it to the repository:

lab46:~/src/cpu$ svn add include/cpumem.h
A         include/cpumem.h
lab46:~/src/cpu$ svn commit -m "CPU memory .h file -John Rine"
Adding         include/cpumem.h
Transmitting file data .
Committed revision 73.

I implemented the cpumem class only after consulting the instructor. I asked him how he envisioned the implementation of the memory class. I also mentioned to him that a vector (must include the vector library, which apparently is part of the Standard Template Library which includes other data structures) rather than an array could be used in the implementation of the memory class as there are predefined methods of the vector class for manipulating vectors and, as I mentioned before, it is part of the STL. He suggested using an array instead which is what I did, and did so successfully as seen above. The implementation shown above is merely a first step. I do not plan to leave the cpumem class this way. After looking through the 8085 book the instructor loaned me, I plan to add memory read and memory write functions to the cpumem class. This closely approximates what really happens in a CPU.
Well guess what? I got the read and write member methods finished, compiled, tested, and committed!
Here is the updated cpumem.h file in its entirety:

#ifndef _CPUMEM_H
#define _CPUMEM_H
class CPUMEM
{
        public:
                CPUMEM();
                CPUMEM(int memLength);
                int& operator[](int address);
                int read(int address);
                void write(int address, int value);
                ~CPUMEM();
        private:
                int memlngth;
                int *memadd;
};
#endif

And here is the cpumem.cc file in its entirety:

#include "cpumem.h"

CPUMEM::CPUMEM()
{
        memlngth = 0;
        memadd = 0;
}

CPUMEM::~CPUMEM()
{
        delete[] memadd;
}

CPUMEM::CPUMEM(int memlength)
{
        memadd = new int[memlength];
}

int& CPUMEM::operator[](int address)
{
        return memadd[address];
}

int CPUMEM::read(int address)
{
        return *(memadd + address);
}

void CPUMEM::write(int address, int value)
{
        *(memadd + address) = value;
}

Last but not least, here is the memtest.cc file in its entirety:

#include <cstdio>
#include "cpumem.h"
const int MEM_MAX = 8192;
int main()
{
        CPUMEM datamemory(MEM_MAX);
        //for(int temp = 0; temp < MEM_MAX; temp++) datamemory[temp] = 8080;
        for (int temp = 0; temp < MEM_MAX; temp++) datamemory.write(temp, 8080);
        //for(int temp = 0; temp < MEM_MAX; temp++) printf("Memory address %d c$
        for(int temp = 0; temp < MEM_MAX; temp++) printf("Memory address %d con$
        return(0);
}

It compiled just fine with no errors:

lab46:~/src/cpu/cpumemory$ make
[B]   cpumem.cc            ... OK
[B]   memtest.cc           ... OK
[CC]  memtest              ... SUCCESS
lab46:~/src/cpu/cpumemory$

The test code executed as expected:

lab46:~/src/cpu/cpumemory$ ./memtest
                  .
                  .
                  .
Memory address 8112 contains the value 8080
Memory address 8113 contains the value 8080
Memory address 8114 contains the value 8080
Memory address 8115 contains the value 8080
Memory address 8116 contains the value 8080
Memory address 8117 contains the value 8080
Memory address 8118 contains the value 8080
Memory address 8119 contains the value 8080
Memory address 8120 contains the value 8080
Memory address 8121 contains the value 8080
Memory address 8122 contains the value 8080
Memory address 8123 contains the value 8080
Memory address 8124 contains the value 8080
Memory address 8125 contains the value 8080
Memory address 8126 contains the value 8080
Memory address 8127 contains the value 8080
Memory address 8128 contains the value 8080
Memory address 8129 contains the value 8080
Memory address 8130 contains the value 8080
Memory address 8131 contains the value 8080
Memory address 8132 contains the value 8080
Memory address 8133 contains the value 8080
Memory address 8134 contains the value 8080
Memory address 8135 contains the value 8080
Memory address 8136 contains the value 8080
Memory address 8137 contains the value 8080
Memory address 8138 contains the value 8080
Memory address 8139 contains the value 8080
Memory address 8140 contains the value 8080
Memory address 8141 contains the value 8080
Memory address 8142 contains the value 8080
Memory address 8143 contains the value 8080
Memory address 8144 contains the value 8080
Memory address 8145 contains the value 8080
Memory address 8146 contains the value 8080
Memory address 8147 contains the value 8080
Memory address 8148 contains the value 8080
Memory address 8149 contains the value 8080
Memory address 8150 contains the value 8080
Memory address 8151 contains the value 8080
Memory address 8152 contains the value 8080
Memory address 8153 contains the value 8080
Memory address 8154 contains the value 8080
Memory address 8155 contains the value 8080
Memory address 8156 contains the value 8080
Memory address 8157 contains the value 8080
Memory address 8158 contains the value 8080
Memory address 8159 contains the value 8080
Memory address 8160 contains the value 8080
Memory address 8161 contains the value 8080
Memory address 8162 contains the value 8080
Memory address 8163 contains the value 8080
Memory address 8164 contains the value 8080
Memory address 8165 contains the value 8080
Memory address 8166 contains the value 8080
Memory address 8167 contains the value 8080
Memory address 8168 contains the value 8080
Memory address 8169 contains the value 8080
Memory address 8170 contains the value 8080
Memory address 8171 contains the value 8080
Memory address 8172 contains the value 8080
Memory address 8173 contains the value 8080
Memory address 8174 contains the value 8080
Memory address 8175 contains the value 8080
Memory address 8176 contains the value 8080
Memory address 8177 contains the value 8080
Memory address 8178 contains the value 8080
Memory address 8179 contains the value 8080
Memory address 8180 contains the value 8080
Memory address 8181 contains the value 8080
Memory address 8182 contains the value 8080
Memory address 8183 contains the value 8080
Memory address 8184 contains the value 8080
Memory address 8185 contains the value 8080
Memory address 8186 contains the value 8080
Memory address 8187 contains the value 8080
Memory address 8188 contains the value 8080
Memory address 8189 contains the value 8080
Memory address 8190 contains the value 8080
Memory address 8191 contains the value 8080
lab46:~/src/cpu/cpumemory$

The changes to cpumem.cc were committed to the repository.

lab46:~/src/cpu/cpumemory$ svn log cpumem.cc
------------------------------------------------------------------------
r88 | jr018429 | 2011-02-12 21:26:27 -0500 (Sat, 12 Feb 2011) | 1 line

updated cpumem class to have read and write function -John Rine
------------------------------------------------------------------------
lab46:~/src/cpu/cpumemory$ svn log memtest.cc
------------------------------------------------------------------------
r88 | jr018429 | 2011-02-12 21:26:27 -0500 (Sat, 12 Feb 2011) | 1 line

updated cpumem class to have read and write function -John Rine
------------------------------------------------------------------------
lab46:~/src/cpu/cpumemory$ cd ..
lab46:~/src/cpu$ cd include
lab46:~/src/cpu/include$ svn log cpumem.h
------------------------------------------------------------------------
r88 | jr018429 | 2011-02-12 21:26:27 -0500 (Sat, 12 Feb 2011) | 1 line

updated cpumem class to have read and write function -John Rine
------------------------------------------------------------------------

Week 4 Journal Entry

CSIT1320 HPC Fundamentals
For my third project in High-Performance Computing fundamemtals, I chose to perform the VM (Virtual Machine) installation, which should follow the VM server install. After all, why install a VM server, and then choose not to install virtual machines?
Instructions for the install are given on the following Web page:
http://lab46.corning-cc.edu/haas/spring2011/hpc0/projects/creating_virtual_machines .
Notes regarding the install, there are notes on the following Web page:
http://lab46.corning-cc.edu/notes:hpc0 .
The install begins…
First, from a remote computer, I logged into my VM server (xen) as the root.

wildgoat:~$ ssh root@vmserver04.student.lab
Warning: Permanently added 'vmserver04.student.lab,10.80.3.61' (RSA) to the list of known hosts.
root@vmserver04.student.lab's password: 
Linux vmserver04 2.6.32-5-xen-686 #1 SMP Wed Jan 12 07:52:18 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Next, I performed an xm list to determine whether or not there were virtual machines already running.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Feb 15 12:04:02 2011 from wildebai.offbyone.lan
root@vmserver04:~# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  1883     1     r-----    315.6

As can be seen above, there were no virtual machines running on my VM server, so the next step is to create one. Actually, I installed two, these instructions reflect the steps taken during the first install. Before the virtual machine can be created, however, the installer must choose open (unused) virtual machines. The machines are listed on the hpc0 notes page: http://lab46.corning-cc.edu/notes:hpc0 .
I chose the following open machines:

HostnameVM ServerMAC AddressOwner
vm03vmserver0400:16:3E:2E:C0:03John Rine
vm04vmserver0400:16:3E:2E:C0:04John Rine

After claiming virtual machines, the next step is to execute the xen-create to create a virtual machine.

root@vmserver04:~# vmserver:~# xen-create-image --hostname=vm03 --mac=00:16:3e:2e:c0:## --role=udev
-bash: vmserver:~#: command not found

I copied and pasted the xen create command from the hpc0 VM install project page. Next, I substituted “–hostname=vm##” with “–hostname=vm03” and the MAC address, “–mac=00:16:3e:2e:c0:” with “–mac=00:16:3e:2e:c0:”.
After executing the command, I received an “command not found” message. The command wasn't found because when I copied and pasted the command from the VM install page, I didn't remove the double '#' string immediately following the MAC address.

root@vmserver04:~# --mac=00:16:3e:2e:c0:## --role=udev
-bash: --mac=00:16:3e:2e:c0:##: command not found

After fixing the xen-create command line options, I executed the xen-create command.

root@vmserver04:~# xen-create-image --hostname=vm03 --mac=00:16:3E:2E:C0:03 --role=udev
  The output directory for creating the xen configuration file within
 doesn't exist:

           /xen/conf

  Aborting.

Since the /xen/conf directory, didn't exist, I created it.

root@vmserver04:~# cd /
root@vmserver04:/# mkdir xen
root@vmserver04:/# cd xen
root@vmserver04:/xen# mkdir conf
root@vmserver04:/xen# cd ~

After creating the /xen/conf directory, I executed the xen-create command again.

root@vmserver04:~# xen-create-image --hostname=vm03 --mac=00:16:3E:2E:C0:03 --role=udev

General Information
--------------------
Hostname       :  vm03
Distribution   :  squeeze
Mirror         :  http://mirror/debian/
Partitions     :  swap            128Mb (swap)
                  /               2Gb   (ext3)
Image type     :  sparse
Memory size    :  128Mb

Networking Information
----------------------
IP Address     : DHCP [MAC: 00:16:3E:2E:C0:03]
Netmask        : 255.255.255.0
Gateway        : 10.80.3.1


Creating partition image: /xen/domains/vm03/swap.img
Done

Creating swap on /xen/domains/vm03/swap.img
Done

Creating partition image: /xen/domains/vm03/disk.img
Done

Creating ext3 filesystem on /xen/domains/vm03/disk.img
Done
Installation method: debootstrap
Running hooks
Done

Role: udev
        File: /etc/xen-tools/role.d/udev
Role script completed.

Creating Xen configuration file
Done
Setting up root password

At this point, I was prompted to enter and then re-enter a passsword, which I performed.

Enter new UNIX password: 
Retype new UNIX password: 
Sorry, passwords do not match
passwd: Authentication token manipulation error
passwd: password unchanged
All done


Logfile produced at:
         /var/log/xen-tools/vm03.log

Installation Summary
---------------------
Hostname        :  vm03
Distribution    :  squeeze
IP-Address(es)  :  dynamic
RSA Fingerprint :  97:f7:8d:7a:45:2b:74:77:02:e2:dd:3a:d2:55:e3:0b
Root Password   :  N/A

As can be seen above, I didn't enter passwords that matched, but the install finished anyway! I was forced to re-enter the password. I order to do that, I had to find the disk image, mount it with “loop” in /mnt, change the root using /mnt, change the password, and then unmount (umount) /mnt.

root@vmserver04:~# cd /xen
root@vmserver04:/xen# ls
conf  domains
root@vmserver04:/xen# cd domains
root@vmserver04:/xen/domains# ls
vm03
root@vmserver04:/xen/domains# cd vm03
root@vmserver04:/xen/domains/vm03# ls
disk.img  swap.img
root@vmserver04:/xen/domains/vm03# mount disk.img
mount: can't find disk.img in /etc/fstab or /etc/mtab
root@vmserver04:/xen/domains/vm03# mount -o loop disk.img /mnt
root@vmserver04:/xen/domains/vm03# cd /mnt
root@vmserver04:/mnt# ls
bin   dev  home        lib         media  opt   root  selinux  sys  usr  vmlinuz
boot  etc  initrd.img  lost+found  mnt    proc  sbin  srv      tmp  var
root@vmserver04:/mnt# chroot /mnt
root@vmserver04:/# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@vmserver04:/# exit
exit
root@vmserver04:/mnt# cd 
root@vmserver04:~# umount /mnt

The next step was to boot the virtual machine using xm create -c /xen/conf/vm##.cfg. I copied this line from the hpc0 VM install project page and replaced the double '#' string with my virtual machine designator 03, and then executed the command.

root@vmserver04:~# vmserver:~# xm create -c /xen/conf/vm03.cfg
-bash: vmserver:~#: command not found

Oops, When I copied and pasted the line from the instructions, I didn't remove the command line stuff. I pasted it again, but this time I removed the command line propt that was part of the example. I didn't, however, replace the double '#' string with my virtual machine designator, 03, but it apparently finished okay-why???

root@vmserver04:~# xm create -c /xen/conf/vm##.cfg
Error: Unable to open config file: /xen/conf/vm##.cfg
Usage: xm create <ConfigFile> [options] [vars]

Create a domain based on <ConfigFile>.

Options:

-h, --help           Print this help.
--help_config        Print the available configuration variables (vars)
                     for the configuration script.
-q, --quiet          Quiet.
--path=PATH          Search path for configuration scripts. The value of
                     PATH is a colon-separated directory list.
-f=FILE, --defconfig=FILE
                     Use the given Python configuration script.The
                     configuration script is loaded after arguments have
                     been processed. Each command-line option sets a
                     configuration variable named after its long option
                     name, and these variables are placed in the
                     environment of the script before it is loaded.
                     Variables for options that may be repeated have list
                     values. Other variables can be set using VAR=VAL on
                     the command line. After the script is loaded, option

    pyGRUB  version 0.6
 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
 x Debian GNU/Linux 6.0                                                   x
 x Debian GNU/Linux 6.0 (Single-User)                                     x
 x                                                                        x
 x                                                                        x
 x                                                                        x
 x                                                                        x
 x                                                                        x
 x                                                                        x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
     Use the ^ and v keys to select which entry is highlighted.            
     Press enter to boot the selected OS, 'e' to edit the      
     commands before booting, 'a' to modify the kernel arguments
     before booting, or 'c' for a command line.                 




     Will boot selected entry in  1 seconds



Started domain vm03 (id=1)
                          [    0.000000] Reserving virtual address space above 0xf5800000
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.32-5-xen-686 (Debian 2.6.32-30) (ben@decadent.org.uk) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Wed Jan 12 07:52:18 UTC 2011
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   NSC Geode by NSC
[    0.000000]   Cyrix CyrixInstead
[    0.000000]   Centaur CentaurHauls
[    0.000000]   Transmeta GenuineTMx86
[    0.000000]   Transmeta TransmetaCPU
[    0.000000]   UMC UMC UMC UMC
[    0.000000] ACPI in unprivileged domain disabled
[    0.000000] released 0 pages of unused memory
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  Xen: 0000000000000000 - 00000000000a0000 (usable)
[    0.000000]  Xen: 00000000000a0000 - 0000000000100000 (reserved)
[    0.000000]  Xen: 0000000000100000 - 0000000008000000 (usable)
[    0.000000] DMI not present or invalid.
[    0.000000] last_pfn = 0x8000 max_arch_pfn = 0x1000000
[    0.000000] init_memory_mapping: 0000000000000000-0000000008000000
[    0.000000] RAMDISK: 0164f000 - 029f5000
[    0.000000] 0MB HIGHMEM available.
[    0.000000] 128MB LOWMEM available.
[    0.000000]   mapped low ram: 0 - 08000000
[    0.000000]   low ram: 0 - 08000000
[    0.000000]   node 0 low ram: 00000000 - 08000000
[    0.000000]   node 0 bootmap 00002000 - 00003000
[    0.000000] (9 early reservations) ==> bootmem [0000000000 - 0008000000]
[    0.000000]   #0 [0000000000 - 0000001000]   BIOS data page ==> [0000000000 - 0000001000]
[    0.000000]   #1 [0002a18000 - 0002a30000]   XEN PAGETABLES ==> [0002a18000 - 0002a30000]
[    0.000000]   #2 [0000001000 - 0000002000]    EX TRAMPOLINE ==> [0000001000 - 0000002000]
[    0.000000]   #3 [0000006000 - 0000007000]       TRAMPOLINE ==> [0000006000 - 0000007000]
[    0.000000]   #4 [0001000000 - 00015298d4]    TEXT DATA BSS ==> [0001000000 - 00015298d4]
[    0.000000]   #5 [000164f000 - 00029f5000]          RAMDISK ==> [000164f000 - 00029f5000]
[    0.000000]   #6 [00029f5000 - 0002a18000]   XEN START INFO ==> [00029f5000 - 0002a18000]
[    0.000000]   #7 [0000007000 - 0000030000]          PGTABLE ==> [0000007000 - 0000030000]
[    0.000000]   #8 [0000002000 - 0000003000]          BOOTMAP ==> [0000002000 - 0000003000]
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00001000
[    0.000000]   Normal   0x00001000 -> 0x00008000
[    0.000000]   HighMem  0x00008000 -> 0x00008000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[2] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x000000a0
[    0.000000]     0: 0x00000100 -> 0x00008000
[    0.000000] Using APIC driver default
[    0.000000] SFI: Simple Firmware Interface v0.7 http://simplefirmware.org
[    0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic"
[    0.000000] APIC: disable apic facility
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 0000000000100000
[    0.000000] Allocating PCI resources starting at 8000000 (gap: 8000000:f8000000)
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.0.1 (preserve-AD)
[    0.000000] NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:1 nr_node_ids:1
[    0.000000] PERCPU: Embedded 15 pages/cpu @c162e000 s37656 r0 d23784 u65536
[    0.000000] pcpu-alloc: s37656 r0 d23784 u65536 alloc=16*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Xen: using vcpu_info placement
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32416
[    0.000000] Kernel command line: root=/dev/xvda2 ro root=/dev/xvda2 ro ip=:127.0.255.255::::eth0:dhcp 
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Enabling fast FPU save and restore... done.
[    0.000000] Enabling unmasked SIMD FPU exception support... done.
[    0.000000] Initializing CPU#0
[    0.000000] Initializing HighMem for node 0 (00000000:00000000)
[    0.000000] Memory: 103488k/131072k available (2633k kernel code, 27032k reserved, 1448k data, 404k init, 0k highmem)
[    0.000000] virtual kernel memory layout:
[    0.000000]     fixmap  : 0xf5556000 - 0xf57ff000   (2724 kB)
[    0.000000]     pkmap   : 0xf5000000 - 0xf5200000   (2048 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xf4ffe000   ( 711 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]       .init : 0xc13fd000 - 0xc1462000   ( 404 kB)
[    0.000000]       .data : 0xc1292719 - 0xc13fcad8   (1448 kB)
[    0.000000]       .text : 0xc1000000 - 0xc1292719   (2633 kB)
[    0.000000] SLUB: Genslabs=13, HWalign=128, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:1536
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [hvc0] enabled
[    0.000000] installing Xen timer for CPU 0
[    0.000000] Detected 2992.586 MHz processor.
[    0.004000] Calibrating delay loop (skipped), value calculated using timer frequency.. 5985.17 BogoMIPS (lpj=11970344)
[    0.004000] Security Framework initialized
[    0.004000] SELinux:  Disabled at boot.
[    0.004000] Mount-cache hash table entries: 512
[    0.004000] Initializing cgroup subsys ns
[    0.004000] Initializing cgroup subsys cpuacct
[    0.004000] Initializing cgroup subsys devices
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] CPU: Trace cache: 12K uops, L1 D cache: 16K
[    0.004000] CPU: L2 cache: 1024K
[    0.004000] CPU: Hyper-Threading is disabled
[    0.004000] Performance Events: no PMU driver, software events only.
[    0.004000] SMP alternatives: switching to UP code
[    0.004000] Freeing SMP alternatives: 14k freed
[    0.004595] Brought up 1 CPUs
[    0.004838] devtmpfs: initialized
[    0.005858] Grant table initialized
[    0.005871] regulator: core version 0.5
[    0.005974] NET: Registered protocol family 16
[    0.007387] PCI: setting up Xen PCI frontend stub
[    0.008873] bio: create slab <bio-0> at 0
[    0.009011] ACPI: Interpreter disabled.
[    0.009087] xen_balloon: Initialising balloon driver with page order 0.
[    0.009190] vgaarb: loaded
[    0.009331] PCI: System does not support PCI
[    0.009342] PCI: System does not support PCI
[    0.009504] Switching to clocksource xen
[    0.012000] pnp: PnP ACPI: disabled
[    0.012000] PnPBIOS: Disabled
[    0.012000] NET: Registered protocol family 2
[    0.012000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.012000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.012000] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.012000] TCP: Hash tables configured (established 4096 bind 4096)
[    0.012000] TCP reno registered
[    0.012123] NET: Registered protocol family 1
[    0.012222] Unpacking initramfs...
[    0.053014] Freeing initrd memory: 20120k freed
[    0.067005] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.067324] audit: initializing netlink socket (disabled)
[    0.067352] type=2000 audit(1298060055.833:1): initialized
[    0.072261] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.074763] VFS: Disk quotas dquot_6.5.2
[    0.074856] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.075019] msgmni has been set to 241
[    0.075403] alg: No test for stdrng (krng)
[    0.075536] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.075551] io scheduler noop registered
[    0.075561] io scheduler anticipatory registered
[    0.075570] io scheduler deadline registered
[    0.075649] io scheduler cfq registered (default)
[    0.075932] isapnp: ISA Plug & Play support disabled
[    0.134818] registering netback
[    0.137906] Linux agpgart interface v0.103
[    0.138111] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.138540] PNP: No PS/2 controller found. Probing ports directly.
[    0.139381] i8042.c: No controller found.
[    0.139475] mice: PS/2 mouse device common for all mice
[    0.139653] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    0.139777] cpuidle: using governor ladder
[    0.139788] cpuidle: using governor menu
[    0.139802] No iBFT detected.
[    0.140302] TCP cubic registered
[    0.140555] NET: Registered protocol family 10
[    0.141190] lo: Disabled Privacy Extensions
[    0.141621] Mobile IPv6
[    0.141632] NET: Registered protocol family 17
[    0.141661] Using IPI No-Shortcut mode
[    0.141828] registered taskstats version 1
[    0.141854] XENBUS: Device with no driver: device/vbd/51714
[    0.141871] XENBUS: Device with no driver: device/vbd/51713
[    0.141881] XENBUS: Device with no driver: device/vif/0
[    0.141891] XENBUS: Device with no driver: device/console/0
[    0.141922] /build/buildd-linux-2.6_2.6.32-30-i386-UYhWt7/linux-2.6-2.6.32/debian/build/source_i386_xen/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    0.141964] Initalizing network drop monitor service
[    0.142029] Freeing unused kernel memory: 404k freed
[    0.143930] Write protecting the kernel text: 2636k
[    0.144539] Write protecting the kernel read-only data: 964k
Loading, please wait...
[    0.200545] udev[47]: starting version 164
[    0.348978] Initialising Xen virtual ethernet driver.
[    0.450922] blkfront: xvda2: barriers enabled
[    0.462262] blkfront: xvda1: barriers enabled
[    0.466131] Setting capacity to 262144
[    0.466152] xvda1: detected capacity change from 0 to 134217728
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[    0.647863] kjournald starting.  Commit interval 5 seconds
[    0.648308] EXT3-fs: mounted filesystem with ordered data mode.
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
Starting the hotplug events dispatcher: udevd[    0.847504] udev[141]: starting version 164
.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...[    0.987892] input: PC Speaker as /devices/platform/pcspkr/input/input0
[    1.079360] Error: Driver 'pcspkr' is already registered, aborting...
done.
Activating swap...[    1.201114] Adding 131064k swap on /dev/xvda1.  Priority:-1 extents:1 across:131064k SS
done.
Checking root file system...fsck from util-linux-ng 2.17.2
/dev/xvda2: clean, 13835/131072 files, 111127/524288 blocks
done.
[    1.246601] EXT3 FS on xvda2, internal journal
Loading kernel modules...done.
Cleaning up ifupdown....
Setting up networking....
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.17.2
done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Setting kernel variables ...done.
Configuring network interfaces...Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:16:3e:2e:c0:03
Sending on   LPF/eth0/00:16:3e:2e:c0:03
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPOFFER from 10.80.3.62
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 10.80.3.62
bound to 10.80.3.3 -- renewal in 20063 seconds.
done.
Cleaning up temporary files....
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: cron.
Starting OpenBSD Secure Shell server: sshd.

Debian GNU/Linux 6.0 vm03 hvc0

vm03 login: vm03.student.lab      
Password: 

Login incorrect
vm03 login: bob
Password: 

Login incorrect
vm03 login: root
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: cron.
Starting OpenBSD Secure Shell server: sshd.

Debian GNU/Linux 6.0 vm03 hvc0

vm03 login: vm03.student.lab      
Password: 

Login incorrect
vm03 login: bob
Password: 

Login incorrect
vm03 login: root
Password: 
Linux vm03 2.6.32-5-xen-686 #1 SMP Wed Jan 12 07:52:18 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@vm03:~#
root@vm03:~# exit
logout

Debian GNU/Linux 6.0 vm03 hvc0

vm03 login: 


wildgoat:~$ ssh root@vm03.student.lab
Warning: Permanently added 'vm03.student.lab,10.80.3.3' (RSA) to the list of known hosts.
root@vm03.student.lab's password: 
Linux vm03 2.6.32-5-xen-686 #1 SMP Wed Jan 12 07:52:18 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 18 15:29:34 2011
root@vm03:~# 

I was able to log into my virtual machine, vm03 from lab46.

lab46:~$ ssh root@vm03.student.lab
Warning: Permanently added 'vm03.student.lab,10.80.3.3' (RSA) to the list of known hosts.
root@vm03.student.lab's password:
Linux vm03 2.6.32-5-xen-686 #1 SMP Wed Jan 12 07:52:18 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 18 15:34:32 2011 from wildgoat.offbyone.lan
root@vm03:~#

I was also able to log into my virtual machine, 04, from lab46.

lab46:~$ ssh root@vm04.student.lab
Warning: Permanently added 'vm04.student.lab,10.80.3.4' (RSA) to the list of known hosts.
root@vm04.student.lab's password:
Linux vm04 2.6.32-5-xen-686 #1 SMP Wed Jan 12 07:52:18 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 18 16:50:58 2011 from vm04.student.lab
root@vm04:~#


CSIT2048 HPC Experience II
Wow! first I attempt to unmount a file system while I am in the middle of it, and then I can't get the umount command right. Even after the instructor showed me how to unmount owfs, I couldn't get it to unmount. The reason why? I was using “unmount” rather than “umount”. I the words of Bugs Bunny, “What a marroon!”

Now that I have owfs under control, I have started the second phase of this project: to log find and use a data logging tool with graphing capabilities to sample the data produce a graph of that data periodically. We plan to install a Web server and serve a Web page that will be used to display the graph produced by the data logging and graphing tool.
The data logging and graphing tool we pla to use is RRDTool. The RRDTool Web site is at: http://oss.oetiker.ch/rrdtool/ .
I began the RRDTool install using the instructions that are posted at:
http://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html

I created an environment varible for the installation directory.

jr018429@dhcp-179:~$ INSTALL_DIR=/opt/rrdtool-1.4.5

Next, I created an environment variable for the build directory. The instructions indicated that there could be an issue with using the /tmp directory so I used my home directory to contain the build directory.

jr018429@dhcp-179:~$ BUILD_DIR=/home/jr018429/rrdbuild

Next, I created the build directory.

jr018429@dhcp-179:~$ mkdir -p $BUILD_DIR

I then changed to the build directory.

jr018429@dhcp-179:~$ cd $BUILD_DIR

Next, I got the RRDTool tar ball.

jr018429@dhcp-179:~/rrdbuild$ wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
--2011-02-14 15:00:35--  http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
Resolving oss.oetiker.ch... 213.144.138.195
Connecting to oss.oetiker.ch|213.144.138.195|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1348713 (1.3M) [application/x-tar]
Saving to: “rrdtool-1.4.5.tar.gz”

100%[======================================>] 1,348,713    320K/s   in 6.6s    

2011-02-14 15:00:42 (199 KB/s) - “rrdtool-1.4.5.tar.gz” saved [1348713/1348713]

Since the file was archived and gziped, I unzipped and untarred it.

jr018429@dhcp-179:~/rrdbuild$ gunzip -c rrdtool-1.4.5.tar.gz | tar xf -

Next, I changed to the rrdtool-1.4.5 directory.

jr018429@dhcp-179:~/rrdbuild$ cd rrdtool-1.4.5

I performed the configuration and install per the instructions, however, at the end, I found there were issues so I installed the dependencies and performed the RRTool install again. This step shows how I installed the dependencies. The next step shows how configuaration and installation performed after installing the dependencies.

root@dhcp-179:/home/jr018429# apt-get install libpango1.0-dev libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  autopoint debhelper gettext git html2text intltool-debian libcairo2-dev
  liberror-perl libexpat1-dev libfontconfig1-dev libfreetype6-dev
  libglib2.0-dev libice-dev libmail-sendmail-perl libpixman-1-dev libpng12-dev
  libpthread-stubs0 libpthread-stubs0-dev libsm-dev libsys-hostname-long-perl
  libunistring0 libx11-dev libxau-dev libxcb-render-util0-dev
  libxcb-render0-dev libxcb1-dev libxdmcp-dev libxft-dev libxrender-dev
  po-debconf rsync x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-render-dev xtrans-dev zlib1g-dev
Suggested packages:
  dh-make gettext-doc git-doc git-arch git-cvs git-svn git-email
  git-daemon-run git-gui gitk gitweb libcairo2-doc libglib2.0-doc
  libpango1.0-doc libmail-box-perl openssh-server
The following NEW packages will be installed:
  autopoint debhelper gettext git html2text intltool-debian libcairo2-dev
  liberror-perl libexpat1-dev libfontconfig1-dev libfreetype6-dev
  libglib2.0-dev libice-dev libmail-sendmail-perl libpango1.0-dev
  libpixman-1-dev libpng12-dev libpthread-stubs0 libpthread-stubs0-dev
  libsm-dev libsys-hostname-long-perl libunistring0 libx11-dev libxau-dev
  libxcb-render-util0-dev libxcb-render0-dev libxcb1-dev libxdmcp-dev
  libxft-dev libxml2-dev libxrender-dev po-debconf rsync x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev x11proto-render-dev xtrans-dev zlib1g-dev
0 upgraded, 39 newly installed, 0 to remove and 9 not upgraded.
Need to get 18.4 MB of archives.
After this operation, 49.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main x11proto-core-dev all 7.0.16-1 [92.2 kB]
Get:2 http://debian.uchicago.edu/debian/ squeeze/main libice-dev i386 2:1.0.6-2 [58.5 kB]
Get:3 http://debian.uchicago.edu/debian/ squeeze/main libxau-dev i386 1:1.0.6-1 [19.3 kB]
Get:4 http://debian.uchicago.edu/debian/ squeeze/main libxdmcp-dev i386 1:1.0.3-2 [21.4 kB]
Get:5 http://debian.uchicago.edu/debian/ squeeze/main x11proto-input-dev all 2.0-2 [63.1 kB]
Get:6 http://debian.uchicago.edu/debian/ squeeze/main x11proto-kb-dev all 1.0.4-1 [27.3 kB]
Get:7 http://debian.uchicago.edu/debian/ squeeze/main xtrans-dev all 1.2.5-1 [68.4 kB]
Get:8 http://debian.uchicago.edu/debian/ squeeze/main libpthread-stubs0 i386 0.3-2 [3,150 B]
Get:9 http://debian.uchicago.edu/debian/ squeeze/main libpthread-stubs0-dev i386 0.3-2 [3,482 B]
Get:10 http://debian.uchicago.edu/debian/ squeeze/main libxcb1-dev i386 1.6-1 [73.6 kB]
Get:11 http://debian.uchicago.edu/debian/ squeeze/main libx11-dev i386 2:1.3.3-4 [3,465 kB]
Get:12 http://debian.uchicago.edu/debian/ squeeze/main liberror-perl all 0.17-1 [23.6 kB]
Get:13 http://debian.uchicago.edu/debian/ squeeze/main git i386 1:1.7.2.3-2.2 [4,857 kB]
Get:14 http://debian.uchicago.edu/debian/ squeeze/main autopoint all 0.18.1.1-3 [627 kB]
Get:15 http://debian.uchicago.edu/debian/ squeeze/main html2text i386 1.3.2a-15 [101 kB]
Get:16 http://debian.uchicago.edu/debian/ squeeze/main libunistring0 i386 0.9.3-3 [433 kB]
Get:17 http://debian.uchicago.edu/debian/ squeeze/main gettext i386 0.18.1.1-3 [1,973 kB]
Get:18 http://debian.uchicago.edu/debian/ squeeze/main intltool-debian all 0.35.0+20060710.1 [30.8 kB]
Get:19 http://debian.uchicago.edu/debian/ squeeze/main po-debconf all 1.0.16+nmu1 [223 kB]
Get:20 http://debian.uchicago.edu/debian/ squeeze/main debhelper all 8.0.0 [454 kB]
Get:21 http://debian.uchicago.edu/debian/ squeeze/main libexpat1-dev i386 2.0.1-7 [214 kB]
Get:22 http://debian.uchicago.edu/debian/ squeeze/main zlib1g-dev i386 1:1.2.3.4.dfsg-3 [186 kB]
Get:23 http://debian.uchicago.edu/debian/ squeeze/main libfreetype6-dev i386 2.4.2-2.1 [710 kB]
Get:24 http://debian.uchicago.edu/debian/ squeeze/main libfontconfig1-dev i386 2.8.0-2.1 [817 kB]
Get:25 http://debian.uchicago.edu/debian/ squeeze/main x11proto-render-dev all 2:0.11-1 [7,368 B]
Get:26 http://debian.uchicago.edu/debian/ squeeze/main libxrender-dev i386 1:0.9.6-1 [37.6 kB]
Get:27 http://debian.uchicago.edu/debian/ squeeze/main libpng12-dev i386 1.2.44-1 [261 kB]
Get:28 http://debian.uchicago.edu/debian/ squeeze/main libsm-dev i386 2:1.1.1-1 [26.5 kB]
Get:29 http://debian.uchicago.edu/debian/ squeeze/main libpixman-1-dev i386 0.16.4-1 [260 kB]
Get:30 http://debian.uchicago.edu/debian/ squeeze/main libxcb-render0-dev i386 1.6-1 [22.1 kB]
Get:31 http://debian.uchicago.edu/debian/ squeeze/main libxcb-render-util0-dev i386 0.3.6-1 [9,116 B]
Get:32 http://debian.uchicago.edu/debian/ squeeze/main libcairo2-dev i386 1.8.10-6 [583 kB]
Get:33 http://debian.uchicago.edu/debian/ squeeze/main libglib2.0-dev i386 2.24.2-1 [1,118 kB]
Get:34 http://debian.uchicago.edu/debian/ squeeze/main libsys-hostname-long-perl all 1.4-2 [11.3 kB]
Get:35 http://debian.uchicago.edu/debian/ squeeze/main libmail-sendmail-perl all 0.79.16-1 [26.6 kB]
Get:36 http://debian.uchicago.edu/debian/ squeeze/main libxft-dev i386 2.1.14-2 [65.1 kB]
Get:37 http://debian.uchicago.edu/debian/ squeeze/main libpango1.0-dev i386 1.28.3-1+squeeze1 [375 kB]
Get:38 http://debian.uchicago.edu/debian/ squeeze/main libxml2-dev i386 2.7.8.dfsg-2 [752 kB]
Get:39 http://debian.uchicago.edu/debian/ squeeze/main rsync i386 3.0.7-2 [338 kB]
Fetched 18.4 MB in 41s (441 kB/s)                                              
Extracting templates from packages: 100%
Selecting previously deselected package x11proto-core-dev.
(Reading database ... 121659 files and directories currently installed.)
Unpacking x11proto-core-dev (from .../x11proto-core-dev_7.0.16-1_all.deb) ...
Selecting previously deselected package libice-dev.
Unpacking libice-dev (from .../libice-dev_2%3a1.0.6-2_i386.deb) ...
Selecting previously deselected package libxau-dev.
Unpacking libxau-dev (from .../libxau-dev_1%3a1.0.6-1_i386.deb) ...
Selecting previously deselected package libxdmcp-dev.
Unpacking libxdmcp-dev (from .../libxdmcp-dev_1%3a1.0.3-2_i386.deb) ...
Selecting previously deselected package x11proto-input-dev.
Unpacking x11proto-input-dev (from .../x11proto-input-dev_2.0-2_all.deb) ...
Selecting previously deselected package x11proto-kb-dev.
Unpacking x11proto-kb-dev (from .../x11proto-kb-dev_1.0.4-1_all.deb) ...
Selecting previously deselected package xtrans-dev.
Unpacking xtrans-dev (from .../xtrans-dev_1.2.5-1_all.deb) ...
Selecting previously deselected package libpthread-stubs0.
Unpacking libpthread-stubs0 (from .../libpthread-stubs0_0.3-2_i386.deb) ...
Selecting previously deselected package libpthread-stubs0-dev.
Unpacking libpthread-stubs0-dev (from .../libpthread-stubs0-dev_0.3-2_i386.deb) ...
Selecting previously deselected package libxcb1-dev.
Unpacking libxcb1-dev (from .../libxcb1-dev_1.6-1_i386.deb) ...
Selecting previously deselected package libx11-dev.
Unpacking libx11-dev (from .../libx11-dev_2%3a1.3.3-4_i386.deb) ...
Selecting previously deselected package liberror-perl.
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously deselected package git.
Unpacking git (from .../git_1%3a1.7.2.3-2.2_i386.deb) ...
Selecting previously deselected package autopoint.
Unpacking autopoint (from .../autopoint_0.18.1.1-3_all.deb) ...
Selecting previously deselected package html2text.
Unpacking html2text (from .../html2text_1.3.2a-15_i386.deb) ...
Selecting previously deselected package libunistring0.
Unpacking libunistring0 (from .../libunistring0_0.9.3-3_i386.deb) ...
Selecting previously deselected package gettext.
Unpacking gettext (from .../gettext_0.18.1.1-3_i386.deb) ...
Selecting previously deselected package intltool-debian.
Unpacking intltool-debian (from .../intltool-debian_0.35.0+20060710.1_all.deb) ...
Selecting previously deselected package po-debconf.
Unpacking po-debconf (from .../po-debconf_1.0.16+nmu1_all.deb) ...
Selecting previously deselected package debhelper.
Unpacking debhelper (from .../debhelper_8.0.0_all.deb) ...
Selecting previously deselected package libexpat1-dev.
Unpacking libexpat1-dev (from .../libexpat1-dev_2.0.1-7_i386.deb) ...
Selecting previously deselected package zlib1g-dev.
Unpacking zlib1g-dev (from .../zlib1g-dev_1%3a1.2.3.4.dfsg-3_i386.deb) ...
Selecting previously deselected package libfreetype6-dev.
Unpacking libfreetype6-dev (from .../libfreetype6-dev_2.4.2-2.1_i386.deb) ...
Selecting previously deselected package libfontconfig1-dev.
Unpacking libfontconfig1-dev (from .../libfontconfig1-dev_2.8.0-2.1_i386.deb) ...
Selecting previously deselected package x11proto-render-dev.
Unpacking x11proto-render-dev (from .../x11proto-render-dev_2%3a0.11-1_all.deb) ...
Selecting previously deselected package libxrender-dev.
Unpacking libxrender-dev (from .../libxrender-dev_1%3a0.9.6-1_i386.deb) ...
Selecting previously deselected package libpng12-dev.
Unpacking libpng12-dev (from .../libpng12-dev_1.2.44-1_i386.deb) ...
Selecting previously deselected package libsm-dev.
Unpacking libsm-dev (from .../libsm-dev_2%3a1.1.1-1_i386.deb) ...
Selecting previously deselected package libpixman-1-dev.
Unpacking libpixman-1-dev (from .../libpixman-1-dev_0.16.4-1_i386.deb) ...
Selecting previously deselected package libxcb-render0-dev.
Unpacking libxcb-render0-dev (from .../libxcb-render0-dev_1.6-1_i386.deb) ...
Selecting previously deselected package libxcb-render-util0-dev.
Unpacking libxcb-render-util0-dev (from .../libxcb-render-util0-dev_0.3.6-1_i386.deb) ...
Selecting previously deselected package libcairo2-dev.
Unpacking libcairo2-dev (from .../libcairo2-dev_1.8.10-6_i386.deb) ...
Selecting previously deselected package libglib2.0-dev.
Unpacking libglib2.0-dev (from .../libglib2.0-dev_2.24.2-1_i386.deb) ...
Selecting previously deselected package libsys-hostname-long-perl.
Unpacking libsys-hostname-long-perl (from .../libsys-hostname-long-perl_1.4-2_all.deb) ...
Selecting previously deselected package libmail-sendmail-perl.
Unpacking libmail-sendmail-perl (from .../libmail-sendmail-perl_0.79.16-1_all.deb) ...
Selecting previously deselected package libxft-dev.
Unpacking libxft-dev (from .../libxft-dev_2.1.14-2_i386.deb) ...
Selecting previously deselected package libpango1.0-dev.
Unpacking libpango1.0-dev (from .../libpango1.0-dev_1.28.3-1+squeeze1_i386.deb) ...
Selecting previously deselected package libxml2-dev.
Unpacking libxml2-dev (from .../libxml2-dev_2.7.8.dfsg-2_i386.deb) ...
Selecting previously deselected package rsync.
Unpacking rsync (from .../rsync_3.0.7-2_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up x11proto-core-dev (7.0.16-1) ...
Setting up libice-dev (2:1.0.6-2) ...
Setting up libxau-dev (1:1.0.6-1) ...
Setting up libxdmcp-dev (1:1.0.3-2) ...
Setting up x11proto-input-dev (2.0-2) ...
Setting up x11proto-kb-dev (1.0.4-1) ...
Setting up xtrans-dev (1.2.5-1) ...
Setting up libpthread-stubs0 (0.3-2) ...
Setting up libpthread-stubs0-dev (0.3-2) ...
Setting up libxcb1-dev (1.6-1) ...
Setting up libx11-dev (2:1.3.3-4) ...
Setting up liberror-perl (0.17-1) ...
Setting up git (1:1.7.2.3-2.2) ...
Setting up autopoint (0.18.1.1-3) ...
Setting up html2text (1.3.2a-15) ...
Setting up libunistring0 (0.9.3-3) ...
Setting up gettext (0.18.1.1-3) ...
Setting up intltool-debian (0.35.0+20060710.1) ...
Setting up po-debconf (1.0.16+nmu1) ...
Setting up debhelper (8.0.0) ...
Setting up libexpat1-dev (2.0.1-7) ...
Setting up zlib1g-dev (1:1.2.3.4.dfsg-3) ...
Setting up libfreetype6-dev (2.4.2-2.1) ...
Setting up libfontconfig1-dev (2.8.0-2.1) ...
Setting up x11proto-render-dev (2:0.11-1) ...
Setting up libxrender-dev (1:0.9.6-1) ...
Setting up libpng12-dev (1.2.44-1) ...
Setting up libsm-dev (2:1.1.1-1) ...
Setting up libpixman-1-dev (0.16.4-1) ...
Setting up libxcb-render0-dev (1.6-1) ...
Setting up libxcb-render-util0-dev (0.3.6-1) ...
Setting up libcairo2-dev (1.8.10-6) ...
Setting up libglib2.0-dev (2.24.2-1) ...
Setting up libsys-hostname-long-perl (1.4-2) ...
Setting up libmail-sendmail-perl (0.79.16-1) ...
Setting up libxft-dev (2.1.14-2) ...
Setting up libpango1.0-dev (1.28.3-1+squeeze1) ...
Setting up libxml2-dev (2.7.8.dfsg-2) ...
Setting up rsync (3.0.7-2) ...
update-rc.d: using dependency based boot sequencing
root@dhcp-179:/home/jr018429#

I then performed the configuration and installation (again after installing the dependecies).

         .
         .
         .
Find 3rd-Party Libraries
checking for libdbi... no
checking for libwrap... no
checking for cairo_font_options_create in -lcairo... yes
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
checking for pkg-config... pkg-config
checking for cairo_font_options_create in -lcairo... yes
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for cairo_svg_surface_create in -lcairo... yes
checking cairo-svg.h usability... yes
checking cairo-svg.h presence... yes
checking for cairo-svg.h... yes
checking for cairo_pdf_surface_create in -lcairo... yes
checking cairo-pdf.h usability... yes
checking cairo-pdf.h presence... yes
checking for cairo-pdf.h... yes
checking for cairo_ps_surface_create in -lcairo... yes
checking cairo-ps.h usability... yes
checking cairo-ps.h presence... yes
checking for cairo-ps.h... yes
checking for glib_check_version in -lglib-2.0... yes
checking glib.h usability... no
checking glib.h presence... no
checking for glib.h... no
checking for pkg-config... (cached) pkg-config
checking for glib_check_version in -lglib-2.0... yes
checking glib.h usability... yes
checking glib.h presence... yes
checking for glib.h... yes
checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... yes
checking pango/pango.h usability... no
checking pango/pango.h presence... no
checking for pango/pango.h... no
checking for pkg-config... (cached) pkg-config
checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... yes
checking pango/pango.h usability... yes
checking pango/pango.h presence... yes
checking for pango/pango.h... yes
checking for xmlParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes

Prep for Building Language Bindings
checking for perl... /usr/bin/perl
checking for pod2man... /usr/bin/pod2man
checking for pod2html... /usr/bin/pod2html
checking for the perl version you are running... 5.10.1
checking for the C compiler perl wants to use to build its modules... cc
checking for cc... /usr/bin/cc
checking Perl Modules to build... perl_piped perl_shared
checking for ruby... no
checking if ruby modules can be built... No .. Ruby not found or disabled
checking for lua... no
checking for tclConfig.sh in /usr/lib... no
checking for tclConfig.sh in /usr/local/lib... no
checking for tclConfig.sh in /usr/lib/tcl8.4... no
checking for tclConfig.sh in /usr/lib/tcl8.3... no
configure: WARNING: tclConfig.sh not found - Tcl interface will not be built
checking for a Python interpreter with version >= 2.3... python
checking for python... /usr/bin/python
checking for python version... 2.6
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.6/site-packages
checking for headers required to compile python extensions... not found
configure: WARNING: could not find Python headers
checking for gnroff... no
checking for nroff... /usr/bin/nroff
checking for groff... /usr/bin/groff

Apply Configuration Information
configure: creating ./config.status
config.status: creating examples/shared-demo.pl
config.status: creating examples/piped-demo.pl
config.status: creating examples/stripes.pl
config.status: creating examples/bigtops.pl
config.status: creating examples/minmax.pl
config.status: creating examples/4charts.pl
config.status: creating examples/perftest.pl
config.status: creating examples/Makefile
config.status: creating examples/rrdcached/Makefile
config.status: creating doc/Makefile
config.status: creating po/Makefile.in
config.status: creating src/Makefile
config.status: creating src/librrd.sym.in
config.status: creating src/librrd.pc
config.status: creating bindings/Makefile
config.status: creating bindings/tcl/Makefile
config.status: creating bindings/tcl/ifOctets.tcl
config.status: creating Makefile
config.status: creating bindings/lua/Makefile
config.status: creating rrd_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing default commands
checking in... and out again
ordering CD from http://tobi.oetiker.ch/wish .... just kidding ;-)

----------------------------------------------------------------
Config is DONE!

          With MMAP IO: yes
      Build rrd_getopt: no
       Static programs: no
          Perl Modules: perl_piped perl_shared
           Perl Binary: /usr/bin/perl
          Perl Version: 5.10.1
          Perl Options: PREFIX=/opt/rrdtool-1.4.5 LIB=/opt/rrdtool-1.4.5/lib/perl/5.10.1
          Ruby Modules: 
           Ruby Binary: no
          Ruby Options: sitedir=/opt/rrdtool-1.4.5/lib/ruby
    Build Lua Bindings: no
    Build Tcl Bindings: no
 Build Python Bindings: no
          Build rrdcgi: yes
       Build librrd MT: yes
           Use gettext: yes
           With libDBI: no
          With libwrap: no

             Libraries: -lxml2 -lcairo -lcairo -lcairo -lm  -lcairo -lpng12   -lglib-2.0   -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0  

Type 'make' to compile the software and use 'make install' to 
install everything to: /opt/rrdtool-1.4.5.

       ... that wishlist is NO JOKE. If you find RRDtool useful
make me happy. Go to http://tobi.oetiker.ch/wish and
place an order.

                               -- Tobi Oetiker <tobi@oetiker.ch>
----------------------------------------------------------------
make  all-recursive
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
Making all in po
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/po'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/po'
Making all in src
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
  CC     hash_32.lo
  CC     pngsize.lo
  CC     rrd_create.lo
  CC     rrd_graph.lo
  CC     rrd_graph_helper.lo
  CC     rrd_version.lo
  CC     rrd_last.lo
  CC     rrd_lastupdate.lo
  CC     rrd_first.lo
  CC     rrd_restore.lo
  CC     rrd_xport.lo
  CC     rrd_gfx.lo
  CC     rrd_dump.lo
  CC     rrd_flushcached.lo
  CC     rrd_fetch.lo
  CC     rrd_resize.lo
  CC     rrd_tune.lo
  CC     rrd_parsetime.lo
  CC     rrd_hw.lo
  CC     rrd_hw_math.lo
  CC     rrd_hw_update.lo
  CC     rrd_diff.lo
  CC     rrd_format.lo
  CC     rrd_info.lo
  CC     rrd_error.lo
  CC     rrd_open.lo
  CC     rrd_client.lo
  CC     rrd_nan_inf.lo
  CC     rrd_rpncalc.lo
  CC     rrd_utils.lo
  CC     rrd_update.lo
  CC     rrd_not_thread_safe.lo
  CCLD   librrdupd.la
  GEN    librrd.sym
  CCLD   librrd.la
  CC     librrd_th_la-rrd_parsetime.lo
  CC     librrd_th_la-rrd_hw.lo
  CC     librrd_th_la-rrd_hw_math.lo
  CC     librrd_th_la-rrd_hw_update.lo
  CC     librrd_th_la-rrd_diff.lo
  CC     librrd_th_la-rrd_format.lo
  CC     librrd_th_la-rrd_info.lo
  CC     librrd_th_la-rrd_error.lo
  CC     librrd_th_la-rrd_open.lo
  CC     librrd_th_la-rrd_client.lo
  CC     librrd_th_la-rrd_nan_inf.lo
  CC     librrd_th_la-rrd_rpncalc.lo
  CC     librrd_th_la-rrd_utils.lo
  CC     librrd_th_la-rrd_update.lo
  CC     librrd_th_la-hash_32.lo
  CC     librrd_th_la-pngsize.lo
  CC     librrd_th_la-rrd_create.lo
  CC     librrd_th_la-rrd_graph.lo
  CC     librrd_th_la-rrd_graph_helper.lo
  CC     librrd_th_la-rrd_version.lo
  CC     librrd_th_la-rrd_last.lo
  CC     librrd_th_la-rrd_lastupdate.lo
  CC     librrd_th_la-rrd_first.lo
  CC     librrd_th_la-rrd_restore.lo
  CC     librrd_th_la-rrd_xport.lo
  CC     librrd_th_la-rrd_gfx.lo
  CC     librrd_th_la-rrd_dump.lo
  CC     librrd_th_la-rrd_flushcached.lo
  CC     librrd_th_la-rrd_fetch.lo
  CC     librrd_th_la-rrd_resize.lo
  CC     librrd_th_la-rrd_tune.lo
  CC     librrd_th_la-rrd_thread_safe.lo
  CCLD   librrd_th.la
  CC     rrd_tool.o
In file included from rrd_i18n.h:18,
                 from rrd_tool.c:19:
gettext.h:176:6: warning: "__STRICT_ANSI__" is not defined
gettext.h:200:5: warning: "__STRICT_ANSI__" is not defined
gettext.h:215:6: warning: "__STRICT_ANSI__" is not defined
gettext.h:246:5: warning: "__STRICT_ANSI__" is not defined
gettext.h:261:6: warning: "__STRICT_ANSI__" is not defined
  CCLD   rrdtool
  CC     rrdupdate.o
  CCLD   rrdupdate
  CC     rrdcached-rrd_daemon.o
  CCLD   rrdcached
  CC     rrd_cgi.o
  CCLD   rrdcgi
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
Making all in examples
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
Making all in rrdcached
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
sed 's,@''exec_prefix@,/opt/rrdtool-1.4.5,' ./cgi-demo.cgi.in > cgi-demo.cgi
chmod a+x cgi-demo.cgi
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
Making all in doc
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
  GEN    RRDs.pod
  GEN    RRDp.pod
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
Making all in bindings
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
cd perl-piped && /usr/bin/perl Makefile.PL PREFIX=/opt/rrdtool-1.4.5 LIB=/opt/rrdtool-1.4.5/lib/perl/5.10.1
Checking if your kit is complete...
Looks good
Writing Makefile for RRDp
cd perl-piped && make
make[4]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
cp RRDp.pm blib/lib/RRDp.pm
Manifying blib/man3/RRDp.3pm
make[4]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
cd perl-shared && /usr/bin/perl Makefile.PL  PREFIX=/opt/rrdtool-1.4.5 LIB=/opt/rrdtool-1.4.5/lib/perl/5.10.1 RPATH=/opt/rrdtool-1.4.5/lib
Checking if your kit is complete...
Looks good
Writing Makefile for RRDs
cd perl-shared && make
make[4]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
cp RRDs.pm blib/lib/RRDs.pm
/usr/bin/perl /usr/share/perl/5.10/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap  RRDs.xs > RRDs.xsc && mv RRDs.xsc RRDs.c
cc -c  -I../../src -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.4004\" -DXS_VERSION=\"1.4004\" -fPIC "-I/usr/lib/perl/5.10/CORE"  -DPERLPATCHLEVEL=10 RRDs.c
Running Mkbootstrap for RRDs ()
chmod 644 RRDs.bs
rm -f blib/arch/auto/RRDs/RRDs.so
cc  -shared -O2 -g -L/usr/local/lib -fstack-protector RRDs.o -L../../src/.libs/ -Wl,--rpath -Wl,/opt/rrdtool-1.4.5/lib -lrrd  -o blib/arch/auto/RRDs/RRDs.so 	\
	     	\
	  
chmod 755 blib/arch/auto/RRDs/RRDs.so
cp RRDs.bs blib/arch/auto/RRDs/RRDs.bs
chmod 644 blib/arch/auto/RRDs/RRDs.bs
Manifying blib/man3/RRDs.3pm
make[4]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
Making install in po
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/po'
if test "rrdtool" = "gettext-tools"; then \
	  /bin/mkdir -p /opt/rrdtool-1.4.5/share/gettext/po; \
	  for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.template; do \
	    /usr/bin/install -c -m 644 ./$file \
			    /opt/rrdtool-1.4.5/share/gettext/po/$file; \
	  done; \
	  for file in Makevars; do \
	    rm -f /opt/rrdtool-1.4.5/share/gettext/po/$file; \
	  done; \
	else \
	  : ; \
	fi
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/po'
Making install in src
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
test -z "/opt/rrdtool-1.4.5/lib" || /bin/mkdir -p "/opt/rrdtool-1.4.5/lib"
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   librrd.la librrd_th.la '/opt/rrdtool-1.4.5/lib'
libtool: install: /usr/bin/install -c .libs/librrd.so.4.1.4 /opt/rrdtool-1.4.5/lib/librrd.so.4.1.4
libtool: install: (cd /opt/rrdtool-1.4.5/lib && { ln -s -f librrd.so.4.1.4 librrd.so.4 || { rm -f librrd.so.4 && ln -s librrd.so.4.1.4 librrd.so.4; }; })
libtool: install: (cd /opt/rrdtool-1.4.5/lib && { ln -s -f librrd.so.4.1.4 librrd.so || { rm -f librrd.so && ln -s librrd.so.4.1.4 librrd.so; }; })
libtool: install: /usr/bin/install -c .libs/librrd.lai /opt/rrdtool-1.4.5/lib/librrd.la
libtool: install: /usr/bin/install -c .libs/librrd_th.so.4.1.4 /opt/rrdtool-1.4.5/lib/librrd_th.so.4.1.4
libtool: install: (cd /opt/rrdtool-1.4.5/lib && { ln -s -f librrd_th.so.4.1.4 librrd_th.so.4 || { rm -f librrd_th.so.4 && ln -s librrd_th.so.4.1.4 librrd_th.so.4; }; })
libtool: install: (cd /opt/rrdtool-1.4.5/lib && { ln -s -f librrd_th.so.4.1.4 librrd_th.so || { rm -f librrd_th.so && ln -s librrd_th.so.4.1.4 librrd_th.so; }; })
libtool: install: /usr/bin/install -c .libs/librrd_th.lai /opt/rrdtool-1.4.5/lib/librrd_th.la
libtool: install: /usr/bin/install -c .libs/librrd.a /opt/rrdtool-1.4.5/lib/librrd.a
libtool: install: chmod 644 /opt/rrdtool-1.4.5/lib/librrd.a
libtool: install: ranlib /opt/rrdtool-1.4.5/lib/librrd.a
libtool: install: /usr/bin/install -c .libs/librrd_th.a /opt/rrdtool-1.4.5/lib/librrd_th.a
libtool: install: chmod 644 /opt/rrdtool-1.4.5/lib/librrd_th.a
libtool: install: ranlib /opt/rrdtool-1.4.5/lib/librrd_th.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /opt/rrdtool-1.4.5/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/rrdtool-1.4.5/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/opt/rrdtool-1.4.5/bin" || /bin/mkdir -p "/opt/rrdtool-1.4.5/bin"
  /bin/bash ../libtool   --mode=install /usr/bin/install -c rrdtool rrdupdate rrdcached rrdcgi '/opt/rrdtool-1.4.5/bin'
libtool: install: /usr/bin/install -c .libs/rrdtool /opt/rrdtool-1.4.5/bin/rrdtool
libtool: install: /usr/bin/install -c rrdupdate /opt/rrdtool-1.4.5/bin/rrdupdate
libtool: install: /usr/bin/install -c .libs/rrdcached /opt/rrdtool-1.4.5/bin/rrdcached
libtool: install: /usr/bin/install -c .libs/rrdcgi /opt/rrdtool-1.4.5/bin/rrdcgi
test -z "/opt/rrdtool-1.4.5/include" || /bin/mkdir -p "/opt/rrdtool-1.4.5/include"
 /usr/bin/install -c -m 644 rrd.h rrd_format.h rrd_client.h '/opt/rrdtool-1.4.5/include'
test -z "/opt/rrdtool-1.4.5/lib/pkgconfig" || /bin/mkdir -p "/opt/rrdtool-1.4.5/lib/pkgconfig"
 /usr/bin/install -c -m 644 librrd.pc '/opt/rrdtool-1.4.5/lib/pkgconfig'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/src'
Making install in examples
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
Making install in rrdcached
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/opt/rrdtool-1.4.5/share/rrdtool/examples/rrdcached" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/rrdtool/examples/rrdcached"
 /usr/bin/install -c RRDCached.pm rrdcached-size.pl '/opt/rrdtool-1.4.5/share/rrdtool/examples/rrdcached'
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples/rrdcached'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/opt/rrdtool-1.4.5/share/rrdtool/examples" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/rrdtool/examples"
 /usr/bin/install -c cgi-demo.cgi piped-demo.pl shared-demo.pl stripes.pl bigtops.pl minmax.pl 4charts.pl perftest.pl '/opt/rrdtool-1.4.5/share/rrdtool/examples'
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/examples'
Making install in doc
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/txt" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/txt"
 /usr/bin/install -c -m 644 bin_dec_hex.pod rrddump.pod rrdgraph_examples.pod rrdrestore.pod rrdupdate.pod cdeftutorial.pod rrdfetch.pod rrdgraph_graph.pod rrdthreads.pod rrdxport.pod rpntutorial.pod rrdfirst.pod rrdgraph_rpn.pod rrdtool.pod rrdcached.pod rrd-beginners.pod rrdinfo.pod rrdtune.pod rrdbuild.pod rrdflushcached.pod rrdcgi.pod rrdgraph.pod rrdlast.pod rrdlastupdate.pod rrdcreate.pod rrdgraph_data.pod rrdresize.pod rrdtutorial.pod bin_dec_hex.txt rrddump.txt rrdgraph_examples.txt rrdrestore.txt rrdupdate.txt cdeftutorial.txt rrdfetch.txt rrdgraph_graph.txt rrdthreads.txt rrdxport.txt rpntutorial.txt rrdfirst.txt '/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/txt'
 /usr/bin/install -c -m 644 rrdgraph_rpn.txt rrdtool.txt rrdcached.txt rrd-beginners.txt rrdinfo.txt rrdtune.txt rrdbuild.txt rrdflushcached.txt rrdcgi.txt rrdgraph.txt rrdlast.txt rrdlastupdate.txt rrdcreate.txt rrdgraph_data.txt rrdresize.txt rrdtutorial.txt librrd.txt '/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/txt'
test -z "/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/html" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/html"
 /usr/bin/install -c -m 644 bin_dec_hex.html rrddump.html rrdgraph_examples.html rrdrestore.html rrdupdate.html cdeftutorial.html rrdfetch.html rrdgraph_graph.html rrdthreads.html rrdxport.html rpntutorial.html rrdfirst.html rrdgraph_rpn.html rrdtool.html rrdcached.html rrd-beginners.html rrdinfo.html rrdtune.html rrdbuild.html rrdflushcached.html rrdcgi.html rrdgraph.html rrdlast.html rrdlastupdate.html rrdcreate.html rrdgraph_data.html rrdresize.html rrdtutorial.html librrd.html RRDs.html RRDp.html '/opt/rrdtool-1.4.5/share/doc/rrdtool-1.4.5/html'
test -z "/opt/rrdtool-1.4.5/share/man/man3" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/man/man3"
 /usr/bin/install -c -m 644 librrd.3 '/opt/rrdtool-1.4.5/share/man/man3'
test -z "/opt/rrdtool-1.4.5/share/man/man1" || /bin/mkdir -p "/opt/rrdtool-1.4.5/share/man/man1"
 /usr/bin/install -c -m 644 bin_dec_hex.1 rrddump.1 rrdgraph_examples.1 rrdrestore.1 rrdupdate.1 cdeftutorial.1 rrdfetch.1 rrdgraph_graph.1 rrdthreads.1 rrdxport.1 rpntutorial.1 rrdfirst.1 rrdgraph_rpn.1 rrdtool.1 rrdcached.1 rrd-beginners.1 rrdinfo.1 rrdtune.1 rrdbuild.1 rrdflushcached.1 rrdcgi.1 rrdgraph.1 rrdlast.1 rrdlastupdate.1 rrdcreate.1 rrdgraph_data.1 rrdresize.1 rrdtutorial.1 '/opt/rrdtool-1.4.5/share/man/man1'
make  install-data-hook
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
  GEN    install-data-hook
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/doc'
Making install in bindings
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
cd perl-piped && make
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
cd perl-shared && make
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
make[3]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[3]: Nothing to be done for `install-exec-am'.
  GEN    install-data-local
make[4]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
Installing /opt/rrdtool-1.4.5/lib/perl/5.10.1/RRDp.pm
Installing /opt/rrdtool-1.4.5/man/man3/RRDp.3pm
Appending installation info to /opt/rrdtool-1.4.5/lib/perl/5.10.1/i486-linux-gnu-thread-multi/perllocal.pod
make[4]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-piped'
  GEN    install-data-local
make[4]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /opt/rrdtool-1.4.5/lib/perl/5.10.1/i486-linux-gnu-thread-multi/auto/RRDs/RRDs.bs
Installing /opt/rrdtool-1.4.5/lib/perl/5.10.1/i486-linux-gnu-thread-multi/auto/RRDs/RRDs.so
Installing /opt/rrdtool-1.4.5/lib/perl/5.10.1/i486-linux-gnu-thread-multi/RRDs.pm
Installing /opt/rrdtool-1.4.5/man/man3/RRDs.3pm
Appending installation info to /opt/rrdtool-1.4.5/lib/perl/5.10.1/i486-linux-gnu-thread-multi/perllocal.pod
make[4]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings/perl-shared'
  GEN    install-data-local
  GEN    install-data-local
make[3]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5/bindings'
make[1]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
make[2]: Entering directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
make[1]: Leaving directory `/home/jr018429/rrdbuild/rrdtool-1.4.5'
root@dhcp-179:/home/jr018429/rrdbuild/rrdtool-1.4.5#

At this point, I stopped the RRDTool install (02/14/2011 at 3:30pm).

Back to RRDTool install (02/17/2011)
The next step of the install is to try an example ( http://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html ).

Now go to $INSTALL_DIR/share/rrdtool/examples/ and run them to see if your build has been successful.

In this case, $INSTALL_DIR is: /opt/rrdtool-1.4.5.
As you can see below, before I attemmpted to run one of the example scripts, there were no .png files in the /opt/rrdtool-1.4.5/share/rrdtool/examples directory.
After the script is run, stripes.pl in this case (see below), stripes.png appears in the examples directory-SUCCESS!!!!.

root@dhcp-179:/opt/rrdtool-1.4.5/share/rrdtool/examples# ls
4charts.pl  cgi-demo.cgi  perftest.pl	 rrdcached	 stripes.pl
bigtops.pl  minmax.pl	  piped-demo.pl  shared-demo.pl
root@dhcp-179:/opt/rrdtool-1.4.5/share/rrdtool/examples# ./stripes.pl
This script has created stripes.png in the current directory
This demonstrates the use of the TIME and % RPN operators
root@dhcp-179:/opt/rrdtool-1.4.5/share/rrdtool/examples# ls
4charts.pl    minmax.pl      random.rrd      stripes.pl
bigtops.pl    perftest.pl    rrdcached	     stripes.png
cgi-demo.cgi  piped-demo.pl  shared-demo.pl


This is a picture of the graph that was created when the stripes.pl script was run:


CSCS2650 Computer Organization
I restored my cpumem class and changed the data type of the array to unsigned char so that it is 8-bits wide as is the 8085. I changed the data type used for the address to unsigned short int because it is 2 bytes so it can address 0 to 65535 just like the 8085. The constructor now automatically creates the correct size memory for the 8085.

#include "cpumem.h"

CPUMEM::CPUMEM()
{
        memadd = new unsigned char[65536];
}

CPUMEM::~CPUMEM()
{
        delete[] memadd;
}

unsigned char& CPUMEM::operator[](unsigned short int address)
{
        return memadd[address];
}

unsigned char CPUMEM::read(unsigned short int address)
{
        return *(memadd + address);
}

void CPUMEM::write(unsigned short int address, unsigned char value)
{
        *(memadd + address) = value;
}

I also restored and then changed the cpumem.h to reflect data type changes.

#ifndef _CPUMEM_H
#define _CPUMEM_H

class CPUMEM
{
        public:
                CPUMEM();
                unsigned char& operator[](unsigned short int address);
                unsigned char read(unsigned short int address);
                void write(unsigned short int address, unsigned char value);
                ~CPUMEM();
        private:
                //unsigned short int memlngth;
                unsigned char *memadd;
};
#endif

I modified memtest.cc so that it would loop through all 65,536 memory locations and write the maximum unsigned char value to each memory loction and thenloop through all of the memory locations again and print the value stored at each location.

#include <cstdio>
#include "cpumem.h"
const int MEM_MAX = 65535;
int main()
{
        CPUMEM datamemory;
        for (int temp = 0x00; temp <= MEM_MAX; temp++) datamemory.write(temp, 2$
        for(int temp = 0x00; temp <= MEM_MAX; temp++) printf("Memory address %x$
        return(0);
}

I also modified Makefile to work with the restored and modified files.

CXX = g++ $(CXXFLAGS) $(INC) $(LIBS)
AR = ar
CXXFLAGS = -Wall
INC = -I ../include/
LIBS =
SRC = cpumem.cc memtest.cc
OBJ = $(SRC:.cc=.o)
BIN = memtest
all: $(SRC) $(BIN)

debug: CXX += -DDEBUG -g
debug: DEBUG = debug
debug: $(SRC) $(BIN)

$(BIN): $(OBJ)
ifneq ($(MAKECMDGOALS),debug)
        @printf "[CC]  %-20s ... " "$(BIN)"
        @$(CXX) -o $(BIN) $(OBJ) && echo "SUCCESS" || echo "FAIL"
else
        $(CXX) -o $(BIN) $(OBJ)
endif

.cc.o:
ifneq ($(MAKECMDGOALS),debug)
        @printf "[B]   %-20s ... " "$<"
        @$(CXX) -c $< && echo "OK" || echo "FAIL"
else
        $(CXX) -c $<
endif

clean:
        rm -f *.o $(BIN) core

default: $(BIN)

This is the result of running make after modifying all of the files.

lab46:~/src/cpu/cpumemory$ make
[B]   cpumem.cc            ... OK
[B]   memtest.cc           ... OK
[CC]  memtest              ... SUCCESS
lab46:~/src/cpu/cpumemory$

I then executed the code to verify that is ran with no errors.

Memory address ff21 contains the value ff
Memory address ff22 contains the value ff
Memory address ff23 contains the value ff
Memory address ff24 contains the value ff
Memory address ff25 contains the value ff
Memory address ff26 contains the value ff
Memory address ff27 contains the value ff
Memory address ff28 contains the value ff
Memory address ff29 contains the value ff
Memory address ff2a contains the value ff
Memory address ff2b contains the value ff
Memory address ff2c contains the value ff
Memory address ff2d contains the value ff
Memory address ff2e contains the value ff
Memory address ff2f contains the value ff
Memory address ff30 contains the value ff
Memory address ff31 contains the value ff
Memory address ff32 contains the value ff
Memory address ff33 contains the value ff
Memory address ff34 contains the value ff
Memory address ff35 contains the value ff
Memory address ff36 contains the value ff
Memory address ff37 contains the value ff
Memory address ff38 contains the value ff
Memory address ff39 contains the value ff
Memory address ff3a contains the value ff
Memory address ff3b contains the value ff
Memory address ff3c contains the value ff
Memory address ff3d contains the value ff
Memory address ff3e contains the value ff
Memory address ff3f contains the value ff
Memory address ff40 contains the value ff
Memory address ff41 contains the value ff
Memory address ff42 contains the value ff
Memory address ff43 contains the value ff
Memory address ff44 contains the value ff
Memory address ff45 contains the value ff
Memory address ff46 contains the value ff
Memory address ff47 contains the value ff
Memory address ff48 contains the value ff
Memory address ff49 contains the value ff
Memory address ff4a contains the value ff
Memory address ff4b contains the value ff
Memory address ff4c contains the value ff
Memory address ff4d contains the value ff
Memory address ff4e contains the value ff
Memory address ff4f contains the value ff
Memory address ff50 contains the value ff
Memory address ff51 contains the value ff
Memory address ff52 contains the value ff
Memory address ff53 contains the value ff
Memory address ff54 contains the value ff
Memory address ff55 contains the value ff
Memory address ff56 contains the value ff
Memory address ff57 contains the value ff
Memory address ff58 contains the value ff
Memory address ff59 contains the value ff
Memory address ff5a contains the value ff
Memory address ff5b contains the value ff
Memory address ff5c contains the value ff
Memory address ff5d contains the value ff
Memory address ff5e contains the value ff
Memory address ff5f contains the value ff
Memory address ff60 contains the value ff
Memory address ff61 contains the value ff
Memory address ff62 contains the value ff
Memory address ff63 contains the value ff
Memory address ff64 contains the value ff
Memory address ff65 contains the value ff
Memory address ff66 contains the value ff
Memory address ff67 contains the value ff
Memory address ff68 contains the value ff
Memory address ff69 contains the value ff
Memory address ff6a contains the value ff
Memory address ff6b contains the value ff
Memory address ff6c contains the value ff
Memory address ff6d contains the value ff
Memory address ff6e contains the value ff
Memory address ff6f contains the value ff
Memory address ff70 contains the value ff
Memory address ff71 contains the value ff
Memory address ff72 contains the value ff
Memory address ff73 contains the value ff
Memory address ff74 contains the value ff
Memory address ff75 contains the value ff
Memory address ff76 contains the value ff
Memory address ff77 contains the value ff
Memory address ff78 contains the value ff
Memory address ff79 contains the value ff
Memory address ff7a contains the value ff
Memory address ff7b contains the value ff
Memory address ff7c contains the value ff
Memory address ff7d contains the value ff
Memory address ff7e contains the value ff
Memory address ff7f contains the value ff
Memory address ff80 contains the value ff
Memory address ff81 contains the value ff
Memory address ff82 contains the value ff
Memory address ff83 contains the value ff
Memory address ff84 contains the value ff
Memory address ff85 contains the value ff
Memory address ff86 contains the value ff
Memory address ff87 contains the value ff
Memory address ff88 contains the value ff
Memory address ff89 contains the value ff
Memory address ff8a contains the value ff
Memory address ff8b contains the value ff
Memory address ff8c contains the value ff
Memory address ff8d contains the value ff
Memory address ff8e contains the value ff
Memory address ff8f contains the value ff
Memory address ff90 contains the value ff
Memory address ff91 contains the value ff
Memory address ff92 contains the value ff
Memory address ff93 contains the value ff
Memory address ff94 contains the value ff
Memory address ff95 contains the value ff
Memory address ff96 contains the value ff
Memory address ff97 contains the value ff
Memory address ff98 contains the value ff
Memory address ff99 contains the value ff
Memory address ff9a contains the value ff
Memory address ff9b contains the value ff
Memory address ff9c contains the value ff
Memory address ff9d contains the value ff
Memory address ff9e contains the value ff
Memory address ff9f contains the value ff
Memory address ffa0 contains the value ff
Memory address ffa1 contains the value ff
Memory address ffa2 contains the value ff
Memory address ffa3 contains the value ff
Memory address ffa4 contains the value ff
Memory address ffa5 contains the value ff
Memory address ffa6 contains the value ff
Memory address ffa7 contains the value ff
Memory address ffa8 contains the value ff
Memory address ffa9 contains the value ff
Memory address ffaa contains the value ff
Memory address ffab contains the value ff
Memory address ffac contains the value ff
Memory address ffad contains the value ff
Memory address ffae contains the value ff
Memory address ffaf contains the value ff
Memory address ffb0 contains the value ff
Memory address ffb1 contains the value ff
Memory address ffb2 contains the value ff
Memory address ffb3 contains the value ff
Memory address ffb4 contains the value ff
Memory address ffb5 contains the value ff
Memory address ffb6 contains the value ff
Memory address ffb7 contains the value ff
Memory address ffb8 contains the value ff
Memory address ffb9 contains the value ff
Memory address ffba contains the value ff
Memory address ffbb contains the value ff
Memory address ffbc contains the value ff
Memory address ffbd contains the value ff
Memory address ffbe contains the value ff
Memory address ffbf contains the value ff
Memory address ffc0 contains the value ff
Memory address ffc1 contains the value ff
Memory address ffc2 contains the value ff
Memory address ffc3 contains the value ff
Memory address ffc4 contains the value ff
Memory address ffc5 contains the value ff
Memory address ffc6 contains the value ff
Memory address ffc7 contains the value ff
Memory address ffc8 contains the value ff
Memory address ffc9 contains the value ff
Memory address ffca contains the value ff
Memory address ffcb contains the value ff
Memory address ffcc contains the value ff
Memory address ffcd contains the value ff
Memory address ffce contains the value ff
Memory address ffcf contains the value ff
Memory address ffd0 contains the value ff
Memory address ffd1 contains the value ff
Memory address ffd2 contains the value ff
Memory address ffd3 contains the value ff
Memory address ffd4 contains the value ff
Memory address ffd5 contains the value ff
Memory address ffd6 contains the value ff
Memory address ffd7 contains the value ff
Memory address ffd8 contains the value ff
Memory address ffd9 contains the value ff
Memory address ffda contains the value ff
Memory address ffdb contains the value ff
Memory address ffdc contains the value ff
Memory address ffdd contains the value ff
Memory address ffde contains the value ff
Memory address ffdf contains the value ff
Memory address ffe0 contains the value ff
Memory address ffe1 contains the value ff
Memory address ffe2 contains the value ff
Memory address ffe3 contains the value ff
Memory address ffe4 contains the value ff
Memory address ffe5 contains the value ff
Memory address ffe6 contains the value ff
Memory address ffe7 contains the value ff
Memory address ffe8 contains the value ff
Memory address ffe9 contains the value ff
Memory address ffea contains the value ff
Memory address ffeb contains the value ff
Memory address ffec contains the value ff
Memory address ffed contains the value ff
Memory address ffee contains the value ff
Memory address ffef contains the value ff
Memory address fff0 contains the value ff
Memory address fff1 contains the value ff
Memory address fff2 contains the value ff
Memory address fff3 contains the value ff
Memory address fff4 contains the value ff
Memory address fff5 contains the value ff
Memory address fff6 contains the value ff
Memory address fff7 contains the value ff
Memory address fff8 contains the value ff
Memory address fff9 contains the value ff
Memory address fffa contains the value ff
Memory address fffb contains the value ff
Memory address fffc contains the value ff
Memory address fffd contains the value ff
Memory address fffe contains the value ff
Memory address ffff contains the value ff
lab46:~/src/cpu/cpumemory$

After testing the cpumem class and the test file, memtest.c, I committed it to the repository.

lab46:~/src/cpu/cpumemory$ svn commit -m "restored cpumem class, changed array data type to unsigned char, changed address data type to unsigned short int (2 bytes), cpumem now automatically allocates 65536 64k memory space automatically -John Rine"
Sending        cpumemory/Makefile
Sending        cpumemory/cpumem.cc
Sending        cpumemory/memtest.cc
Transmitting file data ...
Committed revision 110.

Oops (no pun intended), I was in the cpumemory directory so the cpumem.h file didn't get committed. I changed to the cpu/include directory and committed the cpumem.h file.

lab46:~/src/cpu/include$ svn commit -m "restored cpumem class, changed array data type to unsigned char, changed address data type to unsigned short int (2 bytes), cpumem now automatically allocates 65536 64k memory space automatically -John Rine"
Sending        include/cpumem.h
Transmitting file data .
Committed revision 111.
lab46:~/src/cpu/include$
lab46:~/src/cpu$ svn commit -m "changed memtest.cc to count and print data in hex -John Rine"
Sending        cpumemory/memtest.cc
Transmitting file data .
Committed revision 116.

After commiting the cpumem.cc, memtest.cc, and cpumem.h files to the repository, I added entries to the http://lab46.corning-cc.edu/notes/asm asm course Wiki for the CPUMEM class, including its include file.
http://lab46.corning-cc.edu/notes/asm

Directory File Description API Location
./cpumemory Base of memory files CPUMEM API
./cpumemory Makefile
./cpumemory cpumem.cc
./cpumemory memtest.cc


I then created the CPUMEM API page at http://lab46.corning-cc.edu/notes/asm/cpumem.
class library is included before the main function like this:

#include "cpumem.h"


CPUMEM::CPUMEM() is the constructor and automatically creates memory of the correct size, 64k (65536 elements, 0-65535), and type 1 byte (8-bits) for the 8085. The constructor is called automatically as the object is being instantiated.
An object of the type CPUMEM is instatiated like this:

//Instantiates an object of type CPUMEM
CPUMEM cpumemory;


CPUMEM::~CPUMEM() is the destructor and automatically deallocates the memory which was created when an object of type CPUMEM when an object of this type goes out of scope.

unsigned char& CPUMEM::operator[](unsigned short int address) is a depricated member function. It uses overloaded operators to make the code that calls this method look like an array. Do NOT use it.

unsigned char CPUMEM::read(unsigned short int address) is the member function that is used to read the 8-bit (unsigned char) value at a specific address.
The read member function is used like this:

//reads 8-bit data from last memory address, 0xffff, or 65535
unsigned char value = cpumemory.read(0xffff);


void CPUMEM::write(unsigned short int address, unsigned char value) is the member function that is used to write an 8-bit value to a specific address.
The write member function is used like this:

//writes the value 0xff, or 255, to the last memory address 0xffff, or 65535
cpumemory.write(0xffff, 0xff);


I started the ALU class. This is src/cpu/include/alu.h.

#ifndef _ALU_H
#define _ALU_H
class ALU
{
        public:
                ALU();
                ~ALU();
                void setTempReg(unsigned char tempRegister);
                void setAccumulator(unsigned char accumulator);
                void setInstruction(unsigned char instruction);
                unsigned char getDataBus();
                void doOp();
        private:
};
#endif

This is src/cpu/arithmeticlogicunit/alu.cc.

#include "alu.h"

ALU::ALU()
{
}

ALU:~ALU()
{
}

void ALU::setTempReg(unsigned char tempRegister)
{
}

void ALU::setAccumulator(unsigned char accumulator)
{
}

void ALU::setInstruction(unsigned char instruction)
{
}

unsigned char ALU::getDataBus()
{
}

void ALU::doOp()
{
}

This is the svn add of the alu.h file.

lab46:~/src/cpu/include$ svn add alu.h
A         alu.h
lab46:~/src/cpu/include$

This is the svn add of the arithmeticlogicunit directory and its contents.

lab46:~/src/cpu/8085$ svn add arithmeticlogicunit
A         arithmeticlogicunit
A         arithmeticlogicunit/alu.cc
A         arithmeticlogicunit/alutest.cc
lab46:~/src/cpu/8085$

This is the result of the svn commit after performing the svn add.

lab46:~/src/cpu$ svn commit -m "8085 alu and memory -John Rine"
Adding         8085/arithmeticlogicunit
Adding         8085/arithmeticlogicunit/alu.cc
Adding         8085/arithmeticlogicunit/alutest.cc
Adding         include/alu.h
Transmitting file data ...
Committed revision 118.

I also created an RS flip-flop tutorial on the asn note page at: http://lab46.corning-cc.edu/notes/asm . R-S Flip-Flop Tutorial
by John Rine
Because a few people in the class said “flip-flops make my brain hurt” (my paraphrase), I thought I would add a tutorial that might help people understand and appreciate them.

  1. Nand and nor flip-flops have two types of inputs, independent, tied only to the outside world, and dependent inputs, fed back from the other gate of the flip-flop.
  2. The truth table tells the tale:


NOR Gate
A B O Comment Comment
0 0 1 0 on flip-flop independent input causes either 0 or 1 out
0 1 0 1 on flip-flop independent input causes 0 out0 on flip-flop independent input causes either 0 or 1 out
1 0 0 1 on flip-flop independent input causes 0 out0 on flip-flop independent input causes either 0 or 1 out
1 1 0 1 on flip-flop independent input causes 0 out

Nor Flip-Flop:

  1. 1 on an independent input, output of that gate will be 0.
  2. 0 on an independent input, output could be 0 or 1, output is dependent upon dependent input fed back from the other gate.

Looking at the truth table for a NOR gate, if a 1 appears on the independent input of a NOR gate, which is part of a NOR flip-flop, that gate's output WILL BE 0-PERIOD!

Now there is a state known as the disallowed state. The disallowed state occurs when the outputs of a flip-flop are the same state. The outputs of an R-S flip-flop are known as Q and !Q (not Q). Logically, Q cannot = !Q. Since in a NOR flip-flop, if the determinate state, 1 in this case, occurs on and an independent input the output will be in a known state, 0 in this case. If both independent inputs of a NAND gate have the determinate state, 1 in this case, on both inputs, both outputs will be 0. Remember, Q != !Q so this is a disallowed state. Stay away from it. Under a specific condition, this input state can cause the flip-flop to race. That is, when you analyze the flip-flop, you will go round and round forever with the outputs, Q and !Q, changing between 1,1 and 0,0. Like I said, stay away from the disallowed state (NOR flip-flop: 1 on both inputs)!

Now, if a 0 appears on the independent input of a NOR gate which is part of a NOR flip-flop, that gate's output may be 0 or 1 (look at the truth table), we won't know until we look at the other input which happens to be fed back from the other NOR gate of the NOR flip-flop. Therefore, if the other NOR gate of a NOR flip-flop has the determinate state, 1 in this case, 0 will be fed back from its output to the NOR gate having the indeterminate state, 0 in this case, causing the flip-flop with the indeterminate state on its input, 0 in this case, to have on its output the state opposite that on the NOR gate having the determinate state, 1 in this case.

There is one more R-S flip-flop state to talk about. It is called the no change state. If we assume that the NOR flip-flop is in the state described in the section directly above, and then change the NAND gate having the determinate state on its input to having the indeterminate state, 1 to 0 in this case, the output states will not change due to the output being fed back from the other gate. Since when the flip-flop is placed into a no change state, it is important that the flip-flop be placed into a pre-defined state before it is placed into the no change state. In other words, you must know what output states are not changing, before the circuit is analyzed.
In summary:

NOR Flip-Flop
S R Q !Q Comments
1 0 1 0 SET-Q is true, !Q is false
0 1 0 1 RESET-Q is false, !Q is true
0 0 0 1 NO CHANGE
1 1 X X DISALLOWED!!!

Notice that in the case of the NOR flip-flop, to set Q to 1, Set sets to 1. To set !Q to 1, reset is set to 1 following the rules for the NOR gate described above.


NAND Gate
A B O Comment Comment
0 0 1 0 on flip-flop independent input causes 1 out
0 1 1 0 on flip-flop independent input causes 1 out1 on flip-flop independent input causes either 0 or 1 out
1 0 1 0 on flip-flop independent input causes 1 out1 on flip-flop independent input causes either 0 or 1 out
1 1 0 1 on flip-flop independent input causes either 0 or 1 out

Nand Flip-Flop:

  1. 0 on an independent input, output of that gate will be 1.
  2. 1 on an independent input, output could be 0 or 1, output is dependent upon dependent input fed back from the other gate.

Looking at the truth table for a NAND gate, if a 0 appears on the independent input of a NAND gate, which is part of a NAND flip-flop, that gate's output WILL BE 1-PERIOD!

Now there is a state known as the disallowed state. The disallowed state occurs when the outputs of a flip-flop are the same state. The outputs of an R-S flip-flop are known as Q and !Q (not Q). Logically, Q cannot = !Q. Since in a NAND flip-flop, if the determinate state, 0 in this case, occurs on and an independent input the output will be in a known state, 1 in this case. If both independent inputs of a NAND gate have the determinate state, 0 in this case, on both inputs, both outputs will be 1. Remember, Q != !Q so this is a disallowed state. Stay away from it. Under a specific condition, this input state can cause the flip-flop to race. That is, when you analyze the flip-flop, you will go round and round forever with the outputs, Q and !Q, changing between 1,1 and 0,0. Like I said, stay away from the disallowed state (NAND flip-flop: 0 on both inputs)!

Now, if a 1 appears on the independent input of a NAND gate which is part of a NAND flip-flop, that gate's output may be 0 or 1 (look at the truth table), we won't know until we look at the other input which happens to be fed back from the other NAND gate of the NAND flip-flop. Therefore, if the other NAND gate of a NAND flip-flop has the determinate state, 0 in this case, 1 will be fed back from its output to the NOR gate having the indeterminate state, 1 in this case, causing the flip-flop with the indeterminate state on its input, 1 in this case, to have on its output the state opposite that on the NAND gate having the determinate state, 0 in this case.

There is one more R-S flip-flop state to talk about. It is called the no change state. If we assume that the NAND flip-flop is in the state described in the section directly above, and then change the NAND gate having the determinate state on its input to having the indeterminate state, 0 to 1 in this case, the output states will not change due to the output being fed back from the other gate. Since when the flip-flop is placed into a no change state, it is important that the flip-flop be placed into a pre-defined state before it is placed into the no change state. In other words, you must know what output states are not changing, before the circuit is analyzed.
In summary:

NAND Flip-Flop
S R Q Q1 Comments
1 0 0 1 RESET-Q is true, !Q is false
0 1 1 0 SET-Q is false, !Q is true
1 1 1 0 NO CHANGE
0 0 X X DISALLOWED!!!

Notice that in the case of the NAND flip-flop, to set Q to 1, Set set to 0. To set !Q to 1, reset is set to 0 following the rules for the NAND gate described above.


In Summary:

  1. Stay away from the disallowed state-PERIOD!
  2. When analyzing a flip-flop, put it in an definite state (not the no change state-this rule can be broken, see note at the end!).
  3. There are only two valid states on the output of an R-S flip-flop, either 0, 1 or 1, 0
  4. There are only three valid states on the input of an R-S flip-flop: 0,1 or 1,0, or no change (see flip-flop truth tables)

Note: this rule can be broken. That is, you can start with the flip-flop in the no-change (input) state AS LONG AS you assign the outputs to either 0,1 or 1,0 and then analyze the flip-flop. By assigning states to the outputs, however, you are simply defining the previous state so you could do this by manipulating inputs and then observing the outputs BEFORE changing to the no change state.

Week 5 Journal Entry

CSIT1320 HPC Fundamentals
After successfully completing the virtual machine server installation and virtual machine creation projects for HP0, I realized that I knew nothing about virtual machines, or virtual machine servers, so I searched the Internet for information about virtual machines and virtual machine servers. Regarding virtual machines and virtual machine servers, here is what I found: A virtual machine is an encapsulated piece of software which behaves just like a physical machine, a computer. It has its own virtual hardware, for example, a network interface card, a CPU, and RAM. It executes its own applications on its own operating system or systems.
According to vmware.com, virtual machines have four key characteristics that make them attractive to a user:

  1. Compatibility: (vmware) Virtual machines are compatible with all standard x86 processors
  2. Isolation: All virtual machines are isolated from each other as if they were physically separate machines
  3. Encapsulation: Virtual machines encapsulate an entire computing environment
  4. Hardware independence: Virtual machines run independently of underlying hardware

http://www.vmware.com/virtualization/virtual-machine.html

The backbone of the vm server is called the “hypervisor”. It is a thin software layer which is inserted between the server's hardware and the operating system.
http://www.xen.org/products/xenhyp.html
“A hypervisor, also called a virtual machine manager, is software that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host's processor, memory, and other resources.” http://searchservervirtualization.techtarget.com/definition/hypervisor

Xen's hypervisor is software that runs on top of the computer hardware with nothing in between. The hypervisor replaces the operating system so that computer hardware can execute multiple guest operating systems at the same time. xen supports x86, x86-64, Itanium, Power PC, and ARM processors and supports Linux, NetBSD, FreeBSD, Solaris, Windows, and other common operating systems as guests. http://www.xen.org/files/Marketing/WhatisXen.pdf

CSIT2048 HPC Experience II
Jesse is working at getting the RRDTool to create a graphics file of a graph of the data collected by the data logging part of RRDTool. I believe the plan is to place the graphics file in an html directory along with a Web page so that when a Web query requests the page, the graphics file will be displayed in a browser along with other useful information. Since Jesse is concetrating on RRDTool, I am concentrating on how to best implement a growing solution level sensor for the hydroponics container, and how to read its state using the same system we are using to read Dallas 1-wire sensors. The simplest and probably the cheapest way to read the level of the growing solution would be to use two conductive probes immersed to a given depth in the growing solution with a small voltage applied to the probes to cause current to flow when the probes are immersed in the growing fluid. The presence or absence of current would then be read on the system's parallel port on one of the status pins. Because the growing solution is composed of water and various compunds which ionize when they dissolve in water, current flows when a voltaqe is appled to the probes. When the growing solution level falls below the level of the probes, current flow is interrupted. There are, however, two issues with this approach. First, if a DC voltage is applied to the probes, over time, minerals tend to plate themselves on the probes.
Second, it is possible that some sort of electro-chemical or chemical reaction between the probes and the compounds in the growing solution could take place causing metals to be liberated from ther probes. These metals then be taken up by the plants. Since we assume the plants will be eaten, we must account for all the compounds that will be absorbed by the plants.
Since there are issues with the simplest and cheapest approach, I opted for the next simplest and cheapest solution, a float switch. A commerical float switch is used in a situation where its electrical contacts must be chemically and electrically isolated from the environment in which they are used. Commercial float switches as the name implies, uses a device contructed from material that is less dense then the medium in which it is used so that it will float, hence the name “float-switch”. A magnet is attached to the float. In the housing of the float switch is a reed switch. A reed switch is a switch with two contacts that is evveloped in glass. The contacts close under the influence of a strong, local magnetic field and open again when the magnetic field is removed. When a float switch is used, the housing, including the reed switch is fixed; the float is attached to a rod on which it can move up and down freely. When the water level drops, so does the float and when it does, the reed switch contact change state.
I found plans for a homemade floatswitch at: http://www.otherpower.com/float_switch.html .
I also found a suitable commercial Float switch; I found it by Googling “level sensor+hydroponics”.
It can be purchased from: http://www.sourcingmap.com/liquid-water-level-sensor-horizontal-floating-float-switch-p-102630.html?utm_source=google&utm_medium=froogle&utm_campaign=usfroogle
It is identified as a “Liquid Water Level Sensor Horizontal Floating Float Switch”; its costs $7.19.

CSCS2650 Computer Organization
alu.h

#ifndef _ALU_H
#define _ALU_H
class ALU
{
        public:
                ALU();
                void setTempReg(unsigned char tempregister);
                void setInstruction(unsigned char instruction);
                void setAccumu(unsigned char accum);
                unsigned char getDataBus();
                void doOp();
                unsigned char getFlags();
                ~ALU();
        private:
                unsigned char A;           //accumulator
                unsigned char tempreg;     //temporary register
                unsigned char instructreg; //instruction register
                unsigned char databusout;  //databus out
                //flags
                //D7 = S
                //D6 = Z
                //D5
                //D4 = AC
                //D3
                //D2 = P
                //D1
                //D0 = CY
                unsigned char flags;           //the flag register
                //functions
                void add();
                void setCarryFlag();
                void resetCarryFlag();
};
#endif

alu.cc

#include "alu.h"
#include <cstdio>

const unsigned char signAndMask = 0x7f;     //to clear or reset the sign flag
const unsigned char signOrMask = 0x80;      //to set the sign flag
const unsigned char zeroAndMask = 0xbf;     //to clear or reset the zero flag
const unsigned char zeroOrMask = 0x40;      //to set the zero flag
const unsigned char auxcarryAndMask = 0xef; //to clear or reset the aux carry flag
const unsigned char auxcarryOrMask = 0x10;  //to set the aux carry flag
const unsigned char parityAndMask = 0xfb;   //to clear or reset the parity flag
const unsigned char parityOrMask = 0x04;    //to set the parity flag
const unsigned char carryAndMask = 0xfe;    //to clear or reset the carry flag
const unsigned char carryOrMask = 0x01;     //to set the carry flag

ALU::ALU()
{
}

ALU::~ALU()
{
}

void ALU::setTempReg(unsigned char tempregister)
{
         tempreg = tempregister;
}

void ALU::setAccumu(unsigned char accum)
{
        A = accum;
}

void ALU::setInstruction(unsigned char instruction)
{
        instructreg = instruction;
}

unsigned char ALU::getDataBus()
{
        return(databusout);
}

void ALU::setCarryFlag()
{
        flags = flags | carryOrMask;
}

void ALU::resetCarryFlag()
{
        flags = flags & carryAndMask;
}

unsigned char ALU::getFlags()
{
        return(flags);
}

void ALU::add()
{
        unsigned short int result;

        result = A + tempreg;
        databusout = (unsigned char) result;
        if(0xff00 & result) setCarryFlag();
        else  resetCarryFlag();
}

void ALU::doOp()
{
        switch (instructreg)
        {
                case 0x00:      // NOP operation, do nothing
                        break;
                case 0x01:      //LXI B, 16-bit
                        break;
                case 0x02:      //STX B
                        break;
                case 0x03:      //INX B
                        break;
                case 0x04:      //INR B
                        break;
                case 0x05:      //DCR B
                        break;
                case 0x06:      //MVI B, 8-Bit
                        break;
                case 0x11:      //LXI B, 16-Bit
                        break;
                case 0x21:      //LXI H, 16-Bit
                        break;
                case 0x2f:      //CMA
                        break;
                case 0x31:      //LXI SP, 16-Bit
                        break;
                case 0x40:      //MOV B, B
                        break;
                case 0x41:      //MOV B, C
                        break;
                case 0x42:      //MOV B, D
                        break;

                case 0x43:      //MOV B, E
                        break;
                case 0x44:      //MOV B, H
                        break;
                case 0x45:      //MOV B, L
                        break;
                case 0x46:      //MOV B, M
                        break;
                case 0x47:      //MOV B, A
                        break;
                case 0x48:      //MOV C, B
                        break;
                case 0x49:      //MOV C, C
                        break;
                case 0x4a:      //MOV C, D
                        break;
                case 0x4b:      //MOV C, E
                        break;
                case 0x4c:      //MOV C, H
                        break;

                case 0x4d:      //MOV C, L
                        break;
                case 0x4e:      //MOV C, M
                        break;
                case 0x4f:      //MOV C, A
                        break;
                case 0x50:      //MOV D, B
                        break;
                case 0x51:      //MOV D, C
                        break;
                case 0x52:      //MOV D, D
                        break;
                case 0x53:      //MOV D, E
                        break;
                case 0x54:      //MOV D, H
                        break;
                case 0x55:      //MOV D, L
                        break;
                case 0x56:      //MOV D, M
                        break;
                case 0x57:      //MOV D, A
                        break;
                case 0x58:      //MOV E, B
                        break;
                case 0x59:      //MOV E, C
                        break;
                case 0x5a:      //MOV E, D
                        break;
                case 0x5b:      //MOV E, E
                        break;
                case 0x5c:      //MOV E, H
                        break;
                case 0x5d:      //MOV E, L
                        break;
                case 0x5e:      //MOV E, M
                        break;
                case 0x5f:      //MOV E, A
                        break;
                case 0x60:      //MOV H, B
                        break;
                case 0x61:      //MOV H, C
                        break;
                case 0x62:      //MOV H, D
                        break;
                case 0x63:      //MOV H, E
                        break;
                case 0x64:      //MOV H, H
                        break;
                case 0x65:      //MOV H, L
                        break;
                case 0x66:      //MOV H, M
                        break;
                case 0x67:      //MOV H, A
                        break;
                case 0x68:      //MOV L, B
                        break;
                case 0x69:      //MOV L, C
                        break;
                case 0x6a:      //MOV L, D
                        break;
                case 0x6b:      //MOV L, E
                        break;
                case 0x6c:      //MOV L, H
                        break;
                case 0x6d:      //MOV L, L
                        break;
                case 0x6e:      //MOV L, M
                        break;
                case 0x6f:      //MOV L, A
                        break;
                case 0x78:      //MOV A, B
                        break;
                case 0x79:      //MOV A, C
                        break;
                case 0x7a:      //MOV A, D
                        break;
                case 0x7b:      //MOV A, E
                        break;
                case 0x7c:      //MOV A, H
                        break;
                case 0x7d:      //MOV A, L
                        break;
                case 0x7e:      //MOV A, M
                        break;
                case 0x7f:      //MOV A, A
                        break;
                case 0x80:      //ADD B
                        add();
                        break;
                case 0x81:      //ADD C
                        break;
                case 0x82:      //ADD D
                        break;
                case 0x83:      //ADD E
                        break;
                case 0x84:      //ADD H
                        break;
                case 0x85:      //ADD L
                        break;
                case 0x86:      //ADD M
                case 0x87:      //ADD A
                        break;
                case 0x88:      //ADC B
                        break;
                case 0x89:      //ADC C
                        break;
                case 0x8a:      //ADC D
                        break;
                case 0x8b:      //ADC E
                        break;
                case 0x8c:      //ADC H
                        break;
                case 0x8d:      //ADC L
                        break;
                case 0x8e:      //ADC M
                        break;
                case 0x8f:      //ADC A
                        break;
                case 0xa0:      //ANA B
                case 0xa1:      //ANA C
                        break;
                case 0xa2:      //ANA D
                        break;
                case 0xa3:      //ANA E
                        break;
                case 0xa4:      //ANA H
                        break;
                case 0xa5:      //ANA L
                        break;
                case 0xa6:      //ANA M
                        break;
                case 0xa7:      //ANA A
                        break;
                case 0xb8:      //CMP B
                        break;
                case 0xb9:      //CMP C
                        break;
                case 0xba:      //CMP D
                        break;
                case 0xbb:      //CMP E
                        break;
                case 0xbc:      //CMP H
                        break;
                case 0xbd:      //CMP L
                        break;
                case 0xbe:      //CMP M
                        break;
                case 0xbf:      //CMP A
                        break;
                case 0xc6:      //ADI 8-bit
                        break;
                case 0xcd:      //CALL 16-bit
                        break;
                case 0xce:      //ACI 8-bit
                        break;
                case 0xdc:      //CC 16-bit
                        break;
                case 0xe6:      //ANA 8-bit
                        break;
                case 0xfc:      //CM 16-bit
                        break;
                default:
                        printf("Error %x is not an 8085 instruction\n", instructreg);
        }
}

alutest.cc

#include <cstdio>
#include <ctype.h>
#include <stdlib.h>
#include "alu.h"

unsigned char convert2CharStringTo2DigitHex(char * string);
void getAndPrintVal(char *printString, char *valString);
void prompt(char *);

int main()
{
        char *message;
        char message1[18] = "Enter instruction";
        char message2[26] = "Enter Temp register value";
        char message3[24] = "Enter Accumulator value";
        char hex2DigitString[3];
        char quit;
        char *pQuit;
        pQuit = &quit;

        ALU alu8085;
        printf("Welcome to the 8085 alu simulator\n");
        prompt(pQuit);
        while(toupper(quit)!= 'Q')
        {
                message = message1;
                for (int i = 1; i <= 3; i++)
                {
                        getAndPrintVal(message,  hex2DigitString);
                        switch(i)
                        {
                                case 1:
                                        alu8085.setInstruction(convert2CharStringTo2DigitHex(hex2DigitString));
                                        message = message2;
                                        break;
                                case 2:
                                        alu8085.setTempReg(convert2CharStringTo2DigitHex(hex2DigitString));
                                        message = message3;
                                        break;
                                case 3:
                                        alu8085.setAccumu(convert2CharStringTo2DigitHex(hex2DigitString));
                                        break;
                        }
                }
                alu8085.doOp();
                printf("Result is %2x\n",  alu8085.getDataBus());
                printf("Carry flag is %x\n", (0x01 & alu8085.getFlags()));
                printf("\n");
                prompt(pQuit);
        }
        return(0);
}

unsigned char convert2CharStringTo2DigitHex(char * string)
{
        for (int i = 0; i < 2; i++)
        {
                if(*(string + i) >= '0' && *(string + i) <= '9') *(string + i) = 0x0f & *(string + i);
                else if (*(string + i) >= 'a' && *(string + i) <= 'f') *(string + i) = *(string + i) - 87;
        }
        *string = *string << 4;
        *string = *(string + 1)|*string;
        return(*string);
}

void getAndPrintVal(char *printString, char *valString)
{
        printf(printString);
        printf("\n");
        scanf("%s", valString);
        if (atoi(valString) > 0xff) printf("Warning, data entered is more than 2 digits-I will use the first 2");
        for (int i = 0; i < 2; i++) *(valString + i) = tolower(*(valString + i));
}

void prompt(char *quit)
{
                printf("Press c to continue, or q to quit\n");
                scanf("%s", quit);
        if (atoi(valString) > 0xff) printf("Warning, data entered is more than 2 digits-I will use the first 2");
        for (int i = 0; i < 2; i++) *(valString + i) = tolower(*(valString + i));
}

void prompt(char *quit)
{
                printf("Press c to continue, or q to quit\n");
                scanf("%s", quit);
}

Makefile

CXX = g++ $(CXXFLAGS) $(INC) $(LIBS)
AR = ar
CXXFLAGS = -Wall
INC = -I ../../include/
LIBS =
SRC = alu.cc alutest.cc
OBJ = $(SRC:.cc=.o)
BIN = alutest
all: $(SRC) $(BIN)

debug: CXX += -DDEBUG -g
debug: DEBUG = debug
debug: $(SRC) $(BIN)

$(BIN): $(OBJ)
ifneq ($(MAKECMDGOALS),debug)
        @printf "[CC]  %-20s ... " "$(BIN)"
        @$(CXX) -o $(BIN) $(OBJ) && echo "SUCCESS" || echo "FAIL"
else
        $(CXX) -o $(BIN) $(OBJ)
endif

.cc.o:
ifneq ($(MAKECMDGOALS),debug)
        @printf "[B]   %-20s ... " "$<"
        @$(CXX) -c $< && echo "OK" || echo "FAIL"
else
        $(CXX) -c $<
endif

clean:
        rm -f *.o $(BIN) core

default: $(BIN)

Next, I made the alutest executable file.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[B]   alutest.cc           ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$

After making the alutest file, I then executed it.

lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
80
Enter Temp register value
06
Enter Accumulator value
07
Result is  d
Carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
80
Enter Temp register value
ff
Enter Accumulator value
ff
Result is fe
Carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
ff
Enter Temp register value
08
Enter Accumulator value
09
Error ff is not an 8085 instruction
Result is fe
Carry flag is 1

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$

Commiting alu files to the subversion repository

lab46:~/src/cpu$ svn commit -m "update alutest.cc and alu.cc files; alutest can do an add, use instruction 80, and load the temp and accumulator; alu also shows stae of carry flag -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        8085/arithmeticlogicunit/alutest.cc
Sending        include/alu.h
Transmitting file data ...
Committed revision 139.

I added the following references to the asm class note wiki at http://lab46.corning-cc.edu/notes/asm .

Directory File Description API Location
./include alu.h alu header file
./8085/arithmeticlogicunit Base of alu filesALU API
./8085/arithmeticlogicunitMakefile
./8085/arithmeticlogicunitalu.cc
./8085/arithmeticlogicunitalutest.cc

I also added the ALU API description page.
alu.h
The ALU class library is included before the main function like this:

#include "alu.h"

Object instantiation
An object of the type ALU is instatiated like this:

//Instantiates an object of type ALU
ALU 8085alu;

void ALU::setInstruction(unsigned char instruction)
The void ALU::setInstruction(unsigned char instruction) function is used to set the temporary register's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

     //sets the temporary register value to 0f hex or 15 decimal.
     8085alu.setTempReg(0x0f); //sets the temporary register value to 0f hex or 15 decimal.

void ALU::setAccumu(unsigned char accum)
The void ALU::setAccumu(unsigned char accum) is used to set the accumulator's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

    //sets the accumulaator value to fe hex or 254 decimal.
    setAccumu(unsigned char accum);

void ALU::doOp()
The void ALU::doOp() member function tells an object of type ALU to execute the instruction loaded into the instruction register.

    //execute the instruction loaded into the instruction register
    doOp();

void ALU::getDataBus()
The void ALU::getDataBus() member function returns the resulting value of the last operation.

    //prints the return value of getDataBus()
    printf("Result of the operation is %x\n", getDataBus());

unsigned char getFlags()
The member function unsigned char getFlags() gets or returns the value of the flag register.

    //prints the return value of getFlags()
    printf("The flag register value is %x\n", getFlags());

Added a pdfs directory in the cpu repository so that we can share documentation. In it is documentation for both cpus (8085 and 6502).

lab46:~/src/cpu$ mkdir pdfs
lab46:~$ cp zaks_book.pdf src/cpu/pdfs
lab46:~$ cp Using-6502-Assembly-Language-by-Randy-Hyde.pdf src/cpu/pdfs
lab46:~$ cp 8080-8085_assembly_language_programming__1977__intel__pdf_.pdf src/cpu/pdfs
lab46:~$ cp ATARIAssemblerEditorReferenceCard.pdf src/cpu/pdfs
lab46:~$ cp ATARIAssemblerEditorUsersManualUpdate.pdf src/cpu/pdfs
lab46:~/src/cpu$ svn add pdfs
A         pdfs
A  (bin)  pdfs/zaks_book.pdf
A  (bin)  pdfs/Using-6502-Assembly-Language-by-Randy-Hyde.pdf
A  (bin)  pdfs/8080-8085_assembly_language_programming__1977__intel__pdf_.pdf
A  (bin)  pdfs/ATARIAssemblerEditorReferenceCard.pdf
A  (bin)  pdfs/ATARIAssemblerEditorUsersManualUpdate.pdf
lab46:~/src/cpu$ svn commit -m "Created pdfs directory for cpu related pdfs -John Rine"
Adding         pdfs
Adding  (bin)  pdfs/8080-8085_assembly_language_programming__1977__intel__pdf_.pdf
Adding  (bin)  pdfs/ATARIAssemblerEditorReferenceCard.pdf
Adding  (bin)  pdfs/ATARIAssemblerEditorUsersManualUpdate.pdf
Adding  (bin)  pdfs/Using-6502-Assembly-Language-by-Randy-Hyde.pdf
Adding  (bin)  pdfs/zaks_book.pdf
Transmitting file data .....
Committed revision 143.

Added sign, parity, and zero flag set and reset as ALU member functions; added getflag bit member functions. Formatted hex values displayed in alutest.cc. This is the updated version of alu.h.

#ifndef _ALU_H
#define _ALU_H
class ALU
{
    public:
        ALU();
        void setTempReg(unsigned char tempregister);
        void setInstruction(unsigned char instruction);
        void setAccumu(unsigned char accum);
        unsigned char getDataBus();
        void doOp();
        unsigned char getAccumulator();
        unsigned char getFlags();
        unsigned char getZeroFlag();
        unsigned char getCarryFlag();
        unsigned char getSignFlag();
        unsigned char getParityFlag();
        ~ALU();
    private:
        unsigned char A;           //accumulator
                unsigned char tempreg;     //temporary register
                unsigned char instructreg; //instruction register
         unsigned char databusout;  //databus out
        //flags
        //D7 = S
        //D6 = Z
        //D5
        //D4 = AC
        //D3
        //D2 = P
        //D1
        //D0 = CY
        unsigned char flags;           //the flag register
        //functions
        void add();
        void setCarryFlag();
        void resetCarryFlag();
        void setZeroFlag();
        void resetZeroFlag();
        void setSignFlag();
        void resetSignFlag();
        void setParityFlag();
        void resetParityFlag();
};
#endif

This is alu.cc.

#include "alu.h"
#include <cstdio>

const unsigned char signAndMask = 0x7f;     //to clear or reset the sign flag
const unsigned char signOrMask = 0x80;      //to set the sign flag
const unsigned char zeroAndMask = 0xbf;     //to clear or reset the zero flag
const unsigned char zeroOrMask = 0x40;      //to set the zero flag
const unsigned char auxcarryAndMask = 0xef; //to clear or reset the aux carry flag
const unsigned char auxcarryOrMask = 0x10;  //to set the aux carry flag
const unsigned char parityAndMask = 0xfb;   //to clear or reset the parity flag
const unsigned char parityOrMask = 0x04;    //to set the parity flag
const unsigned char carryAndMask = 0xfe;    //to clear or reset the carry flag
const unsigned char carryOrMask = 0x01;     //to set the carry flag

ALU::ALU()
{
     flags = 0x00;
}

ALU::~ALU()
{
}

void ALU::setTempReg(unsigned char tempregister)
{
     tempreg = tempregister;
}

void ALU::setAccumu(unsigned char accum)
{
    A = accum;
}

void ALU::setInstruction(unsigned char instruction)
{
    instructreg = instruction;
}

unsigned char ALU::getDataBus()
{
    return(databusout);
}

void ALU::setCarryFlag()
{
    flags = flags | carryOrMask;
}

void ALU::resetCarryFlag()
{
    flags = flags & carryAndMask;
}

void ALU::setZeroFlag()
{
        flags = flags | zeroOrMask;
}

void ALU::resetZeroFlag()
{
        flags = flags & zeroAndMask;
}

void ALU::setSignFlag()
{
    flags = flags | signOrMask;
}

void ALU::resetSignFlag()
{
    flags = flags & signAndMask;
}

void ALU::setParityFlag()
{
    flags = flags | parityOrMask;
}

void ALU::resetParityFlag()
{
    flags = flags & parityAndMask;
}

unsigned char ALU::getAccumulator()
{
    return(A);
}

unsigned char ALU::getFlags()
{
    return(flags);
}

unsigned char ALU::getZeroFlag()
{
    unsigned char tempFlags = flags;
    tempFlags = (tempFlags >> 0x06) & 0x01;
    return (tempFlags);
}

unsigned char ALU::getCarryFlag()
{
        unsigned char tempFlags = flags;
        tempFlags = tempFlags & 0x01;
        return (tempFlags);
}

unsigned char ALU:: getSignFlag()
{
    unsigned char tempFlags = flags;
        tempFlags = (tempFlags >> 0x07) & 0x01;
        return (tempFlags);
}

unsigned char ALU::getParityFlag()
{
        unsigned char tempFlags = flags;
        tempFlags = (tempFlags >> 0x02) & 0x01;
        return (tempFlags);

}

void ALU::add()
{
       unsigned short int result;

    result = A + tempreg;
    A = (unsigned char) result;
    if(0x0100 & result) setCarryFlag();
    else  resetCarryFlag();
    if(A == 0x00) setZeroFlag();
    else resetZeroFlag();
    if (A & 0x80) setSignFlag();
    else resetSignFlag();
    unsigned char accumParity = 0;
    unsigned char tempAccum = A;
    for (unsigned char i = 0; i <= 7; i++)
    {
        accumParity = accumParity + (tempAccum & 0x01);
        tempAccum = tempAccum >> 0x01;
    }
    if((accumParity % 2) == 0 && accumParity > 0) setParityFlag();
    else resetParityFlag();
}

void ALU::doOp()
{
    switch (instructreg)
    {
        case 0x00:    // NOP operation, do nothing
            break;
        case 0x01:    //LXI B, 16-bit
            break;
        case 0x02:    //STX B
            break;
        case 0x03:    //INX B
            break;
        case 0x04:    //INR B
                        break;
        case 0x05:    //DCR B
                        break;
        case 0x06:    //MVI B, 8-Bit
            break;
        case 0x11:    //LXI B, 16-Bit
            break;
        case 0x21:    //LXI H, 16-Bit
            break;
        case 0x2f:    //CMA
            break;
        case 0x31:    //LXI SP, 16-Bit
            break;
        case 0x40:    //MOV B, B
            break;
                case 0x41:    //MOV B, C
                        break;
                case 0x42:    //MOV B, D
                        break;
                case 0x43:    //MOV B, E
                        break;
                case 0x44:    //MOV B, H
                        break;
                case 0x45:    //MOV B, L
                        break;
                case 0x46:    //MOV B, M
                        break;
                case 0x47:    //MOV B, A
                        break;
                case 0x48:    //MOV C, B
                        break;
                case 0x49:    //MOV C, C
                        break;
                case 0x4a:    //MOV C, D
                        break;
                case 0x4b:    //MOV C, E
                        break;
                case 0x4c:    //MOV C, H
                        break;
                case 0x4d:    //MOV C, L
                        break;
                case 0x4e:    //MOV C, M
                        break;
                case 0x4f:    //MOV C, A
                        break;
        case 0x50:    //MOV D, B
            break;
        case 0x51:    //MOV D, C
            break;
        case 0x52:    //MOV D, D
            break;
        case 0x53:    //MOV D, E
            break;
        case 0x54:    //MOV D, H
            break;
        case 0x55:    //MOV D, L
            break;
        case 0x56:    //MOV D, M
            break;
        case 0x57:    //MOV D, A
            break;
        case 0x58:    //MOV E, B
            break;
        case 0x59:    //MOV E, C
            break;
        case 0x5a:    //MOV E, D
            break;
        case 0x5b:    //MOV E, E
            break;
        case 0x5c:    //MOV E, H
            break;
        case 0x5d:    //MOV E, L
            break;
        case 0x5e:    //MOV E, M
            break;
        case 0x5f:    //MOV E, A
            break;
        case 0x60:    //MOV H, B
            break;
        case 0x61:    //MOV H, C
                        break;
        case 0x62:    //MOV H, D
                        break;
        case 0x63:    //MOV H, E
                        break;
        case 0x64:    //MOV H, H
                        break;
        case 0x65:    //MOV H, L
                        break;
        case 0x66:    //MOV H, M
                        break;
        case 0x67:    //MOV H, A
                        break;
        case 0x68:    //MOV L, B
                        break;
        case 0x69:    //MOV L, C
                        break;
        case 0x6a:    //MOV L, D
                        break;
        case 0x6b:    //MOV L, E
                        break;
        case 0x6c:    //MOV L, H
                        break;
        case 0x6d:    //MOV L, L
                        break;
        case 0x6e:    //MOV L, M
                        break;
        case 0x6f:    //MOV L, A
            break;
        case 0x78:    //MOV A, B
                        break;
                case 0x79:    //MOV A, C
                        break;
                case 0x7a:    //MOV A, D
                        break;
                case 0x7b:    //MOV A, E
                        break;
                case 0x7c:    //MOV A, H
                        break;
                case 0x7d:    //MOV A, L
                        break;
                case 0x7e:    //MOV A, M
                        break;
                case 0x7f:    //MOV A, A
                        break;
        case 0x80:    //ADD B
        case 0x81:    //ADD C
        case 0x82:    //ADD D
        case 0x83:    //ADD E
        case 0x84:    //ADD H
        case 0x85:    //ADD L
        case 0x86:    //ADD M
        case 0x87:    //ADD A
            add();
            break;
        case 0x88:    //ADC B
            break;
        case 0x89:    //ADC C
            break;
        case 0x8a:    //ADC D
            break;
        case 0x8b:    //ADC E
            break;
        case 0x8c:    //ADC H
            break;
        case 0x8d:    //ADC L
            break;
        case 0x8e:    //ADC M
            break;
        case 0x8f:    //ADC A
            break;
        case 0xa0:    //ANA B
            break;
        case 0xa1:    //ANA C
            break;
        case 0xa2:    //ANA D
            break;
        case 0xa3:    //ANA E
            break;
        case 0xa4:    //ANA H
            break;
        case 0xa5:    //ANA L
            break;
        case 0xa6:    //ANA M
            break;
        case 0xa7:    //ANA A
            break;
        case 0xb8:    //CMP B
                        break;
        case 0xb9:    //CMP C
                        break;
        case 0xba:    //CMP D
                        break;
        case 0xbb:    //CMP E
                        break;
        case 0xbc:    //CMP H
                        break;
        case 0xbd:    //CMP L
                        break;
        case 0xbe:    //CMP M
                        break;
        case 0xbf:    //CMP A
                        break;
        case 0xc6:    //ADI 8-bit
            break;
        case 0xcd:    //CALL 16-bit
            break;
        case 0xce:    //ACI 8-bit
            break;
        case 0xdc:    //CC 16-bit
            break;
        case 0xe6:    //ANA 8-bit
            break;
        case 0xfc:    //CM 16-bit
            break;
        default:
            printf("Error %x is not an 8085 instruction\n", instructreg);
    }
}

This is the test file, alutest.cc.

#include <cstdio>
#include <ctype.h>
#include <stdlib.h>
#include "alu.h"

unsigned char convert2CharStringTo2DigitHex(char * string);
void getAndPrintVal(char *printString, char *valString);
void prompt(char *);

int main()
{
    char *message;
    char message1[18] = "Enter instruction";
    char message2[26] = "Enter Temp register value";
    char message3[24] = "Enter Accumulator value";
    char hex2DigitString[3];
    char quit;
    char *pQuit;
    pQuit = &quit;

    ALU alu8085;
    printf("Welcome to the 8085 alu simulator\n");
    prompt(pQuit);
    while(toupper(quit)!= 'Q')
    {
        message = message1;
        for (int i = 1; i <= 3; i++)
        {
            getAndPrintVal(message,  hex2DigitString);
            switch(i)
            {
                case 1:
                    alu8085.setInstruction(convert2CharStringTo2DigitHex(hex2DigitString));
                    message = message2;
                    break;
                case 2:
                    alu8085.setTempReg(convert2CharStringTo2DigitHex(hex2DigitString));
                    message = message3;
                    break;
                case 3:
                    alu8085.setAccumu(convert2CharStringTo2DigitHex(hex2DigitString));
                    break;
            }
        }
            alu8085.doOp();
            printf("Result is 0x%02x\n",  alu8085.getAccumulator());
                printf("Flag Register = 0x%02x\n",alu8085.getFlags());
            printf("Sign flag is 0x%02x\n", alu8085.getSignFlag());
        printf("Carry flag is 0x%02x\n", alu8085.getCarryFlag());
        printf("Zero flag is 0x%02x\n", alu8085.getZeroFlag());
        printf("Parity flag is 0x%02x\n", alu8085.getParityFlag());
        printf("\n");
        prompt(pQuit);
    }
    return(0);
}

unsigned char convert2CharStringTo2DigitHex(char * string)
{
    for (int i = 0; i < 2; i++)
    {
        if(*(string + i) >= '0' && *(string + i) <= '9') *(string + i) = 0x0f & *(string + i);
        else if (*(string + i) >= 'a' && *(string + i) <= 'f') *(string + i) = *(string + i) - 87;
    }
        *string = *string << 4;
        *string = *(string + 1)|*string;
    return(*string);
}

void getAndPrintVal(char *printString, char *valString)
{
    printf(printString);
    printf("\n");
        scanf("%s", valString);
    if (atoi(valString) > 0xff) printf("Warning, data entered is more than 2 digits-I will use the first 2");
    for (int i = 0; i < 2; i++) *(valString + i) = tolower(*(valString + i));
}

void prompt(char *quit)
{
                printf("Press c to continue, or q to quit\n");
                scanf("%s", quit);
}

I then committed the changes to the Subversion directory.

lab46:~/src/cpu$ svn commit -m "added sign, parity, and zero flags, added get flag bit member funtions, worj still in progress... -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        8085/arithmeticlogicunit/alutest.cc
Sending        include/alu.h
Transmitting file data ...
Committed revision 145.

I found a problem with the parity flag. Adding 0x00 to 0x00 not only yielded a zero flag, but also a parity flag. I had to add a test for value larger than zero to the parity determining code because 0 = 0 % x.

lab46:~/src/cpu$ svn commit -m "fixed a parity bug -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Transmitting file data .
Committed revision 146.
lab46:~/src/cpu$

Week 6 Journal Entry

CSIT1320 HPC Fundamentals
I began the video wall project. I obtained two personal computers and four video monitors. I checked the computers for system memory. Each computer contained 512 megabytes of ram. Each computer contained a hard drive. I arranged the personal computers so that the front of one faced the front of the other. With the computers arranged this way, a video monitor could sit on top of each of them and the other two monitors could sit in front of them. With the video monotors arranged this way, they form a video wall. Next, I connected power cords to each computer then I connected power cords to each video monitor. After connecting the power cords, I connected video patch cables to the digital video port of each computer. I then connected analog video cables from the ends of the patch cables to each monitor. After connecting the computers and monitors to power, the next step was to load operating system components on each computer. In order to load operating system components simultaneously, I connected a hub between the personal computers and a network switch port.

  1. Turn on the computers on which you will install xorg.
  2. As it boots, press F2 on the keyboard to bypass the “System Setup” screen and go directly to the cmos setup.
  3. Arrow down to the “Disk Configuration” item and press enter. A popup screen will appear.
  4. On the popup screen, arrow down to “Primary Master Drive” and press enter. A popup screen appears.
  5. On the popup screen, arrow to (if required) “Drive Type”; using the right or left arrow keys, set to the type “Auto”. Press enter to exit the second popup; press escape to exit the first popup.
  6. On the BIOS setup main screen, arrow down to “Boot Sequence” and press enter. A popup screen appears.
  7. On the popup screen, using the +/- arrow keys, move the “Integrated NIC” item to the second item on the list with the hard drive at the top of the list. Make sure it is enabled (square root symbol directly to the left of this item). If it isn't enabled, use the space bar to enable it. Press enter to exit the popup window.
  8. On the BIOS setup main screen, arrow down to the “Integrated Devices (LegacySelect Options)” and press enter. A popup screen appears.
  9. On the popup, arrow down to “Network Interface Controller” item. Using the right or left arrow keys, set the network interface controller to “On w/PXE”.
  10. On the same popup screen, arrow down to the “Onboard Video Buffer” item and using the right or left arrow keys, set the video buffer size to 8MB. Press enter to exit the popup.
  11. On the BIOS setup screen, arrow down to the “IDE Hard Drive Acooustics Mode” item. using the right or left arrow keys, select “Quiet”.
  12. Press escape to exit the bios setup screen. Popup appears.
  13. On the popup screen, arrow to (if required) the “Save Changes and Exit” item. Press enter to exit the BIOS setup screen.
  14. Computer reboots.
  15. Next, the Lair Network Boot Menu loads.
  16. Select “Debian/i386 Netboot” and press enter.
  17. Arrow to “Install Squeeze/testing [text]” if required and press enter.
  18. At this point, the installation begins (defaults were selected throughout MOST but not all of the installation).
  19. The “Select a language” screen is displayed. The default is “English”, press enter to select this item.
  20. The “Select a location” screen is displayed. The default is “United States”, press enter this item.
  21. The “Select a keyboard layout” screen is displayed. The default is “American English”, press enter this item.
  22. The “Configure the network” screen is displayed. On this screen, the Host name: “dhcp-175” is entered automatically. press enter to continue.
  23. The “Configure the network” screen is displayed. On this screen, the Domain name: “offbyone.lan” is entered automatically. Press enter to continue.
  24. The “Choose a mirror of the Debian archive” screen is displayed. The default is “United States”. Arrow up to “Enter information manually” item and press enter.
  25. The “Choose a mirror of the Debian archive” screen is displayed. The Debian mirror host name: “mirror” is entered automatically. Press enter to continue.
  26. The “Choose a mirror of the Debian archive” screen is displayed. The Debian archive directory: “/debian/” is entered automatically. Press enter to continue.
  27. The “Choose a mirror of the Debian archive” screen is displayed. HTTP proxy information is blank by default. Press enter to continue.
  28. In the first installation od Debian Squeeze, the installation continued from here, however during the second installation, the installation failed because a file could not be insalled from the network archive. This was because there was a newer version that was avalable. When the failure occured, the installer is prompted to either retry or change the mirror. During the second installation the mirror was changed to thr RIT mirror.
  29. Next, the “Set up users and passwords” screen is displayed. The Root password I entered was “bob”.
  30. The “Set up users and passwords” screen is displayed. The installer is prompted to re-enter the password. I entered entered “bob”.
  31. The “Set up users and passwords” screen is displayed. The installer is prompted to enter “The full name for the new user:” I entered “a”.
  32. The “Set up users and passwords” screen is displayed. The installer is prompted to enter the username for the account. I entered “a”.
  33. The “Set up users and passwords” screen is displayed. The installer is prompted to enter a password for the new user. I entered “a”.
  34. Next, the “Configure the clock” screen is displayed. For Select your time zone: “Eastern” is the default. Press enter to continue.
  35. The “Partition disk” screen is displayed. The default is “Guided-use entire disk”, press enter to continue.
  36. The “Partition disk” screen is displayed. The disk to partition: SCSI 1 (0,0,0) (sda)-xxx.xxGB ATA Maxtor. has been entered automatically. Press enter to continue.
  37. The “Partition disk” screen is displayed. Partitioning scheme: “All files in one partition (recommended for new users)” is the default. Press enter to continue.
  38. The “Partition disk” screen is displayed. The default “Finish partitioning and write changes to disk” is displayed. Press enter to continue.
  39. Partitioning message-“The following partitions are going to be formatted: Partition #1 of SCSI1 (0,0,0) sda as ext3; Partition #5 of SCSI1 (0,0,0) sda as swap.”
  40. Popularity contest message “Configuring popularity contest: Participate in the package usage survey?”. Select <no>.
  41. The “Software selection” screen is displayed. The default is “Graphical desktop environment”. Deselect this selection using the spacebar. Using the space bar, select the ssh server. If any other items are selected, deselect them using the space bar. Press enter to continue.
  42. Configuring grub message: “Configuring grub-pc: Install grub boot loader to master boot record”, <yes>.
  43. Installation complete <continue>.
  44. Finishing the installation..
  45. Computer reboots automatically.
  46. Log in to both computers as root.
  47. Now download sources.list. At the command prompt, enter “wget http://10.80.2.6/files/students/sources.list
  48. Next, open sources.list with a text editor and replace all references to “lenny” to “squeeze” (squeeze was release last Sunday). On the command prompt, enter “vi sources.list”. In vi enter “:%s/lenny/squeeze/g”. Next to save the changes and quit vi, Enter “:wq”.
  49. On the command line enter “aptitude update”.
  50. Next, on the command line enter “aptitude upgrade”.
  51. On the command line enter “apt-get install xorg”.
  52. Next, on the command line enter “xorg -continue”.
  53. On the command line enter “wget http://10.80.2.6/files/student/nvidia173.run”.
  54. Next, on the command line enter “apt-get install build-essential
  55. Next, on the command line enter “apt-get install gcc-4.3”.
  56. Change the directory to /usr/src.
  57. On the command line, enter the following: “apt-get install linux-source-2.6.32”
  58. Next, on the command line enter “tar -jxvf linux-source-2.6.32 .tar.bz2” to untar the linux source.
  59. On the command line, create a link as follows: “ln -s linux-source-2.6.32 linux”.
  60. Change the directory to /usr/src/linux.
  61. On the command line, enter “cp /boot/config-2.6.32-5-686 .config”.
  62. On the command line enter “make oldconfig”.
  63. Next, on the command line (in the /usr/src/linux-source-2.6.32 directory) enter “make”.
  64. When the building process displays the line “cc init/main.o” (well past lines listing version.h) press cntl-C to stop it.
  65. Change the directory back to home, on the command line enter “cd ~”.
  66. Set permissions on the nvidia173.run file. On the command line enter “chmod 755 nvidia173.run”.
  67. Execute the nvidia173.run file from the command line. On the command line, enter “CC=gcc-4.3 ./nvidia173.run –no-kernel-module”.

At this point, the nvidia driver installed successfully or so it seemed, however, when “startx” was executed on the command line, the following fatal server error was returned: “Fatal server error: no screens found”.

CSIT2048 HPC Experience II
Besides the Dallas 1-wire devices, we are also planning to implement a float switch or switches to read water level in the hydroponics garden. Currently, the plan is to read the float switch or switches through the parallel port. I found some example code for writing to the parallel port using linux at: http://www.labbookpages.co.uk/electronics/parallelPort.html. Since this code is specifically for Linux, I thought it would be a good place to start. I modified the code so that it would count from 0 to 255 and then roll over; writing the value of each count to the parallel port databus. Matt gave me a parallel port tester with which to test the port. The code and the tester work, however, when I use cntl-C to exit the program, the program continues to execute as witnessed by the LEDs on the tester changing state even after cntl-C was pressed. The ps utility doesn't list a process. What is going on?

#include <stdio.h>
//#include <inttypes.h>
#include <sys/io.h>
#include <signal.h>

#define BASE 0x378

int running = 1;

void signalHandler(int sig)
{
   running = 0;
}

int main(void)
{
   printf("Parallel Port Interface Test (Base: 0x%x)\n", BASE);

   signal(SIGINT, signalHandler);

   // Set permission bits of 4 ports starting from BASE
   int result = ioperm(BASE, 4, 1);

   // If setting permission failed, return
   if (result != 0)
   {
      printf("ERROR: Could not set permissions on ports");
      return result;
   }
   unsigned char count = 0;
   // This loop will keep running until ctrl-c is pressed
   while (running)
   {
      outb(count, BASE);
      count++;
   }

   // Clear permission bits of 4 ports starting from BASE
   result = ioperm(BASE, 4, 0);

   if (result != 0)
   {
      printf("ERROR: Could not clear permissions on ports");
      return result;
   }

   return 0;
}


CSCS2650 Computer Organization
I corrected and updated the alu api notes page at: http://lab46.corning-cc.edu/notes/asm/alu .
alu.h
The ALU class library is included before the main function like this:

#include "alu.h"

Object instantiation
An object of the type ALU is instatiated like this:

//Instantiates an object of type ALU
ALU alu8085;

void ALU::setInstruction(unsigned char)
The void ALU::setInstruction(unsigned char) function is used to set the temporary register's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the ADD instruction
alu8085.setInstruction(0x80);

Valid Instructions

0x80  ADD B
0x81  ADD C
0x82  ADD D
0x83  ADD E
0x84  ADD H
0x85  ADD L
0x86  ADD M
0x87  ADD A

0xc6  ADI 8-bit

0xa0  ANA B
0xa1  ANA C
0xa2  ANA D
0xa3  ANA E
0xa4  ANA H
0xa5  ANA L
0xa6  ANA M
0xa7  ANA A

0xe6  ANI 8-bit

void ALU::setAccumu(unsigned char)
The void ALU::setAccumu(unsigned char) is used to set the accumulator's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the accumulator value to fe hex or 254 decimal.
alu8085.setAccumu(0xfe);

void ALU::setTempReg(unsigned char)

//sets the temporary register value to 0f hex or 15 decimal.
alu8085.setTempReg(0x0f);

void ALU::doOp()
The void ALU::doOp() member function tells an object of type ALU to execute the instruction loaded into the instruction register.

//execute the instruction loaded into the instruction register
alu8085.doOp();

void ALU::getDataBus()
The void ALU::getDataBus() member function returns the resulting value of the last operation.

//prints the return value of getDataBus()
printf("Result of the operation is %x\n", alu8085.getDataBus());

unsigned char getFlags()
The member function unsigned char getFlags() gets or returns the value of the flag register.

//prints the return value of getFlags()
printf("The flag register value is %x\n", alu8085.getFlags());

unsigned char getAccumulator()
The unsigned char getAccumulator() member function is used to get the value of the accumulator after an operation. The result of operations are placed into the accumulator. This function can also be used as a debugging tool to check the value in the accumulator at any time after an object of type ALU has been instantiated.

//prints the return value of getAccumulator()
printf("The value in the accumulator is %x\n", alu8085.getAccumulator());

unsigned char getZeroFlag()
The member function unsigned char getZeroFlag() returns the value of the zero flag.

//prints the value of the zero flag
printf("Zero flag is 0x%02x\n", alu8085.getZeroFlag());

unsigned char getCarryFlag()
The member function unsigned char getCarryFlag() returns the value of the carry flag.

//prints the value of the carry flag
printf("Carry flag is 0x%02x\n", alu8085.getCarryFlag());

unsigned char getSignFlag()
The member function unsigned char getSignFlag() returns the value of the sign flag.

//prints the value of the sign flag
printf("Sign flag is 0x%02x\n", alu8085.getSignFlag());

unsigned char getParityFlag()
The member function unsigned char getParityFlag() returns the value of the parity flag.

//prints the value of the parity flag
printf("Parity flag is 0x%02x\n", alu8085.getParityFlag());


The latest version of alu.cc looks like this (still needs work):

#include "alu.h"
#include <cstdio>

const unsigned char signAndMask = 0x7f;     //to clear or reset the sign flag
const unsigned char signOrMask = 0x80;      //to set the sign flag
const unsigned char zeroAndMask = 0xbf;     //to clear or reset the zero flag
const unsigned char zeroOrMask = 0x40;      //to set the zero flag
const unsigned char auxcarryAndMask = 0xef; //to clear or reset the aux carry flag
const unsigned char auxcarryOrMask = 0x10;  //to set the aux carry flag
const unsigned char parityAndMask = 0xfb;   //to clear or reset the parity flag
const unsigned char parityOrMask = 0x04;    //to set the parity flag
const unsigned char carryAndMask = 0xfe;    //to clear or reset the carry flag
const unsigned char carryOrMask = 0x01;     //to set the carry flag

ALU::ALU()
{
     flags = 0x00;
}

ALU::~ALU()
{
}

void ALU::setTempReg(unsigned char tempregister)
{
     tempreg = tempregister;
}

void ALU::setAccumu(unsigned char accum)
{
    A = accum;
}

void ALU::setInstruction(unsigned char instruction)
{
    instructreg = instruction;
}

unsigned char ALU::getDataBus()
{
    return(databusout);
}

void ALU::setCarryFlag()
{
    flags = flags | carryOrMask;
}

void ALU::resetCarryFlag()
{
    flags = flags & carryAndMask;
}

void ALU::setZeroFlag()
{
        flags = flags | zeroOrMask;
}

void ALU::resetZeroFlag()
{
        flags = flags & zeroAndMask;
}

void ALU::setSignFlag()
{
    flags = flags | signOrMask;
}

void ALU::resetSignFlag()
{
    flags = flags & signAndMask;
}

void ALU::setParityFlag()
{
    flags = flags | parityOrMask;
}

void ALU::resetParityFlag()
{
    flags = flags & parityAndMask;
}

void ALU::setAuxCarryFlag()
{
    flags = flags | auxcarryOrMask;
}

void ALU::resetAuxCarryFlag()
{
    flags = flags & auxcarryAndMask;
}

unsigned char ALU::getAccumulator()
{
    return(A);
}

unsigned char ALU::getFlags()
{
    return(flags);
}

unsigned char ALU::getZeroFlag()
{
    unsigned char flag;
    if(flags & 0x40) flag = 0x01;
    else flag = 0x00;
    return (flag);
}

unsigned char ALU::getCarryFlag()
{
        unsigned char flag;
        if(flags & 0x01) flag = 0x01;
        else flag = 0x00;
        return (flag);

}

unsigned char ALU:: getSignFlag()
{
        unsigned char flag;
        if(flags & 0x80) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getParityFlag()
{
        unsigned char flag;
        if(flags & 0x04) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getAuxCarryFlag()
{
        unsigned char flag;
        if(flags & 0x10) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

void ALU::add()
{
       unsigned short int result;

    unsigned char tTempReg = 0x0f & tempreg;
    unsigned char tA = 0x0f & A;
    tA = (tA + tTempReg) & 0x10;
    if (tA == 0x10) setAuxCarryFlag();
    else resetAuxCarryFlag();
    result = A + tempreg;
    A = (unsigned char) result;
    if(0x0100 & result) setCarryFlag();
    else  resetCarryFlag();
    doZeroFlag();
    doSignFlag();
    doParityFlag();
}

void ALU::andd()
{
    A = A & tempreg;
    doSignFlag();
    doZeroFlag();
    doParityFlag();
    resetCarryFlag();
    setAuxCarryFlag();
}

void ALU::doZeroFlag()
{
    if(A == 0x00) setZeroFlag();
    else resetZeroFlag();
}

void ALU::doSignFlag()
{
        if (A & 0x80) setSignFlag();
        else resetSignFlag();
}

void ALU::doParityFlag()
{
        unsigned char accumParity = 0;
        unsigned char tempAccum = A;
        for (unsigned char i = 0; i <= 7; i++)
        {
                accumParity += (tempAccum & 0x01);
                tempAccum = tempAccum >> 0x01;
    }
        if((accumParity % 2) == 0 && accumParity > 0) setParityFlag();
        else resetParityFlag();
}

void ALU::doOp()
{
    switch (instructreg)
    {
        case 0x00:    // NOP operation, do nothing
            break;
        case 0x01:    //LXI B, 16-bit
            break;
        case 0x02:    //STX B
            break;
        case 0x03:    //INX B
            break;
        case 0x04:    //INR B
                        break;
        case 0x05:    //DCR B
                        break;
        case 0x06:    //MVI B, 8-Bit
            break;
        case 0x11:    //LXI B, 16-Bit
            break;
        case 0x21:    //LXI H, 16-Bit
            break;
        case 0x2f:    //CMA
            break;
        case 0x31:    //LXI SP, 16-Bit
            break;
        case 0x40:    //MOV B, B
            break;
                case 0x41:    //MOV B, C
                        break;
                case 0x42:    //MOV B, D
                        break;
                case 0x43:    //MOV B, E
                        break;
                case 0x44:    //MOV B, H
                        break;
                case 0x45:    //MOV B, L
                        break;
                case 0x46:    //MOV B, M
                        break;
                case 0x47:    //MOV B, A
                        break;
                case 0x48:    //MOV C, B
                        break;
                case 0x49:    //MOV C, C
                        break;
                case 0x4a:    //MOV C, D
                        break;
                case 0x4b:    //MOV C, E
                        break;
                case 0x4c:    //MOV C, H
                        break;
                case 0x4d:    //MOV C, L
                        break;
                case 0x4e:    //MOV C, M
                        break;
                case 0x4f:    //MOV C, A
                        break;
        case 0x50:    //MOV D, B
            break;
        case 0x51:    //MOV D, C
            break;
        case 0x52:    //MOV D, D
            break;
        case 0x53:    //MOV D, E
            break;
        case 0x54:    //MOV D, H
            break;
        case 0x55:    //MOV D, L
            break;
        case 0x56:    //MOV D, M
            break;
        case 0x57:    //MOV D, A
            break;
        case 0x58:    //MOV E, B
            break;
        case 0x59:    //MOV E, C
            break;
        case 0x5a:    //MOV E, D
            break;
        case 0x5b:    //MOV E, E
            break;
        case 0x5c:    //MOV E, H
            break;
        case 0x5d:    //MOV E, L
            break;
        case 0x5e:    //MOV E, M
            break;
        case 0x5f:    //MOV E, A
            break;
        case 0x60:    //MOV H, B
            break;
        case 0x61:    //MOV H, C
                        break;
        case 0x62:    //MOV H, D
                        break;
        case 0x63:    //MOV H, E
                        break;
        case 0x64:    //MOV H, H
                        break;
        case 0x65:    //MOV H, L
                        break;
        case 0x66:    //MOV H, M
                        break;
        case 0x67:    //MOV H, A
                        break;
        case 0x68:    //MOV L, B
                        break;
        case 0x69:    //MOV L, C
                        break;
        case 0x6a:    //MOV L, D
                        break;
        case 0x6b:    //MOV L, E
                        break;
        case 0x6c:    //MOV L, H
                        break;
        case 0x6d:    //MOV L, L
                        break;
        case 0x6e:    //MOV L, M
                        break;
        case 0x6f:    //MOV L, A
            break;
        case 0x78:    //MOV A, B
                        break;
                case 0x79:    //MOV A, C
                        break;
                case 0x7a:    //MOV A, D
                        break;
                case 0x7b:    //MOV A, E
                        break;
                case 0x7c:    //MOV A, H
                        break;
                case 0x7d:    //MOV A, L
                        break;
                case 0x7e:    //MOV A, M
                        break;
                case 0x7f:    //MOV A, A
                        break;
        case 0x80:    //ADD B
        case 0x81:    //ADD C
        case 0x82:    //ADD D
        case 0x83:    //ADD E
        case 0x84:    //ADD H
        case 0x85:    //ADD L
        case 0x86:    //ADD M
        case 0x87:    //ADD A
            add();
            break;
        case 0x88:    //ADC B
            break;
        case 0x89:    //ADC C
            break;
        case 0x8a:    //ADC D
            break;
        case 0x8b:    //ADC E
            break;
        case 0x8c:    //ADC H
            break;
        case 0x8d:    //ADC L
            break;
        case 0x8e:    //ADC M
            break;
        case 0x8f:    //ADC A
            break;
        case 0xa0:    //ANA B
        case 0xa1:    //ANA C
        case 0xa2:    //ANA D
        case 0xa3:    //ANA E
        case 0xa4:    //ANA H
        case 0xa5:    //ANA L
        case 0xa6:    //ANA M
        case 0xa7:    //ANA A
            andd();
            break;
        case 0xb8:    //CMP B
                        break;
        case 0xb9:    //CMP C
                        break;
        case 0xba:    //CMP D
                        break;
        case 0xbb:    //CMP E
                        break;
        case 0xbc:    //CMP H
                        break;
        case 0xbd:    //CMP L
                        break;
        case 0xbe:    //CMP M
                        break;
        case 0xbf:    //CMP A
                        break;
        case 0xc6:    //ADI 8-bit
            add();
            break;
        case 0xcd:    //CALL 16-bit
            break;
        case 0xce:    //ACI 8-bit
            break;
        case 0xdc:    //CC 16-bit
            break;
        case 0xe6:    //ANI 8-bit
            andd();
            break;
        case 0xfc:    //CM 16-bit
            break;
        default:
            printf("Error %x is not an 8085 instruction\n", instructreg);
    }
}


The latest version of alutest.cc has problems. I need to validate input so that the user inputs two digit hex values for the instruction, and for accumulator, and temporary register values. I also need to handle the “add” and “and” instructions when the register encoded in the opcode is the accumulator.
The latest version of alutest.cc looks like this:

#include <cstdio>
#include <ctype.h>
#include <stdlib.h>
#include "alu.h"

unsigned char convert2CharStringTo2DigitHex(char * string);
void getAndPrintVal(char *printString, char *valString);
void prompt(char *);

int main()
{
    char *message;
    char message1[18] = "Enter instruction";
    char message2[26] = "Enter Temp register value";
    char message3[24] = "Enter Accumulator value";
    char hex2DigitString[3];
    char quit;
    char *pQuit;
    pQuit = &quit;

    ALU alu8085;
    printf("Welcome to the 8085 alu simulator\n");
    prompt(pQuit);
    while(toupper(quit)!= 'Q')
    {
        message = message1;
        for (int i = 1; i <= 3; i++)
        {
            getAndPrintVal(message,  hex2DigitString);
            switch(i)
            {
                case 1:
                    alu8085.setInstruction(convert2CharStringTo2DigitHex(hex2DigitString));
                    message = message2;
                    break;
                case 2:
                    alu8085.setTempReg(convert2CharStringTo2DigitHex(hex2DigitString));
                    message = message3;
                    break;
                case 3:
                    alu8085.setAccumu(convert2CharStringTo2DigitHex(hex2DigitString));
                    break;
            }
        }
            alu8085.doOp();
            printf("Result is 0x%02x\n",  alu8085.getAccumulator());
                printf("Flag Register = 0x%02x\n",alu8085.getFlags());
            printf("Sign flag is %x\n", alu8085.getSignFlag());
        printf("Carry flag is %x\n", alu8085.getCarryFlag());
        printf("Zero flag is %x\n", alu8085.getZeroFlag());
        printf("Parity flag is %x\n", alu8085.getParityFlag());
        printf("Aux carry flag is %x\n", alu8085.getAuxCarryFlag());
        printf("\n");
        prompt(pQuit);
    }
    return(0);
}

unsigned char convert2CharStringTo2DigitHex(char * string)
{
    for (int i = 0; i < 2; i++)
    {
        if(*(string + i) >= '0' && *(string + i) <= '9') *(string + i) = 0x0f & *(string + i);
        else if (*(string + i) >= 'a' && *(string + i) <= 'f') *(string + i) = *(string + i) - 87;
        else printf("Error\n");
       }
        *string = *string << 4;
        *string = *(string + 1)|*string;
    return(*string);
}

void getAndPrintVal(char *printString, char *valString)
{
    printf(printString);
    printf("\n");
        scanf("%s", valString);
    if (atoi(valString) > 0xff) printf("Warning, data entered is more than 2 digits-I will use the first 2\n");
    for (int i = 0; i < 2; i++) *(valString + i) = tolower(*(valString + i));
}

void prompt(char *quit)
{
        printf("Press c to continue, or q to quit\n");
        scanf("%s", quit);
}


I committed changes to the Subversion repository:

lab46:~/src/cpu$ svn commit -m "Added ADI, ANA, and ANI instructions -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        8085/arithmeticlogicunit/alutest.cc
Sending        include/alu.h
Transmitting file data ...
Committed revision 165.

I added CPU data to the repository.

lab46:~/src/cpu/xxxx$ svn add xxxxxx
A  (bin)  xxxxxx
lab46:~/src/cpu/xxxx$ svn add xxxxxxx
A         xxxxxxx
lab46:~/src/cpu/xxxx$ svn commit -m "more data -JR"
Adding         xxxx/xxxxxxx
Adding  (bin)  xxxx/xxxxxx
Transmitting file data ..
Committed revision 151.
lab46:~/src/cpu/xxxx$ 

Week 7 Journal Entry

CSIT1320 HPC Fundamentals
After trying to install the video driver several times with no success, the instructor noticed that another computer had a nvidia video driver with a version number which was higher than the latest video driver written by the manufacturer. After this discovery, he performed an aptitude search for nvidia packages (aptitude search nvidia|grep 173) and found some. At this point, we abandoned the old method of installing the video driver and decided to perform aptitude installs of the nvidia packages. These instructions are the steps we took to get xorg to work.

  1. Turn on the computers in which you will install xorg.
  2. As it boots, press F2 on the keyboard to bypass the “System Setup” screen and go directly to the cmos setup.
  3. Arrow down to the “Disk Configuration” item and press enter. A popup screen will appear.
  4. On the popup screen, arrow down to “Primary Master Drive” and press enter. A popup screen appears.
  5. On the popup screen, arrow to (if required) “Drive Type”; using the right or left arrow keys, set to the type “Auto”. Press enter to exit the second popup; press escape to exit the first popup.
  6. On the BIOS setup main screen, arrow down to “Boot Sequence” and press enter. A popup screen appears.
  7. On the popup screen, using the +/- arrow keys, move the “Integrated NIC” item to the second item on the list with the hard drive at the top of the list. Make sure it is enabled (square root symbol directly to the left of this item). If it isn't enabled, use the space bar to enable it. Press enter to exit the popup window.
  8. On the BIOS setup main screen, arrow down to the “Integrated Devices (LegacySelect Options)” and press enter. A popup screen appears.
  9. On the popup, arrow down to “Network Interface Controller” item. Using the right or left arrow keys, set the network interface controller to “On w/PXE”.
  10. On the same popup screen, arrow down to the “Onboard Video Buffer” item and using the right or left arrow keys, set the video buffer size to 8MB. Press enter to exit the popup.
  11. On the BIOS setup screen, arrow down to the “IDE Hard Drive Acooustics Mode” item. using the right or left arrow keys, select “Quiet”.
  12. Press escape to exit the bios setup screen. Popup appears.
  13. On the popup screen, arrow to (if required) the “Save Changes and Exit” item. Press enter to exit the BIOS setup screen.
  14. Computer reboots.
  15. Next, the Lair Network Boot Menu loads.
  16. Select “Debian/i386 Netboot” and press enter.
  17. Arrow to “Install Squeeze/testing [text]” if required and press enter.
  18. At this point, the installation begins (defaults were selected throughout MOST but not all of the installation).
  19. The “Select a language” screen is displayed. The default is “English”, press enter to select this item.
  20. The “Select a location” screen is displayed. The default is “United States”, press enter this item.
  21. The “Select a keyboard layout” screen is displayed. The default is “American English”, press enter this item.
  22. The “Configure the network” screen is displayed. On this screen, the Host name: “dhcp-175” is entered automatically. press enter to continue.
  23. The “Configure the network” screen is displayed. On this screen, the Domain name: “offbyone.lan” is entered automatically. Press enter to continue.
  24. The “Choose a mirror of the Debian archive” screen is displayed. The default is “United States”. Arrow up to “Enter information manually” item and press enter.
  25. The “Choose a mirror of the Debian archive” screen is displayed. The Debian mirror host name: “mirror” is entered automatically. Press enter to continue.
  26. The “Choose a mirror of the Debian archive” screen is displayed. The Debian archive directory: “/debian/” is entered automatically. Press enter to continue.
  27. The “Choose a mirror of the Debian archive” screen is displayed. HTTP proxy information is blank by default. Press enter to continue.
  28. In the first installation od Debian Squeeze, the installation continued from here, however during the second installation, the installation failed because a file could not be installed from the network archive. This was because there was a newer version that was avalable. When the failure occured, the installer is prompted to either retry or change the mirror. During the second installation the mirror was changed to thr RIT mirror.
  29. Next, the “Set up users and passwords” screen is displayed. The Root password I entered was “bob”.
  30. The “Set up users and passwords” screen is displayed. The installer is prompted to re-enter the password. I entered entered “bob”.
  31. The “Set up users and passwords” screen is displayed. The installer is prompted to enter “The full name for the new user:” I entered “bob”.
  32. The “Set up users and passwords” screen is displayed. The installer is prompted to enter the username for the account. I entered “bob”.
  33. The “Set up users and passwords” screen is displayed. The installer is prompted to enter a password for the new user. I entered “bob”.
  34. Next, the “Configure the clock” screen is displayed. For Select your time zone: “Eastern” is the default. Press enter to continue.
  35. The “Partition disk” screen is displayed. The default is “Guided-use entire disk”, press enter to continue.
  36. The “Partition disk” screen is displayed. The disk to partition: SCSI 1 (0,0,0) (sda)-xxx.xxGB ATA Maxtor. has been entered automatically. Press enter to continue.
  37. The “Partition disk” screen is displayed. Partitioning scheme: “All files in one partition (recommended for new users)” is the default. Press enter to continue.
  38. The “Partition disk” screen is displayed. The default “Finish partitioning and write changes to disk” is displayed. Press enter to continue.
  39. Partitioning message-“The following partitions are going to be formatted: Partition #1 of SCSI1 (0,0,0) sda as ext3; Partition #5 of SCSI1 (0,0,0) sda as swap.”
  40. Popularity contest message “Configuring popularity contest: Participate in the package usage survey?”. Select <no>.
  41. The “Software selection” screen is displayed. The default is “Graphical desktop environment”. Deselect this selection using the spacebar. Using the space bar, select the ssh server. Press enter to continue.
  42. Configuring grub message: “Configuring grub-pc: Install grub boot loader to master boot record”, <yes>.
  43. Installation complete <continue>.
  44. Finishing the installation..
  45. Computer reboots automatically.
  46. Log in to both computers as root.
  47. Change the working directory to /etc/apt. At the command prompt enter “cd /etc/apt”.
  48. Rename the existing sources.list to sources.bak. At the command prompt enter “mv sources.list sources.bak”.
  49. Now download sources.list. At the command prompt, enter “wget http://10.80.2.6/files/students/sources.list”.
  50. Next, open sources.list with a text editor and replace all references to “debversion” to “squeeze”. On the command prompt, enter “vi sources.list”. In vi enter “:%s/debversion/squeeze/g”. Next to save the changes and quit vi, Enter “:wq”.
  51. On the command line enter “aptitude update”.
  52. Next, on the command line enter “aptitude upgrade”.
  53. Install the Linux nvidia packages. At the command prompt enter “aptitude install libgl1-nvidia-legacy-173xx-glx nvidia-kernel-legacy-173xx-dkms nvidia-glx-legacy-173xx nvidia-settings”.
  54. Blacklist nouveau, after all the dirty commie shouldn't be able to work (cold war joke). On the command prompt enter “nano /etc/modprobe.d/blacklist.conf”; at the end of the file add the line “blacklist nouveau”.
  55. Reboot the computer. On the command line enter “reboot”.
  56. Change the working directory to /etc/X11. At the command line enter “cd /etc/X11”.
  57. Get the xorg.conf file. On the command line enter “wget http://10.80.2.6/files/student/xorg.conf”.
  58. Install font packages. On the command line enter “aptitude install xfonts-scalable xfonts-cyrillic xfonts-75dpi xfonts-100dpi”.
  59. Install the xbase clients package. On the command line enter “aptitude install xbase-clients”.
  60. The next step is to start X. On the command line enter “startx”.

Oops! a terminal starts. Before performing the startx line, the x window package should be installed.

CSIT2048 HPC Experience II
I have used C code running on DOS to read from and write to the parallel port using dos.h and the functions “inportb(address)” and “outportb(address,value)” respectively, however, I have not done so in Linux. Since the aforementioned functions are contained in an operating system specific library, I expected some difference between implementations which is why I searched the Internet for information regarding Linux and use of the parallel port, and I found there are a few differences. I found the following C programs for Linux at: http://www.epanorama.net/circuits/parallel_output.html . At first the code below wouldn't work. I had to change line “#include <asm/io.h>” to “#include <sys/io.h>”. I compiled and ran it and found it only worked if I was the superuser. If I was simply a user, it would return the message Couldn't get the port at 0x378“.
The first program only outputs to the parallel port data bus which is at the address 0x378. If the parallel port is unidirectional, the databus can only be written to and not read from. However, the status port which is at the databus address + 1 or 0x379 can be read. Some of the pins on the db-25 or 25-pin parallel port connector are reserved for status signals fed back from a printer or other parallel port peripheral. We will use one or two of these pins to read a float switch or switches.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>   //was #include <asm/io.h>

#define base 0x378           /* printer port base address */
#define value 255            /* numeric value to send to printer port */

main(int argc, char **argv)
{
   if (ioperm(base,1,1))
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

   outb(value, base);
}
/*Compile with the command line
gcc -O lpt_test.c -o lpt_test
*/


This C source code for Linux is also from: http://www.epanorama.net/circuits/parallel_output.html .

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include<sys/io.h>    //#include <asm/io.h>

#define base 0x379           /* I/O address to read */

main(int argc, char **argv)
{
  int value;

  if (ioperm(base,1,1))
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

  value = inb(base);
  printf("Port 0x%x read value is %i \n",base,value);
}


/* compile with  command line
  gcc -O lpt_read.c -o lpt_read */

Not knowing if the parallel port input (status) lines require pull-up (or pull down) resistors or not, I decided to set a databus pin high by writing to it and then using its output through a resistor to act as a power supply with pullup. Using a databus pin would save us the use of a power supply if a pullup is required. After writing to the databus port, I then wanted to read the status port, so I created the following code from the two samples above. I found however that I had to change the parameters passed to the ioperm function.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include<sys/io.h>    //#include <asm/io.h>

#define base 0x378           /* I/O base address */

main(int argc, char **argv)
{
  char value;

  if (ioperm(base, 4, 0))   //was ioperm(base, 1, 1)
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

  outb(0x01, base);

  value = inb(base + 1);
  printf("Port 0x%x read value is 0x%x \n",(base + 1),value);
}


/* compile with  command line
  gcc lpttest.c -o lpttest */

When the code above was executed the value printed to the screen for 0x379 was 0x78. Maybe the parallel port has internal pullups on the status pins. When I pulled pin 15 of the parallel port to one of the parallel port ground pins and then read the port, the value returned was 0x70. Success! we can implement a float switch using the parallel port on a Linux platform.

CSCS2650 Computer Organization
On Saturday, March 19, 2011, I updated the alu api page located at: http://lab46.corning-cc.edu/notes/asm/alu. On that page, I added the following documentation:
Valid Instructions
To use valid instructions, first load the instruction register with a valid instruction using the ALU class's setInstruction member function. When a valid instruction is used, it is assumed that the accumulator or A register has a value on which an operation can be performed. To get a value into the accumulator use the ALU class's setAccumu function. To use one of the specific valid instructions, place the value of the specific register, C for example, into the alu's temporary register using the ALU class's setTempReg. If, however, the operand is 8-bit rather than a register, using the setTempReg function, load the temporary register with the 8-bit value. Next, call the ALU class's doOp instruction to execute the instruction loaded in the instruction register.

I added data validation and error messages to alutest.cc.

lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x899
Fatal error-hex value is greater than 2 digits
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x8
Error-hex value is must be at least 2 digits
Enter instruction
0x80
Enter Accumulator value
0xh
Error-hex value is must be at least 2 digits
Enter Accumulator value
0xff
Enter Temporary Register value
0xd
Error-hex value is must be at least 2 digits
Enter Temporary Register value
0xff
Result is 0xfe
Flag Register = 0x91
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 1
Enter instruction
0x^C
lab46:~/src/cpu$ svn commit -m "added data validation and error messages to alutest.cc -John Rine"
Sending        8085/arithmeticlogicunit/alutest.cc
Transmitting file data .
lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alutest.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alutest.cc           ... OK
[CC]  alutest              ... SUCCESS
Committed revision 187.

I added the complement instruction CMA (0x2f) to alu.cc and alu.h files.
The alu.h file now looks like this:

#ifndef _ALU_H
#define _ALU_H
class ALU
{
        public:
                ALU();
                void setTempReg(unsigned char tempregister);
                void setInstruction(unsigned char instruction);
                void setAccumu(unsigned char accum);
                unsigned char getDataBus();
                void doOp();
                unsigned char getAccumulator();
                unsigned char getFlags();
                unsigned char getZeroFlag();
                unsigned char getCarryFlag();
                unsigned char getSignFlag();
                unsigned char getParityFlag();
                unsigned char getAuxCarryFlag();
                ~ALU();
        private:
                unsigned char A;           //accumulator
                unsigned char tempreg;     //temporary register
                unsigned char instructreg; //instruction register
                unsigned char databusout;  //databus out
                //flags
                //D7 = S
                //D6 = Z
                //D5
                //D4 = AC
                //D3
                //D2 = P
                //D1
                //D0 = CY
                unsigned char flags;           //the flag register
                //functions
                 void add();
                void complementA();
                void andd();
                void setCarryFlag();
                void resetCarryFlag();
                void setZeroFlag();
                void resetZeroFlag();
                void setSignFlag();
                void resetSignFlag();
                void setParityFlag();
                void resetParityFlag();
                void setAuxCarryFlag();
                void resetAuxCarryFlag();
                void doZeroFlag();
                void doSignFlag();
                void doParityFlag();
};
#endif

The alu.cc file looks like this:

#include "alu.h"
#include <cstdio>

const unsigned char signAndMask = 0x7f;     //to clear or reset the sign flag
const unsigned char signOrMask = 0x80;      //to set the sign flag
const unsigned char zeroAndMask = 0xbf;     //to clear or reset the zero flag
const unsigned char zeroOrMask = 0x40;      //to set the zero flag
const unsigned char auxcarryAndMask = 0xef; //to clear or reset the aux carry flag
const unsigned char auxcarryOrMask = 0x10;  //to set the aux carry flag
const unsigned char parityAndMask = 0xfb;   //to clear or reset the parity flag
const unsigned char parityOrMask = 0x04;    //to set the parity flag
const unsigned char carryAndMask = 0xfe;    //to clear or reset the carry flag
const unsigned char carryOrMask = 0x01;     //to set the carry flag

ALU::ALU()
{
         flags = 0x00;
}

ALU::~ALU()
{
}

void ALU::setTempReg(unsigned char tempregister)
{
         tempreg = tempregister;
}

void ALU::setAccumu(unsigned char accum)
{
        A = accum;
}

void ALU::setInstruction(unsigned char instruction)
{
        instructreg = instruction;
}

unsigned char ALU::getDataBus()
{
        return(databusout);
}

void ALU::setCarryFlag()
{
        flags = flags | carryOrMask;
}

void ALU::resetCarryFlag()
{
        flags = flags & carryAndMask;
}

void ALU::setZeroFlag()
{
        flags = flags | zeroOrMask;
}

void ALU::resetZeroFlag()
{
        flags = flags & zeroAndMask;
}

void ALU::setSignFlag()
{
        flags = flags | signOrMask;
}

void ALU::resetSignFlag()
{
        flags = flags & signAndMask;
}

void ALU::setParityFlag()
{
        flags = flags | parityOrMask;
}

void ALU::resetParityFlag()
{
        flags = flags & parityAndMask;
}

void ALU::setAuxCarryFlag()
{
        flags = flags | auxcarryOrMask;
}

void ALU::resetAuxCarryFlag()
{
        flags = flags & auxcarryAndMask;
}

unsigned char ALU::getAccumulator()
{
        return(A);
}

unsigned char ALU::getFlags()
{
        return(flags);
}

unsigned char ALU::getZeroFlag()
{
        unsigned char flag;
        if(flags & 0x40) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getCarryFlag()
{
        unsigned char flag;
        if(flags & 0x01) flag = 0x01;
        else flag = 0x00;
        return (flag);

}

unsigned char ALU:: getSignFlag()
{
        unsigned char flag;
        if(flags & 0x80) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getParityFlag()
{
        unsigned char flag;
        if(flags & 0x04) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getAuxCarryFlag()
{
        unsigned char flag;
        if(flags & 0x10) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

void ALU::add()
{
        unsigned short int result;

        unsigned char tTempReg = 0x0f & tempreg;
        unsigned char tA = 0x0f & A;
        tA = (tA + tTempReg) & 0x10;
        if (tA == 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
        result = A + tempreg;
        A = (unsigned char) result;
        if(0x0100 & result) setCarryFlag();
        else  resetCarryFlag();
        doZeroFlag();

void ALU::complementA()
{
        A = ~A;
}

void ALU::andd()
{
        A = A & tempreg;
        doSignFlag();
        doZeroFlag();
        doParityFlag();
        resetCarryFlag();
        setAuxCarryFlag();
}

void ALU::doZeroFlag()
{
        if(A == 0x00) setZeroFlag();
        else resetZeroFlag();
}

void ALU::doSignFlag()
{
        if (A & 0x80) setSignFlag();
        else resetSignFlag();
}

void ALU::doParityFlag()
{
        unsigned char accumParity = 0;
        unsigned char tempAccum = A;
        for (unsigned char i = 0; i <= 7; i++)
        {
                accumParity += (tempAccum & 0x01);
                tempAccum = tempAccum >> 0x01;
        }
        if((accumParity % 2) == 0 && accumParity > 0) setParityFlag();
        else resetParityFlag();
}

void ALU::doOp()
{
        switch (instructreg)
        {
                case 0x00:      // NOP operation, do nothing
                        break;
                case 0x01:      //LXI B, 16-bit
                        break;
                case 0x02:      //STX B
                        break;
                case 0x03:      //INX B
                        break;
                case 0x04:      //INR B
                        break;
                case 0x05:      //DCR B
                        break;
                case 0x06:      //MVI B, 8-Bit
                        break;
                case 0x11:      //LXI B, 16-Bit
                        break;
                case 0x21:      //LXI H, 16-Bit
                        break;
                case 0x2f:      //CMA
                        complementA();
                        break;
                case 0x31:      //LXI SP, 16-Bit
                        break;
                case 0x40:      //MOV B, B
                        break;
                case 0x41:      //MOV B, C
                        break;
                case 0x42:      //MOV B, D
                        break;
                case 0x43:      //MOV B, E
                        break;
                case 0x44:      //MOV B, H
                        break;
                case 0x45:      //MOV B, L
                        break;
                case 0x46:      //MOV B, M
                        break;
                case 0x47:      //MOV B, A
                        break;
                case 0x48:      //MOV C, B
                        break;
                case 0x49:      //MOV C, C
                        break;
                case 0x4a:      //MOV C, D
                        break;
                case 0x4b:      //MOV C, E
                        break;
                case 0x4c:      //MOV C, H
                        break;
                case 0x4d:      //MOV C, L
                        break;
                case 0x4e:      //MOV C, M
                        break;
                case 0x4f:      //MOV C, A
                        break;
                case 0x50:      //MOV D, B
                        break;
                case 0x51:      //MOV D, C
                        break;
                case 0x52:      //MOV D, D
                        break;
                case 0x53:      //MOV D, E
                        break;
                case 0x54:      //MOV D, H
                        break;
                case 0x55:      //MOV D, L
                        break;
                case 0x56:      //MOV D, M
                        break;
                case 0x57:      //MOV D, A
                        break;
                case 0x58:      //MOV E, B
                        break;
                case 0x59:      //MOV E, C
                        break;
                case 0x5a:      //MOV E, D
                        break;
                case 0x5b:      //MOV E, E
                        break;
                case 0x5c:      //MOV E, H
                        break;
                case 0x5d:      //MOV E, L
                        break;
                case 0x5e:      //MOV E, M
                        break;
                case 0x5f:      //MOV E, A
                        break;
                case 0x60:      //MOV H, B
                        break;
                case 0x61:      //MOV H, C
                        break;
                case 0x62:      //MOV H, D
                        break;
                case 0x63:      //MOV H, E
                        break;
                case 0x64:      //MOV H, H
                        break;
                case 0x65:      //MOV H, L
                        break;
                case 0x66:      //MOV H, M
                        break;
                case 0x67:      //MOV H, A
                        break;
                case 0x68:      //MOV L, B
                        break;
                case 0x69:      //MOV L, C
                        break;
                case 0x6a:      //MOV L, D
                        break;
                case 0x6b:      //MOV L, E
                        break;
                case 0x6c:      //MOV L, H
                        break;
                case 0x6d:      //MOV L, L
                        break;
                case 0x6e:      //MOV L, M
                        break;
                case 0x6f:      //MOV L, A
                        break;
                case 0x78:      //MOV A, B
                        break;
                case 0x79:      //MOV A, C
                        break;
                case 0x7a:      //MOV A, D
                        break;
                case 0x7b:      //MOV A, E
                        break;
                case 0x7c:      //MOV A, H
                        break;
                case 0x7d:      //MOV A, L
                        break;
                case 0x7e:      //MOV A, M
                        break;
                case 0x7f:      //MOV A, A
                        break;
                case 0x80:      //ADD B
                case 0x81:      //ADD C
                case 0x82:      //ADD D
                case 0x83:      //ADD E
                case 0x84:      //ADD H
                case 0x85:      //ADD L
                case 0x86:      //ADD M
                case 0x87:      //ADD A
                        add();
                        break;
                case 0x88:      //ADC B
                        break;
                case 0x89:      //ADC C
                        break;
                case 0x8a:      //ADC D
                        break;
                case 0x8b:      //ADC E
                        break;
                case 0x8c:      //ADC H
                        break;
                case 0x8d:      //ADC L
                        break;
                case 0x8e:      //ADC M
                        break;
                case 0x8f:      //ADC A
                        break;
                case 0xa0:      //ANA B
                case 0xa1:      //ANA C
                case 0xa2:      //ANA D
                case 0xa3:      //ANA E
                case 0xa4:      //ANA H
                case 0xa5:      //ANA L
                case 0xa6:      //ANA M
                case 0xa7:      //ANA A
                        andd();
                        break;
                case 0xb8:      //CMP B
                        break;
                case 0xb9:      //CMP C
                        break;
                case 0xba:      //CMP D
                        break;
                case 0xbb:      //CMP E
                        break;
                case 0xbc:      //CMP H
                        break;
                case 0xbd:      //CMP L
                        break;
                case 0xbe:      //CMP M
                        break;
                case 0xbf:      //CMP A
                        break;
                case 0xc6:      //ADI 8-bit
                        add();
                        break;
                case 0xcd:      //CALL 16-bit
                        break;
                case 0xce:      //ACI 8-bit
                        break;
                case 0xdc:      //CC 16-bit
                        break;
                case 0xe6:      //ANI 8-bit
                        andd();
                        break;
                case 0xfc:      //CM 16-bit
                        break;
                default:
                        printf("Error %x is not an 8085 instruction\n", instructreg);
        }
}
lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alutest.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x2f
Enter Accumulator value
0xf0
Enter Temporary Register value
0x00
Result is 0x0f
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q
lab46:~/src/cpu$ svn commit -m "Added the CMA instruction to the alu class -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 191.

Week 8 Journal Entry

CSIT1320 HPC Fundamentals
The instructor and I ended up using the same Xdmx that is used on the large video wall. Once this step was done, it was relatively easy to get the wall to work.
Below are the steps I undertook to get the wall to work.
First, we needed to locate Xdmx, so the instructor entered the following on the command line: whereis Xdmx.
Xdmx was located in the /usr/bin directory.
The next step was to change the working directory to /usr/bin; On the command line, the instructor entered: “cd /usr/bin”.
Next, the instructor performed a wget to get the same Xdmx that was used to create the large video wall. On the command line, the instructor entered: “wget http://10.80.2.6/files/student/Xdmx”.
The next step is to start perform startx at the command prompt on both computers. On the command line, I entered “startx”.
Next on both computers, I right clicked on their screens and selected the bash terminal.
Once the terminals opened, at the command prompts I entered “xhost +” .
On the top computer only, on the command line in the terminal application I entered:

Xdmx :1 -ac -configfile dmx.com -config -ignorebadfontpaths -noclxproxy +xinerama & sleep 4; export DISPLAY=localhost:1; fluxbox

Voila! It works!!!! Its time to try some cool things.
First , I'll played xbill. xbill tries to install the “Wingdows” virus on computers which are part of your network. The player's task is to smash or blow up bill before he is able to gat away with loading the virus.
To play xbill, enter the following on the command line: “/usr/games/xbill”.
My game scoring whent like this:
After level 1:
Score: 155

After level 2:
Score: 425

After level 3:
Score: 810

After level 4:
Score: 1272

After level 5:
Score: 3752

Next, the instructor told me about xscreensaver. He installed it by entering “aptitude install xscreensaver” on the command line.
The next step was to change to the “xscreensaver” directory which is located in “/usr/lib” and perform a directory listing of its contents. In the xscreensaver directory were the following enteries:

  • abstractile
  • cwaves
  • deco
  • distort
  • fiberlamp
  • fuzzyflakes
  • galaxy
  • mb502
  • metaballs
  • penrose
  • popsquares
  • ripples
  • shadebobs
  • slidescreen
  • swirl
  • xlyaps

To start a screensaver from the screensaver directory (/usr/lib/xscreensaver), I entered its name on the command line using the syntax to execute an application or shell script: ./screensavername.
The instructor set “fiberlamp” as one of the screensavers. I tried “fuzzyflakes”, “galaxy”, and “popsquares”; they were very cool!

CSIT2048 HPC Experience II
Using instructions at http://library.linode.com/web-servers/apache/installation/debian-6-squeeze, I installed the Apache2 web server on my machine so that data collected by the dallas 1-wire sensors or the float switch could be shared via the Internet:

root@dhcp-179:/home/bob# apt-get install apache2 apache2-doc apache2-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-worker apache2.2-common
Suggested packages:
  apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-doc apache2-mpm-worker apache2-utils apache2.2-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,779 kB of archives.
After this operation, 15.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org/ squeeze/updates/main apache2-utils i386 2.2.16-6+squeeze1 [165 kB]
Get:2 http://security.debian.org/ squeeze/updates/main apache2.2-common i386 2.2.16-6+squeeze1 [307 kB]
Get:3 http://security.debian.org/ squeeze/updates/main apache2-mpm-worker i386 2.2.16-6+squeeze1 [2,230 B]
Get:4 http://security.debian.org/ squeeze/updates/main apache2 i386 2.2.16-6+squeeze1 [1,386 B]
Get:5 http://security.debian.org/ squeeze/updates/main apache2-doc all 2.2.16-6+squeeze1 [2,304 kB]
Fetched 2,779 kB in 7s (387 kB/s)                                                             
Selecting previously deselected package apache2-utils.
(Reading database ... 124913 files and directories currently installed.)
Unpacking apache2-utils (from .../apache2-utils_2.2.16-6+squeeze1_i386.deb) ...
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from .../apache2.2-common_2.2.16-6+squeeze1_i386.deb) ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.16-6+squeeze1_i386.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.16-6+squeeze1_i386.deb) ...
Selecting previously deselected package apache2-doc.
Unpacking apache2-doc (from .../apache2-doc_2.2.16-6+squeeze1_all.deb) ...
Processing triggers for man-db ...
Setting up apache2-utils (2.2.16-6+squeeze1) ...
Setting up apache2.2-common (2.2.16-6+squeeze1) ...
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
Setting up apache2-mpm-worker (2.2.16-6+squeeze1) ...
Starting web server: apache2.
Setting up apache2 (2.2.16-6+squeeze1) ...
Setting up apache2-doc (2.2.16-6+squeeze1) ...
Reloading web server config: apache2.
root@dhcp-179:/home/bob# 
root@dhcp-179:/home/bob# 
root@dhcp-179:/home/bob# apt-get install libapache2-mod-ruby
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libapache-ruby1.8 libreadline5 libruby1.8
Suggested packages:
  liberuby
The following NEW packages will be installed:
  libapache-ruby1.8 libapache2-mod-ruby libreadline5 libruby1.8
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,180 kB of archives.
After this operation, 8,147 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main libreadline5 i386 5.2-7 [135 kB]
Get:2 http://debian.uchicago.edu/debian/ squeeze/main libruby1.8 i386 1.8.7.302-2 [1,965 kB]
Get:3 http://debian.uchicago.edu/debian/ squeeze/main libapache-ruby1.8 all 1.2.6-2 [20.5 kB]
Get:4 http://debian.uchicago.edu/debian/ squeeze/main libapache2-mod-ruby i386 1.2.6-2 [59.7 kB]
Fetched 2,180 kB in 5s (407 kB/s)         
Selecting previously deselected package libreadline5.
(Reading database ... 126955 files and directories currently installed.)
Unpacking libreadline5 (from .../libreadline5_5.2-7_i386.deb) ...
Selecting previously deselected package libruby1.8.
Unpacking libruby1.8 (from .../libruby1.8_1.8.7.302-2_i386.deb) ...
Selecting previously deselected package libapache-ruby1.8.
Unpacking libapache-ruby1.8 (from .../libapache-ruby1.8_1.2.6-2_all.deb) ...
Selecting previously deselected package libapache2-mod-ruby.
Unpacking libapache2-mod-ruby (from .../libapache2-mod-ruby_1.2.6-2_i386.deb) ...
Setting up libreadline5 (5.2-7) ...
Setting up libruby1.8 (1.8.7.302-2) ...
Setting up libapache-ruby1.8 (1.2.6-2) ...
Setting up libapache2-mod-ruby (1.2.6-2) ...
Enabling module ruby.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@dhcp-179:/home/bob# apt-get install libapache2-mod-perl2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libapache2-reload-perl libbsd-resource-perl libdevel-symdump-perl
The following NEW packages will be installed:
  libapache2-mod-perl2 libapache2-reload-perl libbsd-resource-perl libdevel-symdump-perl
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,146 kB of archives.
After this operation, 4,063 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main libdevel-symdump-perl all 2.08-3 [16.6 kB]
Get:2 http://debian.uchicago.edu/debian/ squeeze/main libapache2-mod-perl2 i386 2.0.4-7 [1,077 kB]
Get:3 http://debian.uchicago.edu/debian/ squeeze/main libapache2-reload-perl all 0.10-2 [19.9 kB]
Get:4 http://debian.uchicago.edu/debian/ squeeze/main libbsd-resource-perl i386 1.2904-1 [32.5 kB]
Fetched 1,146 kB in 2s (418 kB/s)               
Selecting previously deselected package libdevel-symdump-perl.
(Reading database ... 127688 files and directories currently installed.)
Unpacking libdevel-symdump-perl (from .../libdevel-symdump-perl_2.08-3_all.deb) ...
Selecting previously deselected package libapache2-mod-perl2.
Unpacking libapache2-mod-perl2 (from .../libapache2-mod-perl2_2.0.4-7_i386.deb) ...
Selecting previously deselected package libapache2-reload-perl.
Unpacking libapache2-reload-perl (from .../libapache2-reload-perl_0.10-2_all.deb) ...
Selecting previously deselected package libbsd-resource-perl.
Unpacking libbsd-resource-perl (from .../libbsd-resource-perl_1.2904-1_i386.deb) ...
Processing triggers for man-db ...
Setting up libdevel-symdump-perl (2.08-3) ...
Setting up libapache2-mod-perl2 (2.0.4-7) ...
Enabling module perl.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Setting up libapache2-reload-perl (0.10-2) ...
Setting up libbsd-resource-perl (1.2904-1) ...
root@dhcp-179:/home/bob# 
root@dhcp-179:/home/bob# 
root@dhcp-179:/home/bob# apt-get install libapache2-mod-python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libapache2-mod-python-doc
The following NEW packages will be installed:
  libapache2-mod-python
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 122 kB of archives.
After this operation, 537 kB of additional disk space will be used.
Get:1 http://debian.uchicago.edu/debian/ squeeze/main libapache2-mod-python i386 3.3.1-9+b1 [122 kB]
Fetched 122 kB in 0s (240 kB/s)           
Selecting previously deselected package libapache2-mod-python.
(Reading database ... 128129 files and directories currently installed.)
Unpacking libapache2-mod-python (from .../libapache2-mod-python_3.3.1-9+b1_i386.deb) ...
Setting up libapache2-mod-python (3.3.1-9+b1) ...
Reloading web server config: apache2.
Processing triggers for python-central ...
root@dhcp-179:/home/bob# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libmysqlclient16 mysql-common
Suggested packages:
  python-egenix-mxdatetime mysql-server-5.1 mysql-server python-mysqldb-dbg
The following NEW packages will be installed:
  libmysqlclient16 mysql-common python-mysqldb
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,101 kB of archives.
After this operation, 4,788 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main mysql-common all 5.1.49-3 [70.9 kB]
Get:2 http://debian.uchicago.edu/debian/ squeeze/main libmysqlclient16 i386 5.1.49-3 [1,935 kB]
Get:3 http://debian.uchicago.edu/debian/ squeeze/main python-mysqldb i386 1.2.2-10+b1 [95.8 kB]
Fetched 2,101 kB in 5s (374 kB/s)        
Selecting previously deselected package mysql-common.
(Reading database ... 128154 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.1.49-3_all.deb) ...
Selecting previously deselected package libmysqlclient16.
Unpacking libmysqlclient16 (from .../libmysqlclient16_5.1.49-3_i386.deb) ...
Selecting previously deselected package python-mysqldb.
Unpacking python-mysqldb (from .../python-mysqldb_1.2.2-10+b1_i386.deb) ...
Setting up mysql-common (5.1.49-3) ...
Setting up libmysqlclient16 (5.1.49-3) ...
Setting up python-mysqldb (1.2.2-10+b1) ...
Processing triggers for python-support ...
root@dhcp-179:/home/bob# apt-get install libapache2-mod-php5 php5 php-pear php5-xcache
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-prefork libonig2 libqdbm14 php5-cli php5-common php5-suhosin
Suggested packages:
  php5-dev
The following packages will be REMOVED:
  apache2-mpm-worker
The following NEW packages will be installed:
  apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php-pear php5 php5-cli
  php5-common php5-suhosin php5-xcache
0 upgraded, 10 newly installed, 1 to remove and 0 not upgraded.
Need to get 7,101 kB of archives.
After this operation, 20.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main libonig2 i386 5.9.1-1 [134 kB]
Get:2 http://security.debian.org/ squeeze/updates/main apache2-mpm-prefork i386 2.2.16-6+squeeze1 [2,286 B]
Get:3 http://security.debian.org/ squeeze/updates/main php5-common i386 5.3.3-7+squeeze1 [541 kB]
Get:4 http://debian.uchicago.edu/debian/ squeeze/main libqdbm14 i386 1.8.77-4 [147 kB]
Get:5 http://debian.uchicago.edu/debian/ squeeze/main php5-suhosin i386 0.9.32.1-1 [80.8 kB]
Get:6 http://debian.uchicago.edu/debian/ squeeze/main php5-xcache i386 1.3.0-7 [86.4 kB]
Get:7 http://security.debian.org/ squeeze/updates/main libapache2-mod-php5 i386 5.3.3-7+squeeze1 [2,888 kB]
Get:8 http://security.debian.org/ squeeze/updates/main php5-cli i386 5.3.3-7+squeeze1 [2,857 kB]
Get:9 http://security.debian.org/ squeeze/updates/main php-pear all 5.3.3-7+squeeze1 [364 kB] 
Get:10 http://security.debian.org/ squeeze/updates/main php5 all 5.3.3-7+squeeze1 [1,068 B]   
Fetched 7,101 kB in 15s (445 kB/s)                                                            
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you requested:
 apache2 depends on apache2-mpm-worker (= 2.2.16-6+squeeze1) | apache2-mpm-prefork (= 2.2.16-6+squeeze1) | apache2-mpm-event (= 2.2.16-6+squeeze1) | apache2-mpm-itk (= 2.2.16-6+squeeze1); however:
  Package apache2-mpm-worker is to be removed.
  Package apache2-mpm-prefork is not installed.
  Package apache2-mpm-event is not installed.
  Package apache2-mpm-itk is not installed.
(Reading database ... 128207 files and directories currently installed.)
Removing apache2-mpm-worker ...
Stopping web server: apache2 ... waiting .
Selecting previously deselected package apache2-mpm-prefork.
(Reading database ... 128203 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.16-6+squeeze1_i386.deb) ...
Setting up apache2-mpm-prefork (2.2.16-6+squeeze1) ...
Starting web server: apache2.
Selecting previously deselected package libonig2.
(Reading database ... 128208 files and directories currently installed.)
Unpacking libonig2 (from .../libonig2_5.9.1-1_i386.deb) ...
Selecting previously deselected package libqdbm14.
Unpacking libqdbm14 (from .../libqdbm14_1.8.77-4_i386.deb) ...
Selecting previously deselected package php5-common.
Unpacking php5-common (from .../php5-common_5.3.3-7+squeeze1_i386.deb) ...
Selecting previously deselected package libapache2-mod-php5.
Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.3.3-7+squeeze1_i386.deb) ...
Selecting previously deselected package php5-cli.
Unpacking php5-cli (from .../php5-cli_5.3.3-7+squeeze1_i386.deb) ...
Selecting previously deselected package php-pear.
Unpacking php-pear (from .../php-pear_5.3.3-7+squeeze1_all.deb) ...
Selecting previously deselected package php5.
Unpacking php5 (from .../php5_5.3.3-7+squeeze1_all.deb) ...
Selecting previously deselected package php5-suhosin.
Unpacking php5-suhosin (from .../php5-suhosin_0.9.32.1-1_i386.deb) ...
Selecting previously deselected package php5-xcache.
Unpacking php5-xcache (from .../php5-xcache_1.3.0-7_i386.deb) ...
Processing triggers for man-db ...
Setting up libonig2 (5.9.1-1) ...
Setting up libqdbm14 (1.8.77-4) ...
Setting up php5-common (5.3.3-7+squeeze1) ...
Setting up libapache2-mod-php5 (5.3.3-7+squeeze1) ...

Creating config file /etc/php5/apache2/php.ini with new version
Reloading web server config: apache2.
Setting up php5-cli (5.3.3-7+squeeze1) ...

Creating config file /etc/php5/cli/php.ini with new version
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode.
Setting up php-pear (5.3.3-7+squeeze1) ...
Setting up php5 (5.3.3-7+squeeze1) ...
Setting up php5-suhosin (0.9.32.1-1) ...
Setting up php5-xcache (1.3.0-7) ...
root@dhcp-179:/home/bob# apt-get install php5-suhosin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-suhosin is already the newest version.
php5-suhosin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@dhcp-179:/home/bob# apt-get install php5-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  php5-mysql
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 66.8 kB of archives.
After this operation, 250 kB of additional disk space will be used.
Get:1 http://security.debian.org/ squeeze/updates/main php5-mysql i386 5.3.3-7+squeeze1 [66.8 kB]
Fetched 66.8 kB in 2s (27.0 kB/s)     
Selecting previously deselected package php5-mysql.
(Reading database ... 128521 files and directories currently installed.)
Unpacking php5-mysql (from .../php5-mysql_5.3.3-7+squeeze1_i386.deb) ...
Processing triggers for libapache2-mod-php5 ...
Reloading web server config: apache2.
Setting up php5-mysql (5.3.3-7+squeeze1) ...
root@dhcp-179:/home/bob# cd ..
root@dhcp-179:/home# cd /
root@dhcp-179:/# cd /etc/apache2
root@dhcp-179:/etc/apache2# ls
apache2.conf  envvars	  magic		  mods-enabled	sites-available
conf.d	      httpd.conf  mods-available  ports.conf	sites-enabled
root@dhcp-179:/etc/apache2# cd /var/www
root@dhcp-179:/var/www# ls
index.html

I found out where to put CGI scripts using the following information: http://wiki.linuxquestions.org/wiki/Debian:CGI .
I also found this tutorial: http://hi.baidu.com/someprojects/blog/item/01097e6d0b4df4ff421694c6.html .

CSCS2650 Computer Organization

I added the ORA and ORI instruction to the ALU class.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alutest.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0xf6
Enter Accumulator value
0xf0
Enter Temporary Register value
0x0f
Result is 0xff
Flag Register = 0x84
Sign flag is 1
Carry flag is 0
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$ cd ..
lab46:~/src/cpu/8085$ cd ..
lab46:~/src/cpu$ svn commit -m "Added the ORA and ORI instructions to the ALU class -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 209.
lab46:~/src/cpu$

I updated the asm class wiki at http://lab46.corning-cc.edu/notes/asm/alu to reflect the addition of the ORA and ORI instructions to the ALU class.
On March 27, 2011, I added the XRA and XRI instructions function definitions to alu.cc and their prototypes to alu.h. I updated the ALU API sub-page of the asm course wiki notes. The ALU API page below includes all of these instructions.
alu.h
The ALU class library is included before the main function like this:

#include "alu.h"

Object instantiation
An object of the type ALU is instatiated like this:

//Instantiates an object of type ALU
ALU alu8085;

void ALU::setAccumu(unsigned char)
The void ALU::setAccumu(unsigned char) is used to set the accumulator's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the accumulator value to fe hex or 254 decimal.
alu8085.setAccumu(0xfe);

void ALU::setInstruction(unsigned char)
The void ALU::setInstruction(unsigned char) function is used to set the temporary register's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the ADD instruction
alu8085.setInstruction(0x80);

Valid Instructions
Before an instruction mathematical or logical operation is executed, it is assumed that the accumulator has been loaded with a value upon which a mathematical or logic operation will take place. Use the ALU class's setAccumu member function to do so. To use valid instructions, next load the instruction register with a valid instruction using the ALU class's setInstruction member function. Next, place the contents of the specific register or memory address, C for example, into the alu's temporary register using the ALU class's setTempReg. If, however, the operand is 8-bit rather than a register, using the setTempReg function, load the temporary register with the 8-bit value. Next, call the ALU class's doOp instruction to execute the instruction loaded in the instruction register.

0x2f  CMA

0x81  ADD C
0x82  ADD D
0x83  ADD E
0x84  ADD H
0x85  ADD L
0x86  ADD M
0x87  ADD A

0xc6  ADI 8-bit

0xa0  ANA B
0xa1  ANA C
0xa2  ANA D
0xa3  ANA E
0xa4  ANA H
0xa5  ANA L
0xa6  ANA M
0xa7  ANA A

0xa8  XRA B
0xa9  XRA C
0xaa  XRA D
0xab  XRA E
0xac  XRA H
0xad  XRA L
0xae  XRA M
0xaf  XRA A

0xb0  ORA B
0xb1  ORA C
0xb2  ORA D
0xb3  ORA E
0xb4  ORA H
0xb5  ORA L
0xb6  ORA M
0xb7  ORA A

0xe6  ANI 8-bit

0xee  XRI 8-bit

0xf6  ORI 8-bit

void ALU::setTempReg(unsigned char)

//sets the temporary register value to 0f hex or 15 decimal.
alu8085.setTempReg(0x0f);

void ALU::doOp()
The void ALU::doOp() member function tells an object of type ALU to execute the instruction loaded into the instruction register.

//execute the instruction loaded into the instruction register
alu8085.doOp();

void ALU::getDataBus()
The void ALU::getDataBus() member function returns the resulting value of the last operation.

//prints the return value of getDataBus()
printf("Result of the operation is %x\n", alu8085.getDataBus());

unsigned char getFlags()
The member function unsigned char getFlags() gets or returns the value of the flag register.

//prints the return value of getFlags()
printf("The flag register value is %x\n", alu8085.getFlags());

unsigned char getAccumulator()
The unsigned char getAccumulator() member function is used to get the value of the accumulator after an operation. The result of operations are placed into the accumulator. This function can also be used as a debugging tool to check the value in the accumulator at any time after an object of type ALU has been instantiated.

//prints the return value of getAccumulator()
printf("The value in the accumulator is %x\n", alu8085.getAccumulator());

unsigned char getZeroFlag()
The member function unsigned char getZeroFlag() returns the value of the zero flag.

//prints the value of the zero flag
printf("Zero flag is 0x%02x\n", alu8085.getZeroFlag());

unsigned char getCarryFlag()
The member function unsigned char getCarryFlag() returns the value of the carry flag.

//prints the value of the carry flag
printf("Carry flag is 0x%02x\n", alu8085.getCarryFlag());

unsigned char getSignFlag()
The member function unsigned char getSignFlag() returns the value of the sign flag.

//prints the value of the sign flag
printf("Sign flag is 0x%02x\n", alu8085.getSignFlag());

unsigned char getParityFlag()
The member function unsigned char getParityFlag() returns the value of the parity flag.

//prints the value of the parity flag
printf("Parity flag is 0x%02x\n", alu8085.getParityFlag());

Week 9 Journal Entry

CSIT1320 HPC Fundamentals
8 machine HPC cluster
These instructions assume that the boot sequence of all of the computers in the cluster are configured to boot from the hard drive before booting from the network. If a computer's boot order is set to boot from the network first, change the boot order.

  1. Set the master KVM bank switch to bank one.
  2. Set the master KVM computer switches to the computer on which the operating system is to be installed.
  3. Turn on the computer.
  4. As a computer boots, press F2 on the keyboard to bypass the “System Setup” screen and go directly to the cmos setup.
  5. In the cmos setup, use the right or left arrow keys to select “Boot” from the main menu.
  6. Verify that “PXE boot to LAN” is enabled. If it isn't enabled, enable it.
  7. In the cmos setup, use the right and left arrow keys to select “Advanced” from the main menu.
  8. Arrow down to “Peripheral Configuration”.
  9. Verify that “Onboard LAN” is enabled. If it isn't enabled, enable it.
  10. If cmos settings were changed save and exit the cmos setup utility. If no changes were made to the cmos, select the exit without saving option.
  11. The Computer reboots.
  12. Press F10 to access the boot menu.
  13. On the boot menu, arrow down to “IBA GE Slot 0208 V1210” and select it.
  14. Next, the Lair Network Boot Menu loads.
  15. Select “Debian/i386 Netboot” and press enter.
  16. Arrow to “Install Squeeze/testing [text]” if required and press enter.
  17. At this point, the installation begins (defaults were selected throughout MOST but not all of the installation).
  18. The “Select a language” screen is displayed. The default is “English”, press enter to select this item.
  19. The “Select a location” screen is displayed. The default is “United States”, press enter this item.
  20. The “Select a keyboard layout” screen is displayed. The default is “American English”, press enter this item.
  21. The “Configure the network” screen is displayed. On this screen, the Host name: “dhcp-175” is entered automatically. press enter to continue.
  22. The “Configure the network” screen is displayed. On this screen, the Domain name: “offbyone.lan” is entered automatically. Press enter to continue.
  23. The “Choose a mirror of the Debian archive” screen is displayed. The default is “United States”. Arrow up to “Enter information manually” item and press enter.
  24. The “Choose a mirror of the Debian archive” screen is displayed. The Debian mirror host name: “mirror” is entered automatically. Press enter to continue.
  25. The “Choose a mirror of the Debian archive” screen is displayed. The Debian archive directory: “/debian/” is entered automatically. Press enter to continue.
  26. The “Choose a mirror of the Debian archive” screen is displayed. HTTP proxy information is blank by default. Press enter to continue.
  27. In the first installation od Debian Squeeze, the installation continued from here, however during the second installation, the installation failed because a file could not be installed from the network archive. This was because there was a newer version that was avalable. When the failure occured, the installer is prompted to either retry or change the mirror. During the second installation the mirror was changed to thr RIT mirror.
  28. Next, the “Set up users and passwords” screen is displayed. The Root password I entered was “bob”.
  29. The “Set up users and passwords” screen is displayed. The installer is prompted to re-enter the password. I entered entered “bob”.
  30. The “Set up users and passwords” screen is displayed. The installer is prompted to enter “The full name for the new user:” I entered “bob”.
  31. The “Set up users and passwords” screen is displayed. The installer is prompted to enter the username for the account. I entered “bob”.
  32. The “Set up users and passwords” screen is displayed. The installer is prompted to enter a password for the new user. I entered “bob”.
  33. Next, the “Configure the clock” screen is displayed. For Select your time zone: “Eastern” is the default. Press enter to continue.
  34. The “Partition disk” screen is displayed. The default is “Guided-use entire disk”, press enter to continue.
  35. The “Partition disk” screen is displayed. The disk to partition: SCSI 1 (0,0,0) (sda)-xxx.xxGB ATA Maxtor. has been entered automatically. Press enter to continue.
  36. The “Partition disk” screen is displayed. Partitioning scheme: “All files in one partition (recommended for new users)” is the default. Press enter to continue.
  37. The “Partition disk” screen is displayed. The default “Finish partitioning and write changes to disk” is displayed. Press enter to continue.
  38. Partitioning message-“The following partitions are going to be formatted: Partition #1 of SCSI1 (0,0,0) sda as ext3; Partition #5 of SCSI1 (0,0,0) sda as swap.”
  39. Popularity contest message “Configuring popularity contest: Participate in the package usage survey?”. Select <no>.
  40. The “Software selection” screen is displayed. The default is “Graphical desktop environment”. Deselect this selection using the spacebar. Using the space bar, select the ssh server. Press enter to continue.
  41. Configuring grub message: “Configuring grub-pc: Install grub boot loader to master boot record”, <yes>.
  42. Installation complete <continue>.
  43. Finishing the installation..
  44. Computer reboots automatically.
  45. Repeat steps 2 through 44 for all computers in the cluster.
  46. Change the KVM computer switch to the first position, node 00.
  47. Change the working directory to /etc/apt. At the command prompt enter “cd /etc/apt”.
  48. Rename the existing sources.list to sources.bak. At the command prompt enter “mv sources.list sources.bak”.
  49. Now download sources.list. At the command prompt, enter “wget http://10.80.2.6/files/students/sources.list”.
  50. Next, open sources.list with a text editor and replace all references to “debversion” to “squeeze”. On the command prompt, enter “vi sources.list”. In vi enter “:%s/debversion/squeeze/g”. Next to save the changes and quit vi, Enter “:wq”.
  51. On the command line, enter and execute: “ssh-keygen -t rsa -C clusterkey”.
  52. change the directory to “.ssh”.
  53. On the command line, enter and execute the following command: “cat id_rsa.pub » authorized_keys”.
  54. On the command line enter and execute the following commands: for i in 1 2 3 4 5 6 7; do ssh node0$i “mkdir -p .ssh; chmod 700 .ssh” sca id_rsa.pub node0$i:.ssh/ ssh node0$i “cat .ssh/idid_rsa.pub » .ssh/authorized_keys; chmod 600 .ssh/*” sca /etc/apt/sources.list node0$i:/etc/apt ssh node0$i “aptitude update; aptitude upgrade” done
  55. On node00, perform an aptitude install openmpi-bin openmpi-libs0 openmpi-dev openmpi-dev build-essential
  56. On the command line, enter and execute the following command: “for i in 1 2 3 4 5 6 7; do ssh node0$i aptitude install openmpi-bin openmpi-libs0 openmpi-doc done”.
  57. On node00, change directory to /etc/openmpi and edit the file “open-default-hostfile” as follows: vi open-default-hostfile
node00 slots=1 max_slots=1
node01 slots=1 max_slots=1
node02 slots=1 max_slots=1
node03 slots=1 max_slots=1
node04 slots=1 max_slots=1
node05 slots=1 max_slots=1
node06 slots=1 max_slots=1
node07 slots=1 max_slots=1

then close vi and save the file :wq.

Apache Web Server install w/ Web page
Last week I installed Apache Web server. This week I made the Web page listed below, named it index.html and placed it into the /var/www directory along with dancing bear.gif file. I was able to access the Web page from a remote computer in the LAIR.

<html>
<center><b>Anthony</b></center>
<center><p><img src="dancing-bear.gif"></center>
</html>


CSIT2048 HPC Experience II
I wrote the following c source file which executes when a http request is made. The program checks the state of the parallel port pin 15 and reports it.
The graphic file floatswitch.jpeg must reside in the /var/www directory. The compiled file “example” must reside in the /usr/lib/cgi-bin directory. In order for the example executable to be executed via an http request, the following commands must be performed:

  • chown root.root example
  • chmod +s example

The state of the floatswitch can be accessed by entering the following URL in the URL field of a Web browser: “10.80.2.179/cgi-bin/example”.

//execute.c

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>

#define BASEPORT 0x378 /* lp1 */

int main()
{
   /* Get access to the ports */
   if (ioperm(BASEPORT, 3, 1)) {perror("ioperm"); exit(1);}

   /* Set the data signals (D0-7) of the port to all low (0) */
   outb(0x00, BASEPORT);
   /* Sleep for a while (100 ms) */
   usleep(100000);

   /* Read from the status port (BASE+1) and display the result */
         char* theRemoteAddress = getenv("REMOTE_ADDR");
         printf("Content-type: text/html\n\n");
         printf("<html>");
         printf("<HEAD> <TITLE> Float Switch Status </TITLE> </HEAD>\n");
         printf("<BODY bgcolor =\"#FFFF00\" text = \"Black\">\n");
         //printf("status: %d\n", (0x08 & inb(BASEPORT + 1));

         printf("<center> Hello %s </center>\n", theRemoteAddress);

         char dummy;
         dummy = 0x08 & inb(BASEPORT + 1);
         if (dummy) printf("<center> The hydroponic solution level is too low!\n </center>");
         else printf("<center> The hydroponic solution level is okay\n </center>");
         printf("<center> <img src=\"/floatswitch.jpeg\"> </center>\n");
         printf("</body> </html>\n");
   /* don't need the ports anymore */
   if (ioperm(BASEPORT, 3, 0)) {perror("ioperm"); exit(1);}

   exit(0);
}


CSCS2650 Computer Organization
I added the set carry flag instruction (STC) to the ALU API. I updated the ALU API page of the asm notes pages to reflect the addition of the STC instruction to the ALU API.

lab46:~/src/cpu$ svn commit -m "Added Set Carry instruction to the ALU API -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 260.

I added the SUB and SUI subtraction instructions to the ALU API. I then tested them.
The results of testing of the SUB and SUI instructions are shown below:

Enter instruction
0x90
Enter Accumulator value
0xff
Enter Temporary Register value
0x01
Result is 0xfe
Flag Register = 0x90
Sign flag is 1
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Enter instruction
0x90
Enter Accumulator value
0xff
Enter Temporary Register value
0xff
Result is 0x00
Flag Register = 0x50
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 0
Aux carry flag is 1

Enter instruction
0x90
Enter Accumulator value
0xfe
Enter Temporary Register value
0xff
Result is 0xff
Flag Register = 0x85
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

After testing these instructions, I commited them to the subversion repository.

lab46:~/src/cpu$ svn commit -m "Added SUB and SUI instructions -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 261.

I added comments to alu.cc.

lab46:~/src/cpu$ svn commit -m "Added comments in alu.cc -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Transmitting file data .
Committed revision 262.

I added the SUB and and SUI instructions to the ALU API. I updated the ALU API page of the asm notes pages to reflect the addition of the SUB and SUI instructions to the ALU API instruction set. alu.h
The ALU class library is included before the main function like this:

#include "alu.h"

Object instantiation
An object of the type ALU is instatiated like this:

//Instantiates an object of type ALU
ALU alu8085;
//Dynamically allocated, remember to "delete p;" when the dynamically allocated object is no longer used so that memory leaks will not occur
ALU *p = new ALU;

void ALU::setAccumu(unsigned char)
The void ALU::setAccumu(unsigned char) is used to set the accumulator's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the accumulator value to fe hex or 254 decimal.
alu8085.setAccumu(0xfe);

void ALU::setInstruction(unsigned char)
The void ALU::setInstruction(unsigned char) function is used to set the temporary register's 8-bit value. Note that its sole parameter takes an unsigned char. This is because we are only dealing with hex numbers.

//sets the ADD instruction
alu8085.setInstruction(0x80);

Valid Instructions
Before an instruction mathematical or logical operation is executed, it is assumed that the accumulator has been loaded with a value upon which a mathematical or logic operation will take place. Use the ALU class's setAccumu member function to do so. To use valid instructions, next load the instruction register with a valid instruction using the ALU class's setInstruction member function. Next, place the contents of the specific register or memory address, C for example, into the alu's temporary register using the ALU class's setTempReg. If, however, the operand is 8-bit rather than a register, using the setTempReg function, load the temporary register with the 8-bit value. Next, call the ALU class's doOp instruction to execute the instruction loaded in the instruction register.

0x2f  CMA

0x37  STC

0x80  ADD B
0x81  ADD C
0x82  ADD D
0x83  ADD E
0x84  ADD H
0x85  ADD L
0x86  ADD M
0x87  ADD A

0x90  SUB B
0x91  SUB C
0x92  SUB D
0x93  SUB E
0x94  SUB H
0x95  SUB L
0x96  SUB M
0x97  SUB A

0xc6  ADI 8-bit

0xa0  ANA B
0xa1  ANA C
0xa2  ANA D
0xa3  ANA E
0xa4  ANA H
0xa5  ANA L
0xa6  ANA M
0xa7  ANA A

0xa8  XRA B
0xa9  XRA C
0xaa  XRA D
0xab  XRA E
0xac  XRA H
0xad  XRA L
0xae  XRA M
0xaf  XRA A

0xb0  ORA B
0xb1  ORA C
0xb2  ORA D
0xb3  ORA E
0xb4  ORA H
0xb5  ORA L
0xb6  ORA M
0xb7  ORA A

0xd6  SUI 8-bit

0xe6  ANI 8-bit

0xee  XRI 8-bit

0xf6  ORI 8-bit

Issues with instructions

  1. instructions involving A as an operand currently requires user to copy contents of A into the Temporary register before executing the instruction.
  2. The Parity flag may not be working correctly if the result in A is 0.

void ALU::setTempReg(unsigned char)

//sets the temporary register value to 0f hex or 15 decimal.
alu8085.setTempReg(0x0f);

void ALU::doOp()
The void ALU::doOp() member function tells an object of type ALU to execute the instruction loaded into the instruction register.

//execute the instruction loaded into the instruction register
alu8085.doOp();

void ALU::getDataBus()
The void ALU::getDataBus() member function returns the resulting value of the last operation.

//prints the return value of getDataBus()
printf("Result of the operation is %x\n", alu8085.getDataBus());

unsigned char ALU::getFlags()
The member function unsigned char getFlags() gets or returns the value of the flag register.

//prints the return value of getFlags()
printf("The flag register value is %x\n", alu8085.getFlags());

unsigned char ALU::getAccumulator()
The unsigned char getAccumulator() member function is used to get the value of the accumulator after an operation. The result of operations are placed into the accumulator. This function can also be used as a debugging tool to check the value in the accumulator at any time after an object of type ALU has been instantiated.

//prints the return value of getAccumulator()
printf("The value in the accumulator is %x\n", alu8085.getAccumulator());

unsigned char ALU::getZeroFlag()
The member function unsigned char getZeroFlag() returns the value of the zero flag.

//prints the value of the zero flag
printf("Zero flag is 0x%02x\n", alu8085.getZeroFlag());

unsigned char ALU::getCarryFlag()
The member function unsigned char getCarryFlag() returns the value of the carry flag.

//prints the value of the carry flag
printf("Carry flag is 0x%02x\n", alu8085.getCarryFlag());

unsigned char ALU::getSignFlag()
The member function unsigned char getSignFlag() returns the value of the sign flag.

//prints the value of the sign flag
printf("Sign flag is 0x%02x\n", alu8085.getSignFlag());

unsigned char ALU::getParityFlag()
The member function unsigned char getParityFlag() returns the value of the parity flag.

//prints the value of the parity flag
printf("Parity flag is 0x%02x\n", alu8085.getParityFlag());

The latest version of alu.cc, including all of the changes described in this week's journal entry, is listed below:

#include "alu.h"
#include <cstdio>

const unsigned char signAndMask = 0x7f;     //to clear or reset the sign flag
const unsigned char signOrMask = 0x80;      //to set the sign flag
const unsigned char zeroAndMask = 0xbf;     //to clear or reset the zero flag
const unsigned char zeroOrMask = 0x40;      //to set the zero flag
const unsigned char auxcarryAndMask = 0xef; //to clear or reset the aux carry flag
const unsigned char auxcarryOrMask = 0x10;  //to set the aux carry flag
const unsigned char parityAndMask = 0xfb;   //to clear or reset the parity flag
const unsigned char parityOrMask = 0x04;    //to set the parity flag
const unsigned char carryAndMask = 0xfe;    //to clear or reset the carry flag
const unsigned char carryOrMask = 0x01;     //to set the carry flag

ALU::ALU()
{
         flags = 0x00;
}

ALU::~ALU()
{
}

void ALU::setTempReg(unsigned char tempregister)
{
         tempreg = tempregister;
}

void ALU::setAccumu(unsigned char accum)
{
        A = accum;
}

void ALU::setInstruction(unsigned char instruction)
{
        instructreg = instruction;
}

unsigned char ALU::getDataBus()
{
        return(databusout);
}

void ALU::setCarryFlag()
{
        flags = flags | carryOrMask;
}

void ALU::resetCarryFlag()
{
        flags = flags & carryAndMask;
}

void ALU::setZeroFlag()
{
        flags = flags | zeroOrMask;
}

void ALU::resetZeroFlag()
{
        flags = flags & zeroAndMask;
}

void ALU::setSignFlag()
{
        flags = flags | signOrMask;
}

void ALU::resetSignFlag()
{
        flags = flags & signAndMask;
}

void ALU::setParityFlag()
{
        flags = flags | parityOrMask;
}

void ALU::resetParityFlag()
{
        flags = flags & parityAndMask;
}

void ALU::setAuxCarryFlag()
{
        flags = flags | auxcarryOrMask;
}

void ALU::resetAuxCarryFlag()
{
        flags = flags & auxcarryAndMask;
}

unsigned char ALU::getAccumulator()
{
        return(A);
}

unsigned char ALU::getFlags()
{
        return(flags);
}

unsigned char ALU::getZeroFlag()
{
        unsigned char flag;
        if(flags & 0x40) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getCarryFlag()
{
        unsigned char flag;
        if(flags & 0x01) flag = 0x01;
        else flag = 0x00;
        return (flag);

}

unsigned char ALU:: getSignFlag()
{
        unsigned char flag;
        if(flags & 0x80) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getParityFlag()
{
        unsigned char flag;
        if(flags & 0x04) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

unsigned char ALU::getAuxCarryFlag()
{
        unsigned char flag;
        if(flags & 0x10) flag = 0x01;
        else flag = 0x00;
        return (flag);
}

void ALU::add()
{
        unsigned short int result = 0;

        unsigned char tTempReg = 0x0f & tempreg;
        unsigned char tA = 0x0f & A;
        tA = tA + tTempReg;
        if (tA & 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
        result = A + tempreg;
        A = (unsigned char) result;
        if(0x0100 & result) setCarryFlag();
        else  resetCarryFlag();
        doZeroFlag();
        doSignFlag();
        doParityFlag();
}


void ALU::subtract()
{
        unsigned short int result = 0;

        unsigned char tTempReg = A & 0x0f;
        unsigned char tA = (~tempreg + 1) & 0x0f;
        tA = tA + tTempReg;
        if (tA & 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
        result = (unsigned char) ~tempreg;
        result = result + 1;
        result = result + A;
        A = (unsigned char) result;
        if (0x0100 & result) resetCarryFlag();
        else setCarryFlag();
        doZeroFlag();
        doSignFlag();
        doParityFlag();
}

void ALU::setcarry()
{
        setCarryFlag();
}

void ALU::complementA()
{
        A = ~A;
}

void ALU::andd()
{
        A = A & tempreg;
        doSignFlag();
        doZeroFlag();
        doParityFlag();
        resetCarryFlag();
        setAuxCarryFlag();
}

void ALU::orr()
{
        A = A | tempreg;
        doSignFlag();
        doZeroFlag();
        doParityFlag();
        resetCarryFlag();
        resetAuxCarryFlag();
}

void ALU::xorr()
{
        A = A ^ tempreg;
        doSignFlag();
        doZeroFlag();
        doParityFlag();
        resetCarryFlag();
        resetAuxCarryFlag();
}

void ALU::doZeroFlag()
{
        if(A == 0x00) setZeroFlag();
        else resetZeroFlag();
}

void ALU::doSignFlag()
{
        if (A & 0x80) setSignFlag();
        else resetSignFlag();
}

void ALU::doParityFlag()
{
        unsigned char accumParity = 0;
        unsigned char tempAccum = A;
        for (unsigned char i = 0; i <= 7; i++)
        {
                accumParity += (tempAccum & 0x01);
                tempAccum = tempAccum >> 0x01;
        }
        if((accumParity % 2) == 0 && accumParity > 0) setParityFlag();
        else resetParityFlag();
}

void ALU::doOp()
{
        switch (instructreg)
        {
                case 0x00:      // NOP operation, do nothing
                        break;
                case 0x01:      //LXI B, 16-bit
                        break;
                case 0x02:      //STX B
                        break;
                case 0x03:      //INX B
                        break;
                case 0x04:      //INR B
                        break;
                case 0x05:      //DCR B
                        break;
                case 0x06:      //MVI B, 8-Bit
                        break;
                case 0x11:      //LXI B, 16-Bit
                        break;
                case 0x21:      //LXI H, 16-Bit
                        break;
                case 0x2f:      //CMA
                        complementA();
                        break;
                case 0x31:      //LXI SP, 16-Bit
                        break;
                case 0x37:
                        setcarry();
                        break;
                case 0x40:      //MOV B, B
                        break;
                case 0x41:      //MOV B, C
                        break;
                case 0x42:      //MOV B, D
                        break;
                case 0x43:      //MOV B, E
                        break;
                case 0x44:      //MOV B, H
                        break;
                case 0x45:      //MOV B, L
                        break;
                case 0x46:      //MOV B, M
                        break;
                case 0x47:      //MOV B, A
                        break;
                case 0x48:      //MOV C, B
                        break;
                case 0x49:      //MOV C, C
                        break;
                case 0x4a:      //MOV C, D
                        break;
                case 0x4b:      //MOV C, E
                        break;
                case 0x4c:      //MOV C, H
                        break;
                case 0x4d:      //MOV C, L
                        break;
                case 0x4e:      //MOV C, M
                        break;
                case 0x4f:      //MOV C, A
                        break;
                case 0x50:      //MOV D, B
                        break;
                case 0x51:      //MOV D, C
                        break;
                case 0x52:      //MOV D, D
                        break;
                case 0x53:      //MOV D, E
                        break;
                case 0x54:      //MOV D, H
                        break;
                case 0x55:      //MOV D, L
                        break;
                case 0x56:      //MOV D, M
                        break;
                case 0x57:      //MOV D, A
                        break;
                case 0x58:      //MOV E, B
                        break;
                case 0x59:      //MOV E, C
                        break;
                case 0x5a:      //MOV E, D
                        break;
                case 0x5b:      //MOV E, E
                        break;
                case 0x5c:      //MOV E, H
                        break;
                case 0x5d:      //MOV E, L
                        break;
                case 0x5e:      //MOV E, M
                        break;
                case 0x5f:      //MOV E, A
                        break;
                case 0x60:      //MOV H, B
                        break;
                case 0x61:      //MOV H, C
                        break;
                case 0x62:      //MOV H, D
                        break;
                case 0x63:      //MOV H, E
                        break;
                case 0x64:      //MOV H, H
                        break;
                case 0x65:      //MOV H, L
                        break;
                case 0x66:      //MOV H, M
                        break;
                case 0x67:      //MOV H, A
                        break;
                case 0x68:      //MOV L, B
                        break;
                case 0x69:      //MOV L, C
                        break;
                case 0x6a:      //MOV L, D
                        break;
                case 0x6b:      //MOV L, E
                        break;
                case 0x6c:      //MOV L, H
                        break;
                case 0x6d:      //MOV L, L
                        break;
                case 0x6e:      //MOV L, M
                        break;
                case 0x6f:      //MOV L, A
                        break;
                case 0x78:      //MOV A, B
                        break;
                case 0x79:      //MOV A, C
                        break;
                case 0x7a:      //MOV A, D
                        break;
                case 0x7b:      //MOV A, E
                        break;
                case 0x7c:      //MOV A, H
                        break;
                case 0x7d:      //MOV A, L
                        break;
                case 0x7e:      //MOV A, M
                        break;
                case 0x7f:      //MOV A, A
                        break;
                case 0x80:      //ADD B
                case 0x81:      //ADD C
                case 0x82:      //ADD D
                case 0x83:      //ADD E
                case 0x84:      //ADD H
                case 0x85:      //ADD L
                case 0x86:      //ADD M
                case 0x87:      //ADD A
                        add();
                        break;
                case 0x88:      //ADC B
                        break;
                case 0x89:      //ADC C
                        break;
                case 0x8a:      //ADC D
                        break;
                case 0x8b:      //ADC E
                        break;
                case 0x8c:      //ADC H
                        break;
                case 0x8d:      //ADC L
                        break;
                case 0x8e:      //ADC M
                        break;
                case 0x8f:      //ADC A
                        break;
                case 0x90:      //SUB B
                case 0x91:      //SUB C
                case 0x92:      //SUB D
                case 0x93:      //SUB E
                case 0x94:      //SUB H
                case 0x95:      //SUB L
                case 0x96:      //SUB M
                case 0x97:      //SUB A
                        subtract();
                        break;
                case 0xa0:      //ANA B
                case 0xa1:      //ANA C
                case 0xa2:      //ANA D
                case 0xa3:      //ANA E
                case 0xa4:      //ANA H
                case 0xa5:      //ANA L
                case 0xa6:      //ANA M
                case 0xa7:      //ANA A
                        andd();
                        break;
                case 0xa8:      //XRA B
                case 0xa9:      //XRA C
                case 0xaa:      //XRA D
                case 0xab:      //XRA E
                case 0xac:      //XRA H
                case 0xad:      //XRA L
                case 0xae:      //XRA M
                case 0xaf:      //XRA A
                        xorr();
                        break;
                case 0xb0:      //ORA B
                case 0xb1:      //ORA C
                case 0xb2:      //ORA D
                case 0xb3:      //ORA E
                case 0xb4:      //ORA H
                case 0xb5:      //ORA L
                case 0xb6:      //ORA M
                case 0xb7:      //ORA A
                        orr();
                        break;
                case 0xb8:      //CMP B
                        break;
                case 0xb9:      //CMP C
                        break;
                case 0xba:      //CMP D
                        break;
                case 0xbb:      //CMP E
                        break;
                case 0xbc:      //CMP H
                        break;
                case 0xbd:      //CMP L
                        break;
                case 0xbe:      //CMP M
                        break;
                case 0xbf:      //CMP A
                        break;
                case 0xc6:      //ADI 8-bit
                        add();
                        break;
                case 0xcd:      //CALL 16-bit
                        break;
                case 0xce:      //ACI 8-bit
                        break;
                case 0xd6:      //SUB 8-bit
                        subtract();
                        break;
                case 0xdc:      //CC 16-bit
                        break;
                case 0xe6:      //ANI 8-bit
                        andd();
                        break;
                case 0xee:
                        xorr();
                        break;
                case 0xf6:
                        orr();
                        break;
                case 0xfc:      //CM 16-bit
                        break;
                default:
                        printf("Error %x is not an 8085 instruction\n", instructreg);
        }
}


Week 10 Journal Entry

CSIT1320 HPC Fundamentals
As part of the HPC cluster, we used a network file system to share resources across the cluster.
We installed the nfs server on VM03,a virtual machine, and on all of the machines in the cluster.
On the nfs server(vm03 in this case) perform the following steps:

  - Log into the virtual machine as root
  - aptitude intstall nfs-kernel-server
  - mkdir /export/home
  - reboot the vm using the reboot command
  - Log into the vm
  - edit the file /etc/exports; add line: /export/home 10.80.3.0/24(rw, synch, fsid=0, crossmnt, no_subtree_check)
  - exportfs -rva

On each of the machines in the cluster perform the following steps:

  - Log into a machine as root
  - aptitude install nfs-common
  - reboot the machine using the reboot command
  - Log into the machine
  - mount -t nfs vm02:/export/home /home

I have completed my six required projects for the HPC Fundamentals course:

  1. Linux install
  2. VM Server
  3. Virtual machine
  4. Video Wall
  5. Web Server installation
  6. HPC cluster


CSIT2048 HPC Experience II
Last week, I wrote cgi applications in C that would write and read the parallel port using HTTP from as remote computer. I was able to return a web page with the status of pin 15, an status input pin on the parallel port. The next step is to use an Arduino microcontroller to read and write both analog and digital IO through a virtual serial port using USB. I successfully installed the Arduino IDE so that I could use the Arduino Duemilanove to perform both digital and analog I/O operations. The purpose of being able to perform these operations is to monitor and control the hydroponics hardware.
I started the Arduino install by following the instructions on the following Web page: http://arduino.cc/playground/Linux/Debian\\. On this page, I followed the “previous non-packaged approach:” section of the installation instructions.

bob@dhcp-179:~$ sudo apt-get install openjdk-6-jre gcc-avr avr-libc avrdude

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for bob: 
bob is not in the sudoers file.  This incident will be reported.
bob@dhcp-179:~$ su
Password: 
root@dhcp-179:/home/bob# sudo apt-get install openjdk-6-jre gcc-avr avr-libc avrdude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils-avr ca-certificates-java icedtea-6-jre-cacao java-common
  libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre-headless
  openjdk-6-jre-lib tzdata-java
Suggested packages:
  avrdude-doc task-c-devel gcc-doc gcc-4.2 default-jre equivs icedtea6-plugin
  sun-java6-fonts ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-sazanami-gothic
  ttf-kochi-gothic ttf-sazanami-mincho ttf-kochi-mincho ttf-wqy-microhei
  ttf-wqy-zenhei ttf-indic-fonts
The following NEW packages will be installed:
  avr-libc avrdude binutils-avr ca-certificates-java gcc-avr
  icedtea-6-jre-cacao java-common libaccess-bridge-java
  libaccess-bridge-java-jni openjdk-6-jre openjdk-6-jre-headless
  openjdk-6-jre-lib tzdata-java
0 upgraded, 13 newly installed, 0 to remove and 12 not upgraded.
Need to get 49.7 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://debian.uchicago.edu/debian/ squeeze/main java-common all 0.40 [64.3 kB]
Get:2 http://security.debian.org/ squeeze/updates/main openjdk-6-jre-lib all 6b18-1.8.3-2+squeeze1 [5,953 kB]
Get:3 http://debian.uchicago.edu/debian/ squeeze/main ca-certificates-java all 20100412 [101 kB]
Get:4 http://debian.uchicago.edu/debian/ squeeze/main tzdata-java all 2011c-0squeeze1 [153 kB]
Get:5 http://debian.uchicago.edu/debian/ squeeze/main libaccess-bridge-java-jni i386 1.26.2-5 [27.6 kB]
Get:6 http://debian.uchicago.edu/debian/ squeeze/main libaccess-bridge-java all 1.26.2-5 [429 kB]
Get:7 http://debian.uchicago.edu/debian/ squeeze/main binutils-avr i386 2.20.1-1 [4,256 kB]
Get:8 http://debian.uchicago.edu/debian/ squeeze/main gcc-avr i386 1:4.3.5-1 [5,394 kB]
Get:9 http://security.debian.org/ squeeze/updates/main openjdk-6-jre-headless i386 6b18-1.8.3-2+squeeze1 [27.3 MB]
Get:10 http://debian.uchicago.edu/debian/ squeeze/main avr-libc all 1:1.6.8-2 [5,304 kB]
Get:11 http://debian.uchicago.edu/debian/ squeeze/main avrdude i386 5.10-3 [198 kB]
Get:12 http://security.debian.org/ squeeze/updates/main openjdk-6-jre i386 6b18-1.8.3-2+squeeze1 [254 kB]
Get:13 http://security.debian.org/ squeeze/updates/main icedtea-6-jre-cacao i386 6b18-1.8.3-2+squeeze1 [345 kB]
Fetched 49.7 MB in 2min 4s (400 kB/s)                                          
Selecting previously deselected package java-common.
(Reading database ... 128528 files and directories currently installed.)
Unpacking java-common (from .../java-common_0.40_all.deb) ...
Selecting previously deselected package openjdk-6-jre-lib.
Unpacking openjdk-6-jre-lib (from .../openjdk-6-jre-lib_6b18-1.8.3-2+squeeze1_all.deb) ...
Selecting previously deselected package ca-certificates-java.
Unpacking ca-certificates-java (from .../ca-certificates-java_20100412_all.deb) ...
Selecting previously deselected package tzdata-java.
Unpacking tzdata-java (from .../tzdata-java_2011c-0squeeze1_all.deb) ...
Selecting previously deselected package openjdk-6-jre-headless.
Unpacking openjdk-6-jre-headless (from .../openjdk-6-jre-headless_6b18-1.8.3-2+squeeze1_i386.deb) ...
Selecting previously deselected package libaccess-bridge-java-jni.
Unpacking libaccess-bridge-java-jni (from .../libaccess-bridge-java-jni_1.26.2-5_i386.deb) ...
Selecting previously deselected package openjdk-6-jre.
Unpacking openjdk-6-jre (from .../openjdk-6-jre_6b18-1.8.3-2+squeeze1_i386.deb) ...
Selecting previously deselected package libaccess-bridge-java.
Unpacking libaccess-bridge-java (from .../libaccess-bridge-java_1.26.2-5_all.deb) ...
Selecting previously deselected package binutils-avr.
Unpacking binutils-avr (from .../binutils-avr_2.20.1-1_i386.deb) ...
Selecting previously deselected package gcc-avr.
Unpacking gcc-avr (from .../gcc-avr_1%3a4.3.5-1_i386.deb) ...
Selecting previously deselected package avr-libc.
Unpacking avr-libc (from .../avr-libc_1%3a1.6.8-2_all.deb) ...
Selecting previously deselected package avrdude.
Unpacking avrdude (from .../avrdude_5.10-3_i386.deb) ...
Selecting previously deselected package icedtea-6-jre-cacao.
Unpacking icedtea-6-jre-cacao (from .../icedtea-6-jre-cacao_6b18-1.8.3-2+squeeze1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for menu ...
Processing triggers for hicolor-icon-theme ...
Setting up java-common (0.40) ...
Setting up tzdata-java (2011c-0squeeze1) ...
Setting up binutils-avr (2.20.1-1) ...
Setting up gcc-avr (1:4.3.5-1) ...
Setting up avr-libc (1:1.6.8-2) ...
Setting up avrdude (5.10-3) ...
Setting up openjdk-6-jre-lib (6b18-1.8.3-2+squeeze1) ...
Setting up openjdk-6-jre-headless (6b18-1.8.3-2+squeeze1) ...
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/java to provide /usr/bin/java (java) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode.
Setting up libaccess-bridge-java (1.26.2-5) ...
Setting up libaccess-bridge-java-jni (1.26.2-5) ...
Setting up icedtea-6-jre-cacao (6b18-1.8.3-2+squeeze1) ...
Setting up ca-certificates-java (20100412) ...
creating /etc/ssl/certs/java/cacerts...
done.
Setting up openjdk-6-jre (6b18-1.8.3-2+squeeze1) ...
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/pluginappletviewer to provide /usr/bin/pluginappletviewer (pluginappletviewer) in auto mode.
update-alternatives: using /usr/lib/jvm/java-6-openjdk/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode.
Processing triggers for menu ...
root@dhcp-179:/home/bob# 

After performing these steps, I then installed the Arduino IDE software from the following Web page: http://www.arduino.cc/en/Main/Software .
On this page, I downloaded the Linux 32-bit version: http://arduino.googlecode.com/files/arduino-0022.tgz to the /home/bob/Download directory of my Linux Debian Squeeze box and then moved it to the Desktop directory. Next, I right-clicked on the file and selected “Extract here” from the pop-up menu. I navigated into the arduino-0022 directory and ran the arduino file by clicking on it. It ran. On the main menu I selected “Tools”. I noticed that the “Serial Port” sub-menu item was greyed out indicating that the application didn't recognized the serial port. Next, following the instructions on the Web page http://www.arduino.cc/playground/Learning/Linux, I logged in as the Super user and added both users, jr018429 and bob, to the tty group in the /etc/group file. I then rebooted and opened the arduino application and checked the “Tools” main menu item. The “Serial Port” item was still greyed out. At the instructor's prompting and with the Arduino Duemilanove plugged into the USB port and power, I performed a long listing on the /dev/ttyUS[TAB COMPLETED] and found that ttyUSB0 was a member of dialout:

bob@dhcp-179:~$ ls -l /dev/ttyUSB0 
crw-rw---- 1 root dialout 188, 0 Apr  7 10:27 /dev/ttyUSB0

I then logged in as the super-user and added both users, jr018429 and bob, to the dialout group in the /etc/group file. I then rebooted and opened the arduino application located in the /home/bob/Desktop/arduino-0022 directory and selected the “Tools” menu item and noticed that the 'Serial Port“ sub-menu item was no longer greyed out. I then selected the Serial Port item and noticed that the Arduino application now recognizes the /dev/ttyUSB0 and /dev/ttyS0 devices-success!!!! The next step is to write an application to set up the Arduino Duemilanove to perform digital and analog I/O.

CSCS2650 Computer Organization
I fixed the bug which resulted in the parity flag not being set when an instruction which affects the parity flag causes a result of zero. In such a case, the parity flag should be set.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0x02
Enter Temporary Register value
0x01
Result is 0x03
Flag Register = 0x04
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0xff
Enter Temporary Register value
0xff
Result is 0x00
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$ cd ..
lab46:~/src/cpu/8085$ cd ..
lab46:~/src/cpu$ svn commit -m "Fixed the parity when result is zero issue -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Transmitting file data .
Committed revision 285.
lab46:~/src/cpu$

I added the complement carry instruction to the ALU API.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0xff
Enter Temporary Register value
0x01
Result is 0x00
Flag Register = 0x55
Sign flag is 0
Carry flag is 1
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x3f
Enter Accumulator value
0xff
Enter Temporary Register value
0x01
Result is 0xff
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x3f
Enter Accumulator value
0xff
Enter Temporary Register value
0x01
Result is 0xff
Flag Register = 0x55
Sign flag is 0
Carry flag is 1
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$ cd ..
lab46:~/src/cpu/8085$ cd ..
lab46:~/src/cpu$ svn commit -m "Added the complement carry instruction to the ALU API -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 286.
lab46:~/src/cpu$

Week 11 Journal Entry

CSIT1320 HPC Fundamentals
Last week, I completed my six required projects for the HPC Fundamentals course:

  1. Linux install
  2. VM Server
  3. Virtual machine
  4. Video Wall
  5. Web Server installation
  6. HPC cluster


CSIT2048 HPC Experience II
Last week, I successfully installed the Arduino IDE on the PC I am using to develop Arduino and C applications that will be used to monitor and control the hydroponics garden. This week, I connected my Arduino Duemilanove board at the USB port on the front of the computer. I then compiled and loaded the following Arduino source code; I found it at: http://arduino.cc/en/Tutorial/ASCIITable

/*
  ASCII table

 Prints out byte values in all possible formats:
 * as raw binary values
 * as ASCII-encoded decimal, hex, octal, and binary values

 For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII

 The circuit:  No external hardware needed.

 created 2006
 by Nicholas Zambetti
 modified 18 Jan 2009
 by Tom Igoe

 This example code is in the public domain.

 <http://www.zambetti.com>

 */
void setup()
{
  Serial.begin(9600);

  // prints title with ending line break
  Serial.println("ASCII Table ~ Character Map");
}

// first visible ASCIIcharacter '!' is number 33:
int thisByte = 33;
// you can also write ASCII characters in single quotes.
// for example. '!' is the same as 33, so you could also use this:
//int thisByte = '!';

void loop()
{
  // prints value unaltered, i.e. the raw binary version of the
  // byte. The serial monitor interprets all bytes as
  // ASCII, so 33, the first number,  will show up as '!'
  Serial.write(thisByte);

  Serial.print(", dec: ");
  // prints value as string as an ASCII-encoded decimal (base 10).
  // Decimal is the  default format for Serial.print() and Serial.println(),
  // so no modifier is needed:
  Serial.print(thisByte);
  // But you can declare the modifier for decimal if you want to.
  //this also works if you uncomment it:

  // Serial.print(thisByte, DEC);


  Serial.print(", hex: ");
  // prints value as string in hexadecimal (base 16):
  Serial.print(thisByte, HEX);

  Serial.print(", oct: ");
  // prints value as string in octal (base 8);
  Serial.print(thisByte, OCT);

  Serial.print(", bin: ");
  // prints value as string in binary (base 2)
  // also prints ending line break:
  Serial.println(thisByte, BIN);

  // if printed last visible character '~' or 126, stop:
  if(thisByte == 126) {     // you could also use if (thisByte == '~') {
    // This loop loops forever and does nothing
    while(true) {
      continue;
    }
  }
  // go on to the next character
  thisByte++;
}

I wanted to develop a CGI application in C with which to talk to the Arduino. I found the following code at: http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/.

Arduino-serial: C code to talk to Arduino

The Arduino’s USB port is actually a serial port in disguise. To your computer it appears as a ‘virtual’ serial port. This is good news if you want to write custom code on your computer to talk with the Arduino, as talking to serial ports is a well-solved problem. (Unfortunately, so well-solved that there’s many ways of solving it.)

On the Arduino forum there’s been a few requests for some example C code of how to talk to Arduino. The nice thing about standard POSIX C code is that it works on every computer (Mac/Linux/PC) and doesn’t require any extra libraries (like what Java and Python need). The bad thing about C is that it can be pretty incomprehensible.

Here is arduino-serial.c, a command-line C program that shows how to send data to and receive data from an Arduino board. It attempts to be as simple as possible while being complete enough in the port configuration to let you send and receive arbitrary binary data, not just ASCII. It’s not a great example of C coding, but from it you should be able to glean enough tricks to write your own stuff.
Usage


laptop% gcc -o arduino-serial arduino-serial.c
laptop% ./arduino-serial
Usage: arduino-serial -p <serialport> [OPTIONS]

Options:
-h, --help Print this help message
-p, --port=serialport Serial port Arduino is on
-b, --baud=baudrate Baudrate (bps) of Arduino
-s, --send=data Send data to Arduino
-r, --receive Receive data from Arduino & print it out
-n --num=num Send a number as a single byte
-d --delay=millis Delay for specified milliseconds

Note: Order is important. Set '-b' before doing '-p'.
Used to make series of actions: '-d 2000 -s hello -d 100 -r'
means 'wait 2secs, send 'hello', wait 100msec, get reply'
Example Use

Send the single ASCII character “6″ to Arduino

laptop% ./arduino-serial -b 9600 -p /dev/tty.usbserial -s 6

This would cause the Arduino to blink 6 times if you’re using the serial_read_blink.pde sketch from Spooky Arduino.

Send the string “furby” to Arduino

laptop% ./arduino-serial -b 9600 -p /dev/cu.usbserial -s furby

Receive data from Arduino

laptop% ./arduino-serial -b 9600 -p /dev/cu.usbserial -r
read: 15 Hello world!

The output is what you would expect if you were running the serial_hello_world.pde sketch from Spooky Arduino.

Send ASCII string “get” to Arduino and receive result

laptop% ./arduino-serial -b 9600 -p /dev/cu.usbserial -s get -r
read: d=0
Internals

There are three interesting functions that show how to implement talking to serial ports in C:

    * int serialport_init(const char* serialport, int baud)
      — given a serial port name and a speed, return a file descriptor to the open serial port.
    * int serialport_write(int fd, const char* str)
      – write out a string on the given a serial port file descriptor
    * int serialport_read_until(int fd, char* buf, char until)
      – read from serial port into a buffer until a given character is received

You can and should write improved versions of the read and write functions that better match your application.

Update 8 Dec 2006:
Justin McBride sent in a patch because it turns out Linux’s termios.h doesn’t define B14400 & B28800. I’ve updated arduino-serial.c to include the patch, but commented out for now. No one uses those baudrates much anyway. :) If you need them, uncomment the additions out, or better yet, download Justin’s tarball that includes the changes and a Makefile to auto-detect your platform.

Update 26 Dec 2007:
Added ability to sent binary bytes with the ‘-n’ flag.
Added a delay option so you can open a port, wait a bit, then send data. This is useful when using an Arduino Diecimila which resets on serial port open.



125 comments to Arduino-serial: C code to talk to Arduino
1 2 3 ... 7 Newer Comments »

    *
      xSmurf
      December 7th, 2006 at 10:31 am

      Obviously you could also use “screen” to communicate with the Arduino (or any serial device) using the following command:

      screen /dev/cu.usbserial 9600

      screen is bidirectional, so you can send and receive data.
    *
      todbot
      December 7th, 2006 at 10:49 am

      Yup, totally.

      I’ve only ever used screen in interactive sessions. I’m not sure how one would go about routing screen to a proram or sending binary (non-ASCII) data that is present in many Arduino designs.
    *
      Mike
      December 7th, 2006 at 2:26 pm

      I haven’t tried it, but there’s probably some way to have the “expect” command interact with screen as a simple way to get data back and forth from the Arduino in a semi-automated way. However, this is going down the territory of “many ways to solve the same problem” territory Tod mentioned.
    *
      Greg
      December 9th, 2006 at 4:58 pm

      If you do want to do this using a dynamic language, the ruby/serialport library makes it really easy in Ruby. I just put up some video and instructions for a hello world.

      Todbot — Thanks for all your great posts on Arduino (especially the Spooky Arduino series), I’m in the process of learning this stuff with a little study group of other absolute beginners and they’re been totally indespensible. Keep up the great work!
    *
      todbot
      December 9th, 2006 at 5:27 pm

      Thanks, I’m glad people are finding the Spooky Arduino stuff useful. It was a blast to work on.

      And, wow, Ruby can do serial ports now? That’s awesome. Okay I gotta try this out….[follows your link, watches the rad movie, looks a bit more, then 2 minutes later] Yup, works like a charm. I did:

      % wget http://rubyforge.org/frs/download.php/72/ruby-serialport-0.6.tar.gz
      % tar xvzf ruby-serialport-0.6.tar.gz
      % cd ruby-serialport-0.6
      % ruby extconf.rb
      % make
      % sudo make install
      % emacs light.rb
      % ruby light.rb

      With Ruby and its friendliness towards Ajax websites and the ability to do serial ports, I can imagine some really interesting “Web2.0″-type websites that interact with the real world via Arduino.
    *
      Jose
      January 8th, 2007 at 2:59 pm

      Very useful code, thanks!

      However, I’ve found that -under FC6-, sometimes the seriaport_read_until returns a error 11 (resource temporarilly unavailable) in the read() call. I think it is not a problem with the software -obviously- since a “cat
    *
      Peter
      January 11th, 2007 at 4:48 am

      I’m trying to get the hello world program to work I’ve downloaded the modifed Justin Mcbride file (I’m using linux) compiled and ran
      ./arduino-serial -b 9600 -p /dev/ttyUSB0 -r

      the output is then read
      read:

      My port is on ttyUSB0 any clues?
    *
      Peter
      January 11th, 2007 at 4:53 am

      After some experimentation it does return hello world I just need to catch it at the right time.
    *
      Jose
      January 30th, 2007 at 9:27 am

      Hi Todbot,

      Great site, I’m loving all the Arduino content. I’m new to Arduino and I’m trying to understand a few things. In the ruby example at ComputerKraft, they have 2 files – the sketch that’s written in Processing and the light.rb file. Do you need to write a sketch in Processing when you want to use ruby? Is it possible to write a ruby script that does what the Processing sketch does? I would like to be able to just write the code once in Ruby. And last, but not least, can you do an Arduino – Ruby example as you did with C?

      Thanks for all the great content!

      Jose
    *
      todbot
      January 30th, 2007 at 11:37 am

      Hi Jose,
      I’m not familiar with the Ruby example at ComputerKraft so I can’t speak to it. However, you don’t need Processing for Arduino or Ruby. Processing is just one way of writing programs (in this case, Java programs) that can talk to serial ports and thus Arduino. Because Processing is so easy to use and it shares the same style GUI as the Arduino programmer, it is a common tool for showing how you can interface Arduino with a computer.

      Perhaps what the ComputerKraft example is doing is creating a Processing sketch that receives network requests then forwards them on to Arduino. The Ruby program then just connects to a network socket and doesn’t need to have serial port drivers.
    *
      Jose
      February 2nd, 2007 at 6:46 pm

      In the example at ComputerKraft there’s an Arduino sketch, not Processing – sorry… that receives serial requests. In essence, it is nothing more than a case function that when selected turns on the corresponding LED. The Ruby program basically takes input from the user, parses it and forwards it over to the Arduino sketch via serial.

      What I’m trying to understand is this: In order to use Ruby or any other language to speak to Arduino via serial, do I need to have an Arduino sketch already running in Arduino expecting serial requests?
    *
      Void Main
      February 13th, 2007 at 7:38 pm

      minicom is another great way to read/write to the arduino. I have the USB model and just set my minicom serial port to /dev/ttyUSB0. Works great in Fedora Core 6.
    *
      Daily Clerks
      February 18th, 2007 at 12:17 pm

      [...] Here is arduino-serial.c, a command-line C program that shows how to send data to and receive data from an Arduino board. It attempts to be as simple as possible while being complete enough in the port configuration to let you send and receive arbitrary binary data, not just ASCII. It’s not a great example of C coding, but from it you should be able to glean enough tricks to write your own stuff.” – Link. [...]
    *
      Javi
      March 2nd, 2007 at 1:44 am

      Hi everybody,

      I am introducing in this new world called Arduino, here is my problem:

      I have my arduino working and I can receive data from it using:

      tail -f /dev/ttyUSB0 >> “file.txt”

      After trying with the arduino_serial.c, I was not sucesfull, I guess I have the same problem that Peter had.

      Using “tail” would be enough for me since I only want to receive data from it. But when I say to arduino to work at baudrates higher than 9600. “tail” is not giving the right data (Strange symbols).

      My question is do you know how to set the baudrate in order to use “tail” with higher baudrates?

      Anyidea will be wellcome!
    *
      todbot
      March 2nd, 2007 at 1:53 am

      Hi Javi,

      To change the baudrate of serial ports, you use the “stty” command before your tail.

      If you see the “roomba-tilt.pl” program on the Roomba Tilt project, you’ll see a complete invocation of stty that allows full bidirectional binary transmission.

      But if all you need to do is change the speed, then:

      % stty -F /dev/ttyUSB0 57600

      is all you need to change the baudrate to 57600 bps.
    *
      leah
      March 17th, 2007 at 5:53 am

      hi there,
      i’m sorry if you cover this elsewhere, but i am just getting started in trying to program in C for the avr… do you have any recommendations on resources? just looking start with a simple blinkie code so i can figure it all out. i would really appreciate it. thank you!
    *
      todbot
      March 20th, 2007 at 9:07 am

      Hi Leah,
      One of the easiest ways to get into C AVR programming is the Arduino site itself: the Tutorials, Reference, Hacking, and Playground sections are chock full of good intro material.

      If you’re interested in plain vanilla AVR programming without the thin veneer of Arduino, one of the best books out there to get started is the “C Programming for Microcontrollers” available from SmileyMicros.com. It’s based around the Atmel AVR Butterly board, a tiny $20 demo board that’s a lot of fun to play with.

      Once you get a bit familiar with AVR C, you’ll want to bookmark the AVR Libc page. Libc is the collection of C libraries that is the “standard” set of libraries containing all the functions you’re used to in C. In the case of AVR Libc, it’s also the libraries that help you interact with the on-chip hardware.
    *
      Ian
      April 28th, 2007 at 5:02 am

      I can’t get open() to work, it keeps telling me the file does not exist. I can open the serial stream just fine with ‘screen’ from the terminal, but this damn open() just returns an error. Any ideas?
    *
      todbot
      April 28th, 2007 at 7:54 am

      That’s really odd. What’s the exact invocation you’re using and the exact error messages you’re seeing? If this is Linux, I’d say it’s a permission problem with the serial port device file and screen gets around it by being setuid root.
    *
      Ian
      April 28th, 2007 at 4:20 pm

      its Mac OsX Tiger, under the terminal.

      I managed to access properly from my c code by using sudo

      sudo ln -s /dev/tty.usbserial-* /dev/tty.arduino

      although I havent read exactly what that does but im using the alias to access it and it works.

      my original serial path was /dev/tty.usbserial-A10?16fZ

      I’m guessing my c code just hated that ? mark.


125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 2 3 4 ... 7 Newer Comments »

    *
      todbot
      April 28th, 2007 at 5:15 pm

      That’s very strange. I’ve never seen a USB-to-serial driver create a virtual serial port that wasn’t just alphanumeric. Creating a symlink to a more reasonable name like you did is probably the best solution.

      Aside: A symlink (“symbolic link”) is the unix way of doing aliases. The “ln -s” command creates symlinks. The “sudo” command lets you “do” things that normally a “su”per user (admin user) can only do. Creating symlink in the /dev directory is one of those things.

      Again, it’s very strange to have a question-mark in the serial port name. Are you running the latest serial drivers that come with Arduino? Has anyone on the Arduino forums had a similar problem?
    *
      Ian
      April 29th, 2007 at 3:29 am

      how would I got about upgrading the serial drivers?
    *
      todbot
      April 29th, 2007 at 6:29 am

      Download the latest version of the Arduino software. Inside there is a directory called “drivers” containing driver installers.
    *
      Ian
      April 29th, 2007 at 12:37 pm

      ah, this is a new installation already… so maybe a way to change my arduino’s serial number?
    *
      Mick Lionheart
      June 25th, 2007 at 4:14 pm

      I think /dev/tty.usbserial-A10?16fZ works from the command line beacuse bash interprets ? as a wildcard (whereas C doesn’t), so the ? is a typo (kinda like how /dev/tty.usbserial-A10*16fZ works)
    *
      klaus
      December 26th, 2007 at 2:40 am

      Hi Tod great site. I’m new with arduino and C.
      I need that the programm send binary not ascii e..g -s 65 = a and not 65. How can I change the arduino-serial.c ?
      Thanks sorry for my english I hop you understand my Question
      Klaus Germany Berlin
    *
      todbot
      December 26th, 2007 at 1:09 pm

      Hi Klaus,
      To send the byte value 65 instead of the character ‘a’ (ascii 65), you need to do an ascii-to-integer conversion. There’s a function called “atoi()” in C that does this. There’s a more general function called “strtol()” (“string to long”) that will even parse decimal, hex, and other number formats.

      I’ve updated the arduino-serial.c program above to do this with a new option ‘-n ‘.

      To use it you would do something like this:

      % arduino-serial -b 19200 -p /dev/USBS0 -d 2000 -n 65 -r

      This will open up serial port “/dev/USBS0″ at 19200 bps, wait for 2 seconds, then send the number 65 and read back any response terminated by a newline.
    *
      Klaus
      December 27th, 2007 at 2:59 am

      Hi Tod, that’s great – I’m so thankfull! I use it to write on an LCd Screen (4 lines 40 Col) and so I can send the bytes to control it.
      best wishes and an hapy new year
      Klaus
    *
      CMD-c && CMD-v » Python based Arduino serial utility
      January 10th, 2008 at 12:57 pm

      [...] was looking at this link on the todbot blog. It is a utility C program that sends some serial data to your Arduino. I [...]
    *
      Neuromancer
      January 27th, 2008 at 1:37 pm

      I am trying to write a c program that logs the data from the serial port then saves it to a file.

      I have been having some trouble reading the data from the port. The port seems to be set up correctly( I get a 3 back) but when I try a read I get a -1.

      Arduino monitor and cutecom can read the arduino just fine.

      thanks
    *
      Neuromancer
      January 30th, 2008 at 9:33 pm

      Ok I got some output by removing the O_NDELAY from the open.
      The problem now is the data seems to be garbage.

      Any thoughts?

      Thanks
    *
      todbot
      January 30th, 2008 at 9:58 pm

      I don’t think removing O_NDELAY on serial port open() will affect your issues. But it will probably make it so some of your reads() never time out (I’ve not checked this with serial ports)

      Does the arduino-serial.c program read data correctly for you? (it will print to the stdout, but it’s easy to change that to print to a file)

      The fact that you’re reading garbage means either you’re at the wrong baudrate, wrong number of stopbits, or you’re not checking the return value from read() to see how many bytes were actually read.
    *
      plastik
      February 4th, 2008 at 1:48 am

      Arduino features an FTDI chip to do serial communication with an USB host, but of course this limits us to use the FTDI driver, and thus forces us to install drivers and limits us to our own software. Since the USB spec does not allow bulk endpoints for low speed devices, it’s always possible that a new version of e.g. Windows does not allow them.
    *
      John Wiseman
      February 7th, 2008 at 8:38 pm

      Here’s a Python version of arduino-serial.c:
      http://lemonodor.com/archives/2008/02/arduino_serial.html
    *
      Roland Latour
      February 12th, 2008 at 3:27 pm

      I have succeeded in my project to use Diecimila
      with SimpleMessageSystem & linux, via shell scripts.
      Run this now: ‘wget http://207.14.167.161/SMS1.tgz‘
      It only works when my system is booted, so keep trying. Finally got the right data format from readAD-1: Comma-separated values. This imports to OpenOffice calc easily, for further analysis or graphing. Try it.
    *
      Christopher Lund
      February 17th, 2008 at 10:05 pm

      A little off topic, as this is more of a c question.

      I am Very new to all of this, so please pardon what is probably a stupid question;

      In your C code, you are parsing out the options sent to the app with a while statement.

      Why do you have a ‘while(1) { }’ Isn’t that true by default?

      and, how is this able to parse all options?

      any illumination on this is greatly appreciated….

      Thanks!

      Christopher Lund
    *
      todbot
      February 18th, 2008 at 8:38 pm

      Hi Christopher,
      Your questions aren’t stupid. In fact they get some of the less clear aspects of how people typically write C code.

      The while(1){ } block is used to wrap the call to getopt_long(). Each time that function is called, it parses another chunk of the command line argument string. So the while(1){ } says “keep parsing forever”. But there is a if (opt==-1) break; that will break out of that while loop if there are no more arguments to parse.

      Structuring the code this way is a way you’ll see some simple C programs written where it implies that program’s functionality is simple and controlled entirely via command-line arguments. That is, the style of the source code implies the intended use of the program. You’ll find this kind of philosophy in a lot of C code. There’s so many ways to do the same thing in C that people adopt “idioms” in how they code to hint at what they’re trying to do. I just copied it from some other code I had. :)
    *
      Ed Davies
      February 19th, 2008 at 6:41 am

      Another common idiom for loops which are either “infinite” or broken out of in the middle is “for(;;) { … }”. This has the advantage of having the control conditions be explicitly empty – you don’t have to look twice to check if the “1″ is a lower case letter L, for example.
    *
      Estetik
      March 1st, 2008 at 7:58 pm

      This works great in Fedora Core 6.
    *
      Jason
      March 19th, 2008 at 11:32 am

      How would implement this in Visual Studio .NET 2005 ?
      The POSIX libraries are not supported.


125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 2 3 4 5 ... 7 Newer Comments »

    *
      todbot
      March 19th, 2008 at 1:23 pm

      Hi Jason, Sorry, no clue, I don’t use Windows; I thought that it had the POSIX libraries. I seem to recall seeing a Visual Basic serial port library a while back, perhaps generally usable in .NET. Try googling around for “VB serial library” or similar.
    *
      harohase
      April 1st, 2008 at 5:07 am

      hi there
      will all this things work with geexbox too?
      can i implement a package to the geexbox iso to get it working?
    *
      Casper
      April 1st, 2008 at 1:34 pm

      Hey Todd. Im basically trying to read my arduino from my /dev/ttyUSB0 (which works fine with screen). I found out that it exits in the serialport_read_until() with -1 (can’t read). I find this a bit strange since my arduino is just spamming the serial, so there should be something. Any ideas? (btw the baudrate is right so its not that.)
    *
      todbot
      April 1st, 2008 at 5:11 pm

      Hi harohase,
      I’m not familiar with geexbox, but it looks like Linux, so I don’t see why you couldn’t make an arduino-serial package for it.
    *
      todbot
      April 1st, 2008 at 5:13 pm

      Hi Casper,
      I must admit the serialport_read_until() function is the least polished part of arduino-serial. So there might be a logic problem.

      However, if you’re using an Arduino Diecimila or similar newer Arduino, you may be trying to read while the board is in reset, since on Mac OS X & Linux, opening the serial port resets the Arduino.

      To deal with this, insert at least a 2-second delay before reading. Here’s an example that inserts a 5-second delay between opening the open and reading:

      % ./arduino-serial -b 9600 -p /dev/ttyUSB0 -d 5000 -r

    *
      batoub
      April 2nd, 2008 at 11:58 pm

      Hi everybody !

      I have a strange problem.
      The program is working when I have just upload the program to the arduino (with the arduino software), it’s working working very well.

      But If I reboot, I try to configure the TTYUSO with this :
      stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts

      I try to launch the program : not working :/

      I launch screen : screen /dev/ttyUSB0 9600

      I stop screen, launch the program : it’s working.

      What’s wrong with my configuration ??
    *
      todbot
      April 3rd, 2008 at 1:29 am

      Hi Batoub,
      What is the exact arduino-serial command you’re using? Are you trying to read data? If so, be sure to have at least a 2-second delay (see my previous comment) to deal with the Arduino’s reset.

      It may be that screen is opening the serial port but not closing it, so by the time arduino-serial is used, it’s past the reset delay.
    *
      pat
      May 16th, 2008 at 7:30 am

      hi todbot
      very great program :) thanx alot. i’ve wrote a little bash script for reading some strings from arduino a starting some progs… every thing works fine. the only problem is, that “top” shows a big cpu capacity… has you or somebody an idea?

      here is the script:
      http://de.wikiants.org/Arduino-serial#Bash_Script_.7C_Kommunikation_mit_Linux
    *
      todbot
      May 16th, 2008 at 10:17 am

      Hi Pat,

      That’s a great page, a better writeup than this one I think. :)

      I think the reason why you’re seeing a lot of CPU usage for your script is that it’s spawning and killing processes as fast as possible, which is a fairly big task for an OS. Also, each time you run the arduino-serial program, it opens & closes the serial port (another potential heavyweight operation) which has the effect of resetting the newer Arduinos that have auto-upload circuitry.

      You’ll probably have better luck for your application by either incorporating the arduno-serial code into another C program that does the logic your script does, or to use a scripting language like Python or Perl, which has both serial support and is a good scripting language. See some of the above comments for how to do ‘arduino-serial’ in Python.
    *
      rutro
      June 3rd, 2008 at 1:56 pm

      Hello Todbot.

      Oddly, whenever I send things using -s it seems to reset my Arduino board. It works fine, however, when I have serial monitor mode enabled in Arduino IDE. When I have this enabled /bin/stty’s output changes as well, leading me to think arduino-serial is not setting some things, or there are problems with using it in OS X…

      With serial monitor enabled:
      speed 9600 baud;
      lflags: -icanon -isig -iexten -echo
      iflags: -icrnl -ixon -ixany -imaxbel -brkint inpck
      oflags: -opost -onlcr -oxtabs
      cflags: cs8 -parenb -hupcl clocal
      min time
      0 20

      Without:
      lflags: -icanon -isig -iexten -echo
      iflags: -icrnl -ixon -ixany -imaxbel -brkint
      oflags: -opost -onlcr -oxtabs
      cflags: cs8 -parenb

      Exact command used:
      ./arduino-serial -p /dev/tty.usbserial-A6004pba -n 6
    *
      todbot
      June 19th, 2008 at 2:35 pm

      Hi rutro,
      By design, the current Arduino’s will reset when the serial port is opened. See the “Automatic (Software) Reset” section of the Arduino Deicimila description. If you don’t want this automatic reset feature, you’ll have to hack your Arduino a bit. There’s some discussion in the forums on how to remove serial port reset.

      And normally one shouldn’t open up a serial port with more than one application. The results can be undefined.
    *
      chip
      July 4th, 2008 at 2:31 am

      This is the sort of thing i have been looking for but i want to be able to read key presses in real time so i can use key presses to control the arduino.

      Is there any way of doing this at all that anyone knows of?
    *
      ben
      July 11th, 2008 at 1:04 am

      Hi

      Can i use the –send-data to load an arduino sketch into the device without using the arduino GUI?

      Ben
    *
      todbot
      July 11th, 2008 at 8:38 am

      Hi Ben,
      No, you can’t. The bootloader protocol used to load sketches is pretty complex. Arduino actually uses the “avrdude” program to handle it. But you can load sketches from the command-line. Search around the Arduino forums and check out this page for how to do it:
      http://www.arduino.cc/en/Hacking/CommandLine
    *
      Roland Latour
      July 24th, 2008 at 5:45 pm

      My shell script package (mentioned above 2/12/08) has grown to include GUI scripts for IO & PWM control using Xdialog. It is also available 24/7 now, via ‘wget http://user.cavenet.com/rolandl/SMS1.tgz‘
      Please check it out, it’s a good source for fixing scripting problems as mentioned above.
    *
      John
      July 31st, 2008 at 1:02 pm

      Well I can say that this topic has been round and round, but I learned alot from all of it. Getting back to the communication part however, I have come up with a way to communicate bi-directional with any SW language via an Arduino log file as the output and the command line Arduino-serial as the input. Using the command “tail -f /dev/ttyUSB0 >> ArduinoLogFile” you can generate any output you desire from the command “serial.println()” into a log file. Using whatever SW you want you can call command-line Arduino-serial commands to send one char codes that the Arduino can respond to in any fashion you desire, including Arduino Log file entries.

      I know I have not outlined this clearly and with examples, but I just got it all working and thought I would share it. It is a hack, but it is the quickest way I could get the 2-way communication without writing much code. You can even create shares to the directories where the data is and share it over the network. It is a simple concept, but fairly powerful with little effort.

      If I get more time I will create an entire write up to publish.

      A big thanks!!!!!!!! to all you hackers that provided the base of information and code for me to accomplish this method.
    *
      John
      August 14th, 2008 at 1:48 pm

      Ok!, I got the time to document the Arduino Communcation through files, as described one post above. If anybody is interested, check out this webpage http://mrdoall.dnsalias.com/wiki/index.php/Arduino_Communications
    *
      ayman
      August 27th, 2008 at 7:32 pm

      Great little bit of code! I was unable to tail/screen the /dev/tty.usb* to see any of the data otherwise. Not sure why.

      Is this code under any sort of BSD/CC license? I’d like to post a modification I made so it will read forever (or until ^C) and do stuff. Writing the instructable now. Just wanna know if I can reuse this. :)
    *
      todbot
      August 27th, 2008 at 8:56 pm

      Hi ayman,
      Use the code however you like. No real license. I would like a link back if you publish it on the web. :)
    *
      ayman
      August 30th, 2008 at 1:43 pm

      Cool! You can check out the instructable (with your modified code) here:

      http://www.instructables.com/id/Mac_OS_Foot_Switch_from_a_Guitar_Amp_Pedal

      I added a -R flag to read forever and a little bit to exec applescripts based on what it reads.

      Thanks again for the great code sample.


125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 2 3 4 5 6 7 Newer Comments »

    *
      Andy
      August 31st, 2008 at 1:39 pm

      I wrote up a quick diff to clean up how nonstandard Bxxxxx macros are used — with this diff you can compile on any platform without having to edit the source, and all the baudrates supported by your platform will be supported by arduino-serial.

      htttp://web.hexapodia.org/~adi/arduino/fix-arduino-serial-baudrates.diff
    *
      todbot
      August 31st, 2008 at 1:51 pm

      Thanks Andy! That really cleans up that section. I’ve patched the arduino-serial.c file so others can easily use it.
    *
      Bug Blogger » Blog Archive » BUG says “Oh hai!” to Arduino
      October 3rd, 2008 at 2:40 pm

      [...] the VonHippel module, a simple c program compiled for the arm, BUG can talk to the Arduino (in the picture, the USB cable and USB to serial [...]
    *
      Chris
      October 7th, 2008 at 3:15 pm

      Awesome! Thanks for this, will prove very useful.

      I’m having trouble with it though. Using your example, I upload serial_read_blink.pde to the board and then use the command “./arduino-serial -b 9600 -p dev/tty.usbserial-A9003ZlI -d 1100 -s 6″

      This is just the command you gave with an added pause as I have an Arduino Diecimila. The LED blinks as soon as I send the command, and then again at the end of the command (after 1.1 seconds I assume). There are no 6 blinks.

      Any idea what the problem might be?
    *
      todbot
      October 7th, 2008 at 9:32 pm

      Hi Chris,

      What you’re seeing is that when arduino-serial opens the port, it resets the Arduino, which causes a small flash on the pin13 LED, then arduino-serial sends the string (“6″ in this case), and then before the Arduino can fully response, arduino-serial exits, closing the port which causes the Arduino to reset again.

      The solution to this is to add another “-d” delay after you send the string, so you can watch the Arduino do its thing:
      ./arduino-serial -b 9600 -p /dev/tty.usbserial -d 1100 -s 6 -d 2000

      The auto-reset feature of the Diecimila is great, but on Mac OS X & Linux, opening & closing the port always resets it.
    *
      Chris
      October 8th, 2008 at 11:08 am

      Thanks for the reply, but that doesn’t help. It just takes longer between the opening and closing flash of the LED.

      Any other ideas?
    *
      todbot
      October 8th, 2008 at 11:23 am

      hmm, that’s odd because the addition of the trailing delay does work for me. I assume you can get it to blink as you would expect when using the Arduino Serial Monitor?

      The other thing to try is to increase the first delay a bit, say to 2000.
    *
      Chris
      October 8th, 2008 at 12:07 pm

      Ahh great, thanks alot. Seems the minimum pause I can get mine to respond after is 1500, a bit more than the Arduino site’s recomended one second, oh well not too bad.

      Thanks very much!
    *
      seyret
      October 18th, 2008 at 3:28 am

      hi there,
      i’m sorry if you cover this elsewhere, but i am just getting started in trying to program in C for the avr… do you have any recommendations on resources? just looking start with a simple blinkie code so i can figure it all out. i would really appreciate it. thank you!
    *
      todbot
      October 18th, 2008 at 5:09 am

      The easiest is probably to get an Arduino. Its “language” is really C for AVR.
    *
      Nick W.
      October 18th, 2008 at 12:39 pm

      Hi Todbot,

      I am not new to Arduino, though I have some cobwebs to sjake off as it’s been over a year since we made a self-playing LP record player together. (sampled portions of record using 2 servos and simple pulley system, VERY COOL!)

      Anyways, I am a senior engineering student and for my senior design project I want to communicate data from a C++ program into Arduino and use the data to have Arduino control some hardware. Have you done anything like this? Any ideas how I could do this?

      Thanks in advance!
      :)
      p.s. keep up the great site!!
    *
      todbot
      October 18th, 2008 at 7:51 pm

      Hi Nick,
      You can use C code from within C++, so you should be able to take any C serial port code (like the arduino-serial stuff above) and use it in your C++ program that talks to Arduino.
    *
      oyun
      October 19th, 2008 at 1:27 am

      How would implement this in Visual Studio .NET 2005 ?
      The POSIX libraries are not supported.
    *
      Nick W.
      October 20th, 2008 at 2:22 pm

      I am confused how to use the code at the top. Such as sending Furby or 6 to Arduino.

      to send 6 it gave this (code?)

      laptop% ./arduino-serial -b 9600 -p /dev/tty.usbserial -s 6

      Would I want to write that into my C++ program word for word? I did this and was thrown errors, so not sure how to modify or use it. Thanks again for the help!
    *
      todbot
      October 20th, 2008 at 5:12 pm

      You would copy the functions in the arduino-serial source code into your C++ source file and call them from within the C++ file. But really what you should probably do, since you’re writing your own C++ code, is to Google around for “C++ serial port communication” for more native examples on how to communicate with serial ports with C++.
    *
      Nick W.
      October 26th, 2008 at 6:41 pm

      Hello again todbot,

      So I was making progress, or so I thought, because I was using windows xp installed on a Mac. This allowed me to use the termios.h etc. that was unavailable for windows. I tried to go back on my windows machine and it threw the same erorr:

      termios.h: No such file or directory.

      with a couple others(related). Any idea how (if?) I can somehow import this or get around it? thanks again very much
    *
      todbot
      October 26th, 2008 at 6:50 pm

      Hi Nick,
      Oh, you’re on Windows? Low-level things like serial ports are dealt with in very different ways than Unix-based OSs like Linux & Mac OS X. Most people doing serial port stuff on Windows use either Visual Basic (or .NET) or Java with the RXTX serial library. You’d likely be better off not using any of my ‘arduino-serial’ code above, as it assumes a Unix-like environment. Do a Google search for “windows serial port library” and you’ll find lots of tips.

      There are ways of getting full POSIX library support in Windows, but I think it’s complex to do if you’re not used to it.
    *
      Tom Morgan
      November 3rd, 2008 at 10:29 am

      Just so people know, I was able to get this working under windows with just a little bit of playing around. The only real catch is you have to get the full POSIX support from somewhere. Cygwin is free and what I used, and in the end all you have to do is throw a single dll into the folder that your program is in, and it works just fine. I don’t have the source file that compiles fine as I ended up merging it with another program (very messy) but it works fine. Do NOT give up, keep trying and it should fall into place.
    *
      kazalar
      January 12th, 2009 at 5:06 am

      Can i use the –send-data to load an arduino sketch into the device without using the arduino GUI?
    *
      victor
      January 12th, 2009 at 9:21 am

      hello, I have a problem with the sensor sht. My question is worth the program sht75 applied to sht15?
      thanks

125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 ... 3 4 5 6 7 Newer Comments »

    *
      todbot
      January 12th, 2009 at 10:21 am

      Hi kazalar,
      Not really, but the Arduino guys have info on how to program the Arduino from the command-line. See here:
      http://arduino.cc/en/Hacking/CommandLine
    *
      Nick W.
      January 15th, 2009 at 11:26 am

      Tom Morgan AND Todbot:

      I downloaded Cygwin but I do not understand what you did to get the dll file in that folder. Step by step maybe?

      I am on this path again because I worked for a long time using other methods for windows which were unsuccessful but this code above works fine in posix machines
    *
      Bruce
      February 19th, 2009 at 3:23 pm

      Todd,

      The mailman just brought my new Duemilanove, and my first download was “blink”, of course.

      I was looking for something else to try quick, and found your serial_read_blink.

      I just used hyperterm. After seeing “Blink!”

      I tried changing:
      Serial.println(“blink!”);
      to Serial.println(i); to see it count up, then
      Serial.println(val-i) to see it count down.

      Thanks for these examples!
    *
      Stan
      March 17th, 2009 at 5:37 am

      Hi,

      I use the following command in linux to read my arduino board.
      “cat < /dev/ttyUSB0″
      and
      “cat filename” to capture the output to a file.

      Regards Stan
    *
      Jack
      April 26th, 2009 at 11:40 am

      Hello,

      i have this in my .pde (with Arduino) and send this to my microcontroler :

      …
      void loop()
      {
      if (Serial.available() > 0) {
      intervalid = Serial.read();
      if (intervalid==2) {
      intervaldiffuse=Serial.read();
      intervaldiffuse=(intervaldiffuse-3)*60;
      }
      if (intervalid==1) {
      intervalstop=Serial.read();
      intervalstop=(intervalstop-3)*60;
      }
      }

      if (value == LOW) {
      if (millis() – previousMillis > intervalstop) {
      previousMillis = millis();
      value = HIGH;
      }
      }
      if (value == HIGH) {
      if (millis() – previousMillis > intervaldiffuse) {
      previousMillis = millis();
      value = LOW;
      }
      }
      digitalWrite(ledPin, value);
      }
      …

      So, sending something like this with Terminal (MacOSX) :
      arduino-serial -b 9600 -p /dev/tty.usbserial-A6004nYe -n 2 -n 30 n 1 -n 10
      should change the blink of the LED.
      But i need to send this command three times to see its effect.
      the ‘n 1′ is used for ‘if (intervalid==1)’ and the ‘n 2′ for ‘if (intervalid==2)’
      Any idea about my problem ?
      Thanx a lot for your job.
      ++

      Jack
    *
      josh w
      April 30th, 2009 at 8:55 am

      Hi I tried the bash script with tail and redirected it to the logging.csv file so I could make a arduino data logger…
      Be forwarned I found the scripts by searching “/dev/ttyUSB0 arduino” the problem is…

      I told arduino to count and output it to the serial port at 115200 bps…
      then told the bash script to open the serial port at 115200 bps.
      then listen to one line of the count and print to the csv file… loop…

      It was missing the same ammount of numbers from the count I think the number was around 20.

      Any ideas? I hope the c program can work ok…
      Any idea on how to open 2 arduinos and log from both of them?
    *
      todbot
      April 30th, 2009 at 1:08 pm

      Hi Jack,
      I’m not quite sure what you mean by the “n 1″ and “n 2″ are in the above line (do you mean “-n 1″ & “-n 2″?), but I think you might need to add a 3-5 second delay, like:

      % ./arduino-serial -b 9600 -p /dev/tty.usbserial -d 5000 ...

      This is because opening the serial port to Arduino causes the Arduino to reset and then you have to wait for the bootloader to time out.
    *
      todbot
      April 30th, 2009 at 1:10 pm

      Hi Josh,
      I’m not sure what your shell script is or what the sketch is on your Arduino, so I can’t really help debug your problem. But doing things via the shell isn’t that speedy, and 115200 is pretty speedy.
    *
      josh w
      May 5th, 2009 at 7:47 pm

      Hi your code compiled on GCC no problem no warnings etc. Now I will try editing it to just read from 2 arduino’s I have plugged into my laptops 2 serial ports. Then I will try the same thing with a powered hub afterwards.

      This will be at 115200 bits per second.

      Has anyone you know of tried 2 com ports open at once or more?
      Any problems you know of I should be aware of?

      I am working on a data logger the analog and 24 bit analog to digital converter stuff and arduino is coming together nicely.

      I am really interested in Decomposition of EMG signals using arduino’s to shovel data from 4 emg channels to a .csv comma seperated value file or straight to a mysql database for a open source design of this system.

      More channels will be made but 4 is as many as the arduino can shovel so that is why I am testing 2 arduino’s with my data logging setup.
    *
      todbot
      May 5th, 2009 at 8:16 pm

      Hi josh,
      Have you tried this yet and are having problems, or are you just curious how to go about it? If the latter, then the main thing to look at is the “fd” variable. This is the “file descriptor” of the serial port and is returned by the open() function. It is unique for each serial port opened. And all subsequent functions take an “fd”. So if you take care to keep your “fd”s straight, it should work just fine.

      If you’re running out of pins on your Arduino, I’d recommend picking up an Arduino MEGA. It has tonnes more pins than a regular Arduino.
    *
      josh w
      May 6th, 2009 at 3:40 am

      Thanks I will try to keep the arduino’s USB0, USB1… streight I will be trying it very soon. I just want to pass my schematics on for checking to the open eeg mailing list then work on that.
    *
      josh w
      May 7th, 2009 at 6:41 pm

      ./arduino-serial -b 9600 -p /dev/ttyUSB0 -r
      is what I try I am using ubuntu and a Boarduino made by adafruit with a 3.. avr.
      read: ? is what I get in return I am realy confused.
      I tried
      ./arduino-serial -b 9600 -p /dev/ttyUSB0 -d 2000-r
      and it worked
    *
      josh w
      May 7th, 2009 at 7:42 pm

      int ledPin = 13; // select the pin for the LED
      int i=0; // simple counter to show we’re doing something

      void setup() {
      pinMode(ledPin,OUTPUT); // declare the LED’s pin as output
      Serial.begin(115200); // connect to the serial port
      }

      void loop () {
      Serial.print(i++);
      Serial.println(” I”); // print out a hello
      digitalWrite(ledPin, HIGH);
      delayMicroseconds(500);
      digitalWrite(ledPin, LOW);
      delayMicroseconds(500);
      if (i > 255){i=0;}
      }
      seems to do some kind of buffer over flow it turns off /dev/ttyUSB0 and does not let me back in until I restart.
      the directory disapears for my script & arduino ide.
    *
      josh w
      May 7th, 2009 at 8:00 pm

      things seem to run right 1 time then the port disappears could it not be closing?

      void loop () {
      Serial.println(i++);

      delayMicroseconds(1137);
      if (i > 99){i=0;}
      }

      this runs in arduino ide but the c code causes the port to disapear after 1 run.
    *
      todbot
      May 7th, 2009 at 8:19 pm

      What do you mean by this exactly?
      Do you mean causes the /dev/ttyUSB0 device to disappear from the “/dev/” directory?
      Or do you mean the device is still present, but it cannot be opened?
      Or do you mean the serial port on the Arduino becomes unavailable to the running sketch?

      I have a feeling you are running into buffering issues of either the FTDI chip on the Arduino or the Linux device driver.

      Normally when you’re transmitting so much data at such a high speed, you use the hardware flow control lines so you can pace your transmitting so as not to overflow any buffers. I don’t think the Arduino Serial class gives you access to those lines (or even runs them to the Arduino MCU)

      One way to test if this is an Arduino or PC problem is to have two PCs or two Arduinos, and connect them together, sending data from one and receivin on the other.
    *
      josh w
      May 7th, 2009 at 8:59 pm

      I think their is a relationship with the arduino program being on using that com port.
      Also I still have the 1 second light on 1 second light off delay. So I think as that decreses the buffer or lack of buffer in my c program causes problems. I herd somewhere the arduino has a print f buffer in its c code. If that fills up maby that is the problem.
    *
      josh w
      May 7th, 2009 at 9:01 pm

      I have just gotten two arduino’s not two pc’s so maby i can make them talk at eatchother. …
    *
      josh w
      May 11th, 2009 at 5:50 pm

      the serial logger you have does not output to a text file using >>.
      I have this in my command line logger is the binary output. ./logger>> test.csv is their any way I can make that work? I am using ubuntu.
      Will I have to write more c to open a real file or create one and fprintf to it?

      I have tried your program also it does not print help to the text file ether.
    *
      todbot
      May 11th, 2009 at 5:59 pm

      Logger? I’m not sure to what you’re referring. The “arduino-serial” program isn’t a data logger. It’s not really designed to be run for long durations, just to quickly get a chunk of data from an Arduino and exit.

      However, “arduino-serial” does emit its output on stdout, so it’s output can be redirected to a file as you have done.

      What is this “logger” program you’re running? It’s very clearly not arduino-serial.
    *
      Jack
      May 18th, 2009 at 6:46 am

      Hi todbot,
      Thx for your answer : put a 5000 ms delay is the solution !
      ++

      Jack

125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 ... 4 5 6 7 Newer Comments »

    *
      Tyler
      June 23rd, 2009 at 8:50 am

      Hi todbot,
      I’m using your code and everything seems to work fine except when reading back a response. It seems to only echo back the input as a response.
      I type-
      $arduino-serial -b 9600 -p /dev/ttyUSB0 -s ra -d 2000 -r
      where ra should read back a pin value and does through serial monitor and cutecom. I’ve tried the delay in various places and no delay at all. Any idea why it would only echo back the input?
    *
      todbot
      June 23rd, 2009 at 11:54 am

      Hi Tyler,
      Try putting the delay before the send. You need to wait for the Arduino to start up before sending it data. Like this:

      arduino-serial -b 9600 -p /dev/ttyUSB0 -d 5000 -s ra -r

      I increased the delay in case you have an older Arduino.

      If that doesn’t work, then I’d need to know what the sketch is like you’re running on the Arduino before being able to help more. For instance, depending on how your sketch is set up, you might need to add a delay between sending and receiving because your PC is often faster with serial than the Arduino:

      arduino-serial -b 9600 -p /dev/ttyUSB0 -d 5000 -s ra -d 200 -r

      That inserts a 200msec delay between sending and receiving.
    *
      Spiros Gezerlis (sgez) 's status on Thursday, 15-Oct-09 09:36:53 UTC - Identi.ca
      October 15th, 2009 at 2:36 am

      [...] Arduino-serial: C code to talk to Arduino — http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/ [...]
    *
      stealthcopter.com » Python: interfacing with an arduino
      January 18th, 2010 at 2:08 pm

      [...] original arduino-serial.c – by Tod E. Kurt. [...]
    *
      Linux Ubuntu…serial things « FABLAB adventures
      February 2nd, 2010 at 12:30 pm

      [...] http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/ [...]
    *
      jack
      February 11th, 2010 at 11:33 am

      any way to set DTR to off (in order to avoid arduino autoreset?
    *
      FRANX
      February 11th, 2010 at 12:13 pm

      high duty of CPU is due to the reason that this program never close serial previously opened
    *
      joshua wojnas
      February 16th, 2010 at 2:07 pm

      FTDI & teensy++ are both much faster than the arduino usb interfaces the teensy site shows in its usb serial exaple a high speed serial interface that the virtual com port goes as fast as it can in the benchmark example. Has anyone documented virtual serial port speed?
    *
      sergio
      March 31st, 2010 at 2:01 pm

      How can i progem my arduino using a c lenguage environment, it would be great because of being more experienced in c. apreciate feedback.
    *
      todbot
      April 1st, 2010 at 4:35 pm

      Hi Sergio,
      Turns out every Arduino sketch you write is actually C code too! If you want, you can write more complex C functions within your Arduino sketch and use them with no trouble. This is one of the nice things about the Arduino environment.
    *
      Nathan
      June 11th, 2010 at 3:48 am

      Hi,

      I know this isn’t really the place to ask this, but I have looked everywhere and tried for days, to no avail. My task is to have the arduino(s) taking readings of it’s environment (temp, light, humidity etc), which is sent back to a computer via USB/ethernet. The computer has a program which decides the appropriate reponse and tells the arduino to switch on the hot water, take the washing in etc.

      When I attempted to compile your program (using code blocks, MinGW), I found termios.h, ioctl.h, and getopt.h were missing. I tried to include these, but was only returned more errors. I am sorry, I don’t know much about programming, but you seemed to cheerfully answer querys, so, yeah… Once I have a program that communicates, I am sure I will be fine.
    *
      todbot
      June 11th, 2010 at 1:55 pm

      Hi Nathan,
      I suspect Windows’ approach to serial ports is fundamentally different than that of unix-like OSes. So I’m unsure you’d be able to get arduino-serial to work without a substantial rewrite.

      You might have much better luck getting arduino_serial.py, a Python implementation of arduino-serial. The nice thing about arduino_serial.py is that it uses the pyserial Python library, which does work on Windows.
    *
      Nathan
      June 16th, 2010 at 8:52 am

      The python one seems to be working (to some degree haha). Thank you for your time.
    *
      sophie
      June 16th, 2010 at 7:23 pm

      hi~
      i really new in pic and C programming..
      but i need to study of how detecting the sensor and counting it..
      canu give some basic code for sensor that i can study first before i build a new code..
    *
      Marco
      July 11th, 2010 at 5:48 am

      hi,

      @jack (February 11):

      I had problems with the auto-reset on the Arduino Duemilanove as well. And I don’t really want to do any hardware modifications.

      I added the following to the source (around line 225):

      // turn off HUPCL to avoid reset
      toptions.c_cflag &= ~HUPCL;

      This isn’t perfect. The first call to arduino-serial still resets the device and whatever had been send is lost.
      Any calls to arduino-serial after that work perfectly. It seems the setting is remembered until the next reboot.

      Even something like:

      echo “H” > /dev/ttyUSB0

      work after the first call to arduino-serial (no reset).
    *
      Nelly
      August 2nd, 2010 at 8:54 am

      Hola estoy usadon el archivo arduino_serial.py, y escribo la siguiente linea para ejecutar:
      python arduino_serial.py -b 9600 -p /dev/ttyUSB0 -r
      pero me da el siguiente error.:
      —-
      Traceback (most recent call last):
      File “arduino_serial.py”, line 173, in
      main(sys.argv)
      File “arduino_serial.py”, line 146, in main
      print “Read %s” % (port.read_until(‘\n’),)
      File “arduino_serial.py”, line 107, in read_until
      n = os.read(self.fd, 1)
      OSError: [Errno 11] Resource temporarily unavailable
      —-
      espero me puedan ayudar. porque no se como escribir un programa para arduino en python o que arduino pueda entender python.
    *
      piercelayne
      October 8th, 2010 at 2:55 pm

      So, I am a total nice when it comes to this. I am using a mac and am trying to figure out what I am to do with the arduino-serial.c file. I keep typing “laptop% ./arduino-serial -b 9600 -p /dev/tty.usbserial-A900adrY -s 6″ into Terminal with serial_read_blink.pde loaded to my arduino to no avail. I have spent the better part of the day trying to figure it out. So, if someone could please point me in the right direction I would greatly appreciate it.
    *
      todbot
      October 12th, 2010 at 6:12 pm

      Hi piercelayne,
      Try using the “-d” option to insert a delay before you send characters. That is, try doing:

      ./arduino-serial -d 2000 -b 9600 -p /dev/tty.usbserial-A900adrY -s 6

      When you open the serial port, the Arduino reboots, so you have to wait for the reboot process to complete before you can send it data.
    *
      User P
      December 20th, 2010 at 10:59 pm

      I am sending data to the arduino with your script but it only works sometimes other times it does’nt. I have the resister from the reset pin to the 5volt pin so reset is disabled. I have tried both delays before and after sending the command but it stills works sometimes and others it doesn’t. I also tried removing the resistor and also used the delays and still no go. Any ideas?

      Thanks,
    *
      Joshua Cox
      January 15th, 2011 at 6:03 pm

      I just downloaded the C code along with the two example sketches. When I try the read example, I get a jumble of funny looking characters back. I tried inserting a delay I get the message:

      ./arduino-serial: invalid option — ‘d’

      and when I look at the source code, there doesn’t appear to be a delay option in there. Any suggestions?

125 comments to Arduino-serial: C code to talk to Arduino
« Older Comments 1 ... 5 6 7

    *
      todbot
      January 16th, 2011 at 9:15 pm

      Hi Joshua, Apologies, I had some file issues. The updated version of arduino-serial with the ‘-d’ option is back now.
    *
      Vanyamba
      February 3rd, 2011 at 7:22 am

      Hello. I added fsync(fd) into serialport_write() function.
    *
      CoffeeNinja
      March 11th, 2011 at 8:48 pm

      I am getting jibberish when reading with this, any ideas?

      ./arduino-serial -b 9600 -p /dev/ttyUSB0 -r
      read: ?/|?5|?

      The jibberish changes even though I’m writing a static string of “test” to the serial port from arduino.

      Baud rates are the same, serial monitor from arduino IDE and cat /dev/ttyUSB0 shows “Test” which is what I would expect.

      Sketch:

      void setup(){
      Serial.begin(9600);
      }

      void loop(){
      Serial.println("test ");
      delay(1000);
      }
    *
      CoffeeNinja
      March 11th, 2011 at 9:00 pm

      Regarding my last post, I just need to add some delay

      -d 2000 did the trick
    *
      MidiSerial Updates | BlipBox Project Blog
      March 23rd, 2011 at 3:45 am

      [...] simplistic approach to configuring a raw serial connection was not good enough. Having come across this excellent article on todbot I have now managed to sort the problems out. Up-to-date source code is available on our [...]




/*
 * Arduino-serial
 * --------------
 *
 * A simple command-line example program showing how a computer can
 * communicate with an Arduino board. Works on any POSIX system (Mac/Unix/PC)
 *
 *
 * Compile with something like:
 * gcc -o arduino-serial arduino-serial.c
 *
 * Created 5 December 2006
 * Copyleft (c) 2006, Tod E. Kurt, tod@todbot.com
 * http://todbot.com/blog/
 *
 *
 * Updated 8 December 2006:
 *  Justin McBride discoevered B14400 & B28800 aren't in Linux's termios.h.
 *  I've included his patch, but commented out for now.  One really needs a
 *  real make system when doing cross-platform C and I wanted to avoid that
 *  for this little program. Those baudrates aren't used much anyway. :)
 *
 * Updated 26 December 2007:
 *  Added ability to specify a delay (so you can wait for Arduino Diecimila)
 *  Added ability to send a binary byte number
 *
 * Update 31 August 2008:
 *  Added patch to clean up odd baudrates from Andy at hexapodia.org
 *
 */

#include <stdio.h>    /* Standard input/output definitions */
#include <stdlib.h>
#include <stdint.h>   /* Standard types */
#include <string.h>   /* String function definitions */
#include <unistd.h>   /* UNIX standard function definitions */
#include <fcntl.h>    /* File control definitions */
#include <errno.h>    /* Error number definitions */
#include <termios.h>  /* POSIX terminal control definitions */
#include <sys/ioctl.h>
#include <getopt.h>

void usage(void);
int serialport_init(const char* serialport, int baud);
int serialport_writebyte(int fd, uint8_t b);
int serialport_write(int fd, const char* str);
int serialport_read_until(int fd, char* buf, char until);

void usage(void) {
    printf("Usage: arduino-serial -p <serialport> [OPTIONS]\n"
    "\n"
    "Options:\n"
    "  -h, --help                   Print this help message\n"
    "  -p, --port=serialport        Serial port Arduino is on\n"
    "  -b, --baud=baudrate          Baudrate (bps) of Arduino\n"
    "  -s, --send=data              Send data to Arduino\n"
    "  -r, --receive                Receive data from Arduino & print it out\n"
    "  -n  --num=num                Send a number as a single byte\n"
    "  -d  --delay=millis           Delay for specified milliseconds\n"
    "\n"
    "Note: Order is important. Set '-b' before doing '-p'. \n"
    "      Used to make series of actions:  '-d 2000 -s hello -d 100 -r' \n"
    "      means 'wait 2secs, send 'hello', wait 100msec, get reply'\n"
    "\n");
}

int main(int argc, char *argv[])
{
    int fd = 0;
    char serialport[256];
    int baudrate = B9600;  // default
    char buf[256];
    int rc,n;

    if (argc==1) {
        usage();
        exit(EXIT_SUCCESS);
    }

    /* parse options */
    int option_index = 0, opt;
    static struct option loptions[] = {
        {"help",       no_argument,       0, 'h'},
        {"port",       required_argument, 0, 'p'},
        {"baud",       required_argument, 0, 'b'},
        {"send",       required_argument, 0, 's'},
        {"receive",    no_argument,       0, 'r'},
        {"num",        required_argument, 0, 'n'},
        {"delay",      required_argument, 0, 'd'}
    };

    while(1) {
        opt = getopt_long (argc, argv, "hp:b:s:rn:d:",
                           loptions, &option_index);
        if (opt==-1) break;
        switch (opt) {
        case '0': break;
        case 'd':
            n = strtol(optarg,NULL,10);
            usleep(n * 1000 ); // sleep milliseconds
            break;
        case 'h':
            usage();
            break;
        case 'b':
            baudrate = strtol(optarg,NULL,10);
            break;
        case 'p':
            strcpy(serialport,optarg);
            fd = serialport_init(optarg, baudrate);
            if(fd==-1) return -1;
            break;
        case 'n':
            n = strtol(optarg, NULL, 10); // convert string to number
            rc = serialport_writebyte(fd, (uint8_t)n);
            if(rc==-1) return -1;
            break;
        case 's':
            strcpy(buf,optarg);
            rc = serialport_write(fd, buf);
            if(rc==-1) return -1;
            break;
        case 'r':
            serialport_read_until(fd, buf, '\n');
            printf("read: %s\n",buf);
            break;
        }
    }

    exit(EXIT_SUCCESS);
} // end main

int serialport_writebyte( int fd, uint8_t b)
{
    int n = write(fd,&b,1);
    if( n!=1)
        return -1;
    return 0;
}

int serialport_write(int fd, const char* str)
{
    int len = strlen(str);
    int n = write(fd, str, len);
    if( n!=len )
        return -1;
    return 0;
}

int serialport_read_until(int fd, char* buf, char until)
{
    char b[1];
    int i=0;
    do {
        int n = read(fd, b, 1);  // read a char at a time
        if( n==-1) return -1;    // couldn't read
        if( n==0 ) {
            usleep( 10 * 1000 ); // wait 10 msec try again
            continue;
        }
        buf[i] = b[0]; i++;
    } while( b[0] != until );

    buf[i] = 0;  // null terminate the string
    return 0;
}

// takes the string name of the serial port (e.g. "/dev/tty.usbserial","COM1")
// and a baud rate (bps) and connects to that port at that speed and 8N1.
// opens the port in fully raw mode so you can send binary data.
// returns valid fd, or -1 on error
int serialport_init(const char* serialport, int baud)
{
    struct termios toptions;
    int fd;

    //fprintf(stderr,"init_serialport: opening port %s @ %d bps\n",
    //        serialport,baud);

    fd = open(serialport, O_RDWR | O_NOCTTY | O_NDELAY);
    if (fd == -1)  {
        perror("init_serialport: Unable to open port ");
        return -1;
    }

    if (tcgetattr(fd, &toptions) < 0) {
        perror("init_serialport: Couldn't get term attributes");
        return -1;
    }
    speed_t brate = baud; // let you override switch below if needed
    switch(baud) {
    case 4800:   brate=B4800;   break;
    case 9600:   brate=B9600;   break;
#ifdef B14400
    case 14400:  brate=B14400;  break;
#endif
    case 19200:  brate=B19200;  break;
#ifdef B28800
    case 28800:  brate=B28800;  break;
#endif
    case 38400:  brate=B38400;  break;
    case 57600:  brate=B57600;  break;
    case 115200: brate=B115200; break;
    }
    cfsetispeed(&toptions, brate);
    cfsetospeed(&toptions, brate);

    // 8N1
    toptions.c_cflag &= ~PARENB;
    toptions.c_cflag &= ~CSTOPB;
    toptions.c_cflag &= ~CSIZE;
    toptions.c_cflag |= CS8;
    // no flow control
    toptions.c_cflag &= ~CRTSCTS;

    toptions.c_cflag |= CREAD | CLOCAL;  // turn on READ & ignore ctrl lines
    toptions.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off s/w flow ctrl

    toptions.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // make raw
    toptions.c_oflag &= ~OPOST; // make raw

    // see: http://unixwiz.net/techtips/termios-vmin-vtime.html
    toptions.c_cc[VMIN]  = 0;
    toptions.c_cc[VTIME] = 20;

    if( tcsetattr(fd, TCSANOW, &toptions) < 0) {
        perror("init_serialport: Couldn't set term attributes");
        return -1;
    }

    return fd;
}

http://www.en.wikiants.org/Arduino-serial






http://arduino.cc/en/Reference/Serial


http://arduino.cc/en/Tutorial/ASCIITable
/*
  ASCII table

 Prints out byte values in all possible formats:
 * as raw binary values
 * as ASCII-encoded decimal, hex, octal, and binary values

 For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII

 The circuit:  No external hardware needed.

 created 2006
 by Nicholas Zambetti
 modified 18 Jan 2009
 by Tom Igoe

 This example code is in the public domain.

 <http://www.zambetti.com>

 */
void setup()
{
  Serial.begin(9600);

  // prints title with ending line break
  Serial.println("ASCII Table ~ Character Map");
}

// first visible ASCIIcharacter '!' is number 33:
int thisByte = 33;
// you can also write ASCII characters in single quotes.
// for example. '!' is the same as 33, so you could also use this:
//int thisByte = '!';

void loop()
{
  // prints value unaltered, i.e. the raw binary version of the
  // byte. The serial monitor interprets all bytes as
  // ASCII, so 33, the first number,  will show up as '!'
  Serial.write(thisByte);

  Serial.print(", dec: ");
  // prints value as string as an ASCII-encoded decimal (base 10).
  // Decimal is the  default format for Serial.print() and Serial.println(),
  // so no modifier is needed:
  Serial.print(thisByte);
  // But you can declare the modifier for decimal if you want to.
  //this also works if you uncomment it:

  // Serial.print(thisByte, DEC);


  Serial.print(", hex: ");
  // prints value as string in hexadecimal (base 16):
  Serial.print(thisByte, HEX);

  Serial.print(", oct: ");
  // prints value as string in octal (base 8);
  Serial.print(thisByte, OCT);

  Serial.print(", bin: ");
  // prints value as string in binary (base 2)
  // also prints ending line break:
  Serial.println(thisByte, BIN);

  // if printed last visible character '~' or 126, stop:
  if(thisByte == 126) {     // you could also use if (thisByte == '~') {
    // This loop loops forever and does nothing
    while(true) {
      continue;
    }
  }
  // go on to the next character
  thisByte++;
}


Once the code was loaded, I opened the serial monitor which is part of the Arduino IDE and observed the following Arduino output:

ASCII Table ~ Character Map
!, dec: 33, hex: 21, oct: 41, bin: 100001
", dec: 34, hex: 22, oct: 42, bin: 100010
#, dec: 35, hex: 23, oct: 43, bin: 100011
$, dec: 36, hex: 24, oct: 44, bin: 100100
%, dec: 37, hex: 25, oct: 45, bin: 100101
&, dec: 38, hex: 26, oct: 46, bin: 100110
', dec: 39, hex: 27, oct: 47, bin: 100111
(, dec: 40, hex: 28, oct: 50, bin: 101000
), dec: 41, hex: 29, oct: 51, bin: 101001
*, dec: 42, hex: 2A, oct: 52, bin: 101010
+, dec: 43, hex: 2B, oct: 53, bin: 101011
,, dec: 44, hex: 2C, oct: 54, bin: 101100
-, dec: 45, hex: 2D, oct: 55, bin: 101101
., dec: 46, hex: 2E, oct: 56, bin: 101110
/, dec: 47, hex: 2F, oct: 57, bin: 101111
0, dec: 48, hex: 30, oct: 60, bin: 110000
1, dec: 49, hex: 31, oct: 61, bin: 110001
2, dec: 50, hex: 32, oct: 62, bin: 110010
3, dec: 51, hex: 33, oct: 63, bin: 110011
4, dec: 52, hex: 34, oct: 64, bin: 110100
5, dec: 53, hex: 35, oct: 65, bin: 110101
6, dec: 54, hex: 36, oct: 66, bin: 110110
7, dec: 55, hex: 37, oct: 67, bin: 110111
8, dec: 56, hex: 38, oct: 70, bin: 111000
9, dec: 57, hex: 39, oct: 71, bin: 111001
:, dec: 58, hex: 3A, oct: 72, bin: 111010
;, dec: 59, hex: 3B, oct: 73, bin: 111011
<, dec: 60, hex: 3C, oct: 74, bin: 111100
=, dec: 61, hex: 3D, oct: 75, bin: 111101
>, dec: 62, hex: 3E, oct: 76, bin: 111110
?, dec: 63, hex: 3F, oct: 77, bin: 111111
@, dec: 64, hex: 40, oct: 100, bin: 1000000
A, dec: 65, hex: 41, oct: 101, bin: 1000001
B, dec: 66, hex: 42, oct: 102, bin: 1000010
C, dec: 67, hex: 43, oct: 103, bin: 1000011
D, dec: 68, hex: 44, oct: 104, bin: 1000100
E, dec: 69, hex: 45, oct: 105, bin: 1000101
F, dec: 70, hex: 46, oct: 106, bin: 1000110
G, dec: 71, hex: 47, oct: 107, bin: 1000111
H, dec: 72, hex: 48, oct: 110, bin: 1001000
I, dec: 73, hex: 49, oct: 111, bin: 1001001
J, dec: 74, hex: 4A, oct: 112, bin: 1001010
K, dec: 75, hex: 4B, oct: 113, bin: 1001011
L, dec: 76, hex: 4C, oct: 114, bin: 1001100
M, dec: 77, hex: 4D, oct: 115, bin: 1001101
N, dec: 78, hex: 4E, oct: 116, bin: 1001110
O, dec: 79, hex: 4F, oct: 117, bin: 1001111
P, dec: 80, hex: 50, oct: 120, bin: 1010000
Q, dec: 81, hex: 51, oct: 121, bin: 1010001
R, dec: 82, hex: 52, oct: 122, bin: 1010010
S, dec: 83, hex: 53, oct: 123, bin: 1010011
T, dec: 84, hex: 54, oct: 124, bin: 1010100
U, dec: 85, hex: 55, oct: 125, bin: 1010101
V, dec: 86, hex: 56, oct: 126, bin: 1010110
W, dec: 87, hex: 57, oct: 127, bin: 1010111
X, dec: 88, hex: 58, oct: 130, bin: 1011000
Y, dec: 89, hex: 59, oct: 131, bin: 1011001
Z, dec: 90, hex: 5A, oct: 132, bin: 1011010
[, dec: 91, hex: 5B, oct: 133, bin: 1011011
\, dec: 92, hex: 5C, oct: 134, bin: 1011100
], dec: 93, hex: 5D, oct: 135, bin: 1011101
^, dec: 94, hex: 5E, oct: 136, bin: 1011110
_, dec: 95, hex: 5F, oct: 137, bin: 1011111
`, dec: 96, hex: 60, oct: 140, bin: 1100000
a, dec: 97, hex: 61, oct: 141, bin: 1100001
b, dec: 98, hex: 62, oct: 142, bin: 1100010
c, dec: 99, hex: 63, oct: 143, bin: 1100011
d, dec: 100, hex: 64, oct: 144, bin: 1100100
e, dec: 101, hex: 65, oct: 145, bin: 1100101
f, dec: 102, hex: 66, oct: 146, bin: 1100110
g, dec: 103, hex: 67, oct: 147, bin: 1100111
h, dec: 104, hex: 68, oct: 150, bin: 1101000
i, dec: 105, hex: 69, oct: 151, bin: 1101001
j, dec: 106, hex: 6A, oct: 152, bin: 1101010
k, dec: 107, hex: 6B, oct: 153, bin: 1101011
l, dec: 108, hex: 6C, oct: 154, bin: 1101100
m, dec: 109, hex: 6D, oct: 155, bin: 1101101
n, dec: 110, hex: 6E, oct: 156, bin: 1101110
o, dec: 111, hex: 6F, oct: 157, bin: 1101111
p, dec: 112, hex: 70, oct: 160, bin: 1110000
q, dec: 113, hex: 71, oct: 161, bin: 1110001
r, dec: 114, hex: 72, oct: 162, bin: 1110010
s, dec: 115, hex: 73, oct: 163, bin: 1110011
t, dec: 116, hex: 74, oct: 164, bin: 1110100
u, dec: 117, hex: 75, oct: 165, bin: 1110101
v, dec: 118, hex: 76, oct: 166, bin: 1110110
w, dec: 119, hex: 77, oct: 167, bin: 1110111
x, dec: 120, hex: 78, oct: 170, bin: 1111000
y, dec: 121, hex: 79, oct: 171, bin: 1111001
z, dec: 122, hex: 7A, oct: 172, bin: 1111010
{, dec: 123, hex: 7B, oct: 173, bin: 1111011
|, dec: 124, hex: 7C, oct: 174, bin: 1111100
}, dec: 125, hex: 7D, oct: 175, bin: 1111101
~, dec: 126, hex: 7E, oct: 176, bin: 1111110

The USB to RS-232 converter, test program and Arduino all works!!! The next step is to write a program to read analog and digital inputs and write to digital outputs. Once this is accomplished, a CGI application can be developed to read from and write to the Arduino.

CSCS2650 Computer Organization
I added the DCR A instruction to the ALU API. I implemented the functionality in the decrementSource member function. Note that there is only an instruction to decrement A as the other source registers are part of the register class.

void ALU::decrementSource()
{
        //only applies to A within the ALU  class
        //unsigned char tTempReg = A & 0x0f;
        unsigned char tA = A & 0x0f;
        tA = tA + (~0x01 + 0x01);
        if (tA & 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
        A = A + (~0x01 + 0x01);
        doSignFlag();
        doZeroFlag();
        doParityFlag();
}

Here are the results of making alutest after implementing the DCR A instruction.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS

Here is the program output of alutest after executing it using the DCR A instruction (0x3d).

lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x3d
Enter Accumulator value
0xff
Enter Temporary Register value
0x00
Result is 0xfe
Flag Register = 0x80
Sign flag is 1
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x3d
Enter Accumulator value
0x01
Enter Temporary Register value
0x00
Result is 0x00
Flag Register = 0x44
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x3d
Enter Accumulator value
0x00
Enter Temporary Register value
0x00
Result is 0xff
Flag Register = 0x94
Sign flag is 1
Carry flag is 0
Zero flag is 0
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
q

After verifying the DCR A instruction functionality, I committed alu.cc and alu.h to the Subversion repository.

lab46:~/src/cpu$ svn commit -m "Added the DCR instruction to the ALU API; DCR only affects the Accumulator as the other registers are not part of the ALU -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 321.

I added the INR A instruction to the ALU API. I implemented the INR A instruction functionality in the incrementSource member function. Note that there is only an instruction to decrement A as the other source registers are part of the register class.

void ALU::incrementSource()
{
        //only applies to A within the ALU  class
        unsigned char tA = A & 0x0f;
        tA = tA + 0x01;
        if (tA & 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
        A = A + 0x01;
        doSignFlag();
        doZeroFlag();
        doParityFlag();
}

Here are the results of making alutest after implementing the INR A instruction.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest

Here is the program output of alutest after executing it using the INR A instruction (0x3c).

Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x3c
Enter Accumulator value
0xff
Enter Temporary Register value
0x00
Result is 0x00
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x3c
Enter Accumulator value
0x00
Enter Temporary Register value
0x00
Result is 0x01
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q

After verifying the INR A instruction functionality, I committed alu.cc and alu.h to the Subversion repository.

lab46:~/src/cpu$ svn commit -m "I added the INR A instruction to the ALU API; Note that there is only an instruction to decrement A as the other source registers are part of the register class. -John Rine" 
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 322.
lab46:~/src/cpu/8085/arithmeticlogicunit$

Week 12 Journal Entry

CSIT1320 HPC Fundamentals
During the week before last, I completed my six required projects for the HPC Fundamentals course:

  1. Linux install
  2. VM Server
  3. Virtual machine
  4. Video Wall
  5. Web Server installation
  6. HPC cluster


CSIT2048 HPC Experience II
I sent the following e-mail to the instructor:

To      : wedge@lab46.corning-cc.edu
Cc      :
Attchmnt:
Subject : float switches
----- Message Text -----
Matt,
Please purchase the following items for the hydroponics project (HPC2
course):

Quantity 2 float switches, $6.99 each from
http://www.aquahub.com/store/ifloatfloatswitch.html

Quantity 2 tubing adapters, $1.00 each from
http://www.aquahub.com/store/product21.html

Quantity 2 mold-a-holder, $3.95 each from
http://www.aquahub.com/store/moldaholder9.html

Quantity 1 crimp caps, $1.99 each from
http://www.aquahub.com/store/product34.html

thanks

John T. Rine

CSIT 1320 HPC Fundamentals
CSIT 2048 HPC Experience II
CSIT 2320 HPC Systems & Networking
CSCS 2650 Computer Organization
Graduate Electrical Technology-Electronics
Graduate General Studies
---
 Lab46: Penguin Powered

I wrote the following Arduino Wiring code which reads an analog input, reads a digital input, and toggles a digital output based on commands given to the Arduino via USB to serial communications.

//http://arduino.cc/en/Tutorial/AnalogReadSerial
//http://www.arduino.cc/en/Serial/Read
//http://www.arduino.cc/en/Serial/Available
//http://www.arduino.cc/en/Reference/DigitalRead
//http://www.arduino.cc/en/Reference/DigitalWrite


int serialIn = 0;
int sensorValue = 0;
int digitalValue = 0;
int pin7 = 7;
int pin6 = 6;
int pin6State = LOW;
int pinState = LOW;

void setup()
{
  Serial.begin(9600);
  pinMode(pin7, INPUT);
  pinMode(pin6, OUTPUT);

}

void loop()
{
  if (Serial.available() > 0)
  {
        serialIn = Serial.read();
        switch(serialIn)
        {
          case 'a':
              sensorValue = analogRead(A0);
              Serial.println(sensorValue, DEC);
              serialIn = '\0';
              break;
          case 'd':
              digitalValue = digitalRead(pin7);
              Serial.println(digitalValue, DEC);
              serialIn = '\0';
              break;
          case 'o':
              if(pin6State == LOW)
              {
                pinState = HIGH;
                pin6State = HIGH;
              }
              else
              {
                pinState = LOW;
                pin6State = LOW;
              }
              digitalWrite(pin6, pinState);
              break;

        }
  }
 }

The code listed above was tested using the terminal application built into the Arduino IDE. It works!!
CSCS2650 Computer Organization
I updated the ALU API page to include descriptions of the various 8085 logical and mathematical instructions.

Hex Code Mneumonic  Description
-----------------------------------------------------------------------------------------------
0x2f     CMA        Complement the contents of the Accumulator
                    No flags are modified.


0x37     STC        Set Carry
                    The Carry Flag is set to 1, no other flags are modified.


0x3c     INR A      Increment the contents of A by 1
                    The following flags are affected: S, Z, P, AC; Carry (CY) is not affected.


0x3d     DCR A      Decrement the contents of A by 1
                    The following flags are affected: S, Z, P and AC; Carry (CY) is not affected.


0x3f     CMC        Complement the Carry Flag
                    The carry flag is modified, none of the other flags are affected.


0x80     ADD B      Add the contents of B to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x81     ADD C      Add the contents of C to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x82     ADD D      Add the contents of D to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x83     ADD E      Add the contents of E to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x84     ADD H      Add the contents of H to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x85     ADD L      Add the contents of L to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x86     ADD M      Add the contents of M to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x87     ADD A      Add the contents of A to the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.


0x90     SUB B      Subtract the contents of B from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x91     SUB C      Subtract the contents of C from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x92     SUB D      Subtract the contents of D from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x93     SUB E      Subtract the contents of E from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x94     SUB H      Subtract the contents of H from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x95     SUB L      Subtract the contents of L from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x96     SUB M      Subtract the contents of M from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.

0x97     SUB A      Subtract the contents of A from the contents of A and place the result in A
                    All flags are affected to reflect the result of this operation.


0xc6    ADI 8-bit   Add immediate to the Accumulator
                    All flags are affected to reflect the result of this operation.

0xa0    ANA B       Logical and the contents of B with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa1    ANA C       Logical and the contents of C with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa2    ANA D       Logical and the contents of D with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa3    ANA E       Logical and the contents of E with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa4    ANA H       Logical and the contents of H with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa5    ANA L       Logical and the contents of L with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa6    ANA M       Logical and the contents of M with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.

0xa7    ANA A       Logical and the contents of A with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) is reset; AC is set.


0xa8    XRA B       Exclusive or the contents of B with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xa9    XRA C       Exclusive or the contents of C with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xaa    XRA D       Exclusive or the contents of D with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xab    XRA E       Exclusive or the contents of E with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xac    XRA H       Exclusive or the contents of H with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xad    XRA L       Exclusive or the contents of L with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xae    XRA M       Exclusive or the contents of A with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xaf    XRA A       Exclusive or the contents of A with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.


0xb0    ORA B       Inclusive or the contents of B with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb1    ORA C       Inclusive or the contents of C with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb2    ORA D       Inclusive or the contents of D with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb3    ORA E       Inclusive or the contents of E with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb4    ORA H       Inclusive or the contents of H with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb5    ORA L       Inclusive or the contents of L with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb6    ORA M       Inclusive or the contents of M with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

0xb7    ORA A       Inclusive or the contents of A with A and place the result in A
                    The following flags are affected: S, Z, P; Carry (CY) and AC are reset.


0xd6    SUI 8-bit  Subtract an immediate value from the contents of A and place the result in A
                   All flags are affected to reflect the result of the subtraction.


0xe6    ANI 8-bit  Logically and immediate value with the contents of A and place the result in A
                   The following flags are affected: S, Z, P; Carry (CY) is reset; AC is reset.


0xee    XRI 8-bit  Logically exclusive or immediate value with the contents of A and place the result in A
                   The following flags are affected: S, Z, P; Carry (CY) and AC are reset.


0xf6    ORI 8-bit  Logically or immediate value with the contents of A and place the result in A
                   The following flags are affected: S, Z, P; Carry (CY) and AC are reset.

I added the rotate Accumulator right instruction to the ALU API.

void ALU::rotateARight()
{
        unsigned char tA = 0x00;
        if(0x01 & A) tA = 0x80;
        A = A >> 1;
        A = A | tA;
        if(0x01 & A) setCarryFlag();
        else resetCarryFlag();
}

I then tested its functionality. Once its functionality was validated, I committed it to the repository.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
You have mail in /home/jr018429/Maildir
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x0f
Enter Accumulator value
0x55
Enter Temporary Register value
0x00
Result is 0xaa
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x0f
Enter Accumulator value
0xaa
Enter Temporary Register value
0x00
Result is 0x55
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$ cd ..
lab46:~/src/cpu/8085$ cd ..
lab46:~/src/cpu$ svn commit -m "Added the RRC instruction to the ALU API -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 350.
lab46:~/src/cpu$

I added the rotate Accumulator left instruction to the ALU API.

void ALU::rotateALeft()
{
        unsigned char tA = 0x00;
        if(0x80 & A) tA = 0x01;
        A = A << 1;
        A = A | tA;
        if(0x80 & A) setCarryFlag();
        else resetCarryFlag();
}

I then tested the rotate Accumulator left functionality. Once its functionality was validated, I committed it to the repository.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x07
Enter Accumulator value
0xaa
Enter Temporary Register value
0x00
Result is 0x55
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x07
Enter Accumulator value
0x55
Enter Temporary Register value
0x00
Result is 0xaa
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q
lab46:~/src/cpu/8085/arithmeticlogicunit$ svn commit -m "I added the RLC instruction to the ALU API -John Rine"
Sending        arithmeticlogicunit/alu.cc
Transmitting file data .
Committed revision 351.
lab46:~/src/cpu/8085/arithmeticlogicunit$

Week 13 Journal Entry

CSIT1320 HPC Fundamentals
During the week before the week before last, I completed my six required projects for the HPC Fundamentals course:

  1. Linux install
  2. VM Server
  3. Virtual machine
  4. Video Wall
  5. Web Server installation
  6. HPC cluster

As per the instructor's consent, I am using the remainder of my HPC 0 class time to develop the HPC 2 project, the monitoring and control of the Hydroponics garden. Read about it directly below.

CSIT2048 HPC Experience II
I found information regarding communicating via the serial port on the Linux platform at: http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/ . Downloadable code to talk to an Arduino board from a Linux platform is available on the Web page listed above as a Hyperlink on that page to: http://todbot.com/arduino/host/arduino-serial/arduino-serial.c

/*
 * Arduino-serial
 * --------------
 *
 * A simple command-line example program showing how a computer can
 * communicate with an Arduino board. Works on any POSIX system (Mac/Unix/PC)
 *
 *
 * Compile with something like:
 * gcc -o arduino-serial arduino-serial.c
 *
 * Created 5 December 2006
 * Copyleft (c) 2006, Tod E. Kurt, tod@todbot.com
 * http://todbot.com/blog/
 *
 *
 * Updated 8 December 2006:
 *  Justin McBride discoevered B14400 & B28800 aren't in Linux's termios.h.
 *  I've included his patch, but commented out for now.  One really needs a
 *  real make system when doing cross-platform C and I wanted to avoid that
 *  for this little program. Those baudrates aren't used much anyway. :)
 *
 * Updated 26 December 2007:
 *  Added ability to specify a delay (so you can wait for Arduino Diecimila)
 *  Added ability to send a binary byte number
 *
 * Update 31 August 2008:
 *  Added patch to clean up odd baudrates from Andy at hexapodia.org
 *
 */

#include <stdio.h>    /* Standard input/output definitions */
#include <stdlib.h>
#include <stdint.h>   /* Standard types */
#include <string.h>   /* String function definitions */
#include <unistd.h>   /* UNIX standard function definitions */
#include <fcntl.h>    /* File control definitions */
#include <errno.h>    /* Error number definitions */
#include <termios.h>  /* POSIX terminal control definitions */
#include <sys/ioctl.h>
#include <getopt.h>

void usage(void);
int serialport_init(const char* serialport, int baud);
int serialport_writebyte(int fd, uint8_t b);
int serialport_write(int fd, const char* str);
int serialport_read_until(int fd, char* buf, char until);

void usage(void) {
    printf("Usage: arduino-serial -p <serialport> [OPTIONS]\n"
    "\n"
    "Options:\n"
    "  -h, --help                   Print this help message\n"
    "  -p, --port=serialport        Serial port Arduino is on\n"
    "  -b, --baud=baudrate          Baudrate (bps) of Arduino\n"
    "  -s, --send=data              Send data to Arduino\n"
    "  -r, --receive                Receive data from Arduino & print it out\n"
    "  -n  --num=num                Send a number as a single byte\n"
    "  -d  --delay=millis           Delay for specified milliseconds\n"
    "\n"
    "Note: Order is important. Set '-b' before doing '-p'. \n"
    "      Used to make series of actions:  '-d 2000 -s hello -d 100 -r' \n"
    "      means 'wait 2secs, send 'hello', wait 100msec, get reply'\n"
    "\n");
}

int main(int argc, char *argv[])
{
    int fd = 0;
    char serialport[256];
    int baudrate = B9600;  // default
    char buf[256];
    int rc,n;

    if (argc==1) {
        usage();
        exit(EXIT_SUCCESS);
    }

    /* parse options */
    int option_index = 0, opt;
    static struct option loptions[] = {
        {"help",       no_argument,       0, 'h'},
        {"port",       required_argument, 0, 'p'},
        {"baud",       required_argument, 0, 'b'},
        {"send",       required_argument, 0, 's'},
        {"receive",    no_argument,       0, 'r'},
        {"num",        required_argument, 0, 'n'},
        {"delay",      required_argument, 0, 'd'}
    };

    while(1) {
        opt = getopt_long (argc, argv, "hp:b:s:rn:d:",
                           loptions, &option_index);
        if (opt==-1) break;
        switch (opt) {
        case '0': break;
        case 'd':
            n = strtol(optarg,NULL,10);
            usleep(n * 1000 ); // sleep milliseconds
            break;
        case 'h':
            usage();
            break;
        case 'b':
            baudrate = strtol(optarg,NULL,10);
            break;
        case 'p':
            strcpy(serialport,optarg);
            fd = serialport_init(optarg, baudrate);
            if(fd==-1) return -1;
            break;
        case 'n':
            n = strtol(optarg, NULL, 10); // convert string to number
            rc = serialport_writebyte(fd, (uint8_t)n);
            if(rc==-1) return -1;
            break;
        case 's':
            strcpy(buf,optarg);
            rc = serialport_write(fd, buf);
            if(rc==-1) return -1;
            break;
        case 'r':
            serialport_read_until(fd, buf, '\n');
            printf("read: %s\n",buf);
            break;
        }
    }

    exit(EXIT_SUCCESS);
} // end main

int serialport_writebyte( int fd, uint8_t b)
{
    int n = write(fd,&b,1);
    if( n!=1)
        return -1;
    return 0;
}

int serialport_write(int fd, const char* str)
{
    int len = strlen(str);
    int n = write(fd, str, len);
    if( n!=len )
        return -1;
    return 0;
}

int serialport_read_until(int fd, char* buf, char until)
{
    char b[1];
    int i=0;
    do {
        int n = read(fd, b, 1);  // read a char at a time
        if( n==-1) return -1;    // couldn't read
        if( n==0 ) {
            usleep( 10 * 1000 ); // wait 10 msec try again
            continue;
        }
        buf[i] = b[0]; i++;
    } while( b[0] != until );

    buf[i] = 0;  // null terminate the string
    return 0;
}

// takes the string name of the serial port (e.g. "/dev/tty.usbserial","COM1")
// and a baud rate (bps) and connects to that port at that speed and 8N1.
// opens the port in fully raw mode so you can send binary data.
// returns valid fd, or -1 on error
int serialport_init(const char* serialport, int baud)
{
    struct termios toptions;
    int fd;

    //fprintf(stderr,"init_serialport: opening port %s @ %d bps\n",
    //        serialport,baud);

    fd = open(serialport, O_RDWR | O_NOCTTY | O_NDELAY);
    if (fd == -1)  {
        perror("init_serialport: Unable to open port ");
        return -1;
    }

    if (tcgetattr(fd, &toptions) < 0) {
        perror("init_serialport: Couldn't get term attributes");
        return -1;
    }
    speed_t brate = baud; // let you override switch below if needed
    switch(baud) {
    case 4800:   brate=B4800;   break;
    case 9600:   brate=B9600;   break;
#ifdef B14400
    case 14400:  brate=B14400;  break;
#endif
    case 19200:  brate=B19200;  break;
#ifdef B28800
    case 28800:  brate=B28800;  break;
#endif
    case 38400:  brate=B38400;  break;
    case 57600:  brate=B57600;  break;
    case 115200: brate=B115200; break;
    }
    cfsetispeed(&toptions, brate);
    cfsetospeed(&toptions, brate);

    // 8N1
    toptions.c_cflag &= ~PARENB;
    toptions.c_cflag &= ~CSTOPB;
    toptions.c_cflag &= ~CSIZE;
    toptions.c_cflag |= CS8;
    // no flow control
    toptions.c_cflag &= ~CRTSCTS;

    toptions.c_cflag |= CREAD | CLOCAL;  // turn on READ & ignore ctrl lines
    toptions.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off s/w flow ctrl

    toptions.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // make raw
    toptions.c_oflag &= ~OPOST; // make raw

    // see: http://unixwiz.net/techtips/termios-vmin-vtime.html
    toptions.c_cc[VMIN]  = 0;
    toptions.c_cc[VTIME] = 20;

    if( tcsetattr(fd, TCSANOW, &toptions) < 0) {
        perror("init_serialport: Couldn't set term attributes");
        return -1;
    }

    return fd;
}

I was able to compile and then run the above file with no command line switches on a Linux Debian platform.

jr018429@dhcp-179:~/Desktop$ gcc arduino-serial.c -o AC
jr018429@dhcp-179:~/Desktop$ ./AC
Usage: arduino-serial -p <serialport> [OPTIONS]

Options:
  -h, --help                   Print this help message
  -p, --port=serialport        Serial port Arduino is on
  -b, --baud=baudrate          Baudrate (bps) of Arduino
  -s, --send=data              Send data to Arduino
  -r, --receive                Receive data from Arduino & print it out
  -n  --num=num                Send a number as a single byte
  -d  --delay=millis           Delay for specified milliseconds

Note: Order is important. Set '-b' before doing '-p'. 
      Used to make series of actions:  '-d 2000 -s hello -d 100 -r' 
      means 'wait 2secs, send 'hello', wait 100msec, get reply'

I got the above code to return analog values from the Arduino using the following command line invocations:

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s a -d100 -r
read: 496

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s a -d100 -r
read: 516

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s a -d100 -r
read: 525

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s a -d100 -r
read: 525

I jumped +5 volts and circuit ground (0 volts) alternately into pin 7 (digital input) of the Arduino board. I successfully read +5 volts as 1, and circuit ground (0 volts) as 0.

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 0

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 0

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 0

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 0

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 0

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1

jr018429@dhcp-179:~/Desktop$ ./AC --port=/dev/ttyUSB0 -d 2000 -s d -d200 -r
read: 1


CSCS2650 Computer Organization
The RLC (rotate Accumulator left) and RRC (rotate Accumulator right) instructions written last week had bugs. The functions didn't affect the Carry flag. I edited these member functions so that they now work correctly.
This is the new implementation of the RLC instruction:

void ALU::rotateARight()
{
        unsigned char tA = 0x00;
        if(0x01 & A)
        {
                tA = 0x80;
                setCarryFlag();
        }
        else resetCarryFlag();
        A = A >> 1;
        A = A | tA;
}

This is the new implementation of the RRC instruction.

void ALU::rotateALeft()
{
        unsigned char tA = 0x00;
        if(0x80 & A)
        {
                tA = 0x01;
                setCarryFlag();
        }
        else resetCarryFlag();
        A = A << 1;
        A = A | tA;
}

Directly below is the result of compilation and testing.
As can be seen, the compilation was successful and so was the testing.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x07
Enter Accumulator value
0x7f
Enter Temporary Register value
0x00
Result is 0xfe
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x07
Enter Accumulator value
0x8f
Enter Temporary Register value
0x00
Result is 0x1f
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x0f
Enter Accumulator value
0xfe
Enter Temporary Register value
0x00
Result is 0x7f
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x0f
Enter Accumulator value
0xf1
Enter Temporary Register value
0x00
Result is 0xf8
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q

After fixing the RLC and RRC instructions, I wrote the rotateARightThroughCarry() member function which implements the functionality of the RAR (rotate Accumulator right through Carry) instruction.

void ALU::rotateARightThroughCarry()
{
        unsigned char tA = 0x00;
        if(getCarryFlag()) tA = 0x01;
        if(0x01 & A)
        {
                setCarryFlag();
        }
        else resetCarryFlag();
        A = A >> 1;
        A = A | tA;
}

Next, I wrote the rotateALeftThroughCarry() member function which implements the functionality of the RAL (rotate Accumulator left through Carry) instruction.

void ALU::rotateALeftThroughCarry()
{
        unsigned char tA = 0x00;
        if(getCarryFlag()) tA = 0x01;
        if(0x80 & A)
        {
                setCarryFlag();
        }
        else resetCarryFlag();
        A = A << 1;
        A = A | tA;
}

I then compiled the alu files and tested the new instructions: RAL (rotate Accumulator left through Carry) and RAR (rotate Accumulator right through carry). As can be seen directly below, the compilation and testing were successful.

lab46:~/src/cpu/8085/arithmeticlogicunit$ nano alu.cc
lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[CC]  alutest              ... SUCCESS
lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x17
Enter Accumulator value
0x7f
Enter Temporary Register value
0x00
Result is 0xfe
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x17
Enter Accumulator value
0xf7
Enter Temporary Register value
0x00
Result is 0xee
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x7e
Enter Accumulator value
0x00
Enter Temporary Register value
0x00
Result is 0x00
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c 
Enter instruction
0x17
Enter Accumulator value
0x7e
Enter Temporary Register value
0x00
Result is 0xfd
Flag Register = 0x00
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
q

Lastly, I committed the alu.cc and the alu.h files to the repository.

lab46:~/src/cpu/8085/arithmeticlogicunit$ svn commit -m "Fixed bugs in RRC and RLC instructions; Added the RAL and RAR instructions -John Rine"
Sending        arithmeticlogicunit/alu.cc
Transmitting file data .
Committed revision 413.
lab46:~/src/cpu/8085/arithmeticlogicunit$ cd ..
lab46:~/src/cpu/8085$ cd ..
lab46:~/src/cpu$ cd include
lab46:~/src/cpu/include$ 
lab46:~/src/cpu/include$ svn commit -m "Forgot to submit the updated alu.h file -John Rine"
Sending        include/alu.h
Transmitting file data .
Committed revision 414.

Week 14 Journal Entry

CSIT1320 HPC Fundamentals
During the week before the week before the week before last, I completed my six required projects for the HPC Fundamentals course:

  1. Linux install
  2. VM Server
  3. Virtual machine
  4. Video Wall
  5. Web Server installation
  6. HPC cluster

As per the instructor's consent, I am using the remainder of my HPC 0 class time to develop the HPC 2 project, the monitoring and control of the Hydroponics garden. Read about it directly below.

HPC 0 EoCE 0x0: Replication
A big focus of the course was the creation of documentation as you performed the various projects- ultimately assembled on your portfolio page.
The project documentation needs to be process complete and accurate- the original author, or someone else (either in the class or another individual in the future) should be able to reference that documentation and replicate that project.
To put this to the test, choose to perform a project performed by another person in the class, and follow their documentation through to project completion.

Answer the following:

  1. Who was the author, what was the project, and where is the URL to the project documentation you chose? (Does the documentation state the author, project title, etc.?)
  2. Does the documentation lead to a successful and operational conclusion?
  3. Is the documentation complete? (No inferred steps with respect to the project needed to be taken)
  4. Is the documentation organized, easy to read any follow?
  5. Is the documentation nicely formatted, utilizing wiki formatting features? (ie it is not just some huge paragraph or endless stream of bullets on a list).
  6. On a scale of 0 to 11 (yes, it goes to 11) rate the documentation on the above points.
  7. Provide some suggestions for improvement that would have enhanced your experience following this documentation.


Answers:

  1. The project documentation I chose to verify describes how to install an Ubuntu distribution of Linux. Brian Ewanyk is the author of the particular set of instructions I chose to follow. His instructions can be found at: http://lab46.corning-cc.edu/user/bewanyk/portfolio/linux-bsd-deswktop-install .
  2. Brian's documentation led to a successful installation of Ubuntu “Maverick”. His documentation is very good.
  3. Brian's documentation was compete. No further instructions were needed; every step was correct.
  4. Brian's documentation is organized very well and is easy to follow.
  5. Brian's documentation is nicely formatted into logically related sections and utilizes wiki formatting features.
  6. I rate Brian's documentation of the Ubauntu “Maverick” installation at a 10.87623423082739825678578572578746063760846834808279685287 of a possible 11.
  7. As I stated previously, I think Brian's documentation of the Ubuntu “Maverick” installation is very good. perhaps graphics of the bios configuration screens and OS installation screens would be helpful. There are a few spelling errors in the documentation that appeared to be due to the speed of compilation.



CSIT2048 HPC Experience II
Now that I have Arduino code that reads and writes I/O and code that reads the data from the Arduino via the virtual serial port, it is time to create a CGI application that will pass commands to the Arduino and then read data from it and return the data via HTML. To get the CGI application to work this way, I had to find out how to pass parameters to a C CGI application. I found a suitable tutorial at: http://www.cs.tut.fi/~jkorpela/forms/cgic.html . I decided to use the example program posted on the Web page as a test program. The code is shown below:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *data;
long m,n;
printf("%s%c%c\n",
"Content-Type:text/html;charset=iso-8859-1",13,10);
printf("<TITLE>Multiplication results</TITLE>\n");
printf("<H3>Multiplication results</H3>\n");
data = getenv("QUERY_STRING");
if(data == NULL)
  printf("<P>Error! Error in passing data from form to script.");
else if(sscanf(data,"m=%ld&n=%ld",&m,&n)!=2)
  printf("<P>Error! Invalid data. Data must be numeric.");
else
  printf("<P>The product of %ld and %ld is %ld.",m,n,m*n);
return 0;
}

I compiled the program:

jr018429@dhcp-179:~/Desktop/HPC 2 Project$ gcc test.c -o test.cgi

I moved the compiled program to the cgi-bin directory:

root@dhcp-179:/home/jr018429/Desktop/HPC 2 Project# cp test.cgi /usr/lib/cgi-bin

I gave the cgi program root privileges:

root@dhcp-179:/usr/lib/cgi-bin# chown root.root test.cgi

Next, I set permissions on the cgi application:

root@dhcp-179:/usr/lib/cgi-bin# chmod +s test.cgi

In order to test the test cgi application, I entered the following URL into Iceweasel's URL test box:

http://10.80.2.179/cgi-bin/test.cgi?m=2&n=5

The result of using the URL shown above is shown below:

Success!!!! I can now pass parameters to a C cgi program. This ability will allow me to select whether I read digital inputs (float switches) or an analog input (ph meter), or whether I toggle a digital output (output to control the circulator pump in the hydroponics tank).
Next, I need to write my own cgi program to pass commands to the Arduino and then read data from it and then return the data via html to the requester.

CSCS2650 Computer Organization
I moved some of the redundant operations associated with the addition and subtraction instructions into private member functions of the ALU API class in preparation for adding the compare with Accumulator (CMP) and compare immediate with Accumulator (CPI) instructions.
Now addition is performed using exclusive or, and, and shift operations rather than using C addition operations. subtraction is performed by making the twos complement of the temporary register and then using the new addition algorithm to complete the operation.

void ALU::doAddAuxFlag(unsigned char A, unsigned char B)
{
        A = A & 0x0f;
        B = B & 0x0f;
        unsigned char sum;
        unsigned char carry;
        do
        {
                sum = A ^ B;
                carry = A & B;
                carry = carry << 1;
                A = sum;
                B = carry;
        }
        while(carry != 0);
        if(sum & 0x10) setAuxCarryFlag();
        else resetAuxCarryFlag();
}


unsigned char ALU::doAddCarryFlag(unsigned short A, unsigned short B)
{
        unsigned short sum;
        unsigned short carry;
        do
        {
                sum = A ^ B;
                carry = A & B;
                carry = carry << 1;
                A = sum;
                B = carry;

        }
        while(carry != 0);
        unsigned char temp;
        if (sum & 0x100) temp = 0x01;
        else temp = 0x00;
        return(temp);
}


unsigned char ALU::twosComplement(unsigned char A)
{
        A = ~A;
        unsigned char B = 1;
        unsigned char sum;
        unsigned char carry;
        do
        {
                sum = A ^ B;
                carry = A & B;
                carry = carry << 1;
                A = sum;
                B = carry;
        }
        while(carry != 0);
        return(sum);
}


Lastly, I created an add member function using the new addition algorithm.

unsigned char ALU::doAdd (unsigned char A, unsigned char B)
{
        unsigned char sum;
        unsigned char carry;
        do
        {
                sum = A ^ B;
                carry = A & B;
                carry = carry << 1;
                A = sum;
                B = carry;
        }
        while (carry != 0);
        return(sum);
}


I then successfully compiled the files.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[B]   alutest.cc           ... OK
[CC]  alutest              ... SUCCESS


Next, I tested the addition (0x80) instruction.

lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0xff
Enter Temporary Register value
0xff
Result is 0xfe
Flag Register = 0x91
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0x7f
Enter Temporary Register value
0x01
Result is 0x80
Flag Register = 0x90
Sign flag is 1
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0x00
Enter Temporary Register value
0x00
Result is 0x00
Flag Register = 0x44
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0x08
Enter Temporary Register value
0x08
Result is 0x10
Flag Register = 0x10
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x80
Enter Accumulator value
0x80
Enter Temporary Register value
0x80
Result is 0x00
Flag Register = 0x45
Sign flag is 0
Carry flag is 1
Zero flag is 1
Parity flag is 1
Aux carry flag is 0


After testing the addition instruction, I tested the subtraction instruction (0x90).

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0xff
Enter Temporary Register value
0xff
Result is 0x00
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0xff
Enter Temporary Register value
0x00
Result is 0xff
Flag Register = 0x85
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0x02
Enter Temporary Register value
0x03
Result is 0xff
Flag Register = 0x85
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0x01
Enter Temporary Register value
0x01
Result is 0x00
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0x90
Enter Accumulator value
0x02
Enter Temporary Register value
0x01
Result is 0x01
Flag Register = 0x10
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Press c to continue, or q to quit
q


After testing the addition and subtraction instructions, I committed the ALU API files to the Subversion repository.

lab46:~/src/cpu$ svn commit -m "I implemented addition and subtraction instructions using exclusive or, and and shift operations rather than using C additiona abd subtraction operations (+,-) -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 424.


I wrote the Compare with Accumulator member function which implements the compare with Accumulator (CMP)instruction to the ALU API.

void ALU::compareWithAccumulator()
{
        unsigned char temp = twosComplement(tempreg);
        unsigned temp2 = A;
        doAddAuxFlag(temp2,temp);
        if (doAddCarryFlag(temp2, temp)) resetCarryFlag();
        else setCarryFlag();
        temp2 = doAdd(temp2, temp);
        doZeroFlag(temp2);
        doSignFlag(temp2);
        doParityFlag(temp2);
}


Next, I successfully compiled the files.

lab46:~/src/cpu/8085/arithmeticlogicunit$ make
[B]   alu.cc               ... OK
[B]   alutest.cc           ... OK
[CC]  alutest              ... SUCCESS


I then tested the compareWithAccumulator member function.

lab46:~/src/cpu/8085/arithmeticlogicunit$ ./alutest
Welcome to the 8085 alu simulator
Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0xff
Enter Temporary Register value
0xfe
Result is 0xff
Flag Register = 0x10
Sign flag is 0
Carry flag is 0
Zero flag is 0
Parity flag is 0
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0xff
Enter Temporary Register value
0x00
Result is 0xff
Flag Register = 0x85
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0xfe
Enter Temporary Register value
0xff
Result is 0xfe
Flag Register = 0x85
Sign flag is 1
Carry flag is 1
Zero flag is 0
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0x00
Enter Temporary Register value
0xff
Result is 0x00
Flag Register = 0x01
Sign flag is 0
Carry flag is 1
Zero flag is 0
Parity flag is 0
Aux carry flag is 0

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0x0f
Enter Temporary Register value
0x0f
Result is 0x0f
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0xff
Enter Temporary Register value
0xff
Result is 0xff
Flag Register = 0x54
Sign flag is 0
Carry flag is 0
Zero flag is 1
Parity flag is 1
Aux carry flag is 1

Press c to continue, or q to quit
c
Enter instruction
0xb8
Enter Accumulator value
0x00
Enter Temporary Register value
0x00
Result is 0x00
Flag Register = 0x45
Sign flag is 0
Carry flag is 1
Zero flag is 1
Parity flag is 1
Aux carry flag is 0

Press c to continue, or q to quit
q

I committed the files to the Subversion repository.

lab46:~/src/cpu$ svn commit -m "I added the compare with Accumulator instruction to the ALU API -John Rine"
Sending        8085/arithmeticlogicunit/alu.cc
Sending        include/alu.h
Transmitting file data ..
Committed revision 425.
journal/spring2011/jr018429/start.txt · Last modified: 2011/05/31 23:56 (external edit)