Accessing a block-device from kernel-mode

From: Armin (Armin.Gerritsen.DELETE_at_philips.com)
Date: 01/22/04


Date: Thu, 22 Jan 2004 14:45:09 +0100

Hello,

I'm developing a kernel-module (for an embedded system running Linux), which
requires to write to hard disk or similar devices. Note it is not a
harddisk-driver itself, but a driver that operates in parallel with the hard
disk driver. (I already have the driver for hard disk/etc.) That driver
needs to access the disk a low-level; That is using lba-addresses.

Because I already have the hard disk driver, I could easily access some
special functions of that driver to solve my problem. However, I want to
make my solution generic. So if the system gets a different hard disk or
ATA-storage system, I can use my solution without changing anything.

Since a hard disk driver is a block device, I wondered if it would be wise
to let my kernel-module, access the disk a block-level, which is higher in
the ranks.

Question is, how? How do you access a block device from a kernelel-module.
All the examples and documentation I could find refers to using applications
from user-space.

Regards,

Armin



Relevant Pages

  • Accessing a block-device from kernel-mode
    ... I'm developing a kernel-module, ... harddisk-driver itself, but a driver that operates in parallel with the hard ... Because I already have the hard disk driver, ... How do you access a block device from a kernelel-module. ...
    (comp.os.linux.embedded)
  • Re: VMware - installing openserver 5.0.x
    ... disk) and installation stop (no root hard disk). ... this append also on vmware (in vmware sco running on emulated SCSI hard disk ... when use IDE driver. ... install on vmware with SCSI hard disk) without success. ...
    (comp.unix.sco.misc)
  • Re: PROBLEM WITH BOOTING (SMART FAILURE???)
    ... was that exact message. ... Immediately back up your data and replace your hard disk ... >> basically a driver issue. ... >> just reports info that xp doesn't like, but it works fine, always ...
    (microsoft.public.windowsxp.general)
  • Adventures with the little big E... (PS/2 9533)
    ... After going around and around with the PCMCIA ... That time Windows 95 setup told me there wasn't enough free space on ... I've done a Win95 install on a 120MB hard disk before, ... M$ driver, as did the IDE and PCMCIA adapter. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: sd Driver problem
    ... Driver 'sd' needs updating - please use bus_type methods ... The reason for this message is most likely that I am using multiple ... unable to access the hard disk. ...
    (alt.os.linux.suse)