Friday, September 23, 2011

Interview Questions for Software Engineers

C and C+ questions.

1. why C is used for as a programming language? what are demerits of C language?

2. why C++ is still unable to replace C in the current industry?

3. what is the main disadvantage of c++?

4. what is a difference between sizeof and strlen?

5. How many keywords do C have? Is printf/scanf are keywords?

6. what is the main disadvantage of malloc function?

7. what is a use of a 'header file'?

8. what do the printf statement exactly do?

9. what are variadic functions? Can you give an example or write one for yourself?

10. what is #pragma and why it is used?

11. why do you need a getch() or getche() for turbo C??

12. State a disadvantage of usage of local and global variable.

13. what is advantage of recursive function? why recursive functions are generally not used?

14. what will happen if I create a global array like int array[10000000000000000000000000000000000000000000000000000];

15.what is memory leak? why it should be avoided? what kind of error it can cause in the system? Can you give a practical example?

16. what is buffer overflow? how and why it should be avoided? write a code to avoid buffer overflow for an array.

17. what is 'volatile'? why it is required?

18. what is difference between static functions and normal functions?

19. Can 'extern' be applied to a local variable?

20. what is a 'linker' error?

21. how will you reduce the size of Ram which a program occupies in memory? Give some techniques ?

22. what is stack underflow? how it impacts a system?

23. why do you need 'data-structures'? where is link-lists used?

24. when is dynamic memory allocation is needed? Give example

25. what is 'ELF' file?

26. why 'Macros' are needed in a program? why it is part of C language?

27. what are the difference between structures in C and structures in C++?

28. what is 'lexical analysis'?

29. what is 'preprocessing'?

30. what is a FIFO? how will you use that?

31. what is a 'cross-compiler'?

32. what is a 'constant pointer'? how it is different from pointer to const?

33. write a program to show the usage of 'pointer to const'.

34. what is 'stack dump'? why it is important?

35. what makes C a tough language?

36. write a program for atoi function.

37.write a program for strstr/strlen/strchr/strcat functions.

38. write a macro to count the number of bytes in an integer/float/double.

39. reverse a linklist without traversing the list more than once.


Operating System Questions :

1. Difference between task /threads/process?

2. Different scheduling techniques.

3. why 'timers' are required in Operating systems? Give one usage of timers?

4. how does a system maintains time even after it is switched off?

5. what is a micro-kernel?

6. Difference between RTOS and OS.

7. what are different states of a process in Linux?

8.what is a 'zombie' process?

9. what is 'spinlock' in linux? how it is used?

10. what are interrupts? difference between hardware and software interrupts?

11. what do you mean by 'Edge-triggered' interrupt?

12. when do you disable interrupts?

13. Difference between interrupt and polling? when and why its is used?

14. How would you suspend a process in Linux?

15. what are different types of IPC?

16. Can two or more operating system run on a single system at the same time?

17. what is a binary semaphore? why it is required?

18. what is 'Mutex' and why it is used?

19. what is 'Reentrancy'?

20. Give techniques to stop deadlocks.

21. what is a file descriptor? Can a child process write into a file created by its own parent process?

22. Describe File structures - Inode table,File table for Unix.

23. what is 'swapping'?

24. what is 'debouncing'?

25. what is 'ps -a ' command in linux?

Friday, July 22, 2011

Video/Audio Cards

Graphics (Video) Card


Top of the Graphics and Sound Card Advice page
A graphics card (also called a video card or video adapter) is an expansion card that processes instructions sent by the CPU via a dedicated graphics processor. It acts like a small motherboard specifically dedicated to display. People who use their computers primarily for office work require only basic performance, but for serious graphics, video editing or gaming, a good graphics card becomes an important consideration. Some graphics cards also have TV-out, S-Video and video capture connections, although these may not be included as standard. Many graphics cards have the ability to output to two displays simultaneously.

IGP:Some computer manufacturers offer IGP (Integrated Graphics Platform) systems where graphics capabilities are built into the main system motherboard so that a separate, stand-alone graphics card is not necessary. While perfectly adequate for basic computing tasks, current IGP systems are not powerful enough for advanced uses and will not be able to handle today's 3D games.

Graphics Processor: Most graphics cards are based on either the Nvidia GeForce or ATi Radeon family. The technology is licensed to third party manufacturers such as Asus, Creative, Sapphire etc. New generations of GeForce and Radeon cards appear roughly every six months. The latest top-of-the range card is likely to cost around £300-£400. Mid-range cards are available at around £100-£200. These are capable of playing games well and are a good solution for the majority of PCs. Bottom of the range cards cost around £50. These will be fine for most PC tasks, but will perform poorly in graphics-intensive work.

