User Tools

Site Tools


opus:spring2012:tgalpin2:part2

Part 2

Entries

Entry 5: March 7, 2012

Today's Computer Organization class was actually a little weird. We were missing a good chunk of our class inexplicably! We still continued on with class, naturally. We started to talk about the different types of registers that different processors will implement, and how many they use. We took a look at the instruction sets for our given research processors. After a few class-wide side-tracking discussions, I was able to find out that my research processor (PowerPC) has 32 general purpose registers and 32 floating-point registers. Unfortunately, we did not get much father than this for the class.

As for HPC II, I started a new project. I'm writing a guide on updating the kernel of a Linux system. It covers the basic, easy way, and (more importantly) the difficult, manual way of doing it, which involves compiling the kernel yourself and manipulating some boot directories. Fun stuff, after you get past the “learning how to do it” part!

Entry 6: March 14, 2012

Today's class was a sort of recap and reinvestigation of topics touched on in the class before. Basically, we were discussing the idea of instructions and the bits and bytes used to call them. In our specific example we were running off of, our instructions used 4 bytes. We determined that in a so-called Greatly Reduced Instruction Set Computer (or, GRISC), we needed only a handful of commands to ultimately execute all of the actions that we need in an emulator. These included the logic operators (AND, OR, NOT) and a few others (I need to check on the board and do a bit more research, evidently!). Joe also mentioned that there should be separate versions of some of these instructions that deal with either memory or a register.

Entry 7: March 27, 2012

This will serve as a back entry for recent classes, considering a slight lack of activity. Recently, we've been discussing the instructions contained within the instruction set, and how we'd be able to represent and use them. This led to some nice diagrams on the board that highlighted how we would use 4 bytes for each instruction, and how each bit of each byte would be used. For clarity, our chosen instructions included AND, OR, NOT, BRANCH, etc. For an example of how we would use some of the bits within the given bytes, we decided that the first three bits of the first byte would represent the instruction for identification. Afterwards, for example, in the AND instruction, the next two pairs of bits would represent the register being drawn upon, with a misc. bit at the end. The first two bits of the next byte would be for the output register of the AND instruction. That would be a brief explanation of the subject which we've recently started to discuss.

Entry 8: March 30, 2012

Classes lately have been more about independent study than anything else, which is okay. There are projects, programs and opuses to be worked on. As far as relevant in class discussion goes, more time has been dedicated to discussing the properties of the instructions included with our computer simulator. Understanding these of course is important when it comes to creating a solid base to start from. The instructions seem pretty simple in a very general sense, but implementing them isn't as easy. Not necessarily difficult, but not as easy as understanding what AND does in a general sense.

Keywords

asm Keywords

Interrupt

Definition

An interrupt is a signal that can either be asynchronous or synchronous and indicates either a need for specific attention or a change in the computer's current execution. Interrupts are dealt with by the interrupt handler. Interrupts are an important part of the multitasking aspect of computers. Without interrupts, multiple programs would not be able to be run at the same time.

A hardware interrupt has the processor execute its interrupt handler after saving the execution state it left off at. A software interrupt usually takes the form of instructions within the instruction set, as we can see in the instruction sets of many of the processors we've seen.

Demonstration

A diagram of how interrupts are routed by the Linux Kernel.

