YouTube Icon

Interview Questions.

Top 30 Linux Embedded Systems Interview Questions - Jul 24, 2022

fluid

Top 30 Linux Embedded Systems Interview Questions

Q1. Mention What Is The Difference Between Microprocessor And Microcontroller?

Microprocessor is managers of the assets (I/O, memory) which lie outdoor of its structure Microcontroller have I/O, memory, etc. Constructed into it and mainly designed for control.

Q2. Mention What Are Buses Used For Communication In Embedded System?

For embedded device, the buses used for verbal exchange includes

• I2C: It is used for conversation among more than one ICs

• CAN: It is utilized in vehicles with centrally managed network

• USB: It is used for communique among CPU and gadgets like mouse, and so forth.

While ISA, EISA, PCI are general buses for parallel conversation used in PCs, laptop network gadgets, and so on.

Q3. Explain What Is The Need For An Infinite Loop In Embedded Systems?

Embedded systems require limitless loops for repeatedly processing or monitoring the nation of the program.  For example, the case of a program nation continuously being established for any exquisite errors that could simply happen at some point of run-time consisting of memory outage or divide with the aid of 0, and many others.

Q4. List Out Some Of The Commonly Found Errors In Embedded Systems?

Some of the usually discovered errors in embedded systems are

• Damage of memory devices static discharges and trient modern-day

• Address line malfunctioning because of a brief in circuit

• Data lines malfunctioning

• Due to rubbish or mistakes a few memory places being inaccessible in storage

• Inappropriate insertion of memory gadgets into the memory slots

• Wrong manipulate signals

Q5. How Are Macros Different From Inline Functions?

•Macros are commonly used whenever a fixed of commands/duties should be time and again carried out. They are small programs to carryout some predefined movements.

•We commonly use the #outline directive in case we want to outline the values of some constants so in case a exchange is needed best the fee may be changed and is reflected all through.

#define mul(a,b) (a*b) 

•The principal disadvantage of macros is that they may be now not really features and the standard mistakes checking and stepping thru of the code does not occur. 

•Inline functions are improved each time it is invoked instead of the control going to the vicinity in which the characteristic is defined and avoids all the activities inclusive of saving the go back address whilst a soar is finished. Saves time in case of quick codes.

Inline waft upload(flow a,drift b)

 return a+b;

•Inline is just a request to the compiler and it's far upto to the compiler whether to replacement the code at the vicinity of invocation or perform a jump primarily based on its performance algorithms.

Q6. Why Do We Need Virtual Device Drivers When We Have Physical Device Drivers?

Device drivers are basically a fixed of modules/workouts with the intention to deal with a tool for which a direct manner of verbal exchange is not viable through the person's utility program and these may be idea of as an interface for that reason keeping the system small imparting for minimalistic of additions of code, if any.

Physical device drivers can’t carry out all the logical operations needed in a gadget in cases like IPC, Signals and so forth...

The foremost purpose for having virtual device drivers is to imitate the behaviour of positive hardware gadgets without it honestly being present and those may be attributed to the excessive cost of the devices or the unavailability of such gadgets.

These basically create an illusion for the customers as if they're the use of the real hardware and allow them to carryout their simulation effects.

Examples will be using digital drivers in case of Network simulators,also the help of virtual device drivers in case a user runs a further OS in a virtual field kind of a software.

Q7. What Is The Difference Between Hardware Design And Software Design?

•Hardware layout is designed with the collaboration of interconnected parallel additives that inherits the properties of every different. Whereas, Software layout is designed with sequential components, which might be based totally on objects and threads.

•Hardware design shape doesn’t trade dynamically and it may’t be created, modified or eliminated without problems. Whereas, Software design structure may be modified dynamically and re-usability features, used to define the additives. It also consists of easy introduction, amendment and elimination of the additives from the software program.

•Hardware layout makes a speciality of person additives which are represented using analytical version that uses the trfer capabilities. Whereas, Software design represent the additives the use of computation version that may have summary execution engine or it could use the virtual system which might be non-deterministic.

Q8. List Out Various Uses Of Timers In Embedded System?

Timers in embedded gadget are used in a couple of approaches

• Real Time Clock (RTC) for the machine

• Initiating an occasion after a preset time postpone

• Initiating an even after a assessment of preset times

• Capturing the count number cost in timer on an event

• Between two occasions finding the time interval

• Time slicing for numerous duties

• Time department multiplexing

• Scheduling of numerous obligations in RTOS

Q9. When One Must Use Recursion Function? Mention What Happens When Recursion Functions Are Declared Inline?

Recursion function can be used while you are privy to the quantity of recursive calls isn't always immoderate. Inline features belongings says each time it's going to called, it'll replica the entire definition of that function. Recursive feature declared as inline creates the burden at the compilers execution.

