|
-
June 9th, 2011, 02:21 PM
#1
Inline Assembly in a Driver for Hard Drive IO
I have several questions:
1. Are "major functions" (DriverObject->MajorFunction[IRP_MJ_XXX]), which are attached to device object on the init step, being executed in kernel-mode? In other words, can I expect that all the code inside these functions will be executed in the kernel-mode?
2. If #1 = yes, then I would like to know if it is possible to use inline assembly with, for instance, 13h interruption and many others (which are restricted in user-mode) inside those major functions?
3. If #2 = yes, then could you reference me some useful links/sources/books where I can learn how to read/write physical Hard Drive within LBA-style, using this inline assembly?
In case if you are curious: I don't like that "CreateFile("\\\\.\\PhysicalDriveX",...)" functions requires administrator rights...
-
June 13th, 2011, 09:21 PM
#2
Re: Inline Assembly in a Driver for Hard Drive IO
1. Most probably the answer would be "yes", if the driver is kernel
mode driver.
2. The usage of inline assembly is not dependent from particular function or
interrupt. It only requires the compiler to support "inline assembly".
So if I correctly understood your question, the answer would be "yes" it is
possible to use inline assembly in kernel code (as well in user mode
code).
3. I just want to warn you, that if your driver is going to be used also on
64-bit platforms, then inline assembly should not be a choice since Visual
Studio doesn't support inline assembly for 64-bit compilation.
In case if you are curious: I don't like that "CreateFile("\\\\.\\PhysicalDriveX",...)" functions requires administrator rights...
Is this the only reason why you decided to use kernel mode driver and inline assembly?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|