Important Questions: Information Security

 1. What is brute force attack?

  • A brute force attack is a trial-and-error method used to obtain information such as a user password or personal identification number (PIN). 
  • In a brute force attack, automated software is used to generate a large number of consecutive guesses as to the value of the desired data. 
  • Brute force attacks may be used by criminals to crack encrypted data, or by security, analysts to test an organization's network security. An attack of this nature can be time- and resource-consuming.
  • An example of a type of brute force attack is known as a dictionary attack, which might try all the words in a dictionary. 

 Brute force explanation with example

Consider we have to open a number combination like in the above picture.

We have 3 wheels to turn, each wheel has values from 0-9.

Therefore the smallest number is 000 and the largest number is 999, so there are  1000 possible combinations to unlock this lock.

An attacker with a brute force approach will try to manually try out all the possible combinations to unlock this lock.

 # One disadvantage of this method is that it is really slow, to solve this we can use a dictionary attack.

A dictionary attack will try out all the combinations in a list, rather than trying out all possible combinations. Consider my Password is 1234, this is one of the most common passwords found and I am having a list with the top 1000 common passwords, so my password can be hacked in seconds.

 

2. Discuss different types of attacks that can occur in an organization. 

An attack is a deliberate act or action that takes advantage of a vulnerability to compromise a controlled system. It is accomplished by a threat agent that damages or steals an organization's information or physical asset.

Types of Attacks
  • Attacks on confidentiality, integrity, availability.
  • Brute force attack: A brute force attack is a trial-and-error method used to obtain information such as a user password or personal identification number (PIN). 
  • Timing Attack: A timing attack is a security exploit that allows an attacker to discover vulnerabilities in the security of a computer or network system by studying how long it takes the system to respond to different inputs. 
  • Sniffers: Sniffing is a process of monitoring and capturing all data packets passing through a given network. 
  • Denial of Service - It prevents the normal use of communication facilities. This attack may have a specific target.
3. Describe discretionary policies for Biba model. 

The Biba model is a hierarchical security model designed to protect system assets (or objects) from unauthorized modification, which is designed to protect system integrity. In this model, subjects(users) and objects are associated with ordinal integrity levels where subjects can modify objects only at a level equal to or below its own integrity level.

Discretionary policies
1. Access Control Lists: it used to determine which subjects can access which objects. The access control list can then be modified by the subjects with the correct privileges.

2. Object Hierarchy: integrity can be enforced by using an object’s hierarchy. With this method, there is root and objects that are ancestors to the root. To access a particular object, the subject must have the observe privileges to those objects and all the other ancestor objects all the way up to the root. 

3. Ring: it numbers the rings in the system with the lower number being a higher privilege. The access modes of the subject must fall within a certain range of values to be permitted to access an object.


4. What is phishing? Give an example. 

  • Phishing is the fraudulent attempt to obtain sensitive information or data, such as usernames, passwords and credit card details.
  •  it is carried out by email spoofing, instant messaging, and text messaging, phishing often directs users to enter personal information at a fake website which matches the look and feel of the legitimate site. 
  • Phishing is an example of social engineering techniques used to deceive users.
Types of Phishing
  •  Mass Phishing (Deceptive Phishing) – Mass, large-volume attack intended to reach as many people as possible 
  • Spear Phishing – Targeted attack directed at specific individuals or companies using gathered information to personalize the message and make the scam more difficult to detect 
  • Whaling (CEO Fraud) – Type of spear phishing attack that targets “big fish,” including high-profile individuals or those with a great deal of authority or access 
  • Clone Phishing(pharming) – Spoofed copy of a legitimate and previously delivered email, with original attachments or hyperlinks replaced with malicious versions, which is sent from a forged email address. so it appears to come from the original sender or another legitimate source 
  • Advance-Fee Scam- Requests the target to send money or bank account information to the cyber-criminal

Example of phishing

An email or message asking to go to a certain hyperlink, and to enter a person's credentials or sensitive information is an example of phishing. The website will look like an authentic website but the URL will be different.

5. Differentiate between polymorphic and metamorphic worm.

Polymorphic worms and metamorphic worms are used synonymously but they vary due to their respective unique engines.

A metamorphic worm is a worm that can reprogram itself. With each infection, it rewrites its code, making it appear different, but the main functionality of the worm doesn’t change. This change of code is done using a metamorphic engine. This ability to morph itself makes detecting these worms harder. 

