[MIT 6.S081 Fall 2020] Lab: locks
xv6
https://pdos.csail.mit.edu/6.S081/2020/labs/lock.htmlRead in GithubMemory allocatorkmem을 CPU의 개수(NCPU)만큼의 element들을 갖는 배열로 수정한다./* kernel/kalloc.c */struct { struct spinlock lock; struct run *freelist;} kmem[NCPU];CPU마다 lock name을 다르게 만들어야 하므로, kmem 구조체에 lockname을 추가한다./* kernel/kalloc.c */#define LOCKNAME_MAX 0x10struct { struct spinlock lock; char lockname[LOCKNAME_MAX]; struct ..
Issue 1473631 (Type Confusion in Harmony Set Methods)
1-day
Environment Setting # install depot_tools cd ~ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=$HOME/depot_tools:$PATH echo -e '\nexport PATH=$HOME/depot_tools:$PATH' >> ~/.zshrc # get V8 cd ~ mkdir V8 cd V8 fetch v8 cd v8 git checkout f118dd45b7cde0d320e022068f0e98dbc53b2ba9 gclient sync -D # build V8 ./build/install-build-deps.sh gn gen out/debug --args='..
[MIT 6.S081 Fall 2020] Lab: Multithreading
xv6
https://pdos.csail.mit.edu/6.S081/2020/labs/thread.htmlRead in GithubUthread: switching between threadsthread 구조체에 레지스터를 저장할 공간과 thread가 참조할 함수 포인터를 추가한다./* user/uthread.c */struct reg { uint64 ra; uint64 sp; uint64 s0; uint64 s1; uint64 s2; uint64 s3; uint64 s4; uint64 s5; uint64 s6; uint64 s7; uint64 s8; uint64 s9; uint64 s10; uint64 s11;};struct threa..
[MIT 6.S081 Fall 2020] Lab: Copy-on-Write Fork for xv6
xv6
https://pdos.csail.mit.edu/6.S081/2020/labs/cow.htmlRead in GithubXv6의 fork() system call은 parent process의 모든 user-space memory를 child로 copy한다. Parent의 memory가 클수록 시간이 오래 걸릴 것이고, 만약 copy한 memory가 child에서 실제로 사용되지 않는다면 매우 비효율적인 작업이 된다. Copy-on-write(COW) fork의 목표는 memory가 실제로 필요한 시점에 copy하여 시간과 공간을 절약하는 것이다.Implement copy-on write실제로 copy가 진행되기 전에는 page에 대한 reference count를 증가시켜서, 나중에 사용될 예정인 mem..
[MIT 6.S081 Fall 2020] Lab: xv6 lazy page allocation
xv6
https://pdos.csail.mit.edu/6.S081/2020/labs/lazy.htmlRead in GithubLazy allocation은 메모리 효율성을 위한 메모리 관리 기법이다. 메모리 할당 요청이 들어왔을 때는 할당할 메모리의 주소만 반환하고, 그 주소에 처음으로 접근할 떄 실제로 메모리를 할당한다. 실제로 할당되지 않은 메모리에 접근을 시도하면 trap이 발생하는데, trap handler에서 메모리를 할당해주는 식으로 처리한다. 이 lazy allocation을 구현하는 것이 실습의 목표이다.Eliminate allocation from sbrk()sys_sbrk() 시스템 콜에서는 growproc()을 호출하여 프로세스에 메모리를 할당한다. growproc()은 할당할 메모리의 크..
h0meb0dy_
'분류 전체보기' 카테고리의 글 목록 (14 Page)