Linux Flashcards
What is linux?
Open-source operating system.
Linux System Architecture
User Mode:
User Software ->
System Components (Windows Manager, API Libraries etc) ->
C Standard Library ->
Kernel Mode:
Kernel System Call Interface (system calls, around 380) ->
Kernel (Process, Memory, Files, Devices, Networking) / Kernel Modules (device drivers) ->
Outside:
Hardware
System Calls
User programs need to access I/O devices so they can interact with the user and send/receive data to networks/disks, but a protection ring prevents direct access. So the OS provides a collection of system calls (implemented as interrupts), which forms the application programmer interface (API) of the OS.
Monolithic Kernal
All of the device driver are included when kernel is compiled, therefore all drivers can access hardware.
Disadvantages:
The kernel image is very big on disk and memory, since it contain all of the drivers, and you need to recompile the kernel to add new drivers or functionality, since it contains every single one.
Modular Kernel
Specific drivers are included when kernel is compiled.
Disadvantages:
Only fragmentations of kernel memory as file systems and modules are loaded, since if you remove certain modules, there will just be empty spaces of memory. Also security and stability risk appear from loading bad modules since you are choosing specific ones.
Read, write and execute options
Use chmod … filename
We use …+… to add, and …-… to delete.
Annotations are:
- w -> write
- r -> read
- x -> execute
- u -> user
- g -> group
- o -> other
- a -> all
Nano textfile
Opens txt file in editor.
ls -l
List of locations/directories (should display things like created txt files etc)
top
Shows a more dynamic display of processes/active processes.
ps
Shows various status indicators depending on what a process is currently doing.
Echo
Displays text that was passed in as an argument.