A polymorphic worm can transform a program into a version consisting of different code but having the same functionality. Encryption is generally employed here; encrypting the payload with different keys can generate many worm variations. A decryption module has to be prepended before the payload.

6. How do you reduce the impact of XSS vulnerabilities?

Cross-site scripting (XSS) is a code injection security attack targeting web applications. we can reduce the impact of XSS vulnerabilities by,

• If Cookies Are Used:
▫ Scope as strict as possible
▫ Set ‘secure’ flag
▫ Set ‘HttpOnly’ flag
On the client, consider disabling JavaScript (if possible) or use something like
the No Script Firefox extension.


Filtering for XSS

The easiest form of cross-site scripting vulnerability elimination would be to pass all external data through a filter. Such a filter would remove dangerous keywords, for example, the infamous <script> tag, JavaScript commands, CSS styles, and other dangerous HTML markups (such as those that contain event handlers.

Escaping from XSS

Escaping is the primary means to avoid cross-site scripting attacks. When escaping, you are effectively telling the web browser that the data you are sending should be treated as data and should not be interpreted in any other way. If an attacker manages to put a malicious script on your page, the victim will not be affected because the browser will not execute the script if it is properly escaped. In HTML, you can escape dangerous characters by using HTML entities, for example, the &# sequence followed by its character code.

7. Describe frame spoofing with a neat diagram.

Frame Spoofing


Premature Termination of connections


➢ A number of management frames used in 802.11 wireless LANs such as the Beacon, Association and Authentication frames.


➢ A station needs to authenticate and then associate with an Access Point (AP) before they can exchange data frames with each other.


➢ Each party can, at any point in time, terminate the connection by transmitting a Deauthentication frames.


➢ The recipient of a management frame relies on the sender address field in the frame to identify the originator of the message.


However, an attacker can spoof the sender address in the frame. For example, he can fabricate a de-authentication frame with

Sender Address = Sataion_27

Receiver Address = AP


➢ The address used are 48-bit MAC address. When the AP receives the above frame, it thinks that Station_27 wishes to terminate the existing connection to itself. The AP sets the state of the connection between itself and Station_27 to be “Unauthenticated and Unassociated”


➢ Station_27 would have to go through the time-consuming process of re-associating itself to the AP if it wished to resume the communication. The attacker could repeatedly transmit such Deauthentication frames to the AP thus effectively slowing down or even preventing communication between Station_27 and AP.







8. Describe the security enhancements present in UMTS.

The Universal Mobile Telecommunications System (UMTS), based on the GSM standards, is a mobile cellular system of the third generation that is maintained by 3GPP (3rd Generation Partnership Project).
  • Mutual Authentication: provides enhanced protection against false base station attacks by allowing the mobile to authenticate the network.
  • Data Integrity: provides enhanced protection against false base station attacks by allowing the mobile to check the authenticity of certain signalling messages.
  • Network to Network Security: Secure communication between serving networks.
  • Flexibility: Security features can be extended and enhanced as required by new threats and services.
  • Longer key length: Key length is 128 as against 64 bits in GSM.
  • Wider security scope: Security is based within the RNC rather than the base station.
9. What is SOAP binding? Explain with the help of an HTTP message.

  • SOAP (Simple Object Access Protocol) bindings are mechanisms which allow SOAP messages to be effectively exchanged using a transport protocol.
  • Most SOAP implementations provide bindings for common transport protocols, such as HTTP or SMTP.
  • HTTP is synchronous and widely used. A SOAP HTTP request specifies at least two HTTP headers: Content-Type and Content-Length.

Example:

Example code
<binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/ >
<operation name="sayHello">
<soap:operation soapAction="sayHello"/>
<input>...


10. List the security threats in RFID based identification and tracking systems.

  • Man-in-the-Middle Attack: A man-in-the-middle attack happens during the transmission of a signal.  The hacker listens for communication between a tag and reader and then intercepts and manipulates the information. The hacker diverts the original signal and then sends false data while pretending to be a normal component in the RFID system.
  • Denial of Service: A Denial of Service attack is the broad concept of an RFID system failure that is associated with an attack. These attacks are usually physical attacks like jamming the system with noise interference, blocking radio signals, or even removing or disabling RFID tags.
  • Power Analysis: Power analysis attacks can be mounted on RFID systems by monitoring the power consumption levels of RFID tags.
  • Eavesdropping: Eavesdropping, like it sounds, occurs when an unauthorized RFID reader listens to conversations between a tag and reader then obtains important data.

11 a) What is role based access control. Illustrate with suitable example the concept of role inheritance.

  • Role-based access control (RBAC) is an approach to restricting system access to authorized users. 
  • It s a policy-neutral access-control mechanism defined around roles and privileges.
  • RBAC can be used to facilitate administration of security in large organizations with hundreds of users and thousands of permissions.
  • The components of RBAC such as role-permissions, user-role and role-role relationships make it simple to perform user assignments.
