Quiz based on chapter-4 of book linux device drivers 3rd ed

Quiz on chapter-4 of book linux device drivers 3rd ed body {margin: 10px;} Quiz on chapter-4 of book linux device drivers 3rd ed Which of the following config options need to be enabled to be able to debug kernel.
CONFIG_DEBUG_KERNEL
CONFIG_USB
CONFIG_EXT4
CONFIG_DBG

The first argument passed to printk specifies the
loglevel for the message to be printed
terminal number for the message to be printed
userid of the current user
line number in which the message has to be printed

The command that can be used to view the kernel logs from user space is
kmesg
dmesg
kmsg
dmsg

The function create_proc_read_entry returns a pointer to
struct proc_dir
struct proc_entry
struct proc_dir_entry
struct proc

The seq file interface is used for
logging errors in kernel space
Creating a /proc entry
Passing user information to kernel
Passing kernel information to user space

output of strace shows
The function calls made by user applications
The system calls made by a user appliction
The kernel modules used by a user application
The various applications running in the user space.

In a kernel oops message EIP points to
The address of the faulty instruction
The faulty instruction
The faulty line in the user code
The faulty user application

While using gdb for kernel debugging the kernel core file used passed to gdb is
/proc/core
/proc/kcore
/dev/core
/dev/kcore

Which of the following keys will launch the kdb
sysrq
pause
shift
del

To use kgdb we need two systems connected by a serial cable
True
False
depends on kernel version
depends on kgdb version

Category: Linux | Comments Off on Quiz based on chapter-4 of book linux device drivers 3rd ed

Quiz on chapter-3 of book Linux Device Drivers- 3rd Edition

Quiz on chapter-3 of book ldd3 body {margin: 10px;} In the output od "ls -l /dev" a character driver is identified by
Letter c in the second column
Letters ch in the second column
Letter c in the third column
Letter p in the first column

The argument macro MAJOR is of type
int
char
dev
dev_t

Which of the following function is used for static allocation of major number to character driver
register_char
register_chrdev_region
alloc_chrdev_region
alloc_region

The structure file_operations is a
Collection of structure pointers
Collection of function pointers
Collection of macro pointers
Collection of string pointers

The structure "file" is defined in the header file
linux/file.h
linux/filesys.h
linux/fs.h
linux/sys.h

cdev_alloc returns a pointer to
struct cdev
struct chardev
struct dev
struct device

If the file_operation implementation of read returns 0 it signifies
Empty file
End of file
No data in file
Error in reading file

The arguments passed to "open" method in a device driver are
inode pointer and file pointer
inode pointer and file_operations pointer
file_operation pointer and file_pointer
only file pointer

inode structure is used by the kernel internally to represent
Only open files
Only closed files
All files
Running Processes

We can find out the major number of a driver by looking at the file
/proc/major
/proc/devices
/proc/modules
/proc/numbers

Category: Linux | Comments Off on Quiz on chapter-3 of book Linux Device Drivers- 3rd Edition

Quiz on chapter-2 of book Linux Device Drivers

Quiz on chapter-2 of book ldd3 body {margin: 10px;} Quiz on chapter-2 of book ldd3 Function passed to module_init is invoked when
Module is loaded into the kernel
Module is removed from the kernel
Module is compiled
Module is deleted from the kernel

The utility used to compile kernel modules is
made
kernel_make
make
gcc

A module can not call functions defined in
libc
kernel
With in the module
Another module

A module always runs in the
Kernel space
User space
User Space and kernel Space
Module space

current returns a pointer to
struct task_struct
struct current
struct task
struct kernel

struct task_struct is defined in
linux/sched.h
linux/current.h
linux/struct.h
linux/task.h

The option -C passed to make causes it to
Compile the module
Change the directory
Create object file
Clean the object file

modporbe not only loads the module passed to it but also
Loads other modules present in the current working directory
Removes any older modules with the same name
Loads other modules on which the given module depends
Restarts the system

command to list the currently loaded modules in the kernel is
listmod
mod
lkmod
lsmod

