1. Read the program section and answer questions.
Int main (INT argc, char * argv [])
{
Int c = 9, D = 0;
C = C ++ % 5;
D = C;
Printf ("d = % DN", d );
Return 0;
}
A) Write Program output
B) Is this expression risky in a portable system? Why?
# Include "stdio. H"
Int A = 0;
Int B;
Static char C;
Int main (INT argc, char * argv [])
{
Char d = 4;
Static short E;
A ++;
B = 100;
C = (char) ++;
E = (++ d) ++;
Printf ("A = % d, B = % d, c = % D, D = % d, e = % d", a, B, c, d, e );
Return 0;
}
A) Write Program output
B) if the compiler arranges the layout of each variable (A, B, C, D) in the memory (eg. Stack, heap, data section, BSS section), it is best to use a Graphical description.
2. interruption is an important part of embedded systems, which leads to many compilation developers to provide an extension: To interrupt Standard C support, a New Keyword _ interrupt is generated. The following code uses the _ interrupt keyword to define an interrupt service subroutine (ISR). Please comment on the following code.
_ Interrupt double compute_area (double radius)
{
Double area = pI * radius;
Printf ("narea = % F", area );
Return area;
}
3 C/C ++ basic knowledge
A) What is the meaning of the keyword volatile during compilation? Three examples of different use cases are provided (which can be pseudo-code or text description ).
B) What are the specific functions of the static keyword in C language?
C) What is the difference between the following three variable declarations? Please give the specific meaning
Int const * P;
Int * const P;
Int const * const P;
4 embedded system problems
A) for integer variables A = 0x12345678, draw out how to store them in memory in the little endian and big endian modes.
B) In the arm system, which method does the Parameter Pass when a function is called?
C) What is the difference between an interrupt (interrupt, such as a keyboard interrupt) and an exception (exception, such as a division by zero exception?
5. Set the periodic tasks P1, P2, and P3 to T1, T2, and T3 to 100,150,400 respectively, and the execution time to 20, 40, and 100 respectively. Design a Scheduling Algorithm for task scheduling to meet the task execution cycle and task cycle.
6 priority reversal is a serious problem in embedded systems and must be paid enough attention.
A) First, please explain the priority reversal problem.
B) Many RTOS provide priority inheritance policies (Priority Inheritance) and priority ceiling policies (Priority ceilings) to solve the priority reversal problem. Please discuss these two policies.
From: http://buaadallas.blog.51cto.com/399160/80944
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service