Example:
An organization assigns a role-based access control role to every employee; the role determines which permissions the system grants to the user, like you can designate whether a user is an administrator, a specialist, or an end-user, and limit access to specific resources or tasks. 

b) Differentiate between Discretionary and Role based access control.

Discretionary Access Control (DAC)
  • The owner of a protected system or resource sets policies defining who can access it.
  • DAC can involve physical or digital measures, and is less restrictive than other access control systems, as it offers individuals complete control over the resources they own. 
  • It is less secure because associated programs inherit security settings and allow malware to exploit them without the knowledge of the end-user. 
  • You can use RBAC to implement DAC.
Role-based access control (RBAC)
  • Is a mechanism that restricts system access. 
  • It involves setting permissions and privileges to enable access to authorized users. 
  • Most large organizations use role-based access control to provide their employees with varying levels of access based on their roles and responsibilities. 
  • This protects sensitive data and ensures employees can only access information and perform actions they need to do their jobs.

c) Briefly discuss Mandatory access control implemented in a typical secure operating System.

  • MAC is considered the most secure of all access control models.
  • In MAC, central authority regulates access rights based on multiple levels of security. 
  • Only users or devices with the required information security clearance can access protected resources.
  • Access rules are manually defined by system administrators and strictly enforced by the operating system or security kernel. 
  • Organizations with varying levels of data classification, like government and military institutions, typically use MAC to classify all end users. 
  • You can use role-based access control to implement MAC.
Mandatory access control

12 a) Demonstrate Chinese wall security model with neat diagram.

The Chinese Wall model is a security model that concentrates on confidentiality and finds itself application in the commercial world. The model bases itself on the principles defined in the Clark Wilson security model.The Chinese Wall model was introduced by Brewer and Nash in 1989.According to the model, subjects are only granted access to data that is not in conflict with other data they possess.

b) Classify each of the following as a violation of confidentiality, integrity,  availability or some combination thereof. Also, justify your answer.
i. John copies Mary's homework. 
Confidentiality- Copyng the data s violation of confidentiality.

ii. Pau[ clashes Linda's system
Availability- Ths crashing causes unavailability of the system to Linda. 

iii. Carol changes the amount of Angelo's check from 100 to 1000
Integrity- The data on the check got changed which data integrity violation.

iv. Gina forges Roger's signature on a deed.
Integrity- Violation of  Integrity by unauthorized signature.


13 a) Interpret about the star property in Bell -LaPadula model.

b) Write Windows access control algorithm.





14 a) How Buffer OverFlow (BOF) vulnerability makes software insecure. Explain different ways in which BOF exploitations occur.


  • A buffer overflow, or buffer overrun, occurs when more data is put into a fixed-length buffer ( Buffers are areas of memory set aside to hold data) than the buffer can handle. 
  • The extra information, which has to go somewhere, can overflow into adjacent memory space, corrupting or overwriting the data held in that space. 
  • This overflow usually results in a system crash, but it also creates the opportunity for an attacker to run arbitrary code or manipulate the coding errors to prompt malicious actions.
The techniques to exploit a buffer overflow vulnerability vary by architecture, by the operating system and by memory region.
  • Stack-based exploitation
  • Heap-based exploitation: A buffer overflow occurring in the heap data area is referred to as a heap overflow.
  • Barriers to exploitation: Manipulation of the buffer, which occurs before it is read or executed, may lead to the failure of an exploitation attempt. These manipulations can mitigate the threat of exploitation, but may not make it impossible.