Q10. Why Embedded System Is Useful?

With embedded gadget, it's miles possible to replace dozens or maybe more of hardware logic gates, enter buffers, timing circuits, output drivers, and so forth. With a incredibly cheap microprocessor.

Q11. What Could Be The Reasons For A System To Have Gone Blank And How Would You Debug It?

Possible reasons might be:

•PC being overheated.

•Dust having being amassed all round.

•CPU f now not operating nicely .

•Faulty electricity connections.

•Faulty circuit board from where the energy is being drawn.

•Support Drivers not having being installed. 

•Debugging steps which may be taken are:

•Cleaning the machine very well and retaining it in a dirt-free environment. Environment this is cool enough and allows for smooth passage of air have to be ideal enough.

•By locating the correct guide drivers for the machine in consideration and having them set up.

Q12. What Is The Need For Dmac In Es?

•Direct reminiscence get right of entry to is especially used to overcome the hazards of interrupt and progam controlled I/O.

•DMA modules usually take the control over from the processor and perform the reminiscence operations and this is particularly due to the fact to counteract the mismatch within the processing speeds of I/O gadgets and the procesor. This is comparatively faster.

•It is an critical a part of any embedded structures,and the reason for his or her use is they can be used for bursty data trfers rather than unmarried byte methods.

•It has to wait for the structures resources together with the device bus in case it's far already in control of it.

Q13. What Is Endianness Of A System And How Do Different Systems Communicate With Each Other?

•Endianness essentially refers to the ordering of the bytes within words or larger bytes of statistics treated as a unmarried entity.

•When we take into account a several bytes of statistics say as an example 4 bytes of facts,XYZQ the lower byte if saved in a Higher address and others in successively decreasing addresses, then it refers to the Big Endian and the vice versa of this refers to Little Endian architecture.

•Intel 80x86 commonly follows Little Endian and others like IBM structures observe Big Endian formats.

•If the data is being trmitted care must be taken in an effort to understand as to which byte,whether or not the better or the decrease byte is being trmitted.

•Hence a common format previous to verbal exchange has to be agreed upon to avoid incorrect interpretation/calculations.

•Usually layer modules are written so that you can automate those conversion in Operating structures.

Q14. Explain What Are Real-time Embedded Systems?

Real-time embedded systems are computer structures that display, reply or manipulate an outside surroundings. This environment is hooked up to the pc gadget via actuators, sensors, and different enter-output interfaces.

Q15. Why Is Java Mostly Used In Embedded Systems?

•Java became in particular designed and conceptualised for code that could paintings on specific systems without any hassles and also for being comfy sufficient with a purpose to no longer damage or corrupt different modules of code.

•Features like exception dealing with, simple syntax and Automatic Garbage collection all work in its favour because the language for use in ES's.

•Also that it's miles extensively used in the form of Java applets makes it very popular confining it to the bounds of JVM. It is Dynamic in nature.

•Its use is also being exploited in enterprise systems within the form of J2EE, J2SE, J2ME in case of cellular programs.

Q16. If You Buy Some Rtos, What Are The Features You Look For In?

•Deterministic running device having guaranteed worst-case interrupt latency and context-switch times.

•Documentation presenting for the minimal, average, and maximum variety of clock cycles required by every system call.

•Interrupt response times ought to be very minute.

•Context transfer time ought to be very low.

•Compatibility with several plugin gadgets.

•Overall it must be very dependable.

Q17. What Does Dma Address Will Deal With?

DMA address deals with physical addresses. It is a tool which directly drives the facts and cope with bus at some point of records trfer. So, it's far basically physical deal with.

Q18. How To Create A Child Process In Linux?

Prototype of the feature used to create a infant technique is pid_t fork(void);

•Fork is the machine call this is used to create a baby manner. It takes no arguments and returns a value of kind pid_t.

•If the function succeeds it returns the pid of the child technique created to its discern and toddler receives a zero price indicating its a hit creation.

•On failure, a -1 will be returned within the parent's context, no toddler technique can be created, and errno will be set.

•The infant process usually performs all its operations in its mother and father context but each method independently of 1 nother and also inherits some of the critical attributes from it along with UID, current directory, root listing and so on.

Significance of watchdog timer in Embedded Systems.

•Watchdog timer is essentially a timing tool that is set for predefined time interval and some event need to occur all through that time interval else the device generates a day out signal.

•One utility in which it is most extensively used is when the cell phone hangs and no interest takes region, in the ones instances watchdog timer plays a restart of the gadget and comes to the rescue of the users.

•It is used to reset to the authentic nation every time a few irrelevant events take location inclusive of too many commands being given on the same time or other activities that bring about malfunctioning of the GUI. It is usually operated by way of counter gadgets.

Q19. A Vast Majority Of High Performance Embedded Systems Today Use Risc Architecture Why?

•According to the practise sets used, computer systems are commonly labeled into RISC and CISC. RISC stands for 'Reduced Instruction Set Computing' . The design philosophy of RISC structure is such that simplest one preparation is finished on every machine cycle for that reason taking very less time and rushing up whilst compared to their CISC opposite numbers.

•Here the use of registers is optimised as most of the memory get entry to operations are confined to save and load operations.

•Fewer and easy addressing modes, and simple guidance formats ends in greater efficiency, optimisation of compilers, re-agency of code for higher throughput in phrases of area and time complexities. All these functions make it the selection of architecture in majority of the Embedded systems.

•CISC once more have their own benefits and they may be preferred on every occasion the overall performance and compiler simplification are the problems to be sorted.

Q20. Explain What Is Microcontroller?

The microcontroller is a self-contained machine with peripherals, reminiscence and a processor that can be used as embedded machine.

Q21. What Are The Commonly Found Errors In Embedded Systems?

•Damage of reminiscence gadgets because of trient present day and static discharges.

•Malfunctioning of cope with traces because of a short within the circuit.

•Malfunctioning of Data traces.

•Some memory places being inaccessible in storage due to garbage or mistakes.

•Improper insertion of Memory gadgets into the reminiscence slots.

•Faulty manage signals.

Q22. What Is The Need For Having Multibyte Data Input And Output Buffers In Case Of Device Ports?

•It’s usually the case that some gadgets trfer the output either in a bursty or a sequential way and also throughout enter entry. If we take the example of keyboards, all of the statistics entered is saved in a buffer and given at a time or one man or woman at a time.

•In case of networking there may be several requests to get entry to the same useful resource and these kinds of are queued in a buffer and serviced inside the order they may be acquired. Hence to keep away from the input/output units from getting overloaded with requests, we use multibyte buffers.

Q23. Explain What Is Interrupt Latency? How Can You Reduce It?

Interrupt latency is a time taken to return from the interrupt provider habitual publish dealing with a selected interrupt.  By writing minor ISR routines, interrupt latency can be decreased.

Q24. Mention What Are The Essential Components Of Embedded System?

Essential components of embedded system consists of

•Hardware

•Processor

•Memory

•Timers

•I/O circuits

•System application precise circuits

•Software

•It ensures the provision of System Memory

•It tests the Processor Speed availability

•The want to restriction energy lost when running the system constantly

•Real Time Operating System

•It runs a method as in step with scheduling and do the switching from one method to some other

Q25. Explain What Is Embedded System In A Computer System?

An embedded system is a computer machine this is a part of a larger system or system.  It is a machine with a committed characteristic inside a larger electric or mechanical system.

Q26. Explain Whether We Can Use Semaphore Or Mutex Or Spinlock In Interrupt Context In Linux Kernel?

Semaphore or Mutex cannot be used for interrupt context in Linux Kernel. While spinlocks may be used for locking in interrupt context.

Q27. Explain Interrupt Latency And How Can We Decrease It?

1.Interrupt latency essentially refers to the time span an interrupt is generated and it being serviced via an appropriate habitual described, commonly the interrupt handler.

2.External indicators, some situation within the program or through the prevalence of some event, these could be the reasons for technology of an interrupt.

3.Interrupts can also be masked with a view to ignore them although an event takes place for which a ordinary needs to be carried out.

Four.Following steps can be accompanied to reduce the latency

•ISRs being simple and brief.

•Interrupts being serviced straight away

•Avoiding those commands that increase the latency period.

•Also by way of prioritizing interrupts over threads.

•Avoiding use of inappropriate APIs.

Q28. Explain What Is Semaphore?

A semaphore is an summary datatype or variable this is used for controlling get admission to, through multiple procedures to a common resource in a concurrent gadget which include multiprogramming working gadget.  Semaphores are commonly used for 2 purposes

• To percentage a not unusual reminiscence space

• To percentage get admission to to files

Q29. What Is The Need For An Infinite Loop In Embedded Systems?

Infinite Loops are those program constructs wherein in there's no damage declaration to be able to get out of the loop, it simply keeps looping over the statements within the block described.

Example:

While(Boolean True) OR for(;;);

//Code

 

Embedded systems want infinite loops for again and again processing/monitoring the kingdom of the program. One example will be the case of a software nation constantly being checked for any incredible errors that might just arise during run time including memory outage or divide by zero etc.,

Q30. Explain What Is A Watchdog Timer?

A watchdog timer is an digital device or electronic card that execute precise operation after certain term if something is going incorrect with an electronic device.




CFG