nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
onetime mapper

PMA 에 접근하기 위해 임시로 VMA 영역에 매핑 한다. More...

Functions

void * onetime_map (void *pma)
 PMA 를 VMA 로 매핑한다. More...
 
void onetime_map_init (void *vma_start, void *vma_end)
 onetime map 초기화 More...
 
void * onetime_unmap (void *vma)
 임시로 사용되던 VMA 값을 다시 초기화 한다. More...
 

Detailed Description

PMA 에 접근하기 위해 임시로 VMA 영역에 매핑 한다.

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2012-01-17

Function Documentation

void* onetime_map ( void *  pma)

PMA 를 VMA 로 매핑한다.

Parameters
[in]pma물리 메모리
Returns
void * VMA 에 매핑된 영역의 주소

Definition at line 91 of file onetime_map.c.

References info::bitmap, info::bitmap_sz, NULL, and s_info.

Referenced by fdc_read(), fdc_write(), and page_fault_handler().

Here is the caller graph for this function:

void onetime_map_init ( void *  vma_start,
void *  vma_end 
)

onetime map 초기화

Parameters
[in]vma_start사용할 가상 메모리 영역의 시작 주소
[in]vma_end사용할 가상 메모리 영역의 마지막 주소
Note
onetime_map_init 함수는 페이지 디렉토리에서, 설정된 가상 메모리 영역에 해당하는 페이지 테이블들을 준비해 주는 역할을 한다. 각 페이지 테이블들은 커널 메모리 영역에 존재하는 것으로, 모든 프로세스가 공유하게 된다. 테이블(4KB) 의 할당은 initm 을 이용해서 처리한다. onetime_map_init 함수는 쓰레드까지 초기화 된 이후에 사용되어야 한다.
Note
최상위 부모 즉 커널의 Page directory 를 얻어온다.

Number of pages

Number of bytes, each bytes is able to represent 8 pages

Note
페이지 디렉토리에서, 일회성 가상 메모리 매핑 함수가 사용할 메모리 공간에 해당하는 페이지 테이블들을 initm 을 이용해 미리 준비해 둔다. 커널 영역에서 사용되는 페이지들은 모든 다른 프로세스의 페이지 디렉토리에서도 공유 될 것이다. 페이지 디렉토리에 대한 접근 없이도, 특정 페이지 테이블의 엔트리를 직접 수정하여 현재 PGD 에서도 이미 지정된 주소를 이용해 접근할 수 있도록 page table 들의 주소를 기록해둔다.

Definition at line 208 of file onetime_map.c.

References _SC_PAGESIZE, thread::arch_data, info::bitmap, info::bitmap_sz, initm_alloc(), initm_find_pma(), initm_find_vma(), initm_vma(), malloc(), memset(), pgde::p, x86_arch_data::pma_pgd, pgde::pt_base, pthread_self(), thread::root, pgde::rw, s_info, sysconf(), TO_IDX, info::vma_end, and info::vma_start.

Here is the call graph for this function:

void* onetime_unmap ( void *  vma)

임시로 사용되던 VMA 값을 다시 초기화 한다.

Parameters
[in]vma임시 할당 했던 VMA 주소
Returns
void * 임시 할당에 사용했던 PMA 주소

Definition at line 150 of file onetime_map.c.

References _SC_PAGESIZE, thread::arch_data, assert, info::bitmap, initm_find_vma(), NULL, pgte::p, pgte::page_base, x86_arch_data::pma_pgd, pthread_self(), thread::root, s_info, sysconf(), TO_IDX, info::vma_end, and info::vma_start.

Referenced by fdc_read(), fdc_write(), and page_fault_handler().

Here is the call graph for this function:

Here is the caller graph for this function: