CS3841
Operating Systems
Lab 1: Virtual Machine
Phileas Fogg
cs3841-2018-lab-1-foggp
...
I require a more formal lab report this quarter than I usually do. Read it through to check that ***every*** word is spelled correctly and see the checklist for more details.
# Resources
* [Lab Handout](lab1res/CS3841LinuxIntroductionLab.pdf)
* [An Introduction to Linux](https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics) (also available from the [wayback machine](https://web.archive.org/web/20180502225424/https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics))
* [Lab1 Checklist](lab1res/CS3841Lab1Checklist.pdf)
* [VirtualBox Installer](https://www.virtualbox.org/wiki/Downloads)
* [VM Baseline Image](http://www.walterschilling.org/msoe/fall20182019cs3841/SE3910CS3841Fall2018BaselineVM.ova)
* [VM Baseline Image (zipped)](http://www.walterschilling.org/msoe/fall20182019cs3841/SE3910CS3841Fall2018BaselineVM.zip)
* YouTube: [Importing C Code Files Into Eclipse](https://www.youtube.com/watch?v=DIaRhRgNfx4) (Dr. Schilling)
* YouTube: [Git GUI Linux Demonstration](https://www.youtube.com/watch?v=Ilkch3eW9J4) (Dr. Schilling)
* The listings in the Listings section below
# Hints
You may want to start downloading the VM Baseline image (see Resources above) while VirtualBox is installing, since this image is very large.
# Listings
To aid in copying the example files to your computer, the following listings are provided.
## hello.c
```
/**********************************
* hello.c
* Written by: H. Welch - 11/26/2006
* Modified W. Schilling - 8/15/2009
*
*
* Demonstrate basic C-program along with
* system call requiring struct and pointer
* manipulation.
***********************************/
#include Phileas Fogg
cs3841-2018-lab-1-foggp
...
```Makefile SHELL = /bin/sh SRCDIR = . CC = gcc YACC = bison -y CDEBUG = -g COMPLIANCE_FLAGS = CFLAGS = -save-temps $(COMPLIANCE_FLAGS) $(CDEBUG) -I. -I$(SRCDIR) LDFLAGS = -g LIBS = ################################################################################################# # List your sources here. The sources are all of the .c files that are part of the project. SOURCES = hello.c ################################################################################################# ################################################################################################# # list the name of your output program here. (i.e. myfirstprogram EXECUTABLE = hello ################################################################################################# # Create the names of the object files (each .c file becomes a .o file) OBJS = $(patsubst %.c, %.o, $(SOURCES)) include $(SOURCES:.c=.d) all : $(OBJS) $(EXECUTABLE) $(EXECUTABLE) : $(OBJS) $(CC) -o $(EXECUTABLE) $(LDFLAGS) $(OBJS) $(LIBS) %.o : %.c #Defines how to translate a single c file into an object file. echo compiling $< echo $(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $< echo done compiling $< %.d : %.c #Defines how to generate the dependencies for the given files. -M gcc option generates dependencies. @set -e; rm -f $@; \ $(CC) $(COMPLIANCE_FLAGS ) -M $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ clean : # Delete any and all artifacts from the build. The only thing which is kept is the source rm -f *.o rm -f *.i rm -f *.s rm -f *.S rm -f *.o rm -f *d rm -f $(EXECUTABLE) ```