Shao Miller [Fri, 4 Jun 2010 04:27:25 +0000 (00:27 -0400)]
[util] Tons of cosmetic changes
Nothing really effectively different.
Error codes changed a bit.
Shao Miller [Thu, 3 Jun 2010 23:41:56 +0000 (19:41 -0400)]
[filedisk] Support .ISO-on-HDD scenario
Had to add a bit to the threaded filedisk in order to
allow a run-once read/write hook which attempts to find
the correct file-backed disk. This hook used to hook
the enqueuer, but is now queued by it.
So now one can boot an .ISO file that's found on an HDD,
as long as there is a 2048-byte (OD sector) footer whose
last 512 bytes are the Microsoft .VHD footer details.
We should probably provide the convenience for adding
.VHD footers to HDD images and .ISOs in the user-land
utility.
Shao Miller [Thu, 3 Jun 2010 21:17:22 +0000 (17:17 -0400)]
[filedisk] Fix GRUB4DOS logic up a bit
Had a check backwards.
Had a dumb boolean where status is fine.
Shao Miller [Thu, 3 Jun 2010 20:52:44 +0000 (16:52 -0400)]
[filedisk] Require Microsoft VHD footers for booted disk images
The previous check for the short MBR magic was really cheap and
could fairly easily result in false positives. We now require
a Microsoft .VHD "footer" to be within the last 512 bytes of
the disk image. This works nicely for HDD images right now.
[Un]Fortunately, testing the .ISO case revealed that the code
which iterates through disks in an attempt to find the right
backing disk is running at an IRQL which is incompatible with
IoGetDeviceInterfaces(), which wishes to allocate to pageable
memory. It would seem best to enqueue this activity, but
neither threaded filedisks nor the GRUB4DOS threaded filedisk
actually implement a new "class" of device, so there's not a
place to throw the previous disk__io routine while we hook a
read/write operation in order to allow for delayed backing
disk discovery.
Shao Miller [Thu, 3 Jun 2010 05:40:05 +0000 (01:40 -0400)]
[disk] Use unsigned 64-bit integer for sector counting
Shao Miller [Thu, 3 Jun 2010 01:51:01 +0000 (21:51 -0400)]
[headers] Add byte order swapping support
Simply for convenience, we now have a function
byte__order_swap() and a macro
byte__rev_array_union() and a type
byte__array_union which are all just conveniences
for changing byte order.
Shao Miller [Tue, 1 Jun 2010 07:19:42 +0000 (03:19 -0400)]
[version] Up version to 0.0.1.8
This release introduces initial support for GRUB4DOS
sector-mapped disks. Currently, only HDD images with MBRs
are supported.
Please note that this is an early stage in supporting this
scenario, so you might find quirks. Also be aware of the
limitations:
- If your booted-from disk image file gets _moved_ while you
are booted from it, expect terrible things to happen. Try
to avoid such things as defragmenting the filesystem with
the disk image on it!
- There isn't really a good way to know which Windows disk a
GRUB4DOS backing disk corresponds to! Not enough information
is available to make the right decision. BIOS drive numbers
have no relevance in Windows, so we cannot exactly identify
which backing disk is correct for a disk image
- WinVBlock is not capable of magic; your booted disk image
_must_ have drivers and device ID associations so that the
_real_ disks are found at boot time!
Shao Miller [Tue, 1 Jun 2010 07:09:12 +0000 (03:09 -0400)]
[filedisk] Add MBR check for GRUB4DOS disks
We lack any good means of finding the correct backing disk for
a boot-time file-backed disk. Here is a really cheap check
which will test for an MBR where we would expect on on the
backing disk. This doesn't support CD/DVD, obviously.
Shao Miller [Tue, 1 Jun 2010 06:28:04 +0000 (02:28 -0400)]
[disk] Move MBR structure def. and CHS macros into header
Shao Miller [Tue, 1 Jun 2010 04:43:43 +0000 (00:43 -0400)]
[filedisk] Increase timeout for threaded disk processing
If there's nothing to do but a possible device__free(),
just sleep for up to a whole second before checking.
Shao Miller [Tue, 1 Jun 2010 04:04:06 +0000 (00:04 -0400)]
[filedisk] Initial support for booting a filedisk from GRUB4DOS
Whee. We scan memory for GRUB4DOS sector-mapped disks, create
filedisks for them, then hook them so that the first time they
are used, we try to find the appropriate backing disk for each.
The limitations of the current implementation are:
- We assume the first disk is the right backing disk (very naive)
- We don't check to make sure we don't open our own disk
- It's pretty slow for some reason that needs investigation
- There is not really a good way to associate GRUB4DOS mappings
to Windows disks; not enough information is passed!
- If the image file for a filedisk gets moved while we are using
it, expect terrible things to happen!
Shao Miller [Tue, 1 Jun 2010 02:36:38 +0000 (22:36 -0400)]
[filedisk] Move filedisk__get_ptr macro into header
Same as other such *__get_ptr() macros used by multiple
C source files.
Shao Miller [Tue, 1 Jun 2010 01:41:18 +0000 (21:41 -0400)]
[filedisk] Implement threaded filedisk creation function
filedisk__create_threaded() should return a pointer to a
threaded, file-backed disk.
Shao Miller [Tue, 1 Jun 2010 01:21:16 +0000 (21:21 -0400)]
[filedisk] Add support for threaded filedisks
We now have a disk__io routine which enqueues a request for
later processing. We implement a device__free routine to
support such asynchronous filedisks. We have a thread
function per threaded filedisk which processes the queue
of requests.
Shao Miller [Mon, 31 May 2010 19:29:26 +0000 (15:29 -0400)]
[filedisk] Allow for a file offset
It's useful to have a base offset into a file from which
the virtual disk's sectors will be considered to start.
Shao Miller [Sun, 30 May 2010 06:16:19 +0000 (02:16 -0400)]
[filedisk] Add GRUB4DOS module
Distinguish between the case of GRUB4DOS RAM disks and
GRUB4DOS sector-mapped (file-backed) disks. A new probe
routine is added (which currently does nothing).
Shao Miller [Sun, 30 May 2010 06:01:01 +0000 (02:01 -0400)]
[filedisk] Put in own subdir and change to library
There is a plan to support GRUB4DOS sector-mapped disks,
so we will need another probe routine, suggesting that
there should be a GRUB4DOS source file in a filedisk/
directory, as there is a GRUB4DOS source file in the
ramdisk/ directory.
Shao Miller [Sun, 30 May 2010 05:27:48 +0000 (01:27 -0400)]
[disk] Allow for asynchronous IRP completion
After much debugging, it was revealed that in order to use
ZwReadFile() for a file-backed disk during boot, one needs
to return STATUS_PENDING to the caller and start a worker
thread who will use ZwReadFile() and then complete the IRP.
Shao Miller [Sun, 23 May 2010 17:36:53 +0000 (13:36 -0400)]
[irp,bus] Send and handle IRP completion properly for detach
The disk detach handler was not completing the IRP and the
IRP processor was not checking for completion in an outer
while() loop. Both fixed.
Shao Miller [Sun, 23 May 2010 16:47:02 +0000 (12:47 -0400)]
[aoe] Fix get_ptr macro and uses
How I missed this, I really have no idea...
Shao Miller [Sun, 23 May 2010 15:46:31 +0000 (11:46 -0400)]
[bus] Fix NULL pointer dereference when disk walking
For 'winvblk detach' and 'winvblk umount' commands.
Shao Miller [Sun, 23 May 2010 15:45:17 +0000 (11:45 -0400)]
[aoe] Fix NULL pointer dereferencing in disk walking
For the 'winvblk show' command... Which, by the way,
should be untied from the AoE module at some point.
Shao Miller [Sun, 23 May 2010 09:18:22 +0000 (05:18 -0400)]
[major] Re-work device structures and creation
This rather large commit affects a majority of the AoE and
WinVBlock modules. It is unfortunately large in order to
ensure that after the series of changes were made, that a
system was still bootable from a WinVBlock disk.
What was involved:
A DEVICE_OBJECT's DeviceExtension member no longer points to
one of our device types. All of our device types were
previously structures which included the structures they
derived functionality from as their first members. So you
had something like a RAM disk with a disk as its first
member, a disk having a device as its first member. So to
access any one of the structures, you could quite simply
cast a pointer.
Now a DeviceExtension points to a pointer to a device__type.
A device__type has an ext member which is a pointer to the
instance of the next-higher structure type, such as a
disk__type. A disk__type also has an ext member, so that
AoE, RAM, and file-backed disks can extend it.
Each device class provides a global creation routine, which
tracks the device instance in a list of created devices for
that type. The device class' creation routine should set
default parameters. The creation routine can override the
device routines used by callers calling the routines of the
"base class" (the device type). As an example, when you
create a RAM disk, you:
- create a disk
- which creates a device
- which hook's a device routine for the device
- hook some of the disk's routines
- add the RAM disk to the global list
When deleting the RAM disk, you:
- call the deletion routine you hooked for the disk
- which calls the deletion rout. it hooked for the dev.
- remove the RAM disk from the global list
Some copy'n'pasted comments were corrected.
Some code expecting the base-class-as-first-member-of-
derived-class was exposed and modified appropriately.
get_ptr() macros were changed.
DEVICE_OBJECT deletion paths were tied to device__free()
calls.
Some TODOs are left: More error-checking when calling
module initialization functions, watching NULL pointer
dereferences when walking sibling pointers.
Shao Miller [Fri, 21 May 2010 19:33:32 +0000 (15:33 -0400)]
[bus] Use new bus creation strategy
When creating the boot bus or when a user manually installs
a bus device, the bus module will use the new device creation
scheme.
When the bus module initializes, it creates the boot bus,
which is a root-enumerated device via IoReportDetectedDevice().
Using this kernel function means that the PnpManager owns the
PDO. If a user manually installs a bus device, PnpManager also
owns the PDO. So the create_pdo() routine for a bus doesn't
make a lot of sense, except for indirectly for the case of the
boot bus only.
Also, when the IoReportDetectedDevice() is used, we must
manually call our attach_fdo() function to create the
DEVICE_OBJECT which we own and which we will associate with
the driver-internal bus & device details.
There is a really big nasty TODO left over in this commit
which should be removed as soon as possible. In shifting to
the new device classing scheme, we are part-way through,
where some devices use a DEVICE_OBJECT's DeviceExtension as
a device__type_ptr, and the bus uses it as a device__type_ptr*.
So for now, we have the mini IRP handling system sense if it
should compensate for this.
The next steps will be to move all of the various disk types
to use counterpart strategies for device classing. But hey,
it still boots.
Shao Miller [Fri, 21 May 2010 04:07:53 +0000 (00:07 -0400)]
[cosmetics] Fix some typos due to copy and paste
Shao Miller [Fri, 21 May 2010 03:48:15 +0000 (23:48 -0400)]
[bus] bus__add_child once more takes a bus param
Trying to move away from the "one bus" model.
Shao Miller [Fri, 21 May 2010 03:12:12 +0000 (23:12 -0400)]
[device,bus] Further develop device routines
Much of it unused for now, but eventually (seems like it's
always eventually) each device type will create an instance
of a type it would like to derive from, then overrides
whatever operations it wants to. When the device is asked
to perform operations, it should either have sensible, do-
nothing defaults or meaningful device-specific operations.
Shao Miller [Thu, 20 May 2010 20:19:28 +0000 (16:19 -0400)]
[bus] Create boot bus here, introduce init function
The bus module is now responsible for creation of bus PDOs,
such as the boot bus which exposes WinVBlock-supported boot
disks. We now have bus__init() and bus__finalize() funcs
which are called by the driver module.
We also mimic the device module by having a bus__create()
function, though it is currently unused, also like the
device__create() function.
Shao Miller [Thu, 20 May 2010 13:41:29 +0000 (09:41 -0400)]
[device] Don't use a pointer for device operations
Instead of pointing at some device operations structure,
we actually copy the operations' function pointers for
each device.
Shao Miller [Thu, 20 May 2010 05:44:59 +0000 (01:44 -0400)]
[device] Introduce device creation routine
Though currently unused, the idea is to eventually have the
different device type modules as providers of their device
types. The new device-common module will produce a device
structure which has device-common properties. A caller can
then override whichever properties they need to, such as the
device operations.
Also, device creation should track created devices for easy
tear-down later on.
Shao Miller [Tue, 18 May 2010 20:39:41 +0000 (16:39 -0400)]
[device] Introduce device header and move details there
Move device specifics out of the driver header and into a
device headers, instead. We are on our way to a form of
device functionality inheritance... Something like:
device
..bus
..disk
....aoe
....ramdisk
....filedisk
"And the rest." - Gilligan's Island
Shao Miller [Tue, 18 May 2010 14:42:23 +0000 (10:42 -0400)]
[winvblock/driver] Rename dev_ext member to device
Just cosmetic. I am trying to hide the details of
Windows DEVICE_OBJECTs with their DeviceExtension.
Shao Miller [Tue, 18 May 2010 14:25:47 +0000 (10:25 -0400)]
[project] Rename dev_ext variables to dev
Just cosmetic. I am trying to hide the details of
Windows DEVICE_OBJECTs with their DeviceExtension.
Shao Miller [Tue, 18 May 2010 03:02:32 +0000 (23:02 -0400)]
[winvblock/driver] Rename driver__dev_ext to device__type
This type will be coming out of the driver module soon.
Shao Miller [Tue, 18 May 2010 00:59:12 +0000 (20:59 -0400)]
[winvblock/probe] Move disk probe routine into bus
It makes some sense that we can delay our RAM disk probing
until the bus is actually queried for children. This means
that the DriverEntry() returns sooner.
Shao Miller [Tue, 18 May 2010 00:27:37 +0000 (20:27 -0400)]
[disk] Add missing extern specifier for export
Shao Miller [Mon, 17 May 2010 04:12:05 +0000 (00:12 -0400)]
[build] Re-visit build system and directory structure
Thanks to OSR's ntdev mailing-list and Tim Roberts' response,
we now have a directory layout with some hierarchical
organization. Very nice.
Shao Miller [Sun, 16 May 2010 21:23:51 +0000 (17:23 -0400)]
[version] Up version to 0.0.1.7
This version sees a couple of changes:
- AoE has been split off as a separate driver that depends
on the WinVBlock bus driver. This removes the bus driver's
dependency on NDIS.SYS. You can boot from an AoE disk still,
but pay attention to the service load order; you want NDIS to
load first, then your NIC's driver, then WinVBlock, then AoE.
- Geometry detection has been added for file-backed disks, so
you can hopefully do:
winvblk attach c:\foo.hdd h 0 0 0
and get the right geometry.
- We now always create a root-enumerated bus device. There's
no longer a need to add the /WINVBLOCK=BUS=1 option to the
BOOT.INI or TXTSETUP.SIF files.
Shao Miller [Sun, 16 May 2010 21:19:37 +0000 (17:19 -0400)]
[aoe] Add files to support 64-bit compilation
As in, AMD64/x64... Not Itanium/IA-64.
Shao Miller [Sun, 16 May 2010 21:17:45 +0000 (17:17 -0400)]
[project] Add to git ignore file
Ignore warning, error, log files. Ignore object
directories.
Shao Miller [Sun, 16 May 2010 19:18:38 +0000 (15:18 -0400)]
[bus/disk,bus/filedisk] Add geometry detection
Now you can specify something like:
winvblk attach c:\foo.hdd h 0 0 0
and geometry detection will be attempted when the first
sector of the disk is accessed. We use some of the logic
from H. Peter Anvin's MEMDISK to look at FAT and MBR
params.
Shao Miller [Tue, 11 May 2010 03:41:12 +0000 (23:41 -0400)]
[httpdisk] Apply WinVBlock-as-usual indentation
Shao Miller [Tue, 11 May 2010 03:38:24 +0000 (23:38 -0400)]
[httpdisk] Dos2Unix source files
Shao Miller [Tue, 11 May 2010 03:32:34 +0000 (23:32 -0400)]
[httpdisk] Support compilation under DDK 6001.18001
A couple of changes so that HTTPDisk and its mounting
utility compile under the Windows Driver Development Kit
version 6001.18001, which is what I've been using for
WinVBlock.
Shao Miller [Tue, 11 May 2010 02:54:49 +0000 (22:54 -0400)]
[httpdisk] Initial population into WinVBlock repository
The extremely nice work of Bo Brantén found at:
http://www.acc.umu.se/~bosse/
includes HTTPDisk, a read-only HTTP SAN driver, of sorts.
He has very kindly provided permission for its incorporation
into WinVBlock. It will be developed to be a "feature
driver", just as AoE is a "feature driver".
Please note that HTTPDisk is GPLv2 or any later version.
Shao Miller [Tue, 11 May 2010 02:05:58 +0000 (22:05 -0400)]
[project] Split AoE off, part 3
At last, the unfortunately monolithic AoE module can be
separated from the bus, RAM disk and file-backed disk
code. This is the final part of the estimated 3 commits.
Now that AoE is its own driver, but dependent on WinVBlock,
we have to consider the service load order in a booted-from
scenario.
I've re-ordered HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\ServiceGroupOrder\ : List : REG_MULTI_SZ as follows:
...
System Bus Extender
* NDIS Wrapper
* NDIS
SCSI miniport
...
Instead of:
...
System Bus Extender
SCSI miniport
...
Streams Drivers
* NDIS Wrapper
COM Infrastructure
...
PNP_TDI
* NDIS
TDI
...
And I use the following Group values for the two drivers:
...\Services\WinVBlock : Group : REG_SZ : SCSI miniport
...\Services\AoE : Group : REG_SZ : SCSI Class
And of course as usual, you will want your NIC driver set
to boot-start. Loading should thus be ordered as follows:
NDIS
NIC driver
WinVBlock
AoE
Shao Miller [Tue, 11 May 2010 01:40:43 +0000 (21:40 -0400)]
[project] Split AoE off, part 2
At last, the unfortunately monolithic AoE module can be
separated from the bus, RAM disk and file-backed disk
code. This is part 2 of an estimated 3 commits. Do not
expect AoE to work until the third commit.
Shao Miller [Tue, 11 May 2010 01:33:11 +0000 (21:33 -0400)]
[project] Split AoE off, part 1
At last, the unfortunately monolithic AoE module can be
separated from the bus, RAM disk and file-backed disk
code. This is part 1 of an estimated 3 commits. Do not
expect AoE to work until the third commit.
Shao Miller [Tue, 11 May 2010 00:13:00 +0000 (20:13 -0400)]
[debug] Export xDbgPrint
Because AoE (and every other module) uses it.
Shao Miller [Tue, 11 May 2010 00:09:34 +0000 (20:09 -0400)]
[driver] Export Driver_CompletePendingIrp
Because AoE uses it. *sigh* I'm in a hurry to finish this
split so that AoE can be its own driver.
Shao Miller [Mon, 10 May 2010 19:26:16 +0000 (15:26 -0400)]
[disk] Export disk device operations
Because AoE uses them.
Shao Miller [Mon, 10 May 2010 19:17:52 +0000 (15:17 -0400)]
[aoe] Implement a disk close routine
To avoid referencing the disk__default_close() function in
the disk module.
Shao Miller [Mon, 10 May 2010 19:11:24 +0000 (15:11 -0400)]
[driver] Export Error function
Because AoE uses it.
Shao Miller [Mon, 10 May 2010 19:02:58 +0000 (15:02 -0400)]
[bus,aoe,irp] AoE mini IRP handling in AoE module
The bus module pretty well needs to expose the bus device to
other drivers so that they can register their mini IRP
handling tables with it. bus__dev() now yields the FDO.
The un-register function was mis-named in the IRP module.
We are now registering the AoE IOCTL handling twice, but
this is not a big deal. When AoE is finally split off,
the bus module will no longer register anything AoE-related.
Shao Miller [Mon, 10 May 2010 18:13:57 +0000 (14:13 -0400)]
[project] Change get_XXX_ptr to preprocessor macro
I don't think the inline specifier was working anyway.
Shao Miller [Mon, 10 May 2010 17:57:18 +0000 (13:57 -0400)]
[bus] bus__add_child only uses the single bus
The bus__add_child() function has been modified to simply
use the only bus device we allow, rather than taking an
argument. Also, we invalidate the bus relations instead
of the caller.
Shao Miller [Mon, 10 May 2010 17:18:01 +0000 (13:18 -0400)]
[registry,aoe] Move AoE Registry setup into AoE module
AoE needs to register its protocol with NDIS and also does
some Registry manipulation. This logic has been moved from
the Registry module into the AoE module (which is getting
quite monolithic now). This is still towards splitting AoE
into its own driver.
Shao Miller [Mon, 10 May 2010 16:40:32 +0000 (12:40 -0400)]
[registry] Change Registry_NoteOsLoadOptions function
Renamed to registry__note_os_load_opts(). Now takes an
argument instead of storing directly to a global in the
driver module.
We also free this from the driver module at driver unload
time, as well.
Shao Miller [Mon, 10 May 2010 16:12:53 +0000 (12:12 -0400)]
[registry] Export handy functions by Michael Brown
AoE will want to do some Registry manipulation once it has
been split from WinVBlock, so we might as well export some
functions it (or other future drivers) could make use of.
Shao Miller [Mon, 10 May 2010 15:54:06 +0000 (11:54 -0400)]
[aoe] Do not truncate fractional end cylinder
Ran into problems with AoE to a disk image with geometry
constrained to QEmu's expectations. We used to truncate
a fractional end cylinder for the disk, but this has been
changed with the hopes that most disk consumers will use
LBA.
We should really address the FIXME and use geometry from
the MBR.
Shao Miller [Sun, 9 May 2010 22:39:36 +0000 (18:39 -0400)]
[project] Match Entry messages with Exit messages
Simply output messages when functions return via the
"usual" or expected path, so we can track entry and exit.
Shao Miller [Sat, 8 May 2010 20:12:55 +0000 (16:12 -0400)]
[aoe_ioctl] Merge header into AoE header
Also moved a single extern function declaration needed
by the AoE protocol module right into the protocol
module itself, thus avoiding complications for the
user-space "mount" utility having to know about the DDK.
Shao Miller [Sat, 8 May 2010 19:59:59 +0000 (15:59 -0400)]
[aoe] Make AoE_Start private
Renamed to start(). Only the AoE module uses it.
Shao Miller [Sat, 8 May 2010 19:56:28 +0000 (15:56 -0400)]
[aoe] Rename AoE_ResetProbe to aoe__reset_probe
Used by the AoE protocol module, too.
Shao Miller [Sat, 8 May 2010 19:54:19 +0000 (15:54 -0400)]
[aoe] Rename AoE_Reply to aoe__reply
Used by the AoE protocol module, too.
Shao Miller [Sat, 8 May 2010 19:50:12 +0000 (15:50 -0400)]
[aoe] Make AoE disk operations private
An amendment to commit
818ebaaf58fcfbad04c7760ca4db1edfb4d146f1
Shao Miller [Sat, 8 May 2010 19:46:51 +0000 (15:46 -0400)]
[aoe] Make aoe__target_list private
An amendment to commit
793f876c1aa0dddff0d9b2f402ed105e0f7a89b5
Shao Miller [Sat, 8 May 2010 19:42:59 +0000 (15:42 -0400)]
[aoe] Make AoE disk operations private
Shao Miller [Sat, 8 May 2010 19:40:35 +0000 (15:40 -0400)]
[aoe] Rename aoe__get_disk_ptr to get_aoe_disk_ptr
Since it's entirely within the AoE module now.
Shao Miller [Sat, 8 May 2010 19:38:39 +0000 (15:38 -0400)]
[aoe] Make aoe__target_list private
Only AoE functions need to know the AoE target_list
type now.
Shao Miller [Sat, 8 May 2010 19:30:42 +0000 (15:30 -0400)]
[aoe] Make AoE search_state private
Only AoE functions need to know about the search_state
enumeration now.
Shao Miller [Sat, 8 May 2010 19:27:51 +0000 (15:27 -0400)]
[aoe] Make aoe__disk_type private
Only AoE functions need to know about this type now.
Shao Miller [Sat, 8 May 2010 17:53:05 +0000 (13:53 -0400)]
[bus/bus_dev_ctl,bus/aoe] Move AoE IOCTLs into AoE module
Still in the process of splitting AoE off, we move AoE-
specific IOCTL handling into the AoE module.
Shao Miller [Sat, 8 May 2010 16:35:20 +0000 (12:35 -0400)]
[bus/disk] Fix uninitialized mini IRP handling table chain
Before registering a mini IRP handling table with a device,
we should really make sure the chain of tables is empty.
Oops.
Shao Miller [Sat, 8 May 2010 00:37:19 +0000 (20:37 -0400)]
[mount,aoe] Move AoE IOCTLs into their own file
Starting to split AoE from the rest.
Shao Miller [Fri, 7 May 2010 21:33:43 +0000 (17:33 -0400)]
[irp] Use mini IRP handling chain
When an IRP dispatch comes in, we special-case a power
IRP, or pass the IRP along to irp__process().
irp__process() will walk each table of IRP handlings
in the device's chain of registered tables, looking for
an IRP handling that matches the IRP major and minor
codes. This is roughly similar to the PDO stacked
beneath multiple FDOs approach, but just a little less
complex and with perhaps less memory and management
overhead.
A feature (provided by a driver) can register handled
IRP types on a device, then WinVBlock should use that
feature's functions to process the IRP. I hope WinVBlock
can call functions in another driver in this way. :)
So now when a bus or disk device is created, the default
driver IRP handling table is registered as well as the
device-specific handling table (bus or disk). We used
to manually build a large table with these tables copied
into it, but not anymore.
Shao Miller [Fri, 7 May 2010 14:53:21 +0000 (10:53 -0400)]
[irp] Move mini IRP handling into its own module
We introduce bus/irp.c for the miniature IRP handling logic.
We also introduce code for an IRP handling table chain. The
goal of such a chain is to allow IRP handlings to be
dynamically added and removed for a device. An example use
would be for the AoE system to register IOCTL handling with
the WinVBlock bus device, so that the bus processes the
IOCTLs. If the AoE system is unloaded, it should be able to
un-register the handling of these IOCTLs.
Currently, the IRP handling table chain is not used, but
this will change in a future commit.
Shao Miller [Thu, 6 May 2010 23:54:07 +0000 (19:54 -0400)]
[headers] Introduce generic pointer type
We include winvblock__any_ptr to represent a void *.
Shao Miller [Wed, 5 May 2010 23:15:10 +0000 (19:15 -0400)]
[bus/bus] Remove STDCALL for argless func
Bus_Stop() takes no arguments, so it doesn't need the
STDCALL specifier.
Shao Miller [Wed, 5 May 2010 23:12:34 +0000 (19:12 -0400)]
[bus/driver] Remove reinitialization declaration
Should have been removed in commit
3afe1fddd34f0e0187dca6bb569d9f8353aab07a
Shao Miller [Tue, 4 May 2010 22:43:14 +0000 (18:43 -0400)]
[build] Build bus driver to provide exports
Using the helpful information at this web page[1], we
now compile to provide a .LIB so that other drivers
can link against it and use functions that we might
choose to export.
Export functions by beginning with winvblock__lib_func
in the declaration.
[1] http://www.wd-3.com/archive/KernelDlls.htm
Tim Roberts
Shao Miller [Mon, 3 May 2010 18:57:31 +0000 (14:57 -0400)]
[bus/driver] Always create the root-enumerated bus dev
Instead of requiring the user to specify a BOOT.INI/TXTSETUP.SIF
/WINVBLOCK=BUS=1 option, we will simply always provide a root-
enumerated bus device. It's probably less complicated that way.
Shao Miller [Fri, 30 Apr 2010 23:10:11 +0000 (19:10 -0400)]
[devel] Update wxDev-C++ project file
Should reflect directory & file shuffling
Shao Miller [Fri, 30 Apr 2010 23:03:07 +0000 (19:03 -0400)]
[build] Move majority of code into bus subdir
The plan is to split AoE functionality off into its own driver,
to avoid WinVBlock's dependency on NDIS for those users who
do not require or desire the AoE feature.
Similarly, future features with dependencies can have their own
directories and their own .SYS drivers.
For now, all driver code including AoE has been moved into bus/,
but AoE will eventually come out of there.
A strategy needs to be determined to allow for the single bus
device to accept features in a modular fashion, and to route
applicable feature-wide control signals to each feature's driver.
For example, the WinVBlock bus (an "HDD controller" of sorts) can
support certain virtual disk types natively. When an AoE driver
starts, it could look for the bus and register itself as a
feature if the bus is found. Thenceforth, a user-land utility
could request an AoE-attach of the WinVBlock bus, who could forward
that request on to the AoE driver.
Shao Miller [Fri, 30 Apr 2010 21:26:12 +0000 (17:26 -0400)]
[build] Move userland utility into subdir
Shao Miller [Fri, 30 Apr 2010 21:16:05 +0000 (17:16 -0400)]
[build] Move driver loader into subdir
Shao Miller [Fri, 30 Apr 2010 20:15:48 +0000 (16:15 -0400)]
[build] Move PXE NBP sources into nbp subdir
It's time to re-organize the project's directory structure.
Shao Miller [Thu, 14 Jan 2010 19:19:19 +0000 (14:19 -0500)]
[version] Up version to 0.0.1.6
Shao Miller [Wed, 13 Jan 2010 21:28:17 +0000 (16:28 -0500)]
[driver] Remove old testing comments
Some code for outputting text to the initial Windows
kernel-mode boot screen was sitting inside a couple of
comment blocks. Now that code is no longer there to
potentially confuse anyone.
Shao Miller [Wed, 13 Jan 2010 20:19:22 +0000 (15:19 -0500)]
[filedisk] Close file handle
When a file-backed disk is removed, we close the file handle.
Shao Miller [Wed, 13 Jan 2010 19:46:09 +0000 (14:46 -0500)]
[bus_dev_ctl] Do not set boot drive on AoE mount
Shao Miller [Wed, 13 Jan 2010 19:19:31 +0000 (14:19 -0500)]
[bus,disk] Call close routine upon device deletion
For cleanup purposes.
Shao Miller [Wed, 13 Jan 2010 19:00:05 +0000 (14:00 -0500)]
[driver,disk] Add close routine
So that devices can be closed/detached/removed/deleted/whatever.
Implement a simple redirection in the disk module to redirect
a device close call to a disk close call.
Shao Miller [Wed, 13 Jan 2010 18:55:23 +0000 (13:55 -0500)]
[disk] Add close routine
A dummy default close routine for disks is implemented.
Shao Miller [Wed, 13 Jan 2010 17:27:35 +0000 (12:27 -0500)]
[aoe] Set media type for AoE SAN
Now that disk__create_pdo() uses the media type as an
index, we need to set this member beforehand.
Shao Miller [Fri, 8 Jan 2010 21:57:01 +0000 (16:57 -0500)]
[general] Quick header inclusion audit
Shao Miller [Fri, 8 Jan 2010 21:40:42 +0000 (16:40 -0500)]
[aoe] Move target list cleanup code out of bus module
Shao Miller [Fri, 8 Jan 2010 21:28:50 +0000 (16:28 -0500)]
[bus] Remove unused forward declaration for disk
Shao Miller [Fri, 8 Jan 2010 21:27:42 +0000 (16:27 -0500)]
[aoe] Move target list spin-lock into AoE module
Shao Miller [Fri, 8 Jan 2010 21:18:24 +0000 (16:18 -0500)]
[aoe] Move target list type and global into AoE module
Out of the bus module.