nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
메모리 세그먼트

GDT/LDT, TSS 구조체와 관련 함수를 선언한다. More...

Data Structures

struct  gdtr
 x86 의 GDTR 레지스터의 자료 구조 More...
 
struct  segment
 x86 의 Segment descriptor 자료 구조 More...
 
struct  tss
 x86 의 Task state segment 자료 구조 More...
 
struct  tss16
 x86 에서 16 Bits Task state segment descriptor 의 자료 구조 More...
 
struct  tss32
 x86 의 32 Bits Task state segment descriptor 의 자료 구조 More...
 

Macros

#define IO_BITMAP_SIZE   8192
 x86 에서 user level thread (또는 사용자 프로세스) 가 I/O 를 실행할 때 TSS 에서 가리키는 I/O Bitmap 으로 접근 권한을 확인한다. port 는 2 Bytes 로 기술되므로, 총 65536 개가 할당 될 수 있으며, 한 바이트 8 개 까지 표현 할 수 있으므로, I/O Bitmap 은 총 8 KB 크기가 된다. More...
 
#define TI(table)   ((table) << 2)
 GDT 인지 LDT 인 구분 More...
 
#define TI(table)   ((table) << 2)
 GDT 인지 LDT 인 구분 More...
 

Enumerations

enum  { KERNEL = 0, USER = 3 }
 
enum  {
  DESC_NULL = 0x00, DESC_KERNEL_CS = 0x01, DESC_KERNEL_DS = 0x02, DESC_KERNEL_SS = 0x03,
  DESC_USER_CS = 0x04, DESC_USER_DS = 0x05, DESC_USER_SS = 0x06, DESC_TSS = 0x07,
  DESC_COUNT = 0x08, SIZEOF_A_DESC = 8, SIZEOF_A_DESC_BIT = 3
}
 
enum  { GDT = 0, LDT = 1 }
 
enum  {
  ACCESSED = 0x01, WRITABLE = 0x02, EXPANSION_DOWN = 0x04, READABLE = 0x02,
  CONFORMING = 0x04, CODE = 0x08
}
 

Functions

void segment_init (void)
 세그먼테이션 초기화 함수 More...
 
unsigned char * tss_io_bitmap_get (void)
 현재 Task state segment 에 기록된 I/O Bitmap 정보를 가져온다. More...
 
void tss_update_kernel_stack (unsigned long esp)
 TSS 의 커널 레벨 스택 정보를 재 설정한다. More...
 

Variables

struct segment __PACKED
 

Detailed Description

GDT/LDT, TSS 구조체와 관련 함수를 선언한다.

Date
2011-8-29
Author
Sung-jae Park

Macro Definition Documentation

#define IO_BITMAP_SIZE   8192

x86 에서 user level thread (또는 사용자 프로세스) 가 I/O 를 실행할 때 TSS 에서 가리키는 I/O Bitmap 으로 접근 권한을 확인한다. port 는 2 Bytes 로 기술되므로, 총 65536 개가 할당 될 수 있으며, 한 바이트 8 개 까지 표현 할 수 있으므로, I/O Bitmap 은 총 8 KB 크기가 된다.

Definition at line 112 of file segment.h.

#define TI (   table)    ((table) << 2)

GDT 인지 LDT 인 구분

Table indicator. Local descriptor table 인지 Global descriptor table 인지

Definition at line 57 of file segment.h.

Referenced by tss_update_kernel_stack().

#define TI (   table)    ((table) << 2)

GDT 인지 LDT 인 구분

Table indicator. Local descriptor table 인지 Global descriptor table 인지

Definition at line 57 of file segment.h.

Enumeration Type Documentation

anonymous enum
Enumerator
KERNEL 
USER 

Definition at line 33 of file segment.h.

anonymous enum
Enumerator
DESC_NULL 
DESC_KERNEL_CS 
DESC_KERNEL_DS 
DESC_KERNEL_SS 
DESC_USER_CS 
DESC_USER_DS 
DESC_USER_SS 
DESC_TSS 
DESC_COUNT 
SIZEOF_A_DESC 
SIZEOF_A_DESC_BIT 

Definition at line 38 of file segment.h.

anonymous enum
Enumerator
GDT 
LDT 

Definition at line 11 of file segment.h.

anonymous enum
Enumerator
ACCESSED 
WRITABLE 
EXPANSION_DOWN 
READABLE 
CONFORMING 
CODE 

Definition at line 21 of file segment.h.

Function Documentation

void segment_init ( void  )

세그먼테이션 초기화 함수

Definition at line 52 of file segment.c.

References gdtr::base, CODE, DESC_KERNEL_CS, DESC_KERNEL_DS, DESC_KERNEL_SS, DESC_TSS, DESC_USER_CS, DESC_USER_DS, DESC_USER_SS, GDT_SET, KERNEL, gdtr::limit, memset(), READABLE, SIZEOF_A_DESC_BIT, TSS_SET, USER, and WRITABLE.

Referenced by arch_init().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char* tss_io_bitmap_get ( void  )

현재 Task state segment 에 기록된 I/O Bitmap 정보를 가져온다.

Returns
unsigned char * IO Bitmap block

Definition at line 81 of file segment.c.

References tss32::io_bitmap.

void tss_update_kernel_stack ( unsigned long  esp)

TSS 의 커널 레벨 스택 정보를 재 설정한다.

Parameters
[in]esp새로운 스택 포인터
Returns
void

Definition at line 86 of file segment.c.

References DESC_KERNEL_SS, tss32::esp0, GDT, KERNEL, tss32::ss0, and TI.

Variable Documentation

struct tss16 __PACKED