Interface: The interface is the slot, or bus, required in your PC to run the card. There are two main types: AGP, and PCI Express (sometimes written as PCI-E or PCIe).

AGP is the older standard which is now becoming obsolete. However, it is still supported by some manufacturers and there is a strong second-hand market for AGP cards.

The current standard is PCI Express, which is much more powerful than an AGP card. Additional numbers relate to the throughput data that the card can handle, e.g. 4X, 8X or 16x. An AGP 2X card equates to 533MBps (megabytes per second), while 4X is 1.07GBps (gigabytes per second). AGP 8X is the current standard. If you are installing a new card, you will need to ensure that your motherboard supports throughput at that speed, or else the card's full potential will be wasted.

The old PCI slot is now obsolete and a PCI-based graphics card is likely to be found only in older computers. However, this type of card is still adequate for basic office tasks.

Memory : Graphics cards use their own dedicated memory. As with system RAM, the more memory the card has, the better the performance will be. A card with 64MB is adequate for basic office tasks, but at least 256MB is required for the latest games and video applications. Graphics card memory cannot usually be upgraded later.

IGP systems, with graphics chips integrated on the motherboard (see above), often use a portion of system RAM to display graphics, which may reduce the computer's overall performance.

Clock Speed : Manufacturers often quote megahertz (MHz) numbers. There are usually three clock speeds quoted: the core clock speed, the memory clock speed and the Ramdac clock speed. Core clock speed refers to the internal speed of the graphics processor. Memory speed (or memory clock) refers to the speed of data transfer between the card's onboard memory and the graphics processor. A clock speed of around 500MHz or greater is best for 3D graphics and games.

Ramdac speed refers to the capabilities of the digital-to-analogue converter that provides the graphics output from the card. It doesn't directly affect graphics performance but governs the range of refresh rates the card can support at a particular screen resolution. Ensure that the card you buy can display the resolutions you want to use with at least a 75Hz monitor refresh rate to avoid eye strain from screen flicker.

Overclocking : Running a graphics processor faster than the manufacturer's specified speed is popular among PC tweakers and dedicated gamers. Although this carries risks such as overheating, it can be a viable way to gain extra performance from a card when done within safety limits specified by the manufacturer. Some manufacturers sell cards that have already been overclocked, others bundle overclocking software with cards. Be sure to read the manufacturer's recommendations and instructions before overclocking.

Drivers and software : The latest driver can make a big difference to a card's performance. Visit the manufacturer's website regularly to check for updates. Other software bundled with graphics cards can include games that show off the card's performance, DVD players and graphical demos. These deals vary greatly, so check out the bundle that suits you best.

Power Supply Unit : A high-end graphics card requires a strong power supply unit (PSU) in a PC in order to function properly. It may also need a direct connection to the PSU if the graphics card cannot draw enough power from the motherboard alone. Without it, the card will simply not run.

Power demands should be researched in advance of upgrading to a more powerful graphics card. Find out from your retailer of choice just how much power your card will need, and whether it will need an extra connector. If so, what type? Make sure that your existing PSU can support it, otherwise you may have to budget for a new power supply unit as well.

Sound Cards



Most PCs come with some form of sound capability built-in on the motherboard. However, there are advantages to upgrading to a dedicated soundcard. As well as achieving better sound quality, a dedicated soundcard can boost your PC's overall performance because it deals separately with sound, thus saving system resources.

All entry-level soundcards support 16-bit quality sound which is recorded or played back at 44.1 KHz. This is CD-quality sound and is adequate for making and playing CDs and MP3s, and for reproducing most surround sound formats on DVDs and games.

Games enthusiasts may want 3D sound support. DirectSound 3D allows sounds to pan around the speakers; Sensaura, Aureal and EAX technologies are even more convincing for games compatible with these systems.

If you intend to create your own music on your PC, you will want 24-bit sound with sampling rates of 48KHz or 96KHz. A 24-bit card will also support the newer sound formats for DVD movies, such as THX surround or Dolby Digital EX 7.1.

Entry level 16-bit soundcards can cost as little at £15, but cards by the bigger manufacturers such as Creative or Terratec start at around £25. Soundcards are usually installed in an internal PCI slot, but external USB cards are becoming popular, particularly for notebook computers. Currently, external cards are more expensive than internal cards at around £35 for an entry-level card and £60-80 for a 24-bit USB card.

