nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Data Structures | Functions
Architecture 초기화 함수 정의
Collaboration diagram for Architecture 초기화 함수 정의:

Modules

 인터럽트
 인터럽트 관련 아키텍쳐 독립적 인터페이스 정의
 

Data Structures

struct  memmap
 

Functions

int arch_init (void)
 
void drivers_init (void)
 
void halt (void)
 
void panic (const char *fmt,...)
 
void vm_enable (void)
 
int vm_frame_init (int cnt, int membase[], int memsize[])
 
int vm_init (struct memmap *map, uint32_t kvma)
 Kernel 이 가상 메모리상에서 동작할 수 있도록 한다. More...
 
int vm_init_done (struct memmap *map, unsigned long kpma)
 Kernel 이 가상 메모리상에서 동작할 준비가 끝나면 호출된다. More...
 
int vm_is_enabled (void)
 
void * vm_rpgd ()
 

Detailed Description

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2011-9-21

Function Documentation

int arch_init ( void  )
void drivers_init ( void  )

Definition at line 130 of file common.c.

References fdc_init(), keyboard_init(), serial_init(), and video_init().

Here is the call graph for this function:

void halt ( void  )

Referenced by __attribute__(), and do_irq().

Here is the caller graph for this function:

void panic ( const char *  fmt,
  ... 
)

Referenced by _assert(), and page_fault_handler().

Here is the caller graph for this function:

void vm_enable ( void  )
Note
Enable VM (Toggle the PE bit on Control Register 0

Definition at line 305 of file paging.c.

Referenced by vm_init().

Here is the caller graph for this function:

int vm_frame_init ( int  cnt,
int  membase[],
int  memsize[] 
)
Note
Zone 을 생성 하면서, buddy 초기화도 수행 된다
System zone 은 실제 존지 하지 않는다.

Definition at line 326 of file paging.c.

References assert, cpu_node_create(), create_zone(), dbg_printf(), EINVAL, ZONE_BASE, ZONE_HIMEM, ZONE_NORMAL, and ZONE_SYSTEM.

Here is the call graph for this function:

int vm_init ( struct memmap map,
uint32_t  kvma 
)

Kernel 이 가상 메모리상에서 동작할 수 있도록 한다.

Parameters
[in]map메모리 맵 정보
[in]kvma커널이 동작하게 될 가상 메모리 위치(Virtual address)
Returns
int 성공하면 0, 실패하면 오류값
Note
Initiate the identity area. 0 ~ 1MB is used for basic devices, like the VIDEO.
하위 주소 매핑
상위 주소 매핑
현재 커널의 PMA 주소가 VMA 에 그대로 매핑 되어, Paging 이 Enable 되더라도 현재 실행 상태에 문제가 발생하지 않도록 page table 을 구성한다. VMA (> 3GB) 로 Jump 를 하고 나서는 이 Address space 는 필요가 없으므로, 해당 Page table 들을 모두 reset 시킨다.
각 Page table 의 entry 에는 Linear address 값이 기록되어 있어야 하며, 앞서 우리는 그 값들을 설정 하였다.

Definition at line 162 of file paging.c.

References _SC_PAGESIZE, ENOMEM, memmap::env, memmap::env_size, memmap::heap_size, memmap::initm, initm_alloc(), memmap::initm_size, memmap::kernel_size, memset(), memmap::stack_size, sysconf(), memmap::tcb_size, and vm_enable().

Referenced by _start().

Here is the call graph for this function:

Here is the caller graph for this function:

int vm_init_done ( struct memmap map,
unsigned long  kpma 
)

Kernel 이 가상 메모리상에서 동작할 준비가 끝나면 호출된다.

Parameters
[in]map메모리 맵 정보
[in]kpma로딩되는 실제 메모리 위치(Linear address)
Returns
int 성공하면 0, 실패하면 오류값
Note
VMA Space 로 이동한 후 호출 된다.
Note
역변환 테이블을 구성한다.
하위 1MB 주소 매핑
하위 주소 매핑
상위 주소 매핑

Definition at line 241 of file paging.c.

References _SC_PAGESIZE, EFAULT, ENOMEM, memmap::env, memmap::env_size, memmap::heap_size, memmap::initm, initm_alloc(), initm_find_vma(), memmap::initm_size, memmap::kernel_size, memset(), memmap::stack_size, sysconf(), and memmap::tcb_size.

Here is the call graph for this function:

int vm_is_enabled ( void  )

Definition at line 318 of file paging.c.

Referenced by _start().

Here is the caller graph for this function:

void* vm_rpgd ( )

Definition at line 368 of file paging.c.

References s_rpgd.

Referenced by pthread_init().

Here is the caller graph for this function: