리눅스 커널

2023. 12. 26. 11:47b정리/모던 리눅스 교과서

728x90
반응형

 

커널은 사용자(앱)들에게 API를 제공한다. 이번에는 커널이 무엇인지, 그리고 구성요소뿐 아니라 이를 어떻게 생각 해야 하는지 등을 살펴본다. 

3가지 계층

  • 하드웨어 계층

CPU와 메인 메모리부터 디스크 드라이브, 네트워크 인터페이스는 물론 키보드나 모니터 같은 주변 디바이스까지 모두를 일컫는다.

  • 커널 계층

init 시스템과 시스템 서비스(네트워킹 등)처럼 많은 구성요소가 있지만, 엄밀히 말하면 이들은 커널의 일부가 아니라는 점을 유의하자.

  • 사용자 영역 계층

셸 같은 운영체제 구성요소, ps나 ssh같은 유틸리티, X윈도우 시스템 기반 데스크톱 같은 그래픽 사용자 인터페이스를 비롯해 대부분의 앱이 실행되는 곳을 일컫는다.

 

이 책에서는 주로 그림 2-1의 상위 두 계층, 즉 커널과 사용자 영역에 중점을 둔다. 하드웨어 계층은 이번 2장과 그 밖에 관련이 있는 몇몇 장에서만 다룬다.

 

다른 계층 간의 인터페이스는 리눅스 운영체제 패키지의 일부이며 잘 정의돼 있다. 커널과 사용자 영역 사이에는 시스템 콜이라는 인터페이스가 있다. 이에 대해서는 48페이지의 '시스템 콜'절에서 자세히 살펴본다.

 

하드웨어와 커널 사이의 인터페이스는 시스템 콜과 달리 단일 인터페이스 아니라 일반적으로 하드웨어별로 그룹화된 개별 인터페이스 모음으로 구성된다.

  • CPU 인터페이스
  • 메모리와 인터페이스
  • 네트워크 인터페이스와 드라이버
  • 파일시스템과 블록 디바이스 드라이버 인터페이스
  • 캐릭터 디바이스, 하드웨어 인터럽트, 키보드, 터미널, 기타 I/O 등의 입력 디바이스를 위한 디바이스 드라이버

셸, grep, find, ping 같은 유틸리티처럼 일반적으로 리눅스 운영체제의 일부로 여기는 많은 것이 실제로는 커널의 일부가 아니라 사용자 영역의 일부이다. 다운로드하는 앱과 매우 유사하다.

 

커널 모드는 추상화를 제한함으로써 빠르게 실행함을 의미하는 반면,

사용자 모드는 상대적으로 느리지만 더 안전하고 편리한 추상화를 의미한다.

CPU 아키텍처

리눅스는 다양한 CPU 아키텍처에서 실행된다. 제너릭 코드와 드라이버는 물론이고, 리눅스 커널은 아키텍처별 코드도 포함하고 있다.  cpu를 파악하는 방법은 여러 가지가 있다.

  • lscpu
  • cat /proc/cpuinfo
  • uname 

 

  • x86 아키텍처

https://en.wikipedia.org/wiki/X86

 

x86 - Wikipedia

From Wikipedia, the free encyclopedia Family of instruction set architectures This article is about the Intel microprocessor architecture in general. For the 32-bit generation of this architecture that is also referred to as "x86", see IA-32. x86DesignerIn

en.wikipedia.org

  • Arm 아키텍처

https://en.wikipedia.org/wiki/ARM_architecture_family

 

ARM architecture family - Wikipedia

EmbeddedmicrocontrollersCortex-M0 Cypress PSoC 4000, 4100, 4100M, 4200, 4200DS, 4200L, 4200M Infineon XMC1000 Nordic nRF51 NXP LPC1100, LPC1200 nuvoTon NuMicro Sonix SN32F700 STMicroelectronics STM32 F0 Toshiba TX00 Vorago VA108x0 Cortex-M0+ Cypress PSoC 4

en.wikipedia.org

  • RIS-V 아키텍처

https://en.wikipedia.org/wiki/RISC-V

 

RISC-V - Wikipedia

From Wikipedia, the free encyclopedia Open-source CPU hardware instruction set architecture RISC-V[b] (pronounced "risk-five",[2]: 1 ) is an open standard instruction set architecture (ISA) based on established reduced instruction set computer (RISC) p

en.wikipedia.org

https://shapr.github.io/posts/2019-06-08-riscv-linux.html

 

Shae Erisson's blog - Linux on RISC-V

Linux on RISC-V Posted on June 8, 2019 What’s RISC-V ? RISC-V is a new type of CPU architecture. If you’ve used a desktop or laptop computer, it’s almost certainly using Intel’s x86 architecture. If you’ve used a cell phone, it’s almost certain

shapr.github.io

커널 구성요소

  • 프로세스 관리
  • 메모리 관리
  • 네트워킹
  • 파일시스템
  • 디바이스 드라이버
  • 시스템 콜

참고사이트:

https://meltdownattack.com/

 

Meltdown and Spectre

Acknowledgements We would like to thank Intel for awarding us with a bug bounty for the responsible disclosure process, and their professional handling of this issue through communicating a clear timeline and connecting all involved researchers. Furthermor

meltdownattack.com

https://thebook.io/006881/0031/

 

오픈스택을 다루는 기술: KVM

더북(TheBook): (주)도서출판 길벗에서 제공하는 IT 도서 열람 서비스입니다.

thebook.io

https://linux-kernel-labs.github.io/refs/heads/master/lectures/intro.html

 

Introduction — The Linux Kernel documentation

Micro kernel A micro-kernel is one where large parts of the kernel are protected from each-other, usually running as services in user space. Because significant parts of the kernel are now running in user mode, the remaining code that runs in kernel mode i

linux-kernel-labs.github.io

https://developer.ibm.com/articles/l-linux-kernel/

https://kernelnewbies.org/

https://www.cs.cornell.edu/courses/cs614/2007fa/Slides/kernel%20architectures.pdf

https://www.kernel.org/doc/html/v4.10/process/howto.html

 

HOWTO do Linux kernel development — The Linux Kernel documentation

This is the be-all, end-all document on this topic. It contains instructions on how to become a Linux kernel developer and how to learn to work with the Linux kernel development community. It tries to not contain anything related to the technical aspects o

www.kernel.org

https://en.wikipedia.org/wiki/UEFI

 

UEFI - Wikipedia

From Wikipedia, the free encyclopedia Operating system and firmware specification Unified Extensible Firmware Interface (UEFI, or as an acronym)[b] is a specification that defines the architecture of the platform firmware used for booting the computer hard

en.wikipedia.org

https://ko.wikipedia.org/wiki/%EB%B0%94%EC%9D%B4%EC%98%A4%EC%8A%A4

 

바이오스 - 위키백과, 우리 모두의 백과사전

위키백과, 우리 모두의 백과사전. 바이오스(BIOS; Basic Input/Output System)는 운영 체제 중 가장 기본적인 소프트웨어이자 컴퓨터의 입출력을 처리하는 펌웨어다. 사용자가 컴퓨터를 켜면 시작되는 프

ko.wikipedia.org

https://www.youtube.com/watch?v=PFzhXvWi3Eg

 

반응형

'b정리 > 모던 리눅스 교과서' 카테고리의 다른 글

리눅스 소개  (1) 2023.12.17