Hot answers tagged

3

It depends on the type of device for which the driver is written. A simple, but common example are PCI devices. PCI devices identify themselves with a series of registers in the PCI Configuration Space. So, for example, a network card will identify which type of card it is with a series of register values that the Linux kernel can read. Device drivers for ...


2

I noticed that the devpath attribute is constant for my USB ports. You could add a new udev rule and create specific symlinks based on the ports the devices are plugged in then. Just add a new file into your /etc/udev/rules.d directory, that looks like this: #new symlink for my front USB port: KERNELS=="2-1.8", SUBSYSTEMS=="usb", ATTRS{devpath}=="1.8", ...


2

The names of device files in /dev vary between Unix variants. There are a few that you'll find everywhere, such as /dev/tty meaning the current terminal. It seems that /dev/tty3a is the name of the fourth serial port¹ on some Unix variants including Solaris and SCO OpenServer. The Linux equivalent would be /dev/ttyS3. So ls|tee /dev/tty3a duplicates the ...


1

The example you found in a book show that you can write on your own and other terminals screen at the same time. Login two times on the same server and run wand you get something like: $ w USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT joe pts/1 :0 21:53 0.00s 0.04s 0.00s w joe pts/2 :0 22:38 3.00s 0.01s 0.01s /bin/bash At ...


1

I will most likely use Fiximan's answer, but for completeness sake, here's an example script I wrote, to mount the device which is smaller in size and is not yet mounted. #!/bin/bash output=$(lsblk -b -I 8 -i | grep "^[\`|]-sd.1" | awk '{print substr($1,3), $4, $7}') cursize=999999999999999 while read dev size mountpath; do echo $dev :: $size :: $...



Only top voted, non community-wiki answers of a minimum length are eligible