Standard connectivity options should include microphone in, line in/line out for front and rear speakers, midi/joystick port, CD-in and headphone connectors. The latest cards may also feature high-speed FireWire ports for connecting digital camcorders and advanced audio options.

Monday, July 18, 2011

Dealing with Kernel Failure

The below mentioned text is from a Book : Building Embedded Linux System by Karim Yaghmour.I have copied this for self-reference.

The Linux kernel is a very stable and mature piece of software. This, however, does not mean that it or the hardware it relies on never fail. Linux Device Drivers covers issues such as oops messages and system hangs. In addition to keeping these issues in mind during your design, you should think about the most common form of kernel failure known as kernel panic.When a fatal error occurs and is caught by the kernel, it will stop all processing and emit a kernel panic message.

There are many reasons a kernel panic can occur. One of the most frequent is when you forget to specify to the kernel the location of its root file system. In that case, the kernel will boot normally and will panic upon trying to mount its root file system.

The only means of recovery in case of a kernel panic is a complete system reboot.For this reason,the kernel accepts a boot parameter that indicates the number of seconds it should wait after a kernel panic to reboot. If you would like the kernel to reboot one second after a kernel panic, for instance, you would pass the following sequence as part of the kernel's boot parameters: panic=1.

The code for the kernel's panic function, panic(), is in the kernel/panic.c file in the kernel's sources.The first observation to be made is that the panic function's default output goes to the console.However, If your system do not even have a terminal, you may want to modify this function according to your particular hardware. An alternative to the terminal, for example, would be to write the actual error string in a special section of flash memory that is specifically set aside for this purpose. At the next reboot, you would be able to retrieve the text information from that flash section and attempt to solve the problem.



Read Memory : Android inside OMAP


The following Code is used for reading memory map in android, after cross-compilation, the exe should be pushed to the target and executed for reading any memory map registers in the system.

include stdio.h
include stdlib.h
include sys/mman.h
include fcntl.h

#define MEM_SIZE 4096
#define MEM_MASK (MEM_SIZE - 1)
#define MEMORY "/dev/mem"

void memaccess(unsigned int reg_addr, unsigned int *reg_val)
{
int fd;
void *mem_map, *mem_addr;

fd = open(MEMORY, O_RDWR|O_SYNC);
if(fd < 0) {
perror(MEMORY);
exit(1);
}

mem_map = mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, reg_addr & ~MEM_MASK);

if(mem_map == (void*) - 1) {
perror("mmap()");
exit(1);
}

mem_addr = mem_map + (reg_addr & MEM_MASK);

if (reg_val)
*(unsigned int*)mem_addr = *reg_val;
else
printf("0x%08X\n", *(unsigned int*)mem_addr);
}


int main(int argc, char *argv[])
{

unsigned int reg_addr, reg_val, *reg_val_ptr;

if (argc < 2) {
fprintf(stderr, "\nUsage:\t%s [value]\n\n\n", argv[0]);
exit(1);
}

reg_addr = strtoul(argv[1], NULL, 0);

if (argc == 3) {
reg_val = strtoul(argv[2], NULL, 0);
reg_val_ptr = &reg_val;
}
else
reg_val_ptr = NULL;

memaccess(reg_addr, reg_val_ptr);
return 0;
}

Sunday, July 17, 2011

Steps for Building Android for OMAP4430

Lets try to build Android....


I have shown all commands to build from x-loader till Android File system below.However the below mentioned steps are exclusively for OMAP4430 platform, hence changes should be made for building the same for other targets as necessary.
The below text only shows the commands for building Android in Linux Platform only.

Please visit http://omappedia.org/wiki/Android_Getting_Started#Building_kernel for more details.

0) Download cross-compiler from Internet for your corresponding Target like ARM or any other and copy the directory in opt folder of Linux file system(in your PC) and export the path of the compiler.

1. X-Loader:
a)Downloading code:
git clone git://git.omapzoom.org/repo/x-loader.git
git checkout --tract -b omap4_dev origin/omap4_dev

b)Build Commands:
make distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- omap4430sdp_config
make CROSS_COMPILE=arm-none-linux-gnueabi- ift

c)output: x-load.bin

d)Signing:
./generate_MLO OMAP4430 ESx.x x-load.bin


