Programming :: Block Device Driver ?

Nov 30, 2010

Is there an easy example of a block device driver I could follow as a guide to write my own module?

View 5 Replies


ADVERTISEMENT

Programming :: C Program - Getting The Raw Size Of A Block Device

Oct 16, 2010

How do you go about getting the raw size of a block device under Linux from within a C program? And I mean the raw size of the block device itself, not a file system that may or may not be installed on it. And I'd like to be able to get the raw size of any block device, from hard drives (e.g., /dev/sda) to LVM partitions (/dev/mapper/vg0-home) to loop devices to anything else that is a Linux block device.

View 3 Replies View Related

Programming :: Send Block Device Name To Bash Variable?

Feb 13, 2009

I'm setting up a machine that's going to be used to test randomly connected tape drives one at a time, and as such, I'm writing the test routine using mt in a bash script, for user-friendliness. The problem is the block device name changes on occasion as tape drives are swapped out and busses are rescanned, so I can't "hard code" a block name into the script.

I know programs like lsscsi and hwinfo will give you block device names as part of their output, but I can't seem to grep anything in such a way as to have the final output be just the block name (ie /dev/st2, or optimally 'st2'), so that I can just have the script read said output, and drop it into the necessary variable.

View 2 Replies View Related

Programming :: Block On Write Call To TtyACM Device

Nov 1, 2010

I have a write call to a ttyACM serial device that blocks after several hundreds bytes are written.I'm writing in ~25 byte chunks, so I have 5-8 successful writes, then the next write blocks forever.I can bypass the blocked call using select, but I can never call write again without closing and re-opening the port.

The serial port is opened correctly because I can read from it just fine. Write permissions are correct, and it's opened RW.The code is likely correct because I tested the same code using the same device on a pure RS-232 serial port, and it worked fine - no block. Is there anything to know about the linux ACM module?It's my understanding that write calls basically shouldn't block.They're supposed to return -1 if there's an error.

View 1 Replies View Related

Programming :: Searching For Video Or Screen Cast Which Shows Device Driver Programming?

May 30, 2010

I did searched you tube but my results were not great.I have 2 books on KernelProgramming.I feel I need if some where I can get a video tutorial which can help me to understand how to develop a Linux Device driver that will be great.I had a look at Greg Kroah Hartmans video lecture of developing patches on ......I have been reading books and a lot of stuff.So I wish if I could get a video lecture that would be better

View 1 Replies View Related

Programming :: Write USB Device Driver?

Oct 11, 2010

I know, I know..."How long is a piece of string"?

I have one of these devices:

[URL]

Of course, it's Windows only, and XP only at that. However, the data that needs transferred between the device and the computer should be fairly basic, unless it offloads a lot of processing to the computer. I'm not a programmer, nor do I play one on TV, but I have written some fairly complicated microcontroller programs and some basic Java GUIs. Besides writing the actual code, how hard is it to do whatever needs done to make a Linux device driver, apart from the code to make the device work?

View 2 Replies View Related

Ubuntu :: How To Do Device Driver Programming

Jan 14, 2011

How to do device driver programming in Ubuntu 10.04?

View 2 Replies View Related

Programming :: Character Device Driver And Mknod?

Mar 31, 2010

I've a problem with character device mounting. I've a character device module code. Here is the code

Code: /* chardev.c: Creates a read-only char device that says how many times
* you've read from the dev file
*/
#if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS)
#include <linux/modversions.h>
#define MODVERSIONS

[Code]...

View 1 Replies View Related

Programming :: Device Driver Is Dropping Characters?

Sep 23, 2010

I wrote a small hello world type of character device driver. When I type echo -n "abcdef" > /dev/bond and do a cat /dev/bond then only last "f" of above input abcdef is displayed rest nothing is displayed. I asked this question earlier and some people suggested me some modifications I have done and experimented all that but I am unable to catch the error.

Here is the code

Code:
/* Necessary includes for device drivers */
#include <linux/init.h>
//#include <linux/config.h>
#include <linux/module.h>

[Code].....

View 3 Replies View Related

Programming :: Character Device Driver For Communication Between Two Pc's In Code?

Apr 3, 2010

i woul like to know if i could get help in writing a charater device driver for communication between two pc's in linux using RS-232 serial port.

View 5 Replies View Related

Programming :: Create A Device Driver For User Applications?

Feb 7, 2010

I have a user Application for transferring the data from one PC to the other PC using Ethernet Port, can we create a device driver for that ?? that means it should act like a virtual device, if we write data into /dev/some file, it should go the other PC

View 3 Replies View Related

Ubuntu :: Program Kernel Modules And Smoothly Transition In Device Driver Programming?

Apr 27, 2011

i am trying learn to program linux kernel modules and smoothly transition in device driver programming. I have a year and a half worth of programming in C and have been using linux for years!! But my question is how do i compile a module? I got as far as coding it but am stuck as of now.

View 2 Replies View Related