b) Explain XSS vulnerabilities.
  • Cross-site scripting (XSS) is a type of security vulnerability, typically found in web applications.
  •  XSS attacks enable attackers to inject client-side scripts into web pages viewed by other users. 
  • A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same-origin policy. 
  • XSS effects vary in range from a petty nuisance to a significant security risk, depending on the sensitivity of the data handled by the vulnerable site.
  • Cross-site scripting attacks use known vulnerabilities in web-based applications, their servers, or the plug-in systems on which they rely. 
  • Exploiting one of these, attackers fold malicious content into the content being delivered from the compromised site. 
15 a) Describe Kermack-McKendrick Model of worm propagation.


Kermack-McKendrick Model

The model consists of three compartments: 
  • The number of susceptible (S)
  • The number of infectious (I)
  • The number of recovered individuals (R)


SIR compartment model

The model consists of a system of three coupled nonlinear ordinary differential equations,
SIR Model

where,
# N - the total population 
# t - time
# S(t) - the number of susceptible people
# I(t) -  the number of people infected
# R(t) - the number of people who have recovered and developed immunity to the infection
# beta is the infection rate 
# gamma  is the recovery rate

b) Explain any two categories of topological worms.

Email-Worm
  • An Email-Worm (also known as a mass-mailer or less commonly, an Internet worm) is a type of worm that distributes copies of itself in infectious executable files attached to fake email messages. 
  • Email-Worm typically arrives as executable files attached to fake email messages. 

P2P Worms
  • P2P Worms spread via peer-to-peer file-sharing networks (such as Kazaa, EDonkey, FastTrack, etc.). 
  • Most of these worms work in a relatively simple way, to get onto a P2P network, all the worm has to do is, copy itself to the file-sharing directory, which is usually on a local machine. 
  • The P2P network does the rest, when a file search is conducted, it informs remote users of the file and provides services making it possible to download the file from the infected computer.

16 a) Explain how can you detect and prevent SQL Injection vulnerabilities. 



SQL Injection (SQLi) is a type of injection attack that makes it possible to execute malicious SQL statements.
  • The only efficient way to detect SQL Injections is by using a vulnerability scanner, often called a DAST tool (dynamic application security testing).
Prevention
  • Input validation - The validation process is aimed at verifying whether or not the type of input submitted by a user is allowed. Input validation makes sure it is the accepted type, length, format, etc. Only the value which passes the validation can be processed. 
  • Parametrized queries - Parameterized queries are a means of pre-compiling a SQL statement so that you can then supply the parameters in order for the statement to be executed. This method makes it possible for the database to recognize the code and distinguish it from input data.
  • Escaping - Always use character-escaping functions for user-supplied input provided by each database management system (DBMS). This is done to make sure the DBMS never confuses it with the SQL statement provided by the developer.

 

b) Name any worm that exploited buffer overflow vulnerability. Explain its characteristics.

Code Red was a computer worm that exploited buffer overflow vulnerability. It did this by using a long string of the repeated letter 'N' to overflow a buffer, allowing the worm to execute arbitrary code and infect the machine with the worm.

Characteristics

  • It often uses a computer network to spread itself, relying on security failures on the target computer to access it. 
  • It will use this machine as a host to scan and infect other computers.
  • Computer worms use a recursive method to copy themselves without host programs and distribute themselves and then controlling and infecting more and more computers in a short time. 
  • Worms almost always cause at least some harm to the network, even if only by consuming bandwidth, whereas viruses almost always corrupt or modify files on a targeted computer.

17 a) Explain link level security provided by Bluetooth.

  • In link-level security, a device starts security procedures before any physical link is established.
  • In this mode, authentication and encryption are used for all connections to and from the device.
  • The authentication and encryption processes use a separate secret link key that is shared by paired devices, once the pairing has been established.
  • The link key is generated for the first time when two devices communicate.
Link key generation:
  • Two devices communicating for the first time will go through an initialization phase, they will be “associated” at that point. 
  • The link key generation begins when the user enters identical PINs into both devices, which the devices use to generate their secret link keys. 
  • One of Bluetooth's security strengths is that in subsequent communications between devices, the link key is never transmitted outside of the device.
  • The link key is simply used in cryptographic algorithms to generate matching sequences.






 


b) Describe entity authentication and key agreement in GSM Networks.






18 a) How security is implemented in online credit card payment systems? 
 