2.U-Boot*
a)Downloading code:
git clone git://git.omapzoom.org/repo/u-boot.git
git checkout -b xx remotes/origin/omap4_dev

b)Build:
make distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- omap4430sdp_config
make CROSS_COMPILE=arm-none-linux-gnueabi-


3.Linux Kernel*
a)Downloading:
git clone git://git.omapzoom.org/kernel/omap.git
git checkout -b xx remotes/origin/p-android-omap-2.6.35

b)Build:
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
make android_4430_defconfig
make -j4 uImage

4.Android Filesystem
a)Downloading:
repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b gingerbread
repo sync
mkdir manifest
cd manifest
git clone git://git.omapzoom.org/platform/omapmanifest.git
cd omapmanifest
git checkout -b gb remotes/origin/gingerbread
export MANIFEST=`pwd`
cd ../../
repo init -u $MANIFEST
repo sync

//Use the Maninfest and checkout a proper branch :

cd manifest/omapmanifest
git checkout -b gb remotes/origin/gingerbread
git pull
export MANIFEST=`pwd`
cd ../../
repo init -u $MANIFEST
repo sync

b)Build:
make clean
cp -Rfp device/ti/blaze/buildspec.mk.default buildspec.mk
make -j4

Carefree Git

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.Branching and merging are fast and easy to do

Create a folder named Git_test.

Command : Cd git_test // go into that folder

Command : git init // initialise the git for this particular folder

Command:git clone git://git.omapzoom.org/kernel/omap.git android-2.6.35 //for getting the kernel source

or //Create a file : gvim one.c // it will create one file one.

command : git add one.c // It will add this file to a git server(local)

Command : git diff // this will give you the difference of what is not commited

Command : git commit -a // This will create a new page, in that give the commit message then save and close that page.

Command : git log // this will gives the message logs of all commit ID's

Command : git show // this will shows the lines whatever changed during the commit

Command : git format-patch -1 // It will create the patch.

Command: git format-patch -1 changeid //it will create the patch for the changeid.

Command : git am patchname.patch // this is to apply the patches on folder.

Command : git branch -a //to see all branch an select any one branch for checkout.

Command : git checkout -b branchname actualbranch //to create a separate branch.

Command : git checkout branchname //to get into existing branch

Command : git push ssh://x0151836@omap:29418/kernel/omap HEAD:refs/for/p-android-omap-2.6.35 //for code submit

Monday, March 7, 2011

ARM exceptions and Debugging techniques

ARM exceptions and Debugging techniques :


1.Reset:
  • Common reasons for Reset
  • Function call using a NULL pointer
  • Asserts / System Aborts
  • Hardware error
Mostly a NULL pointer is the cause for RESET. Check out the R14 and find out which was the last instruction before jumping to PC 0.In case of condition check fails the programs can choose to ASSERT the system. In case of invalid scenarios in RTOS too, the system may abort. Putting Breakpoints at the common abort points like ASSERT will be the first step to debug these problems.Hardware errors are less common reason for NULL pointer exceptions. Usually the ABORT signal from the peripherals is routed through the Interrupt Controller. When a system resets no handling for interrupts are done. So the registers of Interrupt Controller will be preserved. It will be helpful to check out the registers to find out the source hardware that caused the reset.



2.Data Abort:
  • Accessing Uninitialized Pointers
  • Stack overflow, array over indexing(usually local)
  • Invalid Operation on a memory
  • Memory Failure

The memory subsystem will generate a signal in case of any of the above
Accessing uninitialized pointers will cause ARM to fetch data from areas of memory that are not defined.If you try to do invalid operation on a particular memory device, eg: If you try to write to ROM, it will cause Data Abort.In both the above cases we can know which instruction caused the data abort, by checking out R14 value.Stack overflow or array over indexing will cause some data pointers to be corrupted. This might cause a Data Abort. (Check out the last section, dealing with stack and array overflows).In case of memory failure… nothing much can be done. Check if the Interrupt Controller has some registers which will show which memory system Aborted.


3.Pre-fetch Abort
Pre-fetch abort is similar to Data Abort. It is caused when Instructions are fetched from invalid address.
Usual reasons are :
  • Calling a function via an Uninitialized Function Pointer
  • Stack overflow, array over indexing(usually local)
Approaches similar to Data Abort can be followed.


4.Undefined Instructions
This exception occurs when the instruction fetched from memory cannot be decode. This can be caused by:
  • Memory corruption by Stack overflow or Array over indexing
  • Un-initialized Function Pointer
