본문 바로가기

ComputerScience/Linux

Linux1. Operating System? Linux?

728x90

1. Operating system

An operating system (OS) is system software that manages computer hardware and software resources, and provides common services for computer programs.

 

2. Linux

Linux is an open source software, avaliable for everyone

You can customize any feature of linux so we have various distributions CentOS, Ubuntu, etc.

A lot of Robot OS, Smart-factory OS, Vehicle OS, Android and Server OS are based on linux

 

3. Linux Kernel

Linux kernel is main component of a Linux operating system.

applications - terminal

shell - zsh, bash

libraries - ls, cp, apt-get

kernel - via system call we can enter kernel space, interact with hardware

hardware - cpu, ssd, hdd



Kernel has 4 main jobs

1. process management : determine which process can use cpu, when, and for how long

2. memory/storage management : 

3. device drivers : act as an interpreter between hw and process

4. system call & security : receive service requests from process

 

Even when we have more processors, the performance doesn't increase linearly

because of the cost of synchronization, scheduling or race condition. 

So if you want to utilize more processors efficiently you have to modify kernel's scheduling algorithms.

 

4. User space and Kernel Space

The memory in Linux can be divided into two distinct regions : kernel space and user space

if we execute userspace command to open or write file, cpu will execute kernel space command eventually.

fd = open("file", flag);
write(fd, "hello", count);


User space is that set of memory locations in which user processes run.

Kernel space is where the kernel executes and provides its services.

Kenel space can be accessed by user processes only through the use of system calls.

728x90
반응형

'ComputerScience > Linux' 카테고리의 다른 글

Linux8. Process  (1) 2023.10.09
Linux6. Makefile  (0) 2023.09.28
Linux4. Design Principle of Linux Kernel  (0) 2023.09.28
Linux3. System Call  (1) 2023.09.28
Linux2. linux commands and tools  (0) 2023.09.14