b) What are the main concerns involved in online credit card payment systems?

19  a) Explain MAC generation and encryption in CCMP. 
 

Counter Mode with Cipher Block Chaining Message Authentication Code Protocol



b) Explain any two technologies for web services.

XML

  • XML is a markup language. With a markup language, we can structure a document using tags, using XML, we can customize the tags also.
  • Each bit of information in a document is defined by tags without the overload of formatting present in HTML.
  • This type of representation is suitable for application-to-application communication.
  • Another feature of XML is that the vocabulary can be extended. Vocabulary refers to the types of tags used to structure a document in XML.
  • XML supports multichannel portal applications

 


SOAP

  • The Simple Object Access Protocol is a standard protocol that provides a definition for XML-based information exchange by means of XML messages. 
  • SOAP provides a paradigm for allowing different programs, running in different or the same operative system to communicate with each other using a transport protocol (mainly HTTP) and XML based structures.
  • SOAP is a lightweight protocol that provides a message exchange pattern for structured information in a decentralized, distributed environment; it defines an extensible messaging framework based on XML to provide a message construct (SOAP messages) which can be exchanged over different underlying protocols. This framework is independent of any programming model and other implementation semantics.

SOAP Message Structure

The following block depicts the general structure of a SOAP message −


<?xml version = "1.0"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-

envelope"


  SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">

  <SOAP-ENV:Header>

  ...

  ...

  </SOAP-ENV:Header>

  <SOAP-ENV:Body>

  ...

  ...

  <SOAP-ENV:Fault>

  ...

  ...

  </SOAP-ENV:Fault>

  ...

  </SOAP-ENV:Body>

</SOAP_ENV:Envelope>






Firmware embedding techniques

  Firmware embedding techniques for a non-OS based embedded system are given below: 

1. Out of circuit programming 

2. In System Programming 

3. In Application Programming 


Out-of-Circuit Programming

  • Out-of-circuit programming is performed outside the target board.
  • The processor or memory chip into which the firmware needs to embedded is taken out of the target board and it is programmed with the help of programming device.
  • A programming device is a dedicated unit when contains the necessary hardware circuit to generate the programming signals.
  • The programmer contains a ZIF socket with locking pin to hold the device to be programmed.
  • The programming device will be under the control of a utility program running on a PC.
  • The programmer is interfaced to the PC through RS-232C/USB/Parallel Port Interface.
  • The commands to control the programmer are sent from the utility program to the programmer through the interface.
In System Programming (ISP) 

  • In ISP, programming is done within the system.
  • The firmware is embedded into the target device without removing it from the target board.
  • It is a flexible and easy way of firmware embedding.
  • The only pre-requisite is that the device must have an ISP support.
  • Apart from target board, PC, ISP utility and ISP cable, no other additional hardware is required for ISP.
  • In order to perform ISP operations, the target device should be powered up in a special ‘ISP mode’.
  • ISP mode allows the device to communicate with an external host through a serial interface, such as a PC or terminal.
  • The device receives commands and data from the host, erases and reprograms code memory according to the received command.
  • Once the operations are completed, the device is re-configured so that it will operate normally.
In Application Programming (IAP) 

  • In Application Programming (IAP) is a technique used by the firmware running on the target device for modifying a selected portion of the code memory. 
  • It is not a technique for the first time embedding of user written firmware. 
  • It modifies the program code memory under the control of the embedded application. 
  • Updating calibration data, look-up tables, etc., which are stored in the code memory, are typical examples of IAP. 
  • The Boot ROM resident API instructions which perform various functions such as programming, erasing and reading the Flash memory during ISP mode is made available to the end-user written firmware for IAP. 

Firmware Embedding techniques for Operating System based Devices

Use of factory-programmed chips.
  • It is used for mass production applications and reduces product development time.
  • It Can‟t be used if firmware undergoes frequent changes.

Imporatant Questions & Answers In Embedded Systems

  What is an embedded computing system? Write two functionalities of an embedded system.

  • An embedded system is a computer hardware system having software embedded in it. 
  • An embedded system can be an independent system or it can be a part of a large system. 
  • An embedded system is a microcontroller or microprocessor-based system which is designed to perform a specific task. 
  • For example, a fire alarm is an embedded system; it will sense only smoke.