If a memory which was originally supposed to contain code, gets overwritten due to some memory corruption, the instructions will become invalid. This error is less common in systems where code executes from FLASH. In such systems (called XIP) only some small set of code will be in RAM.Calling function using an Un-initialized Function Pointer can cause this issue.Check out R14.


What are CRASHES?
Crashes are unhandled EXCEPTIONS. If you are looking at a crash basically you are looking at an EXCEPTION. Find out what is the exception and start digging for clues depending upon the type of exception.


How does Memory get corrupted???
Memory gets corrupted due to Uninitialized Pointer,Stack Overflow,Local Array over-indexing and Global Array over-indexing.

When a system crashes due to un-initialized pointers, the LR value will directly give the place where the pointer was accessed. This is usually one of the easiest of memory corruptions to be tracked. Usually these are very consistent in nature.Stack overflow usually happens in heavy system loads. If you are regressing something and you got some aborts, then it can be a stack overflow. One easy way of finding out is to double the stack size and see, whether the crash occurs again or not. This will give you more confidence to debug in this direction. [This is not a litmus test].Some OS’s write a FENCE to the lowest address of a Stack. A FENCE is a special sequence of bytes like CDCDCDCDCD or DEADDEADDEADDEAD which are used to mark boundaries or show unused memory area etc. If the FENCE has been breached, then there is a stack overflow.Local array over-indexing can cause local pointer variables to get corrupted. If you are seeing some local variables corrupted, it can be a local array over-indexing issue.If you are seeing some global array corruption, it can be a global array over indexing.


Array Over-Indexing Vs Stack Overflow :There is a basic difference between Array over Indexing and Stack Overflow. Stack grows from a higher memory area to a lower memory area. While during Array over indexing u will corrupt data from lower memory area to higher memory area. In the memory dump, check which area is getting corrupted and you will get to know who the actual culprit is.

Embedded System -- Day 3

Embedded System -- Day 3

8051 supports external memory interface.

ARM
-- M3 [ Only Microcontroller ] , generally used ARM7
-- A8 [ ARM9 ]
-- R [ real time critical applications]

Multimedia applications : TI Da vince Processors.

Shifting any number of Bits in single cycle : Barell shifters for fast calculation in DSP processors.

PWM is used for simple audio feeding the PWM using RC circuit.

8051 - Storage Class Specifier :
-- Code : Program Memory(64Kbytes) ; accessed by MOVC@A+DPTR
-- data : Directly addressible internal memory
-- bdata : bit adrresible
-- idata : internal
-- xdata : external data memory.

Static Address Number is used for Interrupt in 8051 and Vector Table Method is used in ARM.


Syncronous Transfer : clock transmited along with data.
Asyncronous Transfer : No clock is transmitted , in UART , we need to manually synchronize.
Magic Lt - debugger for JTAG

Embedded System Training -- Day 2

Embedded System -- Day 2

// Important Program for Volatile
int main()
{

volatile const int x = 10;
int *p = (int *)&x;
*p=20;
printf("%d",x); //if we do not write volatile we will see this as 10 .
printf("%d",*p);

}


Structure:
The Compiler maintains a Structure Defination Table[SDT] which has got offset
name,type,offet
a,char,0
x,double,1
y,char,9
with help of this table, at runtime memory is allocated for structures.

struct student p1;
p1.x = 10;
The address of p1 is resolved using Symbol table and Offset is taken from SDT.

Embedded System Training - Day1

Embedded System Training - Day 1
A system is a way of working , organizing or doing one or many tasks
e.g.
Time display system.
Automatic Cloth Washing Machine : Wash by spinning a motor .
Computers Vs Embedded System
1)Combination of HW and SW.
2)Operating System manages many tasks at a time.
3)Combination of HW and SW which works towards specific goal is called embedded system.As a manufacturer, we clearly predict what embedded system is used for.
Optimally Designed HW and Dedicated Software and Firmware.
CPU sits on top of firmware , sensors and actuators communicate through them.
ES domains
a)Automotive
b)Aerospace
c)Livestock Management
d)Medical

Embedded Systems are not used for computation these days..

Real time system : A time constrained Embedded system.
Hard and Soft Real time systems.

Types of Developement
Native Developement : Desktop application and normal development.
Cross Development : Usage of two environment, host machine[PC] and Target [ where application gets executed]
Here the program executes in different machine and developement happens in different machines.
This interface between the Host and Target can be anything * [Doubt1]
Device corresponds to Data Sheet.ESD is all about Cross Development.


