OS – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Mon, 04 Jul 2022 06:41:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg OS – Programmerbay https://programmerbay.com 32 32 Difference between Physical Address and Logical Address https://programmerbay.com/difference-between-physical-address-and-logical-address/ Thu, 30 Jan 2020 09:44:13 +0000 https://programmerbay.com/?p=6042 An address space can be defined as a memory area that is addressable and can be allocated to store data or instructions and used to uniquely identify the particular area available for processes.

logical address vs physical address

There are two types of addresses, logical and physical address. Whenever a program or process is executed, a logical address is produced by CPU and used as a reference to locate physical addresses in memory unit.

Difference between Logical address and Physical address space

BasisLogical AddressPhysical Address
DefinitionAn address of an instruction that is accessed during program or process executionAn address in memory unit where instruction resides
GenerationProduced by Central Processing Unit (CPU)Computed by Memory Management Unit (MMU)
AccessibilityIt is used to access physical address indirectlyCan't be accessed directly
Address SpaceA set of all logical addresses formed during program executionA set of all physical addresses available in the system which is mapped analogously with logical addresses
ExistenceNot physically existPhysically exist
AlterationVariesConstant
RebootVanishedExist
VisibilityCan be ViewedCan't be viewed

Physical address & Physical Address space

A physical address is the actual location of stored instruction. All set of physical addresses present in the system is termed as the system’s physical address space.

A Physical address space is defined in a memory unit which is computed using MMU and represented in binary form. It is also known as a real address.

Logical Address and Logical Address space

A logical address is an address that is used to fetch an instruction while a program in execution. And the sum of all the addresses required in the execution of the process is known as the logical address space of the process.

A logical address is defined by CPU and it is termed as Virtual address.


About Memory Management Unit


The process of mapping logical addresses to physical addresses of a program (or process) is known as Address Binding. It is done in three ways, compile-time binding, load time-binding and runtime binding.

At the time of Compile-time and load time-binding, both physical and logical addresses are similar, even though it becomes varies at runtime binding. To deal with this difference,
A device called MMU ( memory management unit) is used to map the logical address to physical address.

 

Key differences 

Definition

Logical Address is an address of an instruction that is accessed during program or process execution.
A physical address is an address in memory unit where instruction resides.

Generation

It is produced by Central Processing Unit at the time of program execution, whereas physical address is usually an area in the memory unit, responsible for accessing cells of main memory which is computed by Memory Management Unit (MMU) .

Accessibility
A logical address is used to access physical address, whereas Physical address can’t be accessed directly.

Address Space
A set of all logical addresses formed during program execution which is produced by CPU is termed as Logical address space,
A set of all physical addresses available in the system is referred to as physical address space which is mapped with logical addresses.

Existence
Since it is generated by CPU, there is no particular location actually exists in a memory unit. Therefore, it is also known as virtual memory. On another hand, the physical address is addressable and available in the memory unit.

Actual Data

Logical Address is the key to access the physical address in order to locate the actual instruction or data byte, whereas physical address is the actual place where instruction or data Byte exists.

Change
Logical address tends to change from time to time but A physical address remains the same.

Reboot
Since Logical Address doesn’t physically exist, when the system shuts down and boots again, the address no longer available. Whereas, Physical Address physical exists and therefore even after the system reboots it present

]]>
Difference between HarmonyOS and Android https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/ https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/#respond Mon, 12 Aug 2019 11:25:06 +0000 https://www.programmerbay.com/?p=4598 What is HarmonyOS?

  • Huawei has unveiled its latest operating system named HarmonyOS for its upcoming Huawei devices.
  • HarmonyOS is disclosed as the world’s first micro kernel based distributed OS for all scenarios.
  • It has distributed architecture, meaning it would provide a secure kernel and can enable a shared ecosystem.
  • This OS is targeted for IoT services. Some of the services provided by HarmonyOS are power vision, wearable services, hat unit services, speaker services, and Smartphone services. All these services can be supported by HarmonyOS making it an all scenario OS.

In what ways HarmonyOS can give competition to Android?

  • Both Harmony and Android operating systems are open source.
  • Harmony can run on multiple types of devices just like Android which also runs on smartphones, smart TV, smartwatch etc.
  • Through this OS for all scenarios of HarmonyOS, it targets to create an ecosystem of its own just like Android is in the current market.
  • HarmonyOS is a lightweight system which gives a performance boost to multiple applications at once.
  • HarmonyOS is based on a deterministic latency engine which helps in better allocation of system resources using real-time analysis and forecasting, whereas Android is based on the Linux kernel’s scheduling mechanism which has fair scheduling model.
  • HarmonyOS’s microkernel can support true high-performance graphics.

