SSE3044: Operating Systems (Fall 2016)

[Projects]

  • From this semester, we will use the xv6 instructional operating system. To successfully complete these projects, you should have excellent C programming skills and be familiar with the Linux platform.
  • Required skills
    • Fluent C programming
    • Basic knowledge on Intel x86 architecture
    • Intel x86 assembly programming
    • Basic knowledge on Unix/Linux systems
    • Ability to read a large, complex program

[Lab. Class]

  • Monday, 7:00 PM, #400202 in Semiconductor Bldg.

Project #0 (Deadline: 9/21 11:59PM)

  • Install Ubuntu 16.04 -- This is an official Linux distribution we will use.
  • Install xv6 & qemu
  • Print your student ID and name in the xv6 boot message. Your name and student ID should be printed before the shell is running. This means that you have to insert a code (yeah, just a single line) into one of the xv6 kernel code.
  • Submit your screenshot to the TA.

Project #1-1 (Deadline: 10/2 11:59PM)

Project #1-2 (Deadline: 10/9 11:59PM)

  • Implement priority scheduler in xv6
  • xv6 project #1-2 testcase
  • Submit your tarball file to the TA by email with title of "[SSE3044]Project#1_2-YOURID-YOURNAME"
  • [Notice]
  - yield()함수와 관련하여 선언 error가 나는 경우, system call로서 구현이 되어있는지 확인이 필요합니다
  - xv6 project #1 result

Project #2 (Deadline: 10/30 11:59PM)

  • Implement stack growth in xv6
  • xv6 project #2 template
  • Submit your tarball file to the TA by email with title of "[SSE3044]Project#2-YOURID-YOURNAME"
  • [Notice]
  - 위의 template code에서 init.c / Makefile만 가져다 쓰셔도 무방합니다

Project #3 (Deadline: 11/20 11:59PM)

  - COW가 발생한 child process의 page table entry는 writable해야 합니다.
  - Template code에 본인이 구현한 page fault handler를 추가하셔서 사용하시면 됩니다
  - Test code도 곧 준비해드리겠습니다
  - [11/11] 본 과제에서 page fault handler가 발생하는 이유는, user가 read-only 상태인 page에 수정을 시도했기 때문입니다.
    해당 page의 count가 2 이상이라면 새로이 할당을 해주면 되고, count가 1인 경우는 자신 혼자 사용중이지만, 해당 page가
    read-only이기 때문에 fault가 발생한 것이므로 flag만 수정해주시면 됩니다.
  - [11/14] page fault handle에서 page table 연결을 새로이 하기 위해서 mappages 함수를 많이 사용하시는듯 합니다.
    mappages 함수의 내부에 *pte & PTE_P 구간에 의해 무조건 panic이 발생합니다. 굳이 함수를 사용하지 마시고 *pte
    값을 직접 설정하시는 것 만으로도 새로 할당 받은 page를 연결할 수 있습니다. (mappages 내부에도 있습니다)
  - [11/14] 지난 과제에서 사용했던 esp-addr > 32 는 제거하시면 됩니다. (stack pointer의 이동을 나타내는 것으로
    이번 과제와는 상관이 없습니다)
  - [11/14] lcr3는 TLB를 flush해주는 함수로, page table이 수정되어 새로운 연결이 만들어졌을 경우, 기존의 연결을
    무효화시키기 위해 넣어야합니다.
  - xv6 project #2,3 result

Project #4 (Deadline: 11/27 11:59PM)

  - Project 1-2에서 구현하셨던 본인의 priority scheduler를 과제에 사용합니다.
  - 새로운 thread가 만들어질 때, thread의 parent는 가장 처음있던 main thread가 됩니다. (thread가 thread_create할
    경우에도 main thread가 parent가 됩니다)
  - Struct proc의 pid인자는 isthread가 0인 경우에는 process id, isthread가 1인 경우에는 thread id로 생각합니다.
  - Schedluer에서 process냐 thread냐를 구분할 필요 없이 그대로 사용하시면 됩니다.
    (process, thread 모두 동일한 struct proc으로 관리)
  - [11/22] Proc의 isthread가 1인 경우, proc의 pid는 thread id를 나타냅니다. Parent(main thread)의 tid를 1로
    고정하고 이후 만들어지는 thread의 tid는 2부터 부여되도록 만들어주시면 됩니다.
  - [11/22] Thread가 만들어지는 과정은 fork()를 통해 process가 만들어지는 과정과 매우 유사합니다. fork()함수를
    참고하여 parent로부터 어떠한 정보를 받아내는지 유심히 살펴보시기 바랍니다.
  - [11/22] thread_create시 argument를 trapframe->esp에 넣은 후, 다음 사용을 위해 위치를 -4 해주어야 합니다.

Project #5 (Deadline: 12/11 11:59PM)

  • Implement mutex & condition variable in xv6
  • xv6 project5 template
  • Submit your tarball file to the TA by email with title of "[SSE3044]Project#5-YOURID-YOURNAME"
  • [Notice]
  - Project4에서 사용하셨던 본인의 priority scheduler, thread support를 과제에 덧붙여 사용합니다.
  - mutex_unlock, cond_signal 내부에서 unblocked thread를 깨우고 난 후, scheduling은 호출하지 않습니다.
  - xv6 project #4,5 result