Teaching C for Operating Systems ================================ Lecture 1: Introduction to C * Why C? * Hello World * Compilation * printf * variables * variables as memory * loops, conditionals * functions * sizeof * arrays * int types * strings * bitwise operators * linking, libc, libm * preprocessor directives Lecture 2: I/O and processes * string functions * sprintf * file pointers * scanf * file I/O - fprintf, fread, fwrite, fopen * file permissions * perror, errno * file descriptors * strace * system calls - read, write, open * executing processes * fork Lecture 3: Data Structures and Pointers * enumerated types * data structures * typedef * initialisation vs declaration of variables * the stack * scope * static variables, functions * pass by reference vs pass by value * pointers * * and & operators * arrays as pointers * arrays of pointers Lecture 4: Adventures in Memory * revising pointer basics? * the NULL pointer * the void pointer * casting * pointer arithmetic * segmentation faults * null termination * malloc and free * realloc, calloc * memset, memcmp * memory leaks * gdb * valgrind * Makefiles * function pointers ASSIGNMENT 1: Emulated Shell + extra funcs Lecture 5: Networking * client/server networking * byte ordering * sockaddrs * time functions * timeval, time_t * select * event-based programming Lecture 6: Threads * threading concepts - locking etc. * pthreads ASSIGNMENT 2: Double Linked List of Timers Lecture 7: Kernel module programming Lecture 8: Basic character device driver ASSIGNMENT 3: Threaded I/O Lecture 9: /proc/ Lecture 10: skbs, networking Lecture 11: Lecture 12: ASSIGNMENT 4: Extend Minix