HarmonyOS vs. Android

  • HarmonyOS is based upon micro kernel based distributed system whereas Android OS is based upon Linux kernel at its core.
  • HarmonyOS doesn’t give root access to its users whereas, in Android, we can root our smartphones.
  • HarmonyOS have very little to offer in terms of apps. Huawei has to invest heavily in getting developers interested in building apps in their OS. On the other hand, Android already has a big market.

Can HarmonyOS be an alternative for Android OS?

Let’s look at some examples.

  • Samsung came up with its own OS known as Tizen which is a Linux based mobile operating system. They developed this OS to compete with the Android OS. It is also open-source software. In the current market, Tizen OS is just being used in the galaxy wearables only, not in the smartphones or other devices.
  • Windows came up with its own OS known as Windows Phone (WP) for smartphones. Despite its emphasis on productivity and security, it failed against Android.

Now the Huawei’s HarmonyOS. This OS can give rather strong competition to Android but it may have to do more than building its own ecosystem.

]]>
https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/feed/ 0
Difference between user mode and kernel mode https://programmerbay.com/difference-between-kernel-and-user-mode/ https://programmerbay.com/difference-between-kernel-and-user-mode/#respond Mon, 01 Apr 2019 16:41:42 +0000 https://www.programmerbay.com/?p=2641 An operating system can have various modes of operation and these modes define standardised instructions for deciding what resources can be accessed, limit memory access and more in order to protect data and provide system security.

There are two types of modes, User Mode and Kernel Mode. A kernel mode is also known as supervisor mode.

kernel mode and user mode

User mode

It has restricted access to the resources. CPU has restrictions, therefore, it can have only access to limited instructions and memory. Utility applications such as text editor, media player are run in this mode.

When an application or program is executed, its initial state and operation mode are loaded on stack. At this point, CPU starts executing the program in this particular mode. Interrupts and traps are used to signal  or flag the CPU to switch back to Kernel mode and do the essential tasks by storing the current state of the user program to the stack again. After completing it, CPU resumes the program from where it left.

Kernel Mode

It has full access to memory, I/O and other resources. In this, CPU can execute any instructions and have full access to underlying hardware. The core functionalities of the operating system always run in Kernel mode.

Having these authorities, processes using this mode have full rights to access resources, allowing them read/write to the storage media, enable and disable hardware and more. Difference between Kernel Mode and User Mode :

BasisKernel ModeUser Mode
PermissionUnrestricted and full permissions to access the system's hardwareRestricted and limited permissions to access the system's hardware
Memory referenceIt can reference to both the memory spacesIt can only reference to memory space that is dedicated to user mode
AccessOnly core functionality can be allowed to operate in this very modeUser applications can access this mode for a particular system and is allowed to operate in this particular mode
System crashFatal and increases the complexityRecoverable and can simply restart the session
Also Known Privileged mode or Supervisor mode Restricted mode

Key Differences:

  1. The mode in which there is an unconditional, unrestricted and full permission to access the system’s hardware by the current executing piece of code is known as the kernel mode. The mode in which there is no means of accessing the system’s hardware directly by the current piece of code is also known as the user mode.
  2. The kernel mode is a very powerful and impactful mode which means that it can refer to any memory block of the system and can also orders to execute an instruction to the CPU. The user mode is standardized and normal viewing mode which means that it cannot reference to any memory block or execute any information on its own as it requires some Application Protocol Interface (API) to do these tasks.
  1. The kernel mode is the most unrestricted and candid mode that a system can have which means that only the trustable sources can be allowed to operate in this very mode. The user mode is more like a generic mode that can have, which means that any user can access this mode for a particular system and is allowed to operate in this particular mode.
  1. As the kernel mode is very important and candid this means that if the system crashes in this mode then it could be very fatal and increases the complexity. As the user mode is quite general and user-friendly this means that even if the system crashes in this mode then it is not fatal at all and can simply restart the session.
  1. The kernel mode is very crucial to the system as well as the system programmer so everything that runs easily runs on your PC might not run here because its purpose is to employ hardware for a particular task. The user mode is user friendly space where all the general code will definitely execute.
]]>
https://programmerbay.com/difference-between-kernel-and-user-mode/feed/ 0