How to write from linux device driver to hard drive using DMA - device

I can transfer chunks of data from application to device driver but unable to write the interface from device driver to actual harddrive using DMA. Is there any sample code or pointer on this?
Would greatly appreciate your help,

If you've not seen it already, this is pretty informative. It's part of this.

Related

How to program midi-driver software?

I am creating my own midi-instrument and would like to know how to create a PC driver program for this instrument. Does anyone have any pointers or resources I could look at to help me complete this task?
All i have found so far is
1) https://msdn.microsoft.com/en-us/library/windows/hardware/mt187811(v=vs.85).aspx --> USB drivers
Just make your device conform to the USB MIDI device class specification, and you do not need to write any driver for the PC.
Check out the Driver samples for Windows 10. The Sample KMDF Function Driver for OSR USB-FX2 might be closer to what you need, if you want to write a USB device driver.

Reading PCI device memory registers in windows

I need to read the HBA memory registers of the AHCI controller sitting on the PCI bus of the system. I have a driver using which I can read the config space of all the PCI devices in the system (using ReadConfig and WriteConfig). Through this I'm able to get the ABAR content which is the last BAR in AHCI device's config space. Now, I need to read the values of these memory registers. Does anybody has any idea how to do this? PCITree is able to do this, so I know that this is possible.
I'm new to driver development, so any help would be greatly appreciated... :)
AFAIK you can use winio to access memory under Windows NT/2000/XP/2003/Vista/7 and 2008. Please reference the link and click "winio" to download and use. There are samples and sources within it and you can easily transfer to your application.

How to access the ISA Bus of a Windows PC?

I want to access my Motherboard's ISA Bus to read temperature sensor values and set cooling fan speeds.
I could not find any practically helpful information but the hint to use "GiveIO", a unviersial I/O driver which unfortunately is not compatible with windows 7.
If there is no avoiding of coding a driver, any useful information on how to get startet would be highly appreciated.
There is an open source hardware monitor at http://code.google.com/p/open-hardware-monitor that seems to do what you want. It uses the WinRing0 driver for hardware access.
To directly access the hardware under Windows, one must write a device driver.

How do I read/write (program) the MBR/VBR of a flash drive?

I'm looking for a method of reading/writing (actually programming) the Master Boot Record (or maybe VBR) of a usb mass storage device. Actually its a flash drive whose MBR I want to program, so that whenever I plug it into any computer, a program (stored on my flash drive in a file) gets executed.
I know quite a bit of assembly but I don't know how to go about programming MBRs..
Please help
Thanks
If you're using linux, you can simple open the device file /dev/sdXY and write to it, the MBR will be the first 512 bytes.

How to read from USB without any driver?

We are creating small system which has GPS receiver and PC. We want to test my GPS receiver, We do not want to go for a driver on the first go. First I would like to test my circuit works or nor. GPS IC has been set to output NMEA sentence. We want a program which just reads data from USB port and print it on the screen.
Can we write something like this easily ? Do we have any open source tool which will achieve this purpose ?
Platform : Windows 7
All devices need a driver, so I'm going to interpret your question as "how can I read NMEA data from my GPS using only drivers provided by the OS, so I don't have to write my own?"
If the GPS chip has a USB interface, then you should have gotten a driver with it. But most GPS chips have a UART interface which in your case sounds like it is connected to a separate USB-UART conversion chip. That conversion chip most likely came with a driver as well, but if not, you could jumper the reset pin of the converter chip, disabling it, and then attach a TTL/RS-232 level converter (available off-the-shelf) to the UART traces and then to your computer's serial port.
Unless you suspect that the driver for the USB-UART converter is causing problems, I wouldn't bother.
Anything connected via USB is a device. Devices require a device driver, period.
You might be able to get away with an existing driver built into Windows. This is how USB memory keys work for example - they present a generic device that looks like a removable disk, and Windows already includes the drivers for generic removable disks.
You would need to check the documentation for your device to see if it can emulate a device which already has drivers. Otherwise you must install the company's drivers, or you're out of luck.
Have a look at libusb. You should be able to read the data with that and a little code. (Yes, it's a driver. I take the question to mean "without writing a driver".)
You need a device driver for your device. Unless Windows already have a class driver for the device.
For USB devices on Windows 7 you can write a user-mode driver, see UMDF.

Resources