module compiled for one kernel version can not be loaded into kernel of other version.
True
False
True Sometimes
Depends on the module

Related Posts : Quiz on Chapter-1 of Linux Device Drivers Linux Basics commands quiz

Category: Linux | Comments Off on Quiz on chapter-2 of book Linux Device Drivers

Answers to Quiz on chapter 1 of book Linux Device Drivers

Here is the solution to the Quiz on chapter 1 of book Linux Device Drivers

1. A device driver provides
Ans: Policy

2. A piece of code that can be added to kernel at runtime is called as
Ans: Module

3. /dev/conosle is a
Ans: Character Device

4. To link an object code dynamically to the running kernel we can use the command
Ans: insmod

5.Who is allowed to load modules into the kernel ?
Ans: Superuser

6.The linux is versioned under which license ?
Ans: GNU GPL 2

7.Which of the following is not a class of devi ce
Ans: String

8.Third party softwares should be treated with care to take care of the
Ans: Security of kernel

9.Is it possible to compile the linux kernel with not support for modules ?
Ans: Yes

10.Linux supports only i386 architecture true or false ?
Ans: False

Category: Linux | Comments Off on Answers to Quiz on chapter 1 of book Linux Device Drivers

Quiz on pthread basics

Pthreads Basics Quiz body {margin: 10px;} Pthreads Basics QuizA quiz on basics of pthreads 1. Which header file needs to be used for pthread programming ?
pthreads.h
pthread.h
p_thread.h
posix.h

Pthreads are not useful in uniprocessor systems
False
True
Depends on the compiler
Depends on the processor

What are the flags that are passed while compiling a pthread program using gcc
-pthread
-lpthread
-gccpthread
-thread

Among the arguments passed to pthread API pthread_create the final argument, is.
Attributes of the thread
Name of the thread
Data being passed to the thread
Thread id

The data type used for storing the thread id is
pthread
pthread_t
p_thread_t
pthread_id

Which of the following APIs can be used for synchronization between threads
pthread_exit
pthread_cancel
pthread_self
pthread_join

To create a detachable thread which of the following structures needs to be modified
pthread_attr_t
pthread_t
pthread_attribute
attribute_t

pthread_self returns
The thread id
The thread attribute
Thread data
Thread running time

Two threads can be compared using the API
compare_pthreads
pthread_equal
pthread_compare
equal_pthread

pthread_create(&threads_id, NULL, Hello_world, NULL); creates a thread
Called Hello_world with default attributes
Called Hello_world with all attributes set to NULL
Called Hello with default attributes
Called Hello with all attributes set to NULL

Answers the quiz are available at : Answers to pthreads basic quiz

Category: Linux | Comments Off on Quiz on pthread basics

Linux history quiz

Quiz On history of Linux body {margin: 10px;} Quiz On history of LinuxA simple quiz on history of Linux In which year was the linux kernel released under GNU GPL license for the first time?
1991
1992
1993
1996

The penguin was chosen as the official mascot for linux in
1992
2000
1994
1996

“The linux foundation” is the merger of
OSDL and Free standards group
GNU and OSDL
The linux users and unix users group
Many small linux supporting groups

Which famous computer scientist said this in 1992 “Linux is obsolete” ?
Andrew S. Tanenbaum
Alan Cox
Ken Thompson
Richard Stallman

Linux 1.0 was released in
1999
1994
1996
1992

When did microsoft first contribute to linux source code ?
2002
1995
2009
2011

Which of the following is a linux based company and was started in 1994 ?
Ubuntu
Redhat
IBM
Apple

Which of the following companies invested a billion dollars in to linux in the year 2001 ?
Redhat
Canonical
IBM
Google

In which year did Linus Torvalds appear on the cover of Business week ?
2000
2003
2005
1999

Which of the following Linux Desktop environment (GUI) was started in the year 1997 ?
GNOME
KDE
Unity
Enlightment

Answers to the uiz are available at : Answers to linux history quiz

Related Blogs

    Category: Linux | Comments Off on Linux history quiz