Fedora Installation :: Device Driver For Usb To Detect Device?

Sep 19, 2009

I am currently using fedora 11 kernel 2.6.29 version, i wanted to write device driver for usb to detect my own device. My project is radio with computer. My fm radio get connected to usb port so i need to write h/w interfacing program.

View 1 Replies View Related

Hardware :: USB Device Is Not Claimed By Any Active Driver For Every Device

Nov 10, 2010

The error "USB device 6 (vend/prod 0x603/0xf2) is not claimed by any active driver." is in dmesg every time I connect my Logitech keyboard to my system. I also tried (all with the same error):
- Memory stick
- DVD-burner
- Compaq mouse

View 3 Replies View Related

Fedora :: Can A Removable Block Device Be Always Recognized With Same Name

Apr 7, 2010

I have an external hard disk drive and I would like it to be recognized with the same name (e.g. /dev/sbd) after each boot.
Is there any way to make that?

View 7 Replies View Related

General :: Fake Block Device For Testing LVM?

Jun 1, 2010

I want to test LVM+Raid. When I was testing ZFS on Solaris, I was able to create regular files, and use those as disks for testing.I tried creating a regular file full of zeros w/ dd, then partitioning that. fdisk seemed to be able to create a partition on the regular file, but mkfs and parted couldn't work with it. Is there any way to create fake block devices for testing?

View 4 Replies View Related

General :: /dev/sdd1 Is Not A Valid Block Device?

Jun 14, 2010

When I try to mount the /dev/sdd1 device then it give errormount -t ext3 /dev/sdd1 /4hdmount:/dev/sdd1 is not a valid block device

View 9 Replies View Related

Software :: Not A Block Device Error In RHEL 5

Apr 25, 2010

I created LVM and formatted it. But at the time of mounting it getting this error message ".....not a block device".

View 3 Replies View Related

CentOS 5 :: Specify The Device Driver When Mounting A Device?

Jul 28, 2010

I have installed live cd on usb pendrive. Everything works great. How can I find out which device driver it is using? Where are the device driver files stored? How do you specify the device driver when mounting a device?

View 3 Replies View Related

Ubuntu Security :: Block Device By Bluetooth Address?

Apr 22, 2010

Is it possible somehow to block some bluetooth device with specif address (mac) ?
(like iptables block by mac)?

View 3 Replies View Related

Hardware :: Block Device Names Change After Reboot

Jan 19, 2011

I built a Raid5 volume with 3 SATA II hard disk drives. Further I have a system disk conected through IDE. During the first setup the IDE disk becomes sda, the SATA II disk sd[bcd] respectively. Now, sometimes the device names change after reboot - why ever... E.g. one of the raid5 disk become sda and so I got an error message during the boot procedure regarding the raid set. Curious, when the system is up and I stop and restart the Raid5 volume it comes up and runs fine. Because I'm currently at work I can't post any more detailed config files at the moment.

View 2 Replies View Related

Hardware :: Buffer I/O Error Device Hdc Logical Block 15

Jul 4, 2011

I am trying to debug the issue of a desktop that has for the last two weeks started having kernel panics at boot time. This machine has been running flawlessly for the last 8 years, and has had three OS upgrades. I am using memtest to try to understand the issue. The following is part of the memtest output: Reading all physical volumes Buffer I/O error device hdc logical block 0 Buffer I/O error device hdc logical block 15

Illegal node for this track or incompatible media (asc=0x64 ascq=0x00) The failed "Read 10" packet command was /dev/hdc: read failed after 0 of 4096 at 0 Input/output error and similar set of mesaages After this udev checks correctly, and hardware, storage and audio are initialized However sometime in the middle of the boot process, a kernel panic occurs with message Kernel panic -- not symcing : Fatal exception in interrupt

View 4 Replies View Related

General :: Handle Bad Block In Mass Storage Device?

Nov 2, 2009

* I am implementing mass storage device on a test board.

* It contains NAND flash.

* Using corresponding "udc driver" and "g_file_storage" I could make my test board enumerate as mass storage device on my Linux machine.

* my 16 MB pen drive (test board) is now ready for read/write.

But there are some Bad Blocks on the NAND.Hence copy is not complete. Although on Linux machine there is no error message. Now , what is there in a normal pen drive which manages the Bad Block or what am I missing so that such Bad Blocks are managed.

Here is the error I get on my test board :

mtdblock: erase of region [0x2c0000, 0x4000] on "Bon 2" failed
end_request: I/O error, dev mtdblock2, sector 5664
Buffer I/O error on device mtdblock2, logical block 708

[code]....

View 3 Replies View Related

Server :: Mount - Block Device Giving Read Only

Mar 15, 2011

I want to keet some data on windows dir. I have tried the below command and giving the below error.
[root@xyz0044 ~]# mount -t cifs //10.48.64.52/jata -o username=domainv.kumar3,password=xxxx /mnt/backup
mount: block device //10.48.64.52/jata is write-protected, mounting read-only
mount: cannot mount block device //10.48.64.52/jata read-only

