For today:
1) Read Think OS Chapter 2 and do the reading quiz
2) Start Homework 2
3) Prepare for a quiz (here's last year's quiz as practice)
Today:
1) Quiz
2) HFC Chapter 2
3) TOS Chapter 2
4) Linux tutorial, part two
For next time:
1) Finish Homework 2
2) Read Head First C, Chapter 2.5
3) Finish Linux tutorial, part two, whatever we don't do in class.
HFC Chapter 2
The figure on page 43 represents the "address space": learn it, live it, love it.
Also memorize page 59, which explains the differences between pointers and arrays.
Notes on sizeof:
1) Looks like a function, actually a compile-time operator.
2) Knows the size of built-in types.
3) Knows the size of statically allocated variables.
4) Does not know the size of dynamically allocated things (or a small string in a big array).
If you write a function that takes a string parameter, I suggest you declare
void foo(char *s)
Rather than
void foo(char s[]) // not recommended
To remind you that the behavior of s inside foo is pointer-like, not array-like.
Memory and storage
CompArch Minimal Mental Model (MMM)
Abstraction: Providing interfaces that provide capabilities while hiding details and creating useful illusions.
Isolation: Preventing processes from interfering with each other or the OS
Multitasking: sharing the CPU!
Virtual memory: sharing the memory!
Device abstraction: sharing the devices!
Picking up from where we left off in UNIX Tutorial for Beginners:
1) Work through Tutorial Four on wildcards, filenames, and man pages.
Read the man page for puts.
2) Work through Tutorial Five on access rights and processes.
3) Work through Tutorial Six, other useful UNIX commands.