Lecture 3 - Compilation and Linking of a C Program
Let's look back at a compilation towards making a library. A simple compilation is:
gcc foo.c -o foo.o
there are two kinds of libraries:
*.a
: archive libraries. Linked at link time w/ the object files.*.so
: dynamic libraries. Linked at load time w/ the.out
from the linker.
To align up to 16 for each pointer:
Try to just have the header have buffer space up to 16 bytes. Or for each call to malloc
you can increase the number of bytes up to the nearest 16, making sure that you consider the header space being to the nearest 16 as well.
History of UNIX
This is a lot of fluff for the history, but there is three important things to note:
- The I,J,K in Dijkstra's Algorithm are in order. That's how you spell it.
- The idea of multiprogramming: the idea of having multiple programs in memory so that if one is fail/done, then you can keep running the CPU.
- Time sharing: you switch programs when your stuck or when a certain amount of time has passed
- This isn't for efficiency (it costs to switch), but it splits the workload amongst all tasks.
- A system that uses this is multics
- Over time UNICS was typed in a high-level language in B, which became more strict and known as C as we know it. It then advanced to C++ too.