Functionalities

  • An embedded system makes a system dedicated to being used for a variety of application and It provides high reliability and real-time computation ability.
  • Embedded system generally used to do a specific task that provides a real-time output based on various characteristics of an embedded system.
Explain the problems of hardware-software co-design in an embedded system.

Fundamental issues in H/w S/w Co-design

  •  Model Selection - A Model captures and describes the system characteristics and specifications.  It is hard to make a decision on which model should be followed in particular system design. Most often designers switch between a variety of models from the requirements specification to the implementation aspect of the system design. The objectives vary with each phase.
  • Architecture Selection - The architecture specifies how a system is going to implement in terms of the number and types of different components and the interconnection among them. CISC, RISC,  VLIW, etc are the commonly used architectures in system design.
  • Language Selection - A programming Language captures a ‘Computational Model’ and maps it into architecture. A model can be captured using multiple programming languages like C, C++, C#, Java etc for software implementations and languages like VHDL, System C, Verilog etc for hardware implementations.
  •  H/w and S/w Partitioning - it is an Implementation aspect of a System-level Requirement. Various hardware-software trade-offs like performance, re-usability, effort etc are used for making a decision on the hardware-software partitioning.
Draw a concurrent program model for Seat Belt Warning System of an automobile.




Explain the library file in the assembly language context. What is the 'library file'.

Libraries are specially formatted, ordered collection of object modules that may be used by the linker at a later time.
Benefits 
  • Library file is a kind of source hiding technique.
  • Helps in easier programming
e.g: LIB 51 for Keil


Briefly describe out of circuit programming in Embedded System.

  • Out-of-circuit programming is performed outside the target board. 
  • The processor or memory chip into which the firmware needs to embedded is taken out of the target board and it is programmed with the help of programming device. 
  • A programming device is a dedicated unit when contains the necessary hardware circuit to generate the programming signals. 
  • The programmer contains a ZIF socket with locking pin to hold the device to be programmed. 
  • The programming device will be under the control of a utility program running on a PC. 
  • The programmer is interfaced to the PC through RS-232C/USB/Parallel Port Interface. 
  • The commands to control the programmer are sent from the utility program to the programmer through the interface. 


Differentiate generic IDEs with IDEs used in embedded firmware development with suitable examples.

Generic IDE
  • A generic integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development.
  • An IDE normally consists of at least a source code editor, build automation tools and a debugger.
  • Examples: NetBeans and Eclipse etc
IDEs used in embedded firmware development
  • Embedded system IDE stands for an Integrated Environment for developing and debugging the target processor specific embedded software.
  • IDE is a software package which contains:
Text Editor(Source Code Editor)
Cross Compiler
Linker and debugger.
  • Some IDEs may provide an interface to an emulator or device programmer.
  •  
Explain hard real-time considerations and soft real-time considerations.

Hard real-time
  • In a hard real-time system, the size of the data file is small or medium.
  • In this system response time is in a millisecond.
  • In this system safety is critical.
  • For example Air Traffic Control, Medical System 
Soft real-time
  • In soft real-time system, the size of the data file is large.
  • In this system response time are higher.
  • In this system, safety is not critical.
  • For example Multimedia Transmission and Reception, Computer Games 

Differentiate monolithic kernel with microkernel.

What is the Difference Between Microkernel and Monolithic Kernel ...

Explain System on Chip technique (SOC).

  • A system on a chip (SoC) combines the required electronic circuits of various computer components onto a single, integrated chip (IC).
  •  SoC is a complete electronic substrate system that may contain analog, digital, mixed-signal or radio frequency functions. 
  • Its components usually include a graphical processing unit (GPU), a central processing unit (CPU) that may be multi-core, and system memory (RAM).
  • SOC includes both the hardware and software, it uses less power, has better performance, requires less space and is more reliable than multi-chip systems. 
  • Most system-on-chips today come inside mobile devices like smartphones and tablets.
Write any 4 bottlenecks available in the embedded industry.

