2018/09/08

    [ARMv8] aarch64 프로세서 상태 레지스터(PSTATE)

    [ARMv8] aarch64 프로세서 상태 레지스터(PSTATE)

    PSTATE는 프로세서 상태 레지스터입니다. 이 레지스터를 이용해 프로세서의 상태를 알수도 있고 설정할 수도 있습니다. 아래 그림은 ARM Developer 페이지에서 가져온 그림입니다. PSTATE field를 정의해 놓았습니다. (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/BABICCBC.html) PSTATE의 각 비트가 하나 씩 어떤 행위를 하는지 정리해보겠습니다. N(Negative Condition Flag) : 연산의 결과 값이 음수인 경우 설정되는 비트 Z(Zero Condition Flag) : 연산의 결과 값이 0인 경우 설정되는 비트C(Carry Condition Flag) : 캐리 발생 시 설정되는 비트..

    [커널분석] parse_early_param()

    parse_early_param() 함수는 커널 부트업 타임에 사용하는 early parameter를 파싱해 오는 함수로 boot command line을 파싱해오는 역할을 합니다. parse_early_param()init/main.c1234567891011121314/* Arch code calls this early on, or if not, just before other parsing. */void __init parse_early_param(void){ static int done __initdata; static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata; if (done) return; /* All fall through to do_early_par..