1 Systems Programming
1 Systems Programming
◦ User space vs. kernel space ◦ In computer and inter computer communication sys-
tems
User space is restricted, cannot access hardware
directly ◦ Networking
User space software can only access their own
memory regions
Modern CPU can help enforcing these rules Compiling on Linux
◦ The administrator of the system is called root ◦ C code files are simple text files, just use file extension
.c
1/2
◦ mv source dest : to rename source to dest . You
may use this command to move a file to somewhere else
Program arguments
◦ Allows programs to receive input from command line
◦ Using program arguments instead of regular input
should be preferred as program arguments can be spec-
ified easily from another application
◦ Instead of int main(void), use int main(int argc ,
char *argv [])
◦ argc is the number of arguments. First argument is
the name of the program, so this value should at least
be one
while(*arg) {
printf("%s\n", *arg);
arg++;
}
return 0;
}
2/2