Components of embedded system :
System-On-Chip
1.Processor
2.Program Memory and Data Memory
[Memory is no more critical due to advancement in Memory technology]
3)Timers
4)Interrupt Controller
5)Parellel Ports
6)Serial Communication Port
7)Clock Generation Unit
8)Power Supply and Management
[Critical in all systems]
9)Output Interface
10)System Application Specific Circuits.
Power Source :
Systems may or may not have own power supply
digital watch
media player

System which do not have power supply
-- Network Interface card
-- Pen Drive
-- External Hard Disk.
Power Requirements :
-- 5.0V +/- 0.25V
-- 3.3V +/- 0.3V
-- 2.0V +/- 0.2V
-- 1.5V +/- 0.2V
Power Management :
-- Optimizing the code.
-- Enabling and Disabling Caches and Cache blocks
[High speed memory,bypassing accessing of Cache can save power]
-- Reduction of the clock rate during specific set of instruction.
Clock Oscillator and Clocking Units
-- of the cpu
-- of the system timers
-- Fetching codes and data,decoding and execution

Why exe needs to be moved from Secondary memory to RAM?
Processor is not capable : Harddisk is block addressible and RAM[primary memory] is byte addresible .Microcontrollers are Bit-addresible.Flash is Byte Addresible*[semi-conductor based-- Doubt2]
Reset Circuit
1)CPU begins the processing the instruction from a starting address.
2)Program which runs after reset on powerup
-- A system program that executes from the beginings
-- A system boot-up program
-- A system initialization program
3)Reset on WDT expiry.
Types of Memory:
--Internal and external RAM.
--Internal Caches
-- Flash EEPROM [ external or internal ]
-- ROM/PROM
-- NVRAM
ROM/EROM/FLASH
-- RTOS & Application program bundled together
-- Codes for System Booting/Initialization/Initial input data and strings.
-- Non-Volatile results for processing.
RAM[ Internal/ External / Buffer RAM]
-- Storing the code segment
-- Stack/Heap memory

NOR Flash : Kernel, Configuration data , hence protection is there.
NAND Flash :FS,Application,User Space.

Caches
-- copies of instruction/data and brance tranfer instruction .
Interrupt Handler
-- external port interrupt
-- IO interrupt
-- timer and RTC interrupt
-- SW interrupt
Design Process in ES
-- Abstraction
-- HW & SW Architecture
-- Extra functional properties
-- System related family of design [ Not valid much as embedded devices are very much different from each other]
-- Modular Design [ reusable ]
Design process contd....
-- UI design
-- Refinements
Developement Process
-- Model Analysis
-- Design SW architecture,interfaces and algorithms
-- Implementation of Design
-- Test Internal Logic and External Functions.
Design Metrics
-- Power dissipation
-- Performance
-- Process deadlines
-- User Interfaces [ IOS ]
-- Size : code and device both
-- Engineering Cost
-- Manufacturing Cost
-- Flexibility
-- Prototype
-- Development time
-- Time to Market
-- System and user safety
-- Maintenence
Challenges in ESD
-- Clock rate reduction
-- Voltage reduction
-- Wait , Stop and Cache disable functions
-- Process deadlines
-- Flexibility and upgrade ability

ROM image : Final stage of Software image
-- Just as an image in a unique sequence and arrangement of pixel
-- Embedded software must be placed in proper address.
-- Placed in Non-Volatile Memory
General Concepts :
Boot Loader is loaded through MBR.
Boot Loader loads the Operating System.
Basic GCC
gcc -e file.c ---> output to monitor
gcc -s file.c ---> .s file
gcc -c file.c ---> .o file
gcc -d INTEL file.c ---> conditional compilation using INTEL which defined externally.

Small Scale ES
-- Designed with a single 8 or 16 bit microcontroller
-- Little HW & SW complexities and involved board design.
Medium Scale ES
-- 16 bit or 32 bit micro controllers
-- DSP and RISC

Sophisticated ES
-- Enormous SW and HW complexities
-- Scalable and Configurable Processors
-- HW and SW co-design and component integrations in final stages.

Find the Max Value for Datatypes

/* This is independent of all Platforms */

int main()
{

printf("Max Char is %d",(char)((unsigned char )~0 >> 1));
printf("\nMax short int is %d",(short int)((unsigned short int )~0 >> 1));
printf("\nMax long int is %d",(long int)((unsigned long int )~0 >> 1));
return 0;
}