1、Which of the following is wrong about the description of embedded system () A、It can solve certain problems. B、It is no different from general-purpose computers in the nature of technology. C、It has more powerful functions than general-purpose computers. D、It has strict requirements on volume, power consumption, reliability and cost.
2、Which of the following is not an inherent part of an embedded system () A、Processor B、Peripheral circuit C、Embedded operating system D、Embedded application software
3、Which of the following programming languages has the highest execution efficiency() A、Assembly language B、C language C、C++ language D、JAVA language
4、Which is the advantage of using embedded operating system() A、The system runs faster B、The system has higher execution efficiency C、Application softwares run faster D、Programmers can focus on problems
5、Directly for hardware programming, can't () A、Access processor's registers B、Control the working mode and process of the hardware C、Using the scheduling mechanism of operating system D、Read-write memory
2. Overview of Embedded C Programming
1、Which of the following is wrong about the description of the module () A、The module division should conform to the principle of high cohesion and low coupling. B、In C language, the source file and the corresponding header file form a module. C、Global variables shared by several modules can be defined in the header files shared by these files. D、In the embedded system, each hardware device corresponds to a module.
2、Which of the following is wrong about the description of the interrupt service routine() A、It can return the computed result to the main function. B、It should be as short as possible to enhance the real-time of the system. C、It should not include complex operations. D、It cannot pass arguments.
3、Which of the following is correct about the description of the interrupt model of embedded system without operating system() A、Complete the corresponding transaction in the interrupt program. B、Only interrupts are registered in an interrupt program. C、When an interrupt occurs, the interrupt service routine registers the interrupt type in the stack. D、The main function executes the actual interrupt task through infinite loop, and does not distinguish the interrupt priority.
4、When using C language to simulate object-oriented features, the correct description is () A、Its structure is exactly the same as the function of the class. B、Function pointers are used to implement attribute members of a class. C、Inheritance is implemented through struct inclusion. D、A structure can contain member functions.
5、Which of the following is wrong about the description of the use of C language for "object-oriented programming"() A、It can implement better program structure. B、It can effectively organize the display of Chinese characters. C、It can implement the function of some 'class'. D、It is less efficient in menu design.
3. ARM C Program Optimization
1、Which of the following is wrong about the description of the program optimization of ARM C() A、It can analyze the running time of the program. B、It can guide assembly program design. C、It can analyze whether the program is efficient. D、It can guide C programming design.
2、Which of the following is correct about the description of the data type is () A、Shorter data types save more storage space. B、Try to use character variables when passing parameters. C、It is most efficient to use integer variables. D、Try to use a short data type in the loop to speed up execution.
3、Which of the following is correct about the description of loop optimization is () A、Change the loop variable by using the plus count. B、Change the loop variable by using the minus count. C、'while' should be used when the number of loops is uncertain. D、Loop unrolling can improve the quality of program.
4、Which of the following is wrong about the description of pointer aliasing() A、Try to avoid using pointers. B、Using Pointers may reduce program efficiency. C、The compiler cannot recognize the pointer aliasing. D、When using bit fields, we should pay attention to pointer aliasing.
5、Which of the following is wrong about the description of the struct() A、In a struct, short members are defined first and long members are defined later. B、Struct members should be boundary aligned as much as possible. C、Array elements should be placed at the end of the struct. D、__packet keyword can improve the access speed of the struct.
4. The Linux Operating System
1、The characteristics of Linux do not include() A、Micro kernel. B、Meet the POSIX standard. C、It can run on the server. D、It can run on embedded devices.
2、Which of the following is not a feature of 'shell' () A、It's a low-level interface to the operating system. B、You can type shell commands from the console. C、You can write shell scripts. D、Linux supports multiple 'shell'.
3、Which of the following 'shell' environment variables identifies the system executable file path () A、HOME B、PATH C、TERM D、PWD
4、Which of the following paths holds all the device files of the system () A、bin B、dev C、lib D、root
5、Which of the following commands is used to view the current process of the system () A、rm B、touch C、mkdir D、ps
6、Which of the following commands is used to configure the IP address of network card() A、ping B、telnet C、ifconfig D、ftp
5. Linux C Programming Toolchain and Makefile
Section 5-1 Objective questions
1、What are the features of the cross compiler() A、The compiler runs on the host machine, and compiler results also run on the host machine. B、The compiler runs on the target machine, and compiler results also run on the target machine. C、The compiler runs on the host machine, and compiler results run on the target machine. D、The compiler runs on the target machine, and compiler results run on the host machine.
2、Which of the following is not included in the GNU toolchain() A、GCC B、GDB C、LD D、IDE
3、What is the vi forced save exit command() A、q B、q! C、wq D、x
4、When compiling a program with gcc, only the preprocessing phase is carried out, which of the following options() A、-E B、-S C、-c D、-o
5、When compiling a program with gcc, which of the following opens all warnings() A、-w B、-O C、-g D、-Wall
6、Which of the following abbreviations is used to implement the breakpoint function of gdb() A、n B、i C、b D、l
Section 5-2 Objective questions
1、What is the basis for the 'make' command to determine whether a file should be compiled() A、File generation time B、File generation size C、File type D、File attribute
2、Which of the following is not a target type of 'makefile'() A、Ultimate target B、Intermediate target C、Label D、Dependency file
3、Which of the following is wrong about the execution process of 'make'() A、The first target of 'makefile' is the ultimate target. B、Each target is found according to the stack principle. C、If the dependency file does not exist, exit directly. D、The label will be associated first.
4、Which of the following is not a 'Makefile' variable type() A、Environment variable B、Automatic variable C、Recursively expanded variable D、Symbolic variable
5、Which of the following is correct() A、'makefile' doesn't support nesting. B、'makefile' doesn't support the generation of multiple executable programs at the same time. C、'makefile' doesn't need to explicitly state all the rules. D、'makefile' execution error will exit.
6. Construction of Embedded Software Platform
1、Which of the following is not included in the embedded software platform based on operating system() A、Bootloader B、Operating system C、File system D、Graphics system
2、Which of the following is not a feature of Busybox() A、It compresses a large number of programs into a single file. B、It identifies each command with the command line parameter 'argv '. C、It establishes a symbolic link for each command. D、It joins the common parts of multiple commands and keeps only one copy.
3、Which of the following is correct about the description of the features of bootloader() A、It works all the time in the system until it power-down. B、It runs in two phases, both of which are designed in assembly language. C、Its main function is to copy the operating system kernel into memory. D、It has user interaction function.
4、Which of the following is correct about the description of embedded applications() A、It has to be cross compiled. B、It can be cross compiled. C、It must be compiled locally. D、It can be compiled locally.
5、Which of the following ways is not used for downloading and debugging programs() A、TFTP B、FTP C、HTTP D、NFS
7. File Directory and Memory
1、The function of the umask() system call is() A、Sets the mask for the permissions bit that the newly created file or directory should be closed. B、Sets the mask for the permissions bit that the newly created file or directory should open. C、Sets the permissions bit for the newly created file or directory. D、Clear the permissions bit for the newly created file or directory.
2、Which of the following is wrong about the description of system calls:() A、System call is the underlying programming interface provided by the operating system to the user. B、System calls exist in kernel space. C、System calls are implemented by calling library functions. D、Improper use of system call does great harm to the system.
3、Which of the following is correct about the description of fopen() and open() () A、The former is even more subterranean. B、The former returns the file descriptor. C、The latter is a system call. D、The latter returns a pointer of type FILE*.
4、Which of the following functions checks whether the end of the file is accessed() A、fopen B、feof C、fread D、fseek
5、Which of the following functions functions as a new directory() A、chdir B、mkdir C、rmdir D、getcwd
6、When the mmap() function is called, which of the following parameters should be set to NULL if the memory-mapped address is not known() A、start B、length C、prot D、offset
8. Processes and Threads
1、Which of the following is not a feature of the fork() system call() A、A new process is created. B、Call once and return twice. C、The child process is a copy of the parent process, which is identical. D、Returns 0 to the child process.
2、Which of the following is wrong about the description of the operation of the process() A、fork () is used to create a new process that is almost a full copy of the current process. B、exec() function can replace a running program in a process with another program. C、When the function execve() is executed, the code portion of the current process is replaced by a new program. D、The exec family of functions, once executed successfully, does not return its caller.
3、Which of the following is wrong about the description of the waitpid() function() A、Waitpid () temporarily stops the execution of the current process until a signal arrives or the child process finishes. B、If the child process has ended when the waitpid is called, the waitpid immediately returns the value of the child process's end state. C、The end status value of the child process is returned by the parameter status. D、Returns the child process number (PID) on success and 0 if an error occurs.
4、Which of the following characteristics does a thread have() A、Each process contains at least one thread. B、Only when all threads in the process have finished can the process finish. C、The new thread has a separate stack where global and static variables can be Shared. D、Multithreaded programs are more efficient than single-threaded programs.
5、Which of the following is not part of the basic thread control function() A、pthread_creat() B、pthread_exit() C、pthread_join() D、pthread_start()
6、Which of the following functions realizes the semaphore plus 1() A、sem_init() B、sem_wait() C、sem_post() D、sem_destory()
7、Semaphore characteristics do not include which of the following() A、Realize the synchronization operation of two threads. B、It works atomically. C、The semaphore has a value of 0 or 1. D、Used to protect critical areas.
1、Which of the following is wrong about the description of the signal() A、A signal is an event produced by a UNIX/Linux system in response to certain conditions. B、Signals can be generated, captured, responded to, and ignored. C、The signal is generated automatically by the system. D、Use the kill command to send a signal.
2、Using the Ctrl c key on the keyboard, which of the following signals can be sent to the front desk process() A、SIGABORT B、SIGSTOP C、SIGTSTP D、SIGINT
3、Using the Ctrl \ key on the keyboard, which of the following signals can be sent to the front desk process() A、SIGALRM B、SIGKILL C、SIGQUIT D、SIGTERM
4、Possible reasons for the failure of the kill call do not include() A、The target process is in kernel space. B、The given signal is invalid. C、Insufficient send process permissions. D、The target process does not exist.
5、Which of the following is wrong about the description of the signal function() A、This function takes two arguments. B、This function can process the signal. C、This function associates a particular signal with the processing function. D、Function returns the function pointer that was previously used to process the signal.
6、Which of the following is wrong about the description of the sigaction function() A、The function is the same as the signal function. B、This function associates a particular signal with the processing function. C、The signal function options can be set to give RESETHAND or RESTART. D、This function specifies a set of signals that will be blocked and will not be passed to the process.
10. Interprocess communication
1、Which of the following is not IPC mode() A、Semaphore B、Signal C、Shared memory D、Message queue
2、Which of the following is correct about the description of the pipe() A、Pipe is full duplex work. B、Pipe is simplex work. C、Nameless pipes can communicate between unrelated processes. D、A named pipe exists in the file system.
3、Which of the following is wrong about the description of the semaphore() A、It is divided into binary semaphore and universal semaphore. B、Semaphores can be replaced by ordinary variables. C、Semaphores are used to protect critical areas. D、Semaphores belong to interprocess communication.
4、Which of the following functions links the Shared memory to the process address space() A、shmat() B、shmdt() C、shmctl D、shmget
5、Which of the following functions can delete the message queue() A、msgget() B、msgsnd() C、msgrcv() D、msgctl
1、Which of the following is correct about the description of the socket() A、Sockets belong to the inter-process communication mode. B、Sockets are used in the same way as pipes. C、Sockets can only be used between different machines on the network. D、Sockets can only be used on UNIX/Linux hosts.
2、Which of the following functions is not a server-side socket function() A、bind() B、listen() C、accetp() D、connect()
3、Which of the following uniquely identifies a network socket() A、The file name B、The IP address C、The port number D、IP address and port number
4、The IP address of the loopback network is() A、192.168.0.0 B、192.168.0.1 C、127.0.0.0 D、127.0.0.1
5、On the accept() system call, the error is() A、The server through it waits for the client to make a connection to the socket. B、The accept function returns only when a client tries to connect to a socket specified by the socket argument, otherwise it will remain blocked. C、The accept function creates a new socket to communicate with the customer. D、Accept returns a descriptor for the new socket, which is of a different type than the server listening socket.
12. Module and Driver and the Example of Driver
Section 12-1 Objective questions
1、Which of the following is correct about the description of the kernel module() A、A module is a program that can be executed independently. B、Once a module is linked to the kernel, it is fully equivalent to the original code in the kernel. C、Once a module is loaded into the kernel, it cannot be unloaded. D、The module runs in user space.
2、Which of the following commands inserts a module into the kernel() A、insmod B、lsmod C、rmmod D、depmod
3、Which of the following is wrong about the description of the function of the module() A、You can insert a module into the kernel with parameters. B、Kernel functionality can be extended through modules. C、Linux kernel modules must comply with the GPL license. D、After the module is inserted into the kernel, symbols can be exported for use by other modules.
4、Which of the following is wrong about the description of Linux driver() A、The driver must be inserted into the system using dynamic module loading. B、The driver belongs to the kernel code. C、A driver is a collection of functions and data structures. D、The driver is used to control the hardware device.
5、Linux devices do not include which of the following() A、character device B、block device C、network device D、Output device
6、What is the number of bits of the Linux system's major device number in 2.6 and later versions() A、8 B、12 C、24 D、32
7、What is the number of bits of the Linux system's minor device number in 2.6 and later versions() A、8 B、16 C、20 D、24
8、The main job of designing Linux device drivers is to design() A、function pointer B、function C、The function corresponding to the function pointer. D、The function pointer corresponding to the function.
Section 12-2 Objective questions
1、What does the io_p2v() function do() A、Physical address to virtual address. B、Virtual address to physical address. C、Physical address registration. D、Register registration.
2、What does the copy_from_user() function do() A、Copy data from kernel space to user space. B、Copying data from user space to kernel space. C、Copying data between drivers. D、Copying data between applications.
3、Which of the following is wrong about the description of Linux interrupt drivers() A、The top half of the interrupt program is responsible for generating small tasks. B、The body of the interrupt service program is executed by the operating system schedule. C、The interruption service should be completed quickly to ensure quick response of the system. D、Interrupters can only respond to external events.
Final exam in spring 2020
1、Which of the following is wrong about the description of embedded system() A、Embedded system is generally applied in the industrial field, it is difficult to see in daily life. B、The technology adopted by embedded system relies on computer technology. C、The embedded system has strict requirements on volume, power consumption and reliability. D、The embedded system is a special computer system.
2、Which of the following statements is correct for a single-tasking embedded system() A、Single-tasking embedded system is more complex than multitasking system. B、The initial initialization of the system generally uses assembly language. C、The initial initialization of the system generally uses C language. D、Single-tasking embedded system can solve any complex application problems.
3、Which of the following is wrong about the description of C language() A、The development efficiency of C language is higher than that of assembly language. B、C language program runs faster than assembly language. C、C language can access memory address directly. D、C language supports pointers.
4、Which of the following statements is wrong in ARM C programming() A、The C program can be optimized according to the characteristics of ARM architecture. B、The C program can be optimized according to the characteristics of compiler. C、The ARM C program cannot be optimized. D、The variable type, loop and other features of ARM C can be optimized.
5、For a 32-bit embedded processor, in order to improve the execution efficiency of C program as much as possible, how many bits should be set for variables, parameters and function return values() A、1-bit B、8-bit C、16-bit D、32-bit
6、Which of the following is wrong about the description of the Linux operating system() A、Linux operating system is widely used. B、Linux operating system can be ported to many architecture computers. C、Linux operating system can only run on a PC. D、Linux implements many system management functions through the ‘shell’ command.
7、Which of the following Linux 'shell' commands can implement directory switching() A、ls B、cat C、cd D、pwd
8、Which of the following is wrong about the description of the vi() A、vi is a powerful editor. B、vi has command mode and input mode. C、vi is only suitable for editing text files, not for editing source programs. D、vi supports very rich commands.
9、Which of the following is correct about the description of the gcc() A、gcc is a debugger. B、gcc is a compiler. C、gcc is a connector. D、gcc is a version control tool.
10、Which of the following is wrong about the description of the gdb() A、gdb is a powerful debugger. B、gdb supports a variety of debugging commands. C、gdb works in a way of the command line. D、gdb works in a way of the graphical interface.
11、The 'make' program will look for the 'makefile' from the current directory, parse its contents, and complete the automatic compilation of the project. Which of the following statements is wrong() A、makefile is an effective software engineering tool. B、The compilation efficiency of the project can be greatly improved by writing makefile. C、Every C program must use makefile to compile. D、makefile supports many syntactic features.
12、Which of the following functions can open a directory file() A、mkdir() B、rmdir() C、opendir() D、closedir()
13、Which of the following is correct about the description of the file operation() A、It only has read access to files. B、It only has write access to files. C、It only has append access to files. D、It has read, write and append access to files.
14、Which of the following is correct about the description of the process() A、Each program generates a process when it executes. B、There is no interprocess communication between different processes. C、The father process ID is the same as the child process ID. D、The concepts of process and thread are exactly the same.
15、Which of the following is wrong about the description of the thread programming() A、The thread overhead is greater than the process overhead. B、Once the original thread ends, all threads in the process end. C、Reentrancy should be carefully considered in multithreaded programming. D、Thread resources should be properly recovered after the thread ends.
16、What happens when you press ‘Ctrl C’ on the keyboard() A、Wake up the foreground process. B、Terminate the foreground process. C、Terminate the background process. D、Nothing will happen.
17、Which of the following is not a signal set processing function() A、sigaddset() B、sigemptyset() C、sigfillset() D、signal()
18、Which of the following is correct about the description of shared memory() A、Shared memory doesn’t belong to interprocess communication mechanism. B、Shared memory must be connected to the process address space before it can be used. C、The same block of shared memory can’t be used by unrelated processes. D、Shared memory can only be used by parent-child processes with inheritance relationships.
19、Which of the following is wrong about the description of message queue() A、Message queuing belongs to an interprocess communication mechanism. B、Different processes can pass message through message queues. C、The message queue can contain countless messages. D、There is a maximum limit to the length of each message in the message queue.
20、Which of the following is wrong about the description of socket mechanism() A、The computer in the network can use socket communication. B、Socket communication can be used between different processes of a computer. C、Client and server are not distinguished in socket communication. D、Socket mechanism is implemented by a series of functions.
21、What is used to identify devices in the kernel() A、Device name. B、Device aliases. C、Device number. D、None of the above is correct.
22、Which of the following is correct about the description of driver() A、The driver must be inserted into the Linux kernel in a module way. B、The driver must be compiled directly into the kernel. C、The driver can help users manage hardware. D、There is no difference between drivers and applications.
23、Which of the following commands lists the module list in the system() A、insmod B、rmmod C、lsmod D、depmod
24、Which of the following is wrong about the description of device() A、The device has the major device number. B、The device has the minor device number. C、The major device number and the minor device number jointly determine a device. D、The concept of major equipment number and minor equipment number is the same.
25、Which of the following is not a feature of bootloader() A、Bootloader runs when the system is just started. B、Bootloader can do system initialization. C、Bootloader includes all functions of the application. D、Bootloader is responsible for copying the operating system kernel into memory.
26、The development efficiency and operation efficiency of C language are higher than that of assembly language, so C language is the most widely applied in embedded system. Assembly language is no longer necessary to exist.
27、Both the internal code and Chinese font are used for the display of Chinese characters. They are exactly the same.
28、In the embedded system, the screen can be regarded as a "window", and each element in the screen can be regarded as a control in the "window". When an external event occurs, the event is wrapped as a message, and the message is passed to the corresponding control through the callback function of the window, and then the message processing function of the control is activated.
29、Due to the compiler is unable to determine the direction of the pointer when the program is running, the pointer has the so-called "alias" problem, which brings convenience to programming.
30、C language is used to design the loop. The efficiency of loop variable is the same whether it is plus count or minus count.
31、The pstree command has the same function as the top command, which can dynamically display the process tree of the system and constantly refresh according to the system changes.
32、In Linux system, the ping command can be used to detect network connectivity.
33、The full name of GCC is GNU Compiler Collection, which is the compiler set of GNU.
34、The feature of cross compiler is that the compiler itself runs on a host machine platform of some architecture, but the executable file that compiled output runs on a target machine platform of different architectures.
35、The makefile determines which file in the project needs to be recompiled and which project doesn’t need to be recompiled according to the file size.
36、There should generally be a rule in the Makefile to empty the target file, usually called clean.
37、Busybox tool can compress the whole software part (including bootloader, operating system kernel, common application software, etc.) of the embedded system together, and has a very small file size, so it is widely used in the embedded system.
38、The function of bootloader is to copy the operating system kernel from RAM to FLASH memory, and then jump to the beginning of the FLASH memory kernel to start running. The running speed of FLASH is faster than that of RAM.
39、A file can be opened in library function mode and system call mode, both of which are used in the same way.
40、In Linux system, mmap() function can be used for memory mapping, but the user must specify a fixed memory address as the head address of the mapping file, so the user needs to know where the memory is free.
41、Thread programming needs to pay attention to time sequence control to avoid deadlock.
42、The child process is a complete copy of the parent process, which is exactly the same.
43、Linux processes can communicate with each other through semaphores.
44、The sigaction is a more robust signal interface function than signal.
45、Linux can use the module mechanism to expand the core functions, so both Linux system and windows system belong to the microkernel mechanism.
46、In the Linux driver, the programmer must implement the functions corresponding to all pointers in the file operations struct.
47、The file struct represents an open file in which the private_data member has no clear functional definition, so it's actually completely useless.
48、In the driver, it is often necessary to copy information between kernel space and user space.
49、STM32 series processor is based on the ARM Cortex core processor.
50、Proteus can simulate a large number of embedded processors, so embedded systems no longer need to make actual hardware circuit boards.