Unix System Overview Flashcards
what is an operating system?
the software that controls the hardware resourses of the computer. and provides an environment under which programs can run. (generally called the kernel).
In broad sense, an operating system is the kernel and all the other software that makes a computer useful.
What is the interface to the kernel?
It is a layer of software called the Systems calls.
What is Libraries used for in this?
contains common functions which are built on top of the system call interface.
What is the shell?
it is a special application that provides an interface for running other applications.
is a command line interperater that reads user input and executes commands
What does “other software “ refer to when talking operating systems?
software includes: system utilities, applications , shells, libraries of common functions, ect.
give an example of an operating system that uses Linux
GNU/Linux operating system (commonly referenced as Linux).
Linux is the kernel used by the GNU operating system.
What would you find if you look at our entry in the password file?
login name encrypted password, numeric user ID (205) numeric group ID (105) a comment field home directory shell program (*note: newer systems have moved encrypted password to a Different file.)
what is an interactive shell?
the user input to a shell is normally from the terminal
What is a shell script?
A file from which commands will be entered in to run.
What are the only 2 chars that cannont appear in a filename?
slash character (/) and the null character
how many filenames are automatically created whenever a new directory is created?
Two.
current directory
and the parent directory.
(fun fact: in the root directory the dot-dot is the same as dot)
describe C preprocessor
Macro processor automatically used by C compiler to transform ur program before compilation. (ablility for inclusion of header files, macro expansions, and line conditional compilation, system files )
describe modifier “const”
can make types or pointers read only/ cant change without casting (const) away.
difference between const and static
static variable can be change anywhere within its scope. but can only be used within what the function it is in.
so if you call a static global variable then can be used anywhere in that file.
describe pointer
a datatype in C and is an address of some place in memory.
list 4 things pointers can point to in C
global variables
local variables
functions
dynamically allocated memory
describe what this means:
pointers and arrays are same concept in C
arrays use pointer
but not all pointers are arrays
*note: int *dp
dp[cnt] == *(dp+cnt)
where does your file system start?
everything starts in root directory whose name is the single char /.
what does function stat and fstat return?
it returns a structure of information containing all the attributes of a file. such as type of file, directory size of file, owner of file, permissions for file, last modified
what are names in a directory called?
filenames
what is it called when a pathname begins with a slash?
absolute pathname
what is it called when a pathname does not begin with a slash?
relative pathname
what does relative pathname refer to?
refers to files relative to the current directory
what command is used to compile a c file into an exicutable
cc programName.c
gcc for GNU C complilation
what is working directory
the directory from which all relative pathnames are interpreted.
how can a process change its working directory
by using the chdir fucntion
describe what this pathname tells
/usr/lib/lint
is an absolute pathname that refers to the file or directory lint in the directory lib, in the Root directory usr
what is our working directory when we log in?
it is set to our home directory.
where is our home directory obtained?
it is obtained from our entry in the password file
describe file descriptors
small positive nums that kernel uses to identify the files being accessed by a particular process.. all open files are referred to by file descriptors
what 3 descriptors does shell open whenever a new program is run?
standard input 0 (buffered), standard output 1 (buffered), standard error 2 (unbuffered)
unbuffered I/O is provided by functions…
open, read, write, lseek, and close. these functions all work with file descriptors
describe a program
is an executable file residing on disk in a directory. program is read into memory and is executed by kernel as a result of 1 of 6 exec functions.