Showing posts with label virtual machine. Show all posts
Showing posts with label virtual machine. Show all posts

Monday, 10 November 2014

Android Booting Process explained step by step

Android Boot Process is more or less similar to linux booting process. We all know that android is a application running on the top of Linux operating system. More popularly known as " A Stack Of Application"  

Well talking about the various stages in Android Booting , first few steps below are steps of linux booting

Stages Of Booting
  • Bootloader normally the Grub
  • U-Boot or secondary Bootloader or second level Bootloader
  • linux kernel 
  • Android






The Android process has the following sequence
  • Init
  • Zygote
  • System Server
  • Service Manager
  • Other Daemons and processes
  • Applications
BOOTLOADER:
Bootloader is the initial piece of code stored in ROM which has address of the device ( the Boot Media ) from where it should start boot. For example we can boot an operating system from SD-Card , eMMC , SATA , HARDISK , CD-ROM , Network etc. So this Bootloader has the address of the boot media. Since ROM is a non-volatile device bootloader is stored in ROM. we can fuse the ROM to boot from various device. 

U-BOOT:

U-Boot is a second level bootloader which initializes DRAM and other peripheral devices like UART RTC etc. More specifically U-Boot is responsible for loading ramdisk image. Ramdisk image is nothing but the board specific images which initialize certain major peripherals which are necessary to debug the device in case of any emergency.

KERNEL:
Linux kernel is the heart of the Android responsible for the process creation, inter process communication, device drivers, file system management etc. Android applies a custom patch on the main stream kernel to support certain features like Wake locks etc needed for operation of the Android.
The kernel can be either loaded as uncompressed image or as a compressed image. Up on loading, it mounts the root file system (typically passed as kernel command line arguments) and starts the first application in user space.

ANDROID:
The android applications are executed over a Virtual Machine called the Dalvik. Android typically operates wholly on the user space. Now Google has replaced DVM ( The Dalvik Virtual Machine ) with ART ( Android Run Time).

More explanation regarding the boot stages after the zygote Initialization ( The Android Process ) will be explained in the next POST !!!!!


 G HARI PRASATH
Project Engineer





Friday, 15 August 2014

ANDROID ARCHITECTURE


Hai every one!!! Where ever you refer for Android Architecture people use to explain the various stacks in android architecture as Google usually refers to the Android OS as a software stack. I am just showing what i have gathered from other websites which is clearly explaining how Android Architecture is. Each layer of the stack groups together several programs that support specific operating system functions. The image shown below is the architecture of Android.




THE KERNEL:

The base of the stack is the kernel. Google used the Linux version 2.6 OS to build Android's kernel, which includes Android's memory management programs, security settings, power management software and several hardware drivers. Drivers are programs that control hardware devices. For example, the Nexus One has a camera. The Android kernel includes a camera driver, which allows the user to send commands to the camera hardware.

LIBRARIES:

On top of Linux kernel there is a set of libraries including open-source Web browser engine WebKit, well known library libc, SQLite database which is a useful repository for storage and sharing of application data, libraries to play and record audio and video, SSL libraries responsible for Internet security etc.. You can think of libraries as a set of instructions that tell the device how to handle different kinds of data. For example, the media framework library supports playback and recording of various audio, video and picture formats. Other libraries include a three-dimensional acceleration library (for devices with accelerometers) and a Web browser library.

DALVIK VIRTUAL MACHINE / ANDROID RUN TIME:

Located on the same level as the libraries layer, the Android run time layer includes a set of core Java libraries. Android application programmers build their apps using the Java programming language. It also includes the Dalvik Virtual Machine. Google is now replacing Dalvik Virtual Machine With Android Run Time which introduces Ahead-Of-time compilation, which can improve app performance . ART also has tighter install -time verification than Dalvik.

NOTE : I will explain about the difference between Android Run Time and Dalvik virtual Machine in the next post.

A virtual machine is a software application that behaves as if it were an independent device with its own operating system. You can run a virtual machine on a computer that operates on a completely different OS than the physical machine's OS. The Android OS uses virtual machines to run each application as its own process. That's important for a few reasons. First, no application is dependent upon another. Second, if an application crashes, it shouldn't affect any other applications running on the device. Third, it simplifies memory management.

APPLICATION FRAMEWORK:

The next layer is the application framework. This includes the programs that manage the phone's basic functions like resource allocation, telephone applications, switching between processes or programs and keeping track of the phone's physical location. Application developers have full access to Android's application framework. This allows them to take advantage of Android's processing capabilities and support features when building an Android application. Think of the application framework as a set of basic tools with which a developer can build much more complex tools.The Application Framework layer provides many higher-level services to applications in the form of Java classes. Application developers are allowed to make use of these services in their applications

APPLICATION LAYER:

At the top of the stack are the applications themselves. This is where you find the basic functions of the device such as making phone calls, accessing the Web browser and accessing your contacts list. If you're an average user, this is the layer you'll use most. You do that with the user interface. Only Google programmers, application developers and hardware manufacturers access the other layers further down the stack. Moreover most of the people are playing over in this layer, coz it is the one which makes Android an ANDROID :P........

Author
HARI PRASATH G
PROJECT ENGINEER