Latest Linux Sysfs Objective Questions
Q – 1 What is sysfs?
a) it is a virtual filesystem
b) users use it to get the information about the running kernel
c) it is used for exporting kernel objects.
d) all of the mentioned
Ans- d) all of the mentioned
Q – 2 sysfs is based on:
a) rootfs
b) ramfs
c) initramfs
d) none of the mentioned
Ans- b) ramfs
Q – 3 Attributes can be exported for objects in the form of _______ in the file system.
a) regular files
b) directories
c) symbolic links
d) none of the mentioned
Ans- a) regular files
Q – 4 Sysfs is initialised in ______ file via sysfs_init function.
a) fs/sysfs/mount.c
b) sysfs/mount.c
c) fs/mount.c
c) none of the mentioned
Ans- a) fs/sysfs/mount.c
Q – 5 Kernel objects are exported as _____ via sysfs.
a) regular files
b) symbolic links
c) directories
d) none of the mentioned
Ans- c) directories
Q – 6 Sysfs internally stores the pointer to the ____ that implements the directory in the file system.
a) kobjects
b) kstructures
c) kinodes
d) none of the mentioned
Ans- a) kobjects
Q – 7 In sysfs every subsystem has:
a) a shared attribute structure
b) its own attribute structure
c) both (a) and (b)
d) none of the mentioned
Ans- b) its own attribute structure
Q – 8 Which one of the following is a notification to user space from the kernel that something has changed in the system’s configuration?
a) hotplug event
b) module event
c) attach event
d) none of the mentioned
Ans- a) hotplug event
Q – 9 In the device driver model the device_driver object contains the:
a) name of the device driver
b) embedded kobjects
c) method for probing a device
d) all of the mentioned
Ans- d) all of the mentioned
Q – 10 A ____ is a higher level view of a device that abstracts out low level implementation details/
a) inode
b) class
b) major number
d) minor number
Ans- b) class
Q – 11 When a device is removed from the system:
a) files and directories of that device in the sysfs are removed automatically
b) all the files of sysfs are preserved until the system turn offs
c) it does not create any change in the sysfs
d) none of the mentioned
Ans- a) files and directories of that device in the sysfs are removed automatically
Q – 12 Relationship between components of device driver models are expressed in the sysfs as:
a) a directory
b) a regular file
c) symbolic links between files and directories
d) none of the mentioned
Ans- c) symbolic links between files and directories
Q – 13 What is the main role of the regular files in the sysfs?
a) regular files represent the attributes of devices and drivers
b) regular files represent the kernel objects
c) regular files represent the kernel sets
d) none of the mentioned
Ans- a) regular files represent the attributes of devices and drivers
Q – 14 The core data structure of device driver model is:
a) kobject
b) kfile
c) kmodule
d) none of the mentioned
Ans- a) kobject
Q – 15 The kset contains:
a) pointer to subsystem descriptor
b) pointer to the kobject type descriptor of the kset
c) head of the kobjects included in the kset
d) all of the mentioned
Ans- d) all of the mentioned
Q – 16 Which one of the following is a read-write semaphore in linux that protects all ksets and kobjects included in the filesystem?
a) rwsem
b) rwsemaphore
c) rws
d) none of the mentioned
Ans- a) rwsem
Q – 17 Each device in the device driver model is represented by a _____ object.
a) driver
b) device
c) node
d) none of the mentioned
Ans- b) device
Q – 18 Each driver in the device driver model is described by a ______ object.
a) dev_d
b) device_d
c) dev_driver
d) device_driver
Ans- d) device_driver
Q – 19 The channel between the processor and devices is called?
a) bus
b) driver
c) class
d) none of the mentioned
Ans- a) bus
Q – 20 In which directory every kernel module of the system is represented?
a) /sys/kernel
b) /sys/module
c) /sys/kernel/module
d) none of the mentioned
Ans- c) /sys/kernel/module
Q – 21 In sysfs the device drivers of same _____ are expected to provide same functionalities to the user mode application.
a) class
b) kobjects
c) ksets
d) none of the mentioned
Ans- a) class
Q – 22 The directories in the /sys directory represents:
a) the device files
b) major subsystems that are registered with sysfs
c) details of buses only
d) none of the mentioned
Ans- b) major subsystems that are registered with sysfs
Q – 23 Sysfs does not contains:
a) regular files
b) symbolic links
c) directories
d) none of the mentioned
Ans- d) none of the mentioned
Q – 24 Sysfs represents the:
a) kernel objects
b) libraries
c) API
d) none of the mentioned
Ans- a) kernel objects
Q – 25 Libsysfs is a:
a) user space library
b) kernel space library
c) not a library
d) none of the mentioned
Ans- a) user space library
Q – 26 In linux sysfs is always mounted at:
a) /sys
b) /proc/sys
c) /proc/mounts
d) none of the mentioned
Ans- a) /sys
Q – 27 Which one of the following is not true?
a) any file of the sysfs can not be edited
b) some files of the sysfs are writable for configuration of devices
c) both (a) and (b)
d) none of the mentioned
Ans- b) some files of the sysfs are writable for configuration of devices
Q – 28 The files of sysfs contains the information about:
a) devices and drivers
b) memory mapping
c) ports
d) none of the mentioned
Ans- a) devices and drivers
Q – 29 Sysfs can be considered as the reflection of the:
a) kernel’s device model
b) user’s device model
c) network’s device model
d) none of the mentioned
Ans- a) kernel’s device model
Q – 30 Sysfs was originally called:
a) device driver filesystem
b) kernel interface filesystem
c) kernel filesystem
d) none of the mentioned
Ans- a) device driver filesystem
Q – 31 Sysfs attribute should export ____ value per file.
a) one
b) two
c) three
d) four
Ans- a) one
Q – 32 Which one of the following function is used to create a new attribute?
a) sysfs_create_file()
b) sysfs_attribute
c) both (a) and (b)
d) none of the mentioned
Ans- a) sysfs_create_file()
Q – 33 Which one of the following function is used to add the kobject to sysfs?
a) kobject_add()
b) kobject_register()
c) kobject_init()
d) all of the mentioned
Ans- d) all of the mentioned
Q – 34 Which one of the following is a element of a kset data structure?
a) pointer to the subsystem descriptor
b) pointer to the kobject type descriptor of the kset
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 35 The kobjects can be organized in a hierarchical tree by means of:
a) ksets
b) kref
c) ktype
d) none of the mentioned
Ans- a) ksets
Q – 36 Which one of the following is not contained in the kobject data structure?
a) pointer to the kobject type descriptor
b) pointer to the containing kset
c) pointer to the parent kobject
d) none of the mentioned
Ans- d) none of the mentioned
Q – 37 To read/write attribute, which one of the following method is required?
a) show
b) store
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 38 The name pointer of the attribute data structure represents the _____ in sysfs.
a) directory
b) file
c) symbolic link
d) none of the mentioned
Ans- b) file
Q – 39 Which one of the following is not true?
a) kobjects are included in a hierarchic organisation
b) kobjects can have a parent
c) kobjects can be included in a kset
d) none of the mentioned
Ans- d) none of the mentioned
Q – 40 In sysfs.h which one of the following structure represents the directory entries?
a) struct sysfs_dirent
b) struct sysfs_dir
c) struct sysfs
d) none of the mentioned
Ans- a) struct sysfs_dirent
Q – 41 The file fs/sysfs/sysfs.h contains the:
a) internal header files for sysfs
b) function definitions shared locally among the sysfs source
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 42 In device driver model bus_type object contains the:
a) name of the bus type
b) set of kobjects of the drivers
c) set of kobjects of the devices
d) all of the mentioned
Ans- d) all of the mentioned
Q – 43 Which one of the following is not a platform specific code?
a) x86 BIOS
b) EFI on ia64
c) both (a) and (b)
d) none of the mentioned
Ans- d) none of the mentioned
Q – 44 Which one of the following is not a system device?
a) CPU
b) APIC
c) timer
d) none of the mentioned
Ans- d) none of the mentioned
Q – 45 Which type of devices are peripheral devices?
a) platform devices
b) system devices
c) both (a) and (b)
d) none of the mentioned
Ans- b) system devices
Q – 46 Which one of the following directory contains every physical device that has been discovered by the bus types registered with the kernel?
a) /sys/devices
b) /sys/bus/devices
c) /devices
d) none of the mentioned
Ans- a) /sys/devices
Q – 47 A device class describes the ____ type of device.
a) physical
b) stuctural
c) functional
d) none of the mentioned
Ans- c) functional
Q – 48 In sysfs, each represented bus type has two directories named as:
a) attributes and kobjects
b) devices and drivers
c) devices and kobjects
d) none of the mentioned
Ans- b) devices and drivers
Q – 49 The directory /sys/block contains:
a) sub-directories for each block device
b) symbolic link for each block device only
c) device file for each block device only
d) none of the mentioned
Ans- a) sub-directories for each block device
Q – 50 The directories of /sys directory:
a) are created at system startup when the subsystems register themselves with object core
b) are created when any device is connects with the system
c) are created at the time of kernel compilation
d) none of the mentioned
Ans- a) are created at system startup when the subsystems register themselves with kobject core