본문 바로가기
728x90

정글 2기/OS 운영체제25

[Pintos] Project 4_File Allocating Table(FAT) vs multi-level index [Pintos] Project 4_File Allocating Table(FAT) vs multi-level index 파일 시스템에서는 1) 자료구조 2) 접근방법 이 중요하다. 데이터 블록의 위치를 표현하는 대표적인 방식은 inode를 이용한 방식 중 하나인 multi-level index와 linked list 개념을 이용한 File allocating table(FAT)가 있다. File allocating table(FAT) 자료구조 : FAT 접근방법 : linked list의 table화 File allocating table은 linked list의 pointer를 table로 따로 관리하고 있다. 메모리에 올려 사용 가능히다. inode가 없다. linked list는 블럭을 읽는 연산이.. 2021. 10. 31.
[pintos] Project 3_Virtual Memory(가상 메모리)_실행순서 [pintos] Project 3_Virtual Memory(가상 메모리)_실행순서 // 실행순서 # VM ## 실행 순서 initd -> supplemental_page_table_init -> hash_init ->hash_clear -> page_hash -> page_less -> process_exec -> process_cleanup -> susplemental_page_table_kill -> supplemental_page_table_init -> load -> pml4_create -> load_segment -> vm_alloc_page_with_initializer : file 정보를 page 구조체에 저장 후 spt에 추가. load를 위한 준비과정 -> spt_find_page -.. 2021. 10. 28.
[pintos] Project 3_Virtual Memory(가상 메모리)_2 [pintos] Project 3_Virtual Memory(가상 메모리)_2 Memory mapped files mmap and munmap System Call void *mmap (void *addr, size_t length, int writable, int fd, off_t offset); // systcall.c void syscall_handler (struct intr_frame *f UNUSED) { // TODO: Your implementation goes here. switch (f->R.rax) ... case SYS_MMAP: f->R.rax = (uint64_t) mmap ((void*) f->R.rdi, (size_t) f->R.rsi, (int) f->R.rdx, (int).. 2021. 10. 27.
[pintos] Project 3_Virtual Memory(가상 메모리) [pintos] Project 3_Virtual Memory(가상 메모리) Introduction Memory Management Implement Supplemental Page Table void supplemental_page_table_init (struct supplemental_page_table *spt); supplemental page table을 initialization 한다. new process start (initd of process.c)할 때나 process가 fork(__do_fork of process.c)할 때 실행된다. //vm.c void supplemental_page_table_init (struct supplemental_page_table *spt) { str.. 2021. 10. 19.
[three_easy_pieces] 주소 공간의 개념 요약 [three_easy_pieces] 주소 공간의 개념 요약 컴퓨터가 고가 -> CPU 이용률 증가 필요 -> batch가 아닌 시분할(Time sharing)-> 시분할 초기 방식 - 느림 -> 시분할 후기 방식. 메모리 공유, 메모리 가상화 시분할 방식 초기 - 레지스터 상태 저장, 복원 빠르지만, 메모리 내용 전치 디스크에 저장하는 것이 엄청 느림 -> 짧은 시간 동안 실행 -> 프로세스 중단 시점의 모든 상태(물리 메모리 포함)를 디스크 종류의 장치에 저장 후 다른 프로세스의 상태를 메모리에 탑재 -> 짧은 시간 동안 실행 가상 메모리 시스템(VM)의 목표 투명성(Transparency) - 가상 메모리의 존재를 인지하지 못하도록 메모리 시스템 구현 효율성(Efficiency) - 시간, 공간 보호.. 2021. 10. 15.
[Pintos] Project 1, 2_Argument parsing, User Program_system call_code analysis [Pintos] Project 1, 2_Argument parsing, User Program_system call_code analysis 1 ARGUMENT PASSING *목표 명령어와 함께 들어온 인자들을 user program의 user stack에 정해진 순서에 따라 넣어준다. *예시 'bin/ls -l foo bar'이 커맨드라인에 들어오면 argv[0] = 'bin/ls\0', 'argv[1] = -l\0', argv[2] = 'foo\0', argv[3] = 'bar\0'으로 parsing(문자열 분리)한 뒤에 아래와 같이 스택에 넣어준다. | argv[3] | ... | argv[0] | padding for 8 배수 | NULL pointer for argv[argc=4] | poin.. 2021. 10. 14.
728x90