View 9 Replies View Related

Server :: RHEL5 ISCSI Not Creating New Block Device In /dev

Jul 9, 2010

I am running RHEL5.5 its a fresh install and we are testing Xen Virtualization. We are wanting to use our iSCSI SAN for the VMs. I have created the initiator iqn, and discovered the target address. We are connected to the target, but there is no new block device in /dev.

[root@xxxxxxxx etc]# netstat -a | grep iscsi
tcp 0 0 *:iscsi-target *:* LISTEN
tcp 0 0 xxxxx-netapp.okc-:44840 xxxxxx-iscs:iscsi-target ESTABLISHED
tcp 0 0 *:iscsi-target *:* LISTEN

[Code].....

View 2 Replies View Related

Fedora :: Kernel: Buffer I/O Error On Device Dm-0, Logical Block 124

Nov 28, 2009

I have 2 hdds, with encrypted / and /home. Besides there are four other (encrypted ext4) partitions I use rarely. In Fedora 11 at boottime I gave the luks passphrase for / and home and the system booted as intended.

Whenever I needed those extra encrypted partitions I mounted them in Nautilus. Now, in Fedora 12 at boottime dracut tries to open all the encrypted partitions, / and /home are mounted fine, but opening all the other partitions gave the following messages in messages.log:

Quote:

dracut: luksOpen /dev/sdb6 luks-02a0e706-a26f-4019-a2a0-88a0366a994d
kernel: Buffer I/O error on device dm-0, logical block 124
kernel: device-mapper: ioctl: unable to remove open device temporary-cryptsetup-304
kernel: Buffer I/O error on device dm-0, logical block 124
kernel: Buffer I/O error on device dm-0, logical block 124

[code]....

...and these messages are repeated with the other partiitions, and the boot time takes very, very long. How can I tell dracut to ignore those extra encrypted partitions at boottime?

View 8 Replies View Related

OpenSUSE Install :: How To Browse 11.3 CD - Block Device Write Protected

Jul 15, 2010

I can browse the iso image easily enough with a loopback mount, but when it comes to mounting the actual CD (which I did first), I get:

Code:
$ sudo mount -t udf,iso9660 /dev/dvd /mnt/dvd
mount: block device /dev/dvd is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/dvd,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
/var/log/messages isn't very helpful, either:

Code:
Jul 15 15:15:56 bkorb-dt kernel: attempt to access beyond end of device
Jul 15 15:15:56 bkorb-dt kernel: sr0: rw=0, want=68, limit=4
Jul 15 15:15:56 bkorb-dt kernel: isofs_fill_super: bread failed, dev=sr0, iso_blknum=16, block=16
$ md5sum openSUSE-11.3-DVD-x86_64.iso
adf5d2a0a03c1e3aaf102fd6a4771b87 openSUSE-11.3-DVD-x86_64.iso

I burned it with K3B and it gets the same result trying to mount it. K3B seems to know that the image is an iso9660 and is able to display the various 9660 id fields just fine. It just won't mount.

View 9 Replies View Related

Ubuntu :: Buffer I/o Error On Device Loop0 Logical Block?

Jan 13, 2011

i have a inspiron 1520 laptop which is starting to slow down some so i thought linux would help because all i do is internet use, so i download it from another computer and mount it to a usb flash drive like the site says, (netbook remix latest version) then i put it in my laptop and it loads all the way and i press try and after about 10 minutes of loading it lets me try. so that was ok really slow but i thought id install it to hard drive to see if it improved speed. so the next time i start my laptop i get Buffer i/o error on device loop0 logical block xxxxxx so i redo the usbflashdrive no errors switch usb ports and same thing, ive done the switch usb ports and redo the flash drive about 4 times im really getting mad at linux before i even have it installed.

View 1 Replies View Related

Debian :: Yaird Error: Bad Device Link In /sys/block/sda (fatal)

Nov 18, 2010

I'm trying to upgrade my kernel. When i get to the step where i should build the img for grub (i guess the command below is doing that) I get this error: yaird error: bad device link in /sys/block/sda (fatal)Since I installed debian using a USB drive, HDD1 was /dev/sdb and HDD2 was /dev/sdc, the USB was /dev/sda. Is there a way to force mkinitrd.yaird to build the img for /dev/sdb?

View 1 Replies View Related

CentOS 5 Hardware :: Buffer I/O Error On Device Sda, Logical Block 0?

May 20, 2009

I had installed the CENT OS 5.3 it is installed when i rebooted it gives me error continuously.

Buffer I/O Error on device sda, Logical Block 0
ata4.00 : exception Emask 0x0 SAct 0x0 action 0x0 frozen ......
ata4.00 : status: { DRDY }

why it has giving the error.i have Intel based hardware Core II Duo with 1 GB ram check with sata hard drive 120 GB.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved