Driving Intern Questions
One, the choice question (2.5 '/each)
1. The correspondence between device and driver ()
A.1 (device): 1 (driver) B.1 (device): N (drivers)
C.N (Devices): 1 (Driver) D. N (Devices): N (drivers)
2.int counter (int i) {
static int count = 0;
Count = count + i;
return count;
}
Main ()
{
int I, J;
for (i=0; I <=5; i++)
j = count (i);
}
This procedure executes to the last, the value of J is ():
A. B. 6 D. 7
3. The following are not the Linux system process types ().
A process of interactive process B batch processing C daemon D ready process
4. Subsystems not included in the kernel are ().
A Process Management System B memory management system C I/O management System D hardware management system
5. Change the file owner's command to ().
A chmod B Touch C chown D Cat
6. There are three states of the process: ().
A readiness State, execution state and exit state B exact state, fuzzy state, and stochastic state
C run state, ready state and wait state D manual state, self-dynamic and Free State
The configuration file for the 7.Samba server is ().
A httpd.conf B inetd.conf C Rc.samba D smb.conf
The 8.Linux file name must not exceed () characters in length.
A, B, C, D, 512.
9. The case that the kernel does not need to be compiled is ().
A remove the system without the device driver when B upgrades the kernel
C When adding new hardware, D activates the network card
10. Write out the output of the following function ()
Main ()
{
int a[5] = {1, 2, 3, 4, 5};
int *ptr = (int *) (&a+1);
printf ("%d,%d", * (a+1), * (ptr-1));
}
a.2,2 b 2,3 B 2,4 D 2,5
Two Fill in the blanks (2.5 '/empty)
- Linux device driver Model three elements: Device,driver,bus. The device and the driver are registered to the bus respectively, and then through () match, finally go to the driver () function, now with DTS, you can use () way to match.
2. Kernel space and user space are two different states of program execution, which can be transferred from user space to kernel space through () and ().
3. Please write out the search string "test" in the kernel folder, specify the shell command type *.C
( )
4.voidGetMemory (char *p)
{
p = (char *) malloc (100);
}
void Test (void)
{
char *str = NULL;
GetMemory (str);
strcpy (str, "Hello World");
printf (str);
}
What happens if I run the test function?
( )
5.linux device driver Model, device model element () () ()
Three, simple answer
- Please explain why Fork was called once and returned two times? (5 ')
2. (5 ')
Char *getmemory (void) {
Char p "" = "Hello World";
return p;
}
void Test (void)
{
char *str = NULL;
str = GetMemory ();
printf (str);
}
What happens if I run the test function?
3. Please illustrate the difference between function pointer and pointer function, and explain three elements of function declaration. (10 ')
4. (10 ')
void GetMemory2 (char **p, int num)
{
*p = (char *) malloc (num);
}
void Test (void)
{
char *str = NULL;
GetMemory (&STR, 100);
strcpy (str, "Hello");
printf (str);
}
What does the run test function output? Does it cause a memory leak? If so, please revise it.
5 Linux consists of two parts: User space and kernel space. Why is this design? (10 ')
6 What library functions are used by Linux systems to build threads and what are their prototypes? What system call does its implementation call? (10 ')
Embedded Driver Intern Questions