Day 68 - Why Applications are Os Specific

If you have used more than one operating system you know that all of the have different file types for the executables like if you want to install a software on Windows you have to install it using a .exe file or using a .msi file type and in Linux if you use Debian based Linux distro you see a .deb filetype for installing a new software. But why is that they both have different filetypes for the same function? That is what I will be finding out today.

Why Applications Are Operating System Specific?

Most of the apps that you use on one OS cannot be used with the same filetype on some other OS because of the OS System Calls. System calls are services provided by the OS for use by the programs and they all are implemented in different way maybe because of the OS structure, design or just because someone wanted to. But even if the system calls are implemented the same way there are other things that does not let one program to run on some other OS.

Other reasons why apps are OS specific are following.

  • All OS have different APIs (Application Programming Interface) for interacting with OS binaries but not all OS have same kind of APIs.
  • Having different CPU instructions sets where only applications who can execute those instructions can work.
  • Each OS follows a binary format for all the executeable files so it can access them and execute them when it wants to.
  • Also because of CPU Architecture.

All these tells us why we cannot use a program in one OS on another OS but there are ways to execute programs on all OS. There are three ways to do that.

  1. A progam can be executed on all OS by writing the program in an Interpreted Language like Python etc and then using the language's interpreter on the OS where you want to run the program to interept the instructions according to the OS and accessing system calls of that OS and execute the program.
  2. Another way of achieving this by writing the program in a language which uses a virtual machine containing the running program. Java uses this method and any Java program can run on any OS as long as the OS supports Java RTE. What Java does is that it converts the source code into Java bite-code which the Java Virtual Machine uses to execute the program.
  3. Another way is to write the progam in a standard language where it builds the source code into machine and operating system specific binaries. But you have to build the binaries for all the popular OS and of all the verisons and had to do many tests and on all OS for this approach.

All the above mentioned ways can be used to buld cross-platform applications but they may lack in speed and performance comparing to the natively built programs.


zainscizainsci