[Source: tldp.org: Interrupts and Interrupt Handling

I/O

Definition

As we all know, I/O refers to Input and Output. This refers to the interaction between the forces of the outside world (say, a person, for example) and all of the components that make up the computer system. These interactions can take the form of either data or signals. Input is obviously either of those things going in to the system, and output are these things leaving the system. There are various interfaces for Input and Ouput. Some examples of Input interfaces include a keyboard or a mouse, while output interfaces can include a screen or a speaker.

Demonstration

Block diagram of I/O in a 6502 styled CPU.

[Source: http://www.cast-inc.com/ip-cores/processors/c6502/index.html]

Machine Word

Definition

Machine Word is the basic, natural unit of information used in a computer processor. The details of which are, of course, dependent on the type of processor. Words can be based off of a fixed amount of bits (ultimately, of course), bytes, digits and characters which are handled collectively by hardware or the instruction set of the processor. The length of the words used by the processor is an important, defining characteristic, which would be how we determine what X-bit a processor is (as in 32-bit or 64-bit, for example).

Instruction Sets

Definition

An Instruction Set is the compiled set of machine words and native commands that can possibly be carried out by a given processor. Instruction sets will vary in size along with the variation of processors.

There are different types of instruction sets, notably CISC and RISC instruction sets.

CISC stands for Complex Instruction Set Computer, whereas RISC stands for Reduced Instruction Set Computer. CISC means that single instructions can perform multiple lesser tasks, and RISC means that smaller, simpler instructions will be used in the hopes that these smaller instructions will execute quicker, leading to better performance.

Demonstration

Here is the 6502's instruction set, as an example–

http://www.masswerk.at/6502/6502_instruction_set.html

Registers (Stack Pointer, Program Counter, Flag/Status)

Definition

These are some of the different types of special purpose registers that can be used:

  • Stack Pointer: A type of hardware register which points to the most recently used location of a stack (which is usually a group of memory locations).
  • Program Counter: A register within the processor which tells where the computer currently is within the program sequence. It is incremented after completing an instruction, and holds the address of the next instruction.
  • Flag/Status Register: Hardware register that details information on the current state of the process being executed.

Registers (Index/Pointer)

Definition

An index register is used to modify certain addressing while an operation within a program is taking place. The contents of the register are added to an address being used in the instruction to form the location of the actual data.

Pointer registers include either stack pointer registers or base pointer registers. The stack pointer was obviously mentioned in the above keyword. A base pointer is a general-purpose register that points to the base of the stack of instructions/memory locations.

Demonstration

von Neumann vs. Harvard architecture

Definition

These are two different styles of computer architecture, which describes the design and function of a computer that uses it.

von Neumann architecture was developed by John von Neumann around 1945, and suggests that a processing unit has several different divisions within it, each assigned specific processing duties. These divisions include the ALU, registers, memory, I/O, etc. It is also referred to as stored-program, as instructions can not be fetched an executed at the same time.

Harvard architecture is different in that it can fetch and execute instructions at the same time. This is because it has physically separated storage and signal pathways dedicated to instructions and data respectively. This, naturally leads to a faster computer.

Demonstration

Binary and Hexadecimal Number Representation

Definition

Binary and Hexidecimal are two different types of number systems. To new CS students, number systems may be confusing, as the only number system we grow up with would be decimal (i.e. 0-9, 0, 1, 2, 3, …). However, we do not use decimal when it comes to the finer, inner workings of a computer. We use binary and hexidecimal instead.

Most people have heard of binary. Binary has a two number digit system, which is most commonly represented as 0 and 1. A binary digit is known as a bit. As we know, eight bits are a unit known as a byte. As is such, binary has an inherent importance to computers.

Hexidecimal, on the other hand, is a little more confusing. It uses a 16 number digit system, which means that a digit can be incremented 16 times before a new bit is added. Most commonly, hexidecimal is represented from 0 to F (explained below). It is commonly used in addressing and color codes.

Demonstration
Binary

Digits: 0, 1 Counting: 0, 1, 10, 11, 100, 101, 110, 111, 1000, etc.

Hexidecimal

Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Counting (by 5): 0, 5, A, F, 14, 19, 1E, 23, etc.

asm Objective

asm Objective: Familiarity with the role of the C library

Definition

In order to effectively code generally, let alone for a computer simulator, one must know how to use the numerous functions that the C library has to offer.

Method

Discussion on the topic along with some code examples.

Measurement

We make use of many different functions within the C library, and most often these functions come from the specific library of stdio.h and stdlib.h. stdio.h obviously is our standard library that contains the basic functions for input and output, such as our trusty printf and scanf and its many variations. stdlib.h opens things up for us as far as what we can do with code, as it provides us with dynamic memory allocation functions such as malloc, realloc and free, lets us generate “random” numbers, convert strings to other data types and manipulate the working environment with certain exit commands.

These two libraries account for much of what we do in our classes, and knowing them is integral to being able to efficiently transfer ideas and concepts in to working code.

Analysis

I believe I have met the goal, as there isn't a whole lot here that I can do to demonstrate a familiarity with how the C library works.

hpc2 Keywords

make/Makefile

Definition

make is a Linux program that updates parts of a large program when it is determined that those parts need to be recompiled. Once this happens, make will issue the commands needed to carry out the needed processes.

In order to use make, a makefile is needed. A makefile contains information that details how the parts of a program are related, and how they should be updated. make will search your directory for “Makefile” or “makefile.”

Demonstration
tyler@aleron ~/example $ ls
Makefile README examplesrc.c othersrc.c examplelib.h
tyler@aleron ~/example $ make

GRUB (Linux Bootloader)

Definition

GRUB, whose name is derived from Grand Unified Bootloader, is a bootloader with multiboot functionality, which means that it can load multiple different systems at start up. A bootloader is a program that runs at startup and loads the kernel of the operating system, which then loads the rest of the operating system.

GRUB is highly configurable, with many different options available. Basically, one can choose a specific operating system out of how ever many they have loaded on to their system. Even further, if one of these operating systems has multiple versions of kernels, you can choose which version you'd like to boot up with. Also, GRUB provides a simple command line like interface during boot up.

Demonstration

Below, GRUB running during boot up.

[Source: Wikipedia: GNU GRUB]

kernel.org

Definition

kernel.org is the Linux Kernel Archives, the website where one can find Linux kernels for download. The newest stable version, the newest unstable version, and past stable versions are available here. You can download installable patches, view changelogs, and download the full source code for each kernel, should you want to compile it yourself. It goes without saying that if one wished to manually update their Linux kernel, here would be a good place to start.

Demonstration

Added Repositories

Definition

The added repositories on your system are what your system draws on as software sources. They are used in the updating, repairing and installing of packages on your system. Mainline distributions of Linux have their on repository that installations of their distribution have installed by default, and often times, they have repositories from other distributions that their OS is based on (example: Ubuntu has repositories for Debian on their systems, and Mint has repositories from Ubuntu and consequently Debian). You can add (or remove) whatever repositories suit the needs of your system.

Demonstration

One can add or remove repositories through Synaptic Package Manager, as shown above. Go to Settings → Repositories.

Linux swap partition

Definition

During the initial partitioning of the hard drive during the installation of a system, a Linux swap partion (linux-swap) is needed. This swap partition is an extra amount of space on the hard drive that is set aside for the system to use when RAM is not readily available. Without such a thing, a system may become unstable, depending on its use. Use of this swap space will free up RAM for prominent tasks within the system, making for faster processing, while the tasks being used less at the time are put in to the swap partition, assuming it is taking up space in RAM. Conventional wisdom dictates that the amount of storage dedicated to swap should be twice as large as the amount of RAM you have, though this is by no means an objective standard.

Demonstration

This is reusing a picture, but you can plainly see the amount of memory allocated to swap in Gparted.

Now, this is how tasks are swapped:

Task 1 is being run, using memory in RAM
Task 1 is now in standby, not priority task in system, still taking up RAM
Task 2 is being run as a priority, needs more RAM than is currently easily available
Task 1 is swapped to the swap partition on the disk
Task 2 uses RAM to execute faster
etc. etc.

Software Package

Definition

A Software Package is a specific piece of software that a system can install and uninstall using a package management program such a Synaptic or Aptitude, as opposed to manipulation through a file manager. Packages are useful, because they contain metadata that can be read by your package management system such as description, version name, and the other packages needed in order for the given package to work. Ultimately, the use of packages makes updating and maintenance relatively simple and efficient.

Demonstration

A picture of GDebi, a package manager that deals with .deb packages, installing a package on Ubuntu.

[Source: Wikipedia: GDebi ]

Dependencies

Definition

Dependencies refer to the software packages a system needs in order to install and use a given package. Dependencies are often made known when the user prompts the system to install a given package, due to the metadata provided with it. Often times, a package management system can go and fetch the dependencies for a package when the installation prompt is made. Naturally, all of these situations use the repositories added to your system.

Demonstration

A window showing the dependencies needed for a selected package in Synaptic.

dpkg

Definition

dpkg is a low-level packaging tool found in Debian-based system. As is such, it is used from the command line and it manages .deb packages on the system. Being a lower-level tool, it is not used as often as often as tools like apt, which are much more user-friendly, but dpkg comes in handy when you need (and are able) to get your hands dirty within the system, so to speak.

Demonstration

Use of dpkg:

Install a package:

tyler@aleron ~ $ dpkg -i examplepackage.deb

Install a list of packages:

tyler@aleron ~ $ dpkg -l examplepackage.deb otherpackage.deb ohlookanotherdeb.deb

Remove a package:

tyler@aleron ~ $ dpkg -r examplepackage.deb

hpc2 Objective

hpc2 Objective: Demonstrate knowledge of Linux & Open Source

Definition

The only way to have true knowledge of the world of Linux and Open Source software and philosophy is to have hands-on experience with it. One must understand the importance of the availability of code that is free to use and modify.

Method

Well, shucks. Why don't I just talk about my experience with Linux and Open Source software for a bit, yeah?

Measurement

I've been using Linux since I began my time here at CCC, and I've been using open source software for longer, whether or not I realized the implications behind open source. First and foremost, from this, I've learned the utility of open source software, and the supreme convenience of having powerful, effective software that met my needs, and could be modified further to meet specific needs, provided I had the knowledge and the inclination. Many of these open source solutions provided a superior end product to their proprietary counterparts.

Linux has provided me with greater insight to the inner workings of a computer's operating system, along with an alternative, that is superior in various ways, to the same OS that has been forced on me for most of my life. It, too, allowed me to have a system which suited me best, and, more importantly, did not require a significant amount of technical knowledge to achieve that system. Through manipulating the system through a terminal, altering the packages on the system, stylizing and experimenting with various desktop environments, a greater understanding of Linux is gained, along with a better general understanding of computers. This is demonstrated in myself through my various Linux related troubleshooting projects and general discussions.

Analysis

I think my goal is met. At the very least, my laptop should be sufficient evidence of my knowledge on the subject.

Experiments

Experiment 4

Question

What is the question you'd like to pose for experimentation? State it here.

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

Experiment 5

Question

What is the question you'd like to pose for experimentation? State it here.

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

Retest 2

Perform the following steps:

State Experiment

Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.

Resources

Evaluate their resources and commentary. Answer the following questions:

  • Do you feel the given resources are adequate in providing sufficient background information?
  • Are there additional resources you've found that you can add to the resources list?
  • Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
  • If you find a deviation in opinion, state why you think this might exist.

Hypothesis

State their experiment's hypothesis. Answer the following questions:

  • Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
  • What improvements could you make to their hypothesis, if any?

Experiment

Follow the steps given to recreate the original experiment. Answer the following questions:

  • Are the instructions correct in successfully achieving the results?
  • Is there room for improvement in the experiment instructions/description? What suggestions would you make?
  • Would you make any alterations to the structure of the experiment to yield better results? What, and why?

Data

Publish the data you have gained from your performing of the experiment here.

Analysis

Answer the following:

  • Does the data seem in-line with the published data from the original author?
  • Can you explain any deviations?
  • How about any sources of error?
  • Is the stated hypothesis adequate?

Conclusions

Answer the following:

  • What conclusions can you make based on performing the experiment?
  • Do you feel the experiment was adequate in obtaining a further understanding of a concept?
  • Does the original author appear to have gotten some value out of performing the experiment?
  • Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).
opus/spring2012/tgalpin2/part2.txt · Last modified: 2012/04/11 09:14 by tgalpin2