Why we are saying that the OS is purely hardware dependent (other than hardware peripherals like RAM/USB etc)?
The word hardware independence means, the OS should run on any platform with out any underlying hardware abstraction layer like ARM/x86/xtensa/starcore etc etc.
Can you please give me the exact hardware dependencies in a simple/common OS? Meaning exactly in which are all points in the OS is accessing the hardware or depending on the platform?
Also is it possible to write a simple OS or a RTOS (using C language) with out any hardware or platform dependency(ie without any VM concept) so that it’ll run on any platforms?
I would be expecting the answers from the OS kernel side and not from the peripheral side like RAM /keyboard/mouse
I will give you an example of exact hardware dependency in an OS “at context switching (context of the tasks/threads should be stored with help of underlying platform/CPU only)”
__Kanu
In general, the following things are hardware dependent:
At some level, way way down, an OS kernel needs to sit on top of something. Most kernels are written such that they touch the hardware with as small a surface area as possible, but there must be some touch point there.
You can write most of a kernel in C (this is usually the case). But you’ll need to run on top of something. If you fudge with the definition of an OS a little bit, you could have a “microkernel” that is hardware-dependent, and build many of the above as abstractions as a toy OS on top of it, but you’d suffer in performance/accuracy/sophistication.