- Fri 10:00am - 10:50am OHE 136, lead by Zhuojin Li (live discussion can be accessed via D2L)
Please note that programming assignments are due on Fridays. Since you are expected to have finished the an assignment before its due date, on the due date of a programming assignment, the TA will be focusing on the next programming assignment and that takes priority over the current assignment. If there is time left, the TA can discuss the current assignment.
To download all the PDF and text files below in one command, do the following inside a terminal in Ubuntu 16.04:
where USERID and PASSWORD are the user ID and password used to access protected content from our class web site. But please note that the slides can change at any time without notice. Therefore, it's a good idea to re-run the above command often to synchroniza your copy with the server!wget -r -l 1 --user=USERID --password=PASSWORD http://merlot.usc.edu/cs402-s25/discussions.html
Please note that the source code below is for the purpose of discussions and may not be identical to the code in your assignments. It would be a really bad idea (because you can lose a lot of points) to replace the code in your assignments with the code here! So, please do not replace the code in your assignments with the code here.
- Week 1
(PDF)
- gdb, warmup #1
Demo (for live discussion section):
- Week 2 (PDF) - parsing text input in C, Unix/Linux commands
- Week 3 (PDF) - introduction to warmup #2
- Week 4
(PDF)
- warmup #2 (catching SIGINT and pthread cancellation), introduction to kernel assignments (part 1)
Code in slides:
- Week 5 (PDF) - introduction to kernel assignments (part 2)
- Week 6
(PDF)
- kernel 1, kmain.c, kmain_aux.c
Code in slides:
Code (kernel)
- Week 7
(PDF)
- more on kernel 1, faber_test.c
Code (kernel)
- Week 8
(PDF)
- introduction to kernel 2
Code (kernel):
- namev.c (path name resolution code)
- Week 9
(TXT)
- kernel 2 polymorphism, vfs.c, vnode.c, vn_special.c, file.c, vfs_syscall.c, vn_mmobj_ops.c, ramfs.c, vfstest.c,
faber_fs_test
Code (kernel):
- vfs.c
- vnode.c
- vn_special.c
- file.c
- vfs_syscall.c
- vn_mmobj_ops.c
- ramfs.c (also look for any "_ops_t" in "kernel/include/fs/*.h", "kernel/fs/*.c" and "kernel/fs/ramfs/*.c")
- vfstest.c
- faber_fs_test.c
- Week 10
(PDF)
- introduction to kernel 3, the elf32 loader
Code (kernel):
- Week 11
(PDF)
- more on kernel 3, address space implementation (vmarea, mmobj, pframe, page table)
Code (kernel):
- vn_mmobj_ops.c - code for the mmobj inside a vnode
- syscall.c (in the kernel)
Code (user):- syscall.c (in the libc user space library)
Kernel 3 FAQ: - Week 12
(TXT)
- objdump, page fault handling, hello
Code (kernel):
- pagefault.c
- syscall.c (in the kernel)
- vn_mmobj_ops.c - code for the mmobj inside a vnode
Code (user):
Kernel 3 FAQ:
Useful Linux commands:objdump --disassemble --section=".text" user/usr/bin/hello.exec objdump --disassemble --section=".text" -S user/usr/bin/hello.exec objdump --headers user/usr/bin/hello.exec xxd -g 1 user/usr/bin/hello.exec
Useful GDB commands:add-symbol-file user/usr/bin/hello.exec 0x08048094 b __libc_static_entry b main b *0x12345678 layout asm layout next si info registers kernel info vmmap_mapping_info curproc->p_vmmap
- Week 13
(TXT)
- fork(), user space shell
Code (user):
Remaining user space programs:
Kernel 3 FAQ:Code (user):
Kernel 3 FAQ: - Week 14 - (no discussion section this week)
- Week 15 - (no discussion section this week)
Week #Quiz #DateCoverage3-1/31no quiz (warmup1 due on Fri)6-2/21no quiz (warmup2 due on Fri)9-3/14no quiz (kernel1 due on Fri)--3/21no quiz (spring recess)10-3/28no quiz (Midterm Exam on Wed)12-4/11no quiz (kernel2 due on Fri)14-4/25no quiz15-5/2no quiz (kernel3 due on Fri)