Embedded Systems Unit I Part A (2 Marks)
Embedded Systems Unit I Part A (2 Marks)
Unit I
Part A (2 Marks )
1.What is an embedded system?
An embedded system employs a combination of hardware & software
(acomputational engine) to perform a specific function; is part of a larger
system that may not be a computer; works in a reactive and time-constrained
environment.
2.What are the typical characteristics of an embedded system
T ypical characteristics:
perform a single or tightly knit set of functions; increasingly high-performance
& real-time constrained; power, cost and reliability are often important
attributes that influence design;
Application specific processor design can be a significant component of some
embedded systems.
3.What are the advantages of embedded system
Advantages:
Customization yields lower area, power, cost, ...
4.What are the disadvantages of embedded system
Disadvantages:
Higher HW/software development overhead design, compilers, debuggers, ...
may result in delayed time to market!
5.What are the applications of an embedded system
Embedded Systems:Applications:
Consumer electronics, e.g., cameras, camcorders, ....
Consumer products, e.g., washers, microwave ovens, ...
Automobiles (anti-lock braking, engine control, ...)
Industrial process controllers & avionics/defense
applications
Computer/Communication products, e.g., printers, FAX
machines, ...
Emerging multimedia applications & consumer electronics
6.What are the various embedded system designs
Modelling
Refining (or partitioning)
HW-SW partitioning
7.What are the complicating factors in embedded design
Complicating factors in the design of embedded systems
Many of the subtasks in design are intertwined.
Allocation depends on the partitioning, and scheduling presumes a certain
allocation.
Predicting the time for implementing the modules in hardware or software is
not very easy, particularly for tasks
that have not been performed before.
8.What are the realtime requirements of an embedded system? Hard-real time
systems: where there is a high penalty for missing a deadline
e.g., control systems for aircraft/space probes/nuclear reactors; refresh rates
for video, or DRAM. Soft real-time systems: where there is a steadily
increasing
penalty if a deadline is missed.
e.g., laser printer: rated by pages-per-minute, but can take differing times to
print a page (depending on the \"complexity\" of the page) without harming the
machine
or the customer.
Man-Machine Interaction
informs the operator of the current state of the controlled object
assists the operator in controlling the system.
14.What are the various embedded sysyem requirements
Types of requirements imposed by embedded applications:
R1 Functional requirements
R2 Temporal requirements
R3 Dependability requirements
15.What are the temporal requirements
Tasks may have deadlines
Minimal latency jitter
Minimal error detection latency
Timing requirements due to tight software control loops
Human interface requirements.
16.Givethe classification of embedded system
Multi-dimensional classifications
cost for a particular project. (It costs significantly more to develop an ASIC, but
the cost per chip may be lower in the
long run.
27.Give the internal structure of CPLD
28.Define PLDs
At the low end of the spectrum are the original Programmable Logic Devices
(PLDs). These were the first chips that could be used to implement a flexible
digital logic design in hardware. In other words, you could remove a couple of
the 7400-series TTL parts (ANDs, ORs, and NOTs) from your board and
replace them with a single PLD. Other names you might encounter for this
class of device are Programmable Logic Array (PLA), Programmable Array
Logic (PAL), and Generic Array Logic (GAL).
29.What are dependability requirements of an embedded system
Safety
critical failure modes certification Maintainability
MTTR in terms of repairs per hour
Availability
A = MTTF / (MTTF + MTTR) Security
30.Give the diversity of embedded computing
Diversity in Embedded Computing
Unit II
Part A (2 Marks )
1.Give the summary of I/O devices used in embedded system
Program, data and stack memories occupy the same memory space. The total
addressable memory size is 64 KB.
Program memory - program can be located anywhere in memory. Jump,
branch and call instructions use 16-bit addresses, i.e. they can be used to
jump/branch anywhere within 64 KB. All jump/branch instructions use absolute
addressing.
Data memory - the processor always uses 16-bit addresses so that data can
be placed anywhere. Stack memory is limited only by the size of memory.
Stack grows downward.
First 64 bytes in a zero memory page should be reserved for vectors used by
RST instructions. I/O ports -256 Input ports -256 Output ports
Unit III
Part A(2 Marks )
A Cross-Compiler is a computer program that translates a computer program
written in one computer language (called the source language) into an
equivalent program written in another computer language (called the output or
the target language) as in a normal compiler.
A cross-compiler is distinguished by producing output in a form to be used by
a Computer_architecture other than the one hosting the cross-compiler. The
external interrupt in order that a button release (a rising edge on the interrupt
pin) triggers an event (e.g. prints a bit pattern in the STK500\'s leds).
void main(void)
{
int_handler(BUTTON, &button_handler);
int_enable();
while(1);
}
void button_handler(void) ISR
{
leds_on(buttons_chk());
}
8.What is an assembler.
An assembler is a computer program for translating assembly language
essentially, a mnemonic representation of machine language into object
code. A cross assembler (eg:cross compiler) produces code for one type of
processor, but runs on another.
9.Define task scheduling.
Most RTOSs do their scheduling of tasks using a scheme called \"prioritybased preemptive scheduling.\" Each task in a software application must be
assigned a priority, with higher priority values representing the need for
quicker responsiveness. Very quick responsiveness is made possible by
the \"preemptive\" nature of the task scheduling. \"Preemptive\" means that the
scheduler is allowed to stop any task at any point in its execution, if it
determines that another task needs to run immediately
10.Explain Boolean algebra. Boolean algebra
Certain logic functions (i.e. truth tables) are quite common and familiar.
We use a notation that looks like algebra to express logic functions and
expressions involving them. The notation is called Boolean algebra in honor of
George Boole.
A Boolean value is a 1 or a 0.
A Boolean variable takes on Boolean values.
A Boolean function takes in boolean variables and produces boolean values.
11. What do you meant by bus arbitration. Bus Arbitration
Most processors use special control lines for bus arbitration, ie, controlling the
use of the address and data bus,
an input which the DMAC uses to request the bus
an output(s) indicating the bus status
an output indicating acceptance of the DMAC\'s bus request
introduced by D. Gajski) shown in Fig. 1.4 illustrates a design flow for most
logic chips, using design activities on three different axes (domains) which
resemble the letter Y.
20.Define Object oriented interfacing
In general, an interface is a device or a system that unrelated entities use to
interact. According to
this definition, a remote control is an interface between you and a television
set, the English language is an interface between two people, and for eg
protocol of behavior enforced in the military is the interface between people of
different ranks.
21. Give the internal structure of a trap gate entry.
22. What are software interrupts
Software interrupts are still widely used by protected-mode operating systems
in order to publish their internal services to the external world. However, most
of these interfaces are now wrapped by functions and cannot be accessed
directly (although it\'s possible, it\'s not recommended). For instance, Windows
NT uses the undocumented interrupt 2Eh to allow control transfers between its
user mode and kernel mode components. Whenever a non-privileged
Windows application issues a call to an API function, the system routes the
call until it reaches an INT 2Eh instruction.
23.What are hardware interrupts
Hardware interrupts in protected-mode behave in the same manner as
described in the real-mode section. The only major difference is that when
executing in protected-mode, the processor consults its IDT rather than
searching the real-mode IVT for the address of the interrupt handler.
cost for a particular project. (It costs significantly more to develop an ASIC, but
the cost per chip may be lower in the long run.
27.Give the internal structure of CPLD
28.Define PLDs
At the low end of the spectrum are the original Programmable Logic Devices
(PLDs). These were the first chips that could be used to implement a flexible
digital logic design in hardware. In other words, you could remove a couple of
the 7400-series TTL parts (ANDs, ORs, and NOTs) from your board and
replace them with a single PLD. Other names you might encounter for this
class of device are Programmable Logic Array (PLA), Programmable Array
Logic (PAL), and Generic Array Logic (GAL).
29.What are dependability requirements of an embedded system
Safety
critical failure modes certification Maintainability
MTTR in terms of repairs per hour
Availability
A = MTTF / (MTTF + MTTR) Security
30 Explain how to optimize codes
This operation is best performed with the help of a DMAC. The operating
system can load the DMAC chip with the required information, ie,
track/sector(s) information, load address, and then instruct the DMAC to
perform the transfer. When the transfer is complete, the DMAC will provide a
signal to the processor. The processor can then check the status of the DMAC
to ensure the operation was performed correctly.
Part B( 16 Marks )
1.Explain the concepts of embedded programming
2.Explain the features of assemblers ,combilers and cross combilers used in
embedded systems
3.Explain Interrupt service routine Queues
4.What is an interrupt? What are the types of interrupts ? Explain
5.What is interrupt latency ? Explain
6.Explain the C.Program elements ,macros and functions used in embedded
systems..
7.Explain the use of function calls in embedded programming
8.Explain how to optimize memory codes
9.Explain the various multiple function calls in Embedded C
10.Discuss the scheduling architecture and the algorithms used in embedded
software development
11.Give the difference between programming in assembly language (ALP) and
high level language
Unit IV
Part A (2 Marks )
1. What is a thread?
A thread otherwise called a lightweight process (LWP) is a basic unit of CPU
utilization, it comprises of a thread id, a program counter, a register set and a
stack. It shares with other threads belonging to the same process its code
section, data section, and operating system resources such as open files and
signals.
2. What are the benefits of multithreaded programming?
The benefits of multithreaded programming can be broken down into four
major categories: Responsiveness
Resource sharing
Economy
Utilization of multiprocessor architectures
3.Compare user threads and kernel threads. User threads Kernel threads
User threads are supported above the kernel and are implemented by a thread
library at the user level
Kernel threads are supported directly by the operating system
Thread creation & scheduling are done in the user space, without kernel
intervention. Therefore they are fast to create and manage Thread creation,
scheduling and management are done by the operating system. Therefore
they are slower to create & manage compared to user threads
Blocking system call will cause the entire process to block If the thread
performs a blocking system call, the kernel can schedule another thread in the
application for execution
4.Define thread cancellation & target thread.
The thread cancellation is the task of terminating a thread before it has
completed. A thread that is to be cancelled is often referred to as the target
thread. For example, if multiple threads are concurrently searching through a
database and one thread returns the result, the remaining threads might be
cancelled.
5.What are the different ways in which a thread can be cancelled?
Cancellation of a target thread may occur in two different scenarios:
Asynchronous cancellation: One thread immediately terminates the target
thread is called asynchronous cancellation.
Deferred cancellation: The target thread can periodically check if it should
terminate, allowing the target thread an opportunity to terminate itself in an
orderly fashion.
6.Define CPU scheduling.
CPU scheduling is the process of switching the CPU among various
processes. CPU scheduling is the basis of multiprogrammed operating
systems. By switching the CPU among processes, the operating system can
make the computer more productive.
signal (S)
{ S++;
}
18. When the error will occur when we use the semaphore?
i. When the process interchanges the order in which the wait and signal
operations on the semaphore mutex.
ii. When a process replaces a signal (mutex) with wait (mutex).
iii. When a process omits the wait (mutex), or the signal (mutex), or both.
19.Define deadlock.
A process requests resources; if the resources are not available at that time,
the process enters a wait state. Waiting processes may never again change
state, because the resources they have requested are held by other waiting
processes. This situation is called a deadlock.
20.What is the sequence in which resources may be utilized?
Under normal mode of operation, a process may utilize a resource in the
following sequence: Request: If the request cannot be granted immediately,
then the requesting process must wait until
it can acquire the resource.
Use: The process can operate on the resource. Release: The process
releases the resource.
Unit V
Part A (2 Marks)
A real-time operating system (RTOS) is an operating system that has been
developed for real-time applications. It is typically used for embedded
applications, such as mobile telephones, industrial robots, or scientific
research equipment.
2.Define task and task rates.
An RTOS facilitates the creation of real-time systems, but does not guarantee
that they are real-time; this requires correct development of the system level
software. Nor does an RTOS necessarily have high throughput rather they
allow, through specialized scheduling algorithms and deterministic behavior,
the guarantee that system deadlines can be met. That is, an RTOS is valued
more for how quickly it can respond to an event than for the total amount of
work it can do. Key factors in evaluating an RTOS are therefore maximal
interrupt and thread latency
3.Explain memory allocation in embedded system.
Memory allocation is even more critical in a RTOS than in other operating
systems.Firstly, speed of allocation is important. A standard memory
allocation scheme scans a linked list of indeterminate length to find a suitable
free memory block; however, this is unacceptable as memory allocation has to
occur in a fixed time in a RTOS.
Secondly, memory can become fragmented as free regions become
separated by regions that are in use. This can cause a program to stall,
unable to get memory, even though there is theoretically enough available.
Memory allocation algorithms that slowly accumulate fragmentation may work
fine for desktop machineswhen rebooted every month or sobut are
unacceptable for embedded systems that often run for years without rebooting
4.Explain multi task and their fuctions in embedded system.
This system implements cooperative and time-sliced multitasking, provides
resource locking and mailbox services, implements an efficient paged memory
manager, traps and reports errors, handles interrupts, and autostarts your
application at system startup. By following some simple coding practices as
shown in the documented coding examples, you can take advantage of these
sophisticated features without having to worry about the implementation
details.
5.Explain memory allocation functions
Determinism of service times is also an issue in the area of dynamic allocation
of RAM memory. Many general-computing non-real-time operating systems
offer memory allocation services from what is termed a \"Heap.\" The
1. Use the Unix command ipcs to get a list of defined message queues, then
use the command ipcrm to delete the queue.
2.Write a program to do it for you
12.Give the needs for memory management]
Each new model of computer seems to come with more main memory than
the last, but, since the memory requirements of the software rise just as fast,
memory is always a precious commodity, hence the need for memory
management .
Memory is allocated to a process when needed
Memory is deallocated when no longer in use
Swapping allows the total memory used by all the running processes to
exceed main memory
Virtual memory makes it possible to run a single program that uses more
memory than the main
memory (normally RAM) available on the system. Virtual memory is normally
divided into pages .
Programs refer to parts of memory using addresses . In a virtual memory
system, these are virtual
addresses
The virtual address is mapped onto a physical addresses by a memory
management unit (MMU)
int milliseconds; /* interval between actions */ int remaining; /* time until action
*/ TimerAction action; /* user-defined action */ void * data; /* user-defined data
*/
int value; /* user-defined value */
};
16.What is a semaphore.
Semaphores -- software, blocking, OS assistance solution to the mutual
exclusion problem
basically a non-negative integer variable that saves the number of wakeup
signals sent so they are not lost if the process is not sleeping
another interpretation we will see is that the semaphore value represents the
number of resources available
17.Give the semaphore related functions.
A semaphore enforces mutual exclusion and controls access to the process
critical sections. Only one process at a time can call the function fn.
SR Program: A Semaphore Prevents the Race Condition.
SR Program: A Semaphore Prevents Another Race Condition.
18.What are the various shared data operating system services.
explain how operating systems provide abstraction from the computer
hardware.