Following are some of the problems faced by the embedded devices industry:

  •  Memory Performance- The rate at which processors can process may have increased considerably but the rate at which memory speed is increasing is slower.
  • Lack of Standards/ Conformance to standards- Standards in the embedded industry are followed only in certain handful areas like Mobile handsets.
  • Lack of Skilled Resource- The most important aspect in the development of the embedded system is the availability of skilled labour. There may be thousands of developers who know how to code in C, C++, Java or .NET but very few in embedded software.
  • • Size
  • • Power
  • • Performance
  • • Cost


 With a suitable example, explain the specification phase of an embedded system.

  • Requirements gathered is refined into a specification. 
  • Specification serves as the contract between the customers and the architects.
  • Specification is essential to create working systems with a minimum of designer effort. It must be specific, understandable and accurately reflect the customer’s requirements.

  • Example:
    Considering the example of the GPS system, the specification would include details for several components:
    • Data received from the GPS satellite constellation
    • Map data
    • User interface
    • Operations that must be performed to satisfy customer requests
    • Background actions 


    Show the UML representation of an object and a class with a suitable example.

    Object Diagram Example: Writer



    Design a coin-operated public telephone unit based on FSM model for the 
    following requirements.

    1. The calling process is initiated by lifting the receiver (off-hook) of the
    telephone unit.
    2. After lifting the phone the user needs to insert a 1 rupee coin to make
    the call.
    3. If the line is busy, the coin is returned on placing the receiver back on
    the hook (on-hook).
    4. If the line is through, the user is allowed to talk till 60 seconds and at the
    end of 45th second, prompt for inserting another one rupee coin
    for continuing the call is initiated.
    5. If the user doesn't insert another 1 rupee coin, the call is terminated on
    completing the 60 seconds time slot.
    6. The system is ready to accept new call request when the receiver is
    placed back on the hook (on-hook).
    7. The system goes to the "Out of Order" state when there is a line fault.


    List and explain the non functional requirements in an embedded system.

    Non-functional requirements
    • Time required to compute output.
    • Size: The physical space required by the system, measured in bytes for software and gates or transistor for hardware.
    • Weight 
    • Power consumption: The amount of power consumed by a system which decides the lifetime of battery or cooling requirements of IC.
    • Reliability
    • Speed of the system
    • Cost: Target cost, purchase cost, manufacturing cost


    Draw a class diagram for a basic microwave oven, cooking time should be adjusted from 1 min to 60 min. Include classes for door, front panel and heating elements.






    With a neat diagram explain the steps in converting assembly language to machine language.

    • Assembly language provides mnemonics or symbols for the machine level code instructions. 
    • Assembly language program is consisting of mnemonics that are translated into machine code. 
    • A program that is used for this conversion is known as an assembler.
    Steps

    Assembly Language


    • Editor Program: At first, we use an editor for type in a program. Editors like MS-DOS program that comes with all Microsoft operating systems can be used for creating or edit a program. The editor produces an ASCII file. The ?asm? extension for a source file is used by an assembler during the next step.
    • Assembler Program: The "asm" source file contains the code created in Step 1. It is transferred to an 8051 assembler. The assembler is used for converting the assembly language instructions into machine code instructions and it produced the .obj file (object file) and .lst file (list file). It is also called a source file because some assembler requires that this file must have "src" extension.
    • Linker Program: The linker program is used for generating one or more object files and produces an absolute object file with an extension "abs".
    • OH Program: The OH program fetches the "abs" file and fed it to a program called "OH". OH is called an object to hex converter it creates a file with an extension "hex" that is ready for burn into the ROM.

    Explain the Debuggers used in Embedded System Development Environment.

    • A debugger is a tool used to debug your code and to test whether the code you is free from errors or not.
    • Debugger goes through the whole code and tests it for errors and bugs.
    • It tests your code for different types of errors, for example, a run time error or a syntax error and notifies you wherever it occurs.
    • The line number or location of the error is shown by debugger so you can go ahead and rectify it.
    • A debugger allows a programmer to stop a program at any point and examine and change the values of the variables.
    Briefly describe (i) decompiler (ii) disassemblers


    Is it possible to embed the firmware into the target processor/controller memory at the time of chip fabrication? Justify your answer.

    It is possible to embed the firmware into the target processor/controller memory at the time of chip fabrication itself. Such chips are known as ‘Factory Programmed Chips'.
    IT is used for mass production applications and reduces product development time.
    IT Can‟t be used if firmware undergoes frequent changes

    Explain the merits and demerits of assembly language based embedded firmware development.




    Consider a mobile phone device and look at the main menu. Explain how the events of touching the screen at different points on the screen are handled by an RTOS using two-level SR handling.

    ISRs have higher priorities over the RTOS functions and the tasks.
    Example:
    • Each device event has the codes for an ISR, which executes only on scheduling it by the RTOS and provided an interrupt is pending for its service. 
    • Assume that using an RTOS, the touch screen ISR, ISR_TouchScreen has been created using function OS_ISR_Create ( ).
    • The ISR can share the memory heap with other ISRs.
    • A function, IntConnect connects the touch screen event with the event identifier in an interrupt handler, ISR_handler.
    • When a touch screen event occurs on tap at the screen to select icon or menu the OS sends the signal on behalf of the ISR_handler to the waiting ISR_TouchScreen. 
    • ISR_TouchScreen runs on an interrupt call message.
    • ISR_TouchScreen executes as per its priority, IST_TouchScreenPriority among the other pending ISRs before it starts executing.
    • Before return from the ISR_TouchScreen, it sends a message to the kernel using a function OS_eventPost ( ) or OS_ISR_Exit ( ) just before the end of the codes in the ISR_TouchScreen.

    Explain the memory model of a thread in an operating system

    • Memory model describes the interactions of threads through memory and their shared use of the data.
    • A memory model allows a compiler to perform many important optimizations. 
    • Compiler optimizations like loop fusion move statements in the program, which can influence the order of reading and write operations of potentially shared variables.
    •  Changes in the ordering of reads and writes can cause race conditions. 
    • Without a memory model, a compiler is not allowed to apply such optimizations to multi-threaded programs in general, or only in special cases
    Depict four reasons to build network-based embedded systems.

    • Provides resource sharing (sharing of files, applications or hardware, an Internet connection, etc.)
    • Provides Communication support (email, live discussions, etc.)
    • Processes Communication (communication between industrial computers)
    • Provides access to information: Guarantees full access to information for a specified group of people through networked databases
    • Supports Multiplayer video games

    Imagine yourself as an Embedded System developer. A client approached your
    team to make an automated Coffee Vending machine. Develop requirements
    description of the machine.

    User Level Requirements :
    • The user shall get an empty cup placed right below the filter.
    • The user shall be able to choose his preferred beverage from the list of options(buttons).
    • There must be buttons(start, pause, stop, coffee, tea, milk) for a user to interact with the system.
    • The user shall be able to purchase one kind of available drink at a time and get back the exact changes if he has put extra money.
    • The user shall be able to quit the dispense of any beverage at any time during the dispensing.
    2.System-Level Requirements:
    • The system(machine) shall check for properly inserted coins.
    • The system shall be able to dispense coffee(or selected beverage) after a con has been inserted.
    • The system shall be able to detect the low amount of ingredients and a low number of cups and indicate with an indicator(small LED).


    Draw the Finite State Machine diagram for an automated Coffee Vending Machine
    enter image description here


    Describe the sequence diagram for a mouse click scenario. 
    Draw the Use case diagram for Seat Belt Warning System with explanation



    What is ‘Inline Assembly’ ? Explain with an example.

    Explain different types of files generated after cross-compilation.

    Once the compile button is clicked, myFile.asm is given to “Assembler Program”. This program produces 2 files, 1). myFile.lst and 2). myFile.obj

    .lst file: This file contains all the opcodes and the addresses as well as the errors that are detected by the assembler.

    .obj file : This is the object file.

    Now, the myFile.obj is given to the “Linker Program” with the other object file files to be linked. The linker again gives out 2 files 1). myFile.abs and 2). myFile.map

    .map : This file contains the information about how much memory is used, details regarding the stack etc.

    .abs file: This is an absolute file, which is passed on to further processes of compiling.

    Now the myFile.abs is given to “OH Program” (This is the program which converts the Object to Hex.). Finally, the OH Program outputs the file called “myFile.exe”. This can be loaded for execution.


    Three processes with process IDs P1, P2, P3 with estimated completion time 6,
    8, 2 milliseconds respectively, enters the ready queue together in the order.
    Process P4 with estimated execution completion time 4 milliseconds enters the
    ready queue after 1 millisecond. (Assuming there is no I/O waiting for the
    processes) in non- preemptive SJF scheduling algorithm.

    Monk and Inversions

    using System; public class Solution { public static void Main () { int T = Convert . ToInt32 ( Console . ReadLine...