본문 바로가기

분류 전체보기222

node pre-commit 훅 설정하는데 참고한 글들 보호되어 있는 글 입니다. 2022. 7. 7.
[프로그래머스] 여행경로 - 파이썬 BFS 꼭 BFS로 풀어야 하는 문제는 아닙니다. 그냥 간만에 BFS 연습할 겸 BFS로 풀어보았습니다. 중복티켓을 위한 테스트 케이스 tickets: [["ICN", "A"], ["ICN", "A"], ["ICN", "A"], ["A", "ICN"], ["A", "ICN"]] Return: ["ICN", "A", "ICN", "A", "ICN", "A"] 출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/courses/30/lessons/43164# 코딩테스트 연습 - 여행경로 [["ICN", "SFO"], ["ICN", "ATL"], ["SFO", "ATL"], ["ATL", "ICN"], ["ATL","SFO"]] ["ICN", "ATL", "ICN", "SF.. 2022. 6. 22.
install_page 코드 static bool install_page (void *upage, void *kpage, bool writable) { struct thread *t = thread_current (); /* Verify that there's not already a page at that virtual * address, then map our page there. */ return (pml4_get_page (t->pml4, upage) == NULL && pml4_set_page (t->pml4, upage, kpage, writable)); } 목적 페이지 테이블에 upage(user virtual address) -> kpage(kernel virtual address) 매핑을 추가함. unmappe.. 2022. 6. 11.
load_segment 코드 static bool load_segment (struct file *file, off_t ofs, uint8_t *upage, uint32_t read_bytes, uint32_t zero_bytes, bool writable) { ASSERT ((read_bytes + zero_bytes) % PGSIZE == 0); ASSERT (pg_ofs (upage) == 0); ASSERT (ofs % PGSIZE == 0); file_seek (file, ofs); while (read_bytes > 0 || zero_bytes > 0) { /* Do calculate how to fill this page. * We will read PAGE_READ_BYTES bytes from FILE * an.. 2022. 6. 11.