User Tools

Site Tools


blog:spring2016:ahoover3:journal

This is an old revision of the document!


HPC Experience ][ Journal

MONTH Day, YEAR

This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
  • Why was this significant?
  • What concepts are you dealing with that may not make perfect sense?
  • What challenges are you facing with respect to the course?

Systems Programming Journal

January 21st, 2016

  • unistd equates to unix standard
  • header files are a good source of documentation
  • asm-generic/errno-base.h: gives error code names
  • apropos is really useful
  • man 3 getopt - play with it

Day 2: implementing cat2.c, the updated version.

We are using the read function instead of read, open for fopen, and write instead of printf for more universality. These are system calls.

posix standard allows for universal system error codes, among other things. It defines system behaviors.

fopen returns FILE* (which is a struct), but open returns an int, which is known as a file descriptor.

fdopen takes a file descriptor and creates a file pointer in order to cross between the two.

For next time

  • what does the system call to chmod do?
  • command line arguments
  • -e, -n, help and version implementation
  • user include directory
  • look at getopt; see above

January 26th, 2016

Continuing the making of cat2.c

implementing getopt so that we can use:

  • -n –number
  • -E –show-ends
  • –help
  • –version

January 28th, 2016

Moving on from cat into the “who” command!

/var/log/wtmp* → shows login data into lab 46.

apropos utmp → u stands for user. See section 5 for configuration items. The header files are located within this file. (man 5 utmp)

Manual page utmp(5) line 26: shows the ut_type translations.

when logging in, ssh calls the login command, and login makes note of the login.

POSIX

Portable Operating System Interface, a set of formal descriptions that provide a standard for the design of operating systems, especially ones that are compatible with Unix.

Origin

1980s: from the initial letters of portable operating system + -ix suggested by Unix.

Life before POSIX = madness.

BSD - Berkeley Standard Distribution (from UC Berkeley)

man gettimeofday, man ctime

February 2nd, 2016

Adjusted the time output to include month, day hour and min using the tm struct.

Chmod (change mode) section 2 . we are using the chmod files in order to implement the + & - in our own implementation of who. (who2)

%o prints out in octal

stat man page

including sys/types.h & sys/stat.h

Today we created who2.c as a more functional and closer looking version to the actual who command.

Our first project is to create a version of chmod command.

  • include sys/stat.h

February 4th, 2016

Today, we are taking on the program of “ls”.

In order to do this, we use man pages such as closedir, opendir, readdir, scandir.

When printing out, we use the attributes of the directory which are name, inode, type, etc.

In scandir, we begin to see the insane (yet still understandable) use of double and even triple pointers. woot.

Alphasort helps us put our results in alphabetical order. :

we are using the extra libraries of <sys/types.h> and <dirent.h>

Section 2 stat man page. displaying file permissions is tedious as all hell. At least in the way that we did it.

blog/spring2016/ahoover3/journal.1454605386.txt.gz · Last modified: 2016/02/04 17:03 by ahoover3