What is a Kernel?



cybersecurity cyber security jobs cybersecurity certification facebook login java ruby soap mongodb matlab mysql maven php facebook login page vi pointer pointer microsoft access python tutorial nodejs ariba qa encapsulation polymorphism lisp java arraylist arraylist java socket scala aws lambda c string tutorial online java compiler vba java compiler online sql update java array lua quick sort html comment merge sort bubble sort html image sql create table python if statement insertion sort matlab for loop for loop matlab tuple python online online python online python compiler jsp python online compiler online c compiler python operators python sleep selection sort java tutorial javascript tutorial assembly language python if divide and conquer python replace java compiler java set sql tutorial nodejs tutorial c compiler readlines python python readlines ethical hacks java generics python command line arguments batch file python not equal elif quantization java string length polymorphism in java strcpy pointers java online ide online java ide printf c pointers in c c printf qa testing multithreading in java java multithreading excel quick analysis tool scanf in c java charat http requests charat java malloc c strcmp c java online compiler network security with firewall java online 2d array python atoi c atoi in c java char fopen c computer ports fopen in c java string substring waterfall model python lower java absolute value sql where clause kafka tutorial sprintf c ruby for loop java constants ajax strtox atoi fgets inheritance java multiplexers pass python python online ide quicksort teradata perl design patterns binary code flask azure portal java interfaces node js java interface sql like java collections singleton python time powershell guice dynamic programming python compiler stack java python interview questions java stack rdbms sql left join angular material sed c strtok what is an instance variable in java flow of energy in an ecosystem relational algebra instance variables java c function free in c free c how to change font in html instance variable java python hashtable online java editor what is soap python isnumeric fread c database types algorithm for merge sort process vs thread html change font fread in marketing communications ten thousandths place typedef isnumeric python hashtable python plsql ten thousandth c free exception handling in java java method call batch file commands basic java java online editor what is grub sqrt python strncpy create table communication process kruskal's algorithm mosfet git clone data structures switch case whatis linux command jenkins git tutorial python length of list bing image search google colab cobol shell script java 8 binary search tree linked list bfs sql update statement c programming java switch  jdbc sap ariba ms access hashset java parseint data types in sql malloc python split decorator pattern java square root data types c date functions sql custom tag what is bean in spring what are constraints in sql hibernet tutorial nested loops python java bitwise operators c data types java editor online c files json for java java tutorial point c read from file hibernate in java symmetric distribution c file read file c ruby if else salesforce tutorial c strcat scala tutorial mutex vs semaphore pandas tutorial python strcat c java to json computer applications strstr c break loop python software design query in access pyspark tutorial date functions in sql reading a file in c readlines html for bold text powershell tutorial what is web services





Introduction

Linux is often referred to as the entire operating System but in reality, Linux is the  Operating System Kernel that is started by the bootloader.  A bootloader is a software that is launched first after the system is turned on. 

Although we cannot change our default kernel of our system if we don't have a root access.
Luckily we have a root access in Kali Linux.

Various Tasks Handled By Kernel

  • Driving Hardware
  • Unifying File Systems
  • Managing processes 
  • Right Management

So lets talk about these processes in detail below.

--> Driving Hardware\

So basically Kernel is the medium of communication between Software and Hardware .It detects and configure hardware when computer is powered on or when a device is inserted or removed. So a better kernel is required for better performance of a system. Slow Kernel can result to slow system.

The exports data about detected hardware thorough the /proc/  and  /sys/  virtual file systems


Application often access device by way files created by within /dev/ 

Specific Files represented 
  1.  disk drives      [ /dev/sda ]
  2.  partition          [ /dev/sda1 ]
  3.  keyboards       [ /dev/input/event 0]
  4.  mice                [ /dev/input/mouse0]
  5. Sound Cards    [ /dev/snd/*]
  6. Serial number  [ /dev/ttys/*]

There are basically two types of devices files :-
  • Character : A character (c) device is one which  the driver  communicate by sending and receiving single character(bytes, octates ). Eg - Sound-cards , Serial ports , parallel ports.     
                rw--rw--- 
  • Block :  A block ( b )  device is one which the driver communicates by sending block of data .   Eg - camera ,harddisk,etc.

                b rw--rw---
you can access these directories by  a simple shell command (cd) which means change directory.



-->Unifying  File Systems
Add caption

File Systems area prominent aspects of kernel. Unix like systems merge all the file stores into a single hierarchy , which allows  user and  applications  to access by knowing its location within that hierarchy .The starting point of this hierarchical tree , represented by the  "/" character. This directory can contain named sub directories.For instance ,the home sub directories of / is called /home/. The  Kernel stores all data in one file starting with /root    .
There are many file systems like  are ext2 , ext3 , ext4 ,  VFAT ,etc.


Important commands like mkfs .ext3(where mkfs stands for Make FileSystems) handle formatting . These commands require , as a  parameter a device file representing the partition to be formatted(for instance, /dev/sda1). This command is very destructive and should be used once unless u want to delete whole FileSystem and start fresh.

There is a also a network file system such as NFS , which do not require to  store data in local disk and.Instead Data is transmitted through network or server.


-->Managing process  

A process is  a running instance of a program , which require memory to store both the program itself and its operating data .The kernel is in charge of creating and tracking processes. When a program runs, the kernel first set aside some memory ,loads the executable code running.

It keeps information about this process , the most visible of which is an identification number known as the process identification number(PID). 

Is single processor Linux Systems are capable of multi tasking ?





Linux OS are capable of multi-tasking and capable of performing many tasks at a same time. BUT IN REALITY ITS ONLY TASK IS RUNNING AT A TIME . What the kernel does is slice CPU time into small time slices. These time slices are very short usually  a  milliseconds. This happens so fast that its like too many tasks running parallel but in  reality it is happening so fast that it seems parallel. Kernel adjust these tasks accordingly to the priority. These tasks are only active at that time and rest of the time it is idle. Now  kernel do everything to maximise the global system performance. 

  • Now  if a task is running for longer period of time then it may not appear as responsive as desired .
  • If time slices are too short then it may lose time for frequently switching between tasks.
The decision can refined with process priorities , the higher priorities will run for longer periods  and more frequent time slices than low-priority processes .

How multi-processors systems perform multi-tasking ?

The multi-processors , multi-core , hyper-threaded Systems allow several tasks running in parallel. But here also time-slicing Systems are used to handle where there is more active processes than  available cores . Normally  a  systems are running tons of running processes almost everytime.


The kernel allows several instance of same programme to  run, but only in their time slices.


-->Rights Management


Unix -like systems support multiple users and group and  allow separate permissions for them . Most of the time a process is identified by its user who started it.  The kernel manages the rights of its user or owner or root.















Comments