summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Shao Miller [Wed, 16 Dec 2009 04:12:50 +0000 (23:12 -0500)]
[bus_pnp] Move bus PnP IRP handling into bus_pnp
Changed functions to use mini IRP handling. Put in own file.
Shao Miller [Wed, 16 Dec 2009 01:51:45 +0000 (20:51 -0500)]
[bus] Initial test for mini IRP handling
Implemented handling_table[] in the bus module. The bus module has
also been updated to copy this table into a new bus device.
The picture of a bus device's mini IRP handling stack now goes:
IRP_MJ_PNP && IRP_MN_QUERY_DEVICE_RELATIONS ? bus foo()
IRP_MJ_PNP && IRP_MN_START_DEVICE ? bus pnp_start_dev()
IRP_MJ_CREATE ? driver create_close()
IRP_MJ_CLOSE ? driver create_close()
driver old_strategy()
driver all_irps()
Where lower handlings are only pursued if
the completion boolean is not set.
A simple foo() which catches IRP_MJ_PNP with
IRP_MN_QUERY_DEVICE_RELATIONS just for testing.
foo() should be removed soon.
IRP_MJ_PNP, IRP_MN_START_DEVICE moved to pnp_start_dev()
Shao Miller [Wed, 16 Dec 2009 00:45:22 +0000 (19:45 -0500)]
[driver] First test with new mini IRP handling strategy
The driver IRP dispatch routine now scans through the DeviceObject's
DeviceExtension's irp_handler_stack(_ptr) looking for IRP major and
minor function matches. An appropriate handler function is called,
if available.
The IRP_MJ_CREATE and IRP_MJ_CLOSE have their own create_close()
IRP handler function now, for example.
Now each of the case labels in the IRP function-handling switch
statements in all modules can be re-worked to use this system.
This means less indentation!
Also of note is a change to the bus module to copy the default
mini-stack of IRP handlings from the driver module to any new device.
Shao Miller [Tue, 15 Dec 2009 20:17:45 +0000 (15:17 -0500)]
[irp,driver] Add mini IRP handling stacks
An irp__handling structure esentially matches an irp__handler
function to the IRP major and minor functions it is intended to
handle. Booleans are used for the case where such a handler handles
multiple major and/or minor combinations.
In order to facilitate knowledge of when an Irp has been fully
handled for the driver module, we implement a boolean completion
status parameter. If an irp__handler wants to prevent the Irp
from further processing by the driver Irp dispatch routine, it
should set the completion status to TRUE.
This miniature IRP handling strategy is sitting doing nothing until
routines are ported to use it.
Shao Miller [Tue, 15 Dec 2009 04:21:24 +0000 (23:21 -0500)]
[cosmetics] Remove STDCALL where unneeded
STDCALL should not affect 'foo func(void)' functions. (Functions
taking no parameters.)
Shao Miller [Tue, 15 Dec 2009 03:46:16 +0000 (22:46 -0500)]
[cosmetics] Fix tab-size
All this time the tab-size was set to two spaces. Wrong.
It made things in git look like... Well, gitweb, that is, looked
pretty poor. Better now, I hope.
Shao Miller [Tue, 15 Dec 2009 01:34:34 +0000 (20:34 -0500)]
[bus] Fix AoE unmounting
When we invalidate our bus relations, we are queried for them. Each
of the PDOs that were previously known are dereferenced, so we need to
balance that by referencing each PDO we report before the report is
complete.
This is the fix for item 10 in V.'s readme.txt (I believe).
Shao Miller [Mon, 14 Dec 2009 20:18:40 +0000 (15:18 -0500)]
[protocol] Fix AoE startup
Use NDIS 4.0. Check if we registered the protocol properly.
Startup AoE upon IOCTL_AOE_SCAN.
Shao Miller [Mon, 14 Dec 2009 18:38:36 +0000 (13:38 -0500)]
[driver] Remove bus and disk details from the device extension
The eventual goal is for each module to know what it needs to know
and to delegate module-specific tasks to the appropriate modules.
In working towards this goal, the device extension in driver.h no
longer contains space for bus or disk structures. This involved
major access changes. Where modules used to access the bus/disk
members of the device extension, they now use helper functions to
get a pointer to these structures.
The helper functions get_bus_ptr() and get_disk_ptr() are in the bus
module. This isn't really right, since the bus module should
eventually know nothing about disks. It's a temporary measure.
The bus module has always been responsible for adding child devices
as well as the bus device itself. When adding a device, the bus
module now allocates enough device extension space to include the
driver-common structure as well as the appropriate bus- or disk-
specific structure.
It might be good if other modules inform
the bus module of how much device extension space they need in the
future. This commit does not introduce such logic, but it's an
idea for later.
Shao Miller [Mon, 14 Dec 2009 04:49:57 +0000 (23:49 -0500)]
[bus] Do not include bus.h from driver.h
bus__bus renamed to bus__type. bus.h is included by modules
before they include driver.h, since driver.h needs to know the size
of bus__type.
Shao Miller [Mon, 14 Dec 2009 04:38:29 +0000 (23:38 -0500)]
[disk] Do not include disk.h from driver.h
DISK_DISK renamed to disk__type. disk.h is included by modules
before they include driver.h, since driver.h needs to know the size
of disk__type.
Shao Miller [Mon, 14 Dec 2009 03:45:31 +0000 (22:45 -0500)]
[irp] Introduce IRP header
Moved some IRP specifics out of driver.h.
We have an unfortunate circular dependency where several modules
need to know the driver__dev_ext structure from driver.h, but that
structure also includes structures from irp.h, bus.h, disk.h. These
things need to be shuffled around some more until they're prettier.
Shao Miller [Sun, 13 Dec 2009 23:44:34 +0000 (18:44 -0500)]
[probe] Minor functions renames
Probe_GetSafeHook() renamed to get_safe_hook()
Probe_MemDisk_mBFT() renamed to check_mbft()
Shao Miller [Sun, 13 Dec 2009 23:34:04 +0000 (18:34 -0500)]
[bus,driver,probe] Re-work probe invocation and bus FDO creation
Probe routines had a bus FDO parameters. We only allow for one such
global FDO, so this was silly. The global bus FDO is renamed from
Bus_Globals_Self to bus__fdo. Probe routines simply use it.
The driver code was calling each of the probe routines by name. Now
we call a single routine probe__disks() which itself can call each
probe routine by name.
The bus FDO creation has been modified to work directly with the
bus__fdo global instead of the previous middle-man behaviour.
Hopefully this does not lead to any race conditions.
Shao Miller [Sun, 13 Dec 2009 06:37:12 +0000 (01:37 -0500)]
[bus] BUS_BUS renamed to bus__bus
Shao Miller [Sun, 13 Dec 2009 06:12:41 +0000 (01:12 -0500)]
[cosmetics] indent_add.sh shell script added
This script indents and does 'git add' to specified files.
Shao Miller [Sun, 13 Dec 2009 06:05:26 +0000 (01:05 -0500)]
[probe] Probe_NoInitialize renamed to no_init
Shao Miller [Sun, 13 Dec 2009 06:01:05 +0000 (01:01 -0500)]
[driver] DRIVER_DEVICEEXTENSION renamed to driver__dev_ext
Shao Miller [Sun, 13 Dec 2009 05:38:01 +0000 (00:38 -0500)]
[driver] SEARCHSTATE renamed to driver__search_state
Shao Miller [Sun, 13 Dec 2009 05:18:54 +0000 (00:18 -0500)]
[driver] STATE renamed to driver__state
Shao Miller [Sun, 13 Dec 2009 05:03:31 +0000 (00:03 -0500)]
[headers] Add winvblock__def_enum convenience macro
Not 100% convenient in avoiding writing the same name twice, but
this macro will set up typedefs for an enumerated type that begins
with an underscore.
Shao Miller [Fri, 11 Dec 2009 21:57:05 +0000 (16:57 -0500)]
[headers] BOOLEAN renamed to winvblock__bool
Shao Miller [Fri, 11 Dec 2009 21:47:41 +0000 (16:47 -0500)]
[headers] Type definition convenience macro
Shao Miller [Fri, 11 Dec 2009 21:32:21 +0000 (16:32 -0500)]
[headers] UINT renamed to winvblock__uint32
Not including pxe.asm and pxe.c subdirectories.
Shao Miller [Fri, 11 Dec 2009 21:21:04 +0000 (16:21 -0500)]
[headers] USHORT and UINT16 renamed to winvblock__uint16
Not including pxe.asm and pxe.c subdirectories.
Shao Miller [Fri, 11 Dec 2009 21:09:33 +0000 (16:09 -0500)]
[headers] UINT32 renamed to winvblock__uint32
Not including pxe.asm and pxe.c subdirectories.
Shao Miller [Fri, 11 Dec 2009 21:04:48 +0000 (16:04 -0500)]
[headers] UINT64 renamed to winvblock__uint64
Shao Miller [Fri, 11 Dec 2009 17:47:45 +0000 (12:47 -0500)]
[headers] UCHAR and UINT8 renamed to winvblock__uint8
Not including pxe.asm and pxe.c subdirectories.
Shao Miller [Fri, 11 Dec 2009 17:06:12 +0000 (12:06 -0500)]
[probe] PROBE_GRUB4DOSDRIVEMAPSLOT renamed to grub4dos_drive_mapping
Shao Miller [Fri, 11 Dec 2009 17:01:28 +0000 (12:01 -0500)]
[probe] PROBE_SAFEMBRHOOK renamed to safe_mbr_hook
Shao Miller [Fri, 11 Dec 2009 16:55:15 +0000 (11:55 -0500)]
[probe] PROBE_ABFT renamed to abft
Shao Miller [Fri, 11 Dec 2009 16:50:19 +0000 (11:50 -0500)]
[probe] PROBE_INT_VECTOR renamed to int_vector
Shao Miller [Fri, 11 Dec 2009 16:45:59 +0000 (11:45 -0500)]
[headers] Introduce winvblock header for common material
winvblock.h will help to facilitate code style and abstraction.
Currently, it provides a means to define and typedef structures in code.
Shao Miller [Fri, 11 Dec 2009 15:39:18 +0000 (10:39 -0500)]
[project] Ignore wxDev-Cpp layout file
Shao Miller [Fri, 11 Dec 2009 06:13:39 +0000 (01:13 -0500)]
[probe] Fix GRUB4DOS sector-size detection
GRUB4DOS was just broken by the recent sector-size detection. Fixed.
Shao Miller [Fri, 11 Dec 2009 04:31:52 +0000 (23:31 -0500)]
[version] Version is now 0.0.0.7
Shao Miller [Fri, 11 Dec 2009 04:27:31 +0000 (23:27 -0500)]
[disk] Use the appropriate sector-size
ODDs get a sector-size of 2048 bytes. Others get 512.
Shao Miller [Thu, 10 Dec 2009 06:22:15 +0000 (01:22 -0500)]
[aoedisk] Support optical disc emulation
We should be able to pick up MEMDISK and GRUB4DOS ODDs now.
Floppies are unfortunately detected as removable-storage disks, but
not specifically as floppies.
Shao Miller [Wed, 9 Dec 2009 23:06:23 +0000 (18:06 -0500)]
[probe] Support multiple GRUB4DOS mappings
Walk the "safe hook" chain and for each instance of GRUB4DOS found,
check all 8 possible slots for RAM drive mappings.
Shao Miller [Wed, 9 Dec 2009 08:23:38 +0000 (03:23 -0500)]
[aoedisk] Support multiple RAM disk instances
Give each RAM disk a PnP devnode name based on its physical address.
TODO: Move each disk type's code out of aoedisk.c; A RAM disk is not
an AoE disk.
Shao Miller [Wed, 9 Dec 2009 07:10:01 +0000 (02:10 -0500)]
[probe] Support MEMDISK mBFT and safe hook
The recent mBFT and "safe hook" additions to MEMDISK were added to
facilitate OS drivers being able to find and use MEMDISK instances.
WinVBlock now supports this.
Duplicate PnP devnode names will have to be worked out.
Shao Miller [Mon, 7 Sep 2009 03:27:26 +0000 (23:27 -0400)]
[version] Up version to 0.0.0.2
Shao Miller [Mon, 7 Sep 2009 03:25:40 +0000 (23:25 -0400)]
[registry] Added Michael Brown's registry routines from sanbootconf
Michael Brown's registry manipulation functions in his "sanbootconf"
package for helping MS iSCSI drivers to work with gPXE (especially
for Windows XP, where you need a static IP address) are really quite
handy. This patch adds them, and starts to make use of them.
Unfortunately, I forgot to release a previous bug-fix for a fairly
serious bug, so this commit is functional, but not the end of changes
to registry.c. After upping the version and releasing, changes to
registry.c will continue.
Shao Miller [Wed, 2 Sep 2009 22:23:25 +0000 (18:23 -0400)]
[driver] Add check for DriverEntry() re-entry
We do not really wish to execute DriverEntry() code more than once.
Shao Miller [Wed, 2 Sep 2009 03:58:26 +0000 (23:58 -0400)]
[bus] Bus_Stop() now nullifies global pointer to bus object
Even though we are typically about to unload the driver anyway.
Shao Miller [Wed, 2 Sep 2009 03:22:57 +0000 (23:22 -0400)]
[aoe] Fix BSoD where we stop AoE when not started
Added a missing check in AoE_Stop() to only stop if started.
Shao Miller [Mon, 31 Aug 2009 23:40:34 +0000 (19:40 -0400)]
[diskio,probe] Map memory on each I/O request
Probing code no longer attempts to map the physical memory for the
RAM disk to virtual memory for the driver's access all at once.
Instead, each I/O request will map memory, and only for the size of
the I/O buffer.
Users were running into trouble mapping 1.2 GB images, so I am
hopeful that this helps that situation.
Shao Miller [Mon, 31 Aug 2009 23:00:01 +0000 (19:00 -0400)]
[project] Project is now officially forked as WinVBlock
Information pertaining to WinAoE is still present in various places.
Shao Miller [Thu, 27 Aug 2009 21:39:42 +0000 (17:39 -0400)]
[grub4dos] Initial GRUB4DOS memory-mapped drive support
A little more abstraction, as well as initial support for a single
GRUB4DOS memory-mapped disk.
Shao Miller [Wed, 26 Aug 2009 05:01:23 +0000 (01:01 -0400)]
[abstraction] Rework IRP handlers, move boot-disk probing code
- Changed my mind about IRP handlers; we use an IRPHandler function
type now
- We used to probe for a MEMDISK and/or an AoE target (via aBFT)
in the bus code; we call these functions in probe.c from
DriverEntry() now
- driver.c handles device creation and closing now, and passes on
any other IRPs to the device's particular Dispatch() function.
Currently, there is only a Bus and Disk device type, where Disk
should really be abstracted some more to split AoE from MEMDISK
All of the 'include's are looking really messy right now, but we
_should_ be on our way to being cleaner, where modules should not
need to know so much about other modules.
Shao Miller [Mon, 24 Aug 2009 23:18:51 +0000 (19:18 -0400)]
[abstraction] Several things -- see commit message
- Renamed DEVICEEXTENSION to DRIVER_DEVICEEXTENSION
- Began abstraction of IRP MajorFunction dispatching
- Split away AoE disk parameters from RAM disk parameters
- Removed a couple of compiler warnings
Shao Miller [Sun, 23 Aug 2009 09:19:30 +0000 (05:19 -0400)]
[memdisk] Changes to support MEMDISK as the boot disk
We only do Protocol_Start() now when we add an actual AoE device to the
bus. The bus itself is forced as a reported device. Just tested with
a Windows XP SP2 PE HDD image. Still need some serious abstraction.
Shao Miller [Sat, 22 Aug 2009 01:28:20 +0000 (21:28 -0400)]
[cosmetics] Make mdi.h consistent with previous commit
Shao Miller [Sat, 22 Aug 2009 00:29:58 +0000 (20:29 -0400)]
[cosmetics] Global, function, typedef naming convention
Minor cosmetic changes to globals', functions' and typedefs' names so
that I can more easily identify where things come from. Looks somewhat OO,
but with an underscore instead of :: or . or ->
Module_Globals_SomeGlobal
MODULE_SOMESTRUCT
Module_Function
Most things without a module prefix are going to be locally-scoped vars or
external WinDDK functions and types.
Shao Miller [Thu, 20 Aug 2009 13:43:47 +0000 (09:43 -0400)]
[devel] Minor changes for development convenience
Made a wxDev-Cpp project file and changed a batch file to point to the WinDDK.
Shao Miller [Thu, 20 Aug 2009 13:40:46 +0000 (09:40 -0400)]
[feature] MEMDISK support
The code is extremely hacky, but MEMDISKs can be discovered and used
at boot time now. We check the old real-mode INT 0x13 hook, follow some
bread crumbs to find MEMDISK 3.82, then note the MEMDISK's geometry and
details.
We hack AoERequest() to simply copy memory for the MEMDISK case.
Neither the wacky globals/statics, nor the MEMDISK installation check,
nor the AoE I/O hijacking check are really the right strategy, but reworking
WinAoE has been slow going thus far. The ToDos are becoming more obvious.
It would likely be best to implement classes for an AoE disk and a MEMDISK,
and to split out (abstract) knowledge of AoE specifics from things like
the bus and disk code. This will take time, but would allow for other
classes to eventually be implemented... Things like:
Software RAID
File-backed disks
User-mode back-ends
HTTPDisk (already exists, but reworked to sit on our bus)
Also, regardless of the disk's interface, we should support floppy, HDD,
and ODD (optical disc drive) emulation.
Shao Miller [Mon, 17 Aug 2009 23:23:58 +0000 (19:23 -0400)]
[cosmetics] Changed my mind about indent again
Re-indented all files using the options documented in indent.txt. There is
also a shell script called indent.sh now. Goto labels seem ugly.
Shao Miller [Mon, 17 Aug 2009 22:03:51 +0000 (18:03 -0400)]
[repository] Insert void into empty arguments in function declarations
Shao Miller [Mon, 10 Aug 2009 21:08:03 +0000 (17:08 -0400)]
[cosmetics] Added static and extern qualifiers for variables
As well as static for __divdi3() function.
Shao Miller [Mon, 10 Aug 2009 20:35:05 +0000 (16:35 -0400)]
[cosmetics] Added static and extern qualifiers for functions
Shao Miller [Mon, 10 Aug 2009 19:33:38 +0000 (15:33 -0400)]
[cosmetics] Cosmetic changes, C-style comments, copyright text
Also moved some things into headers.
Shao Miller [Fri, 10 Jul 2009 01:07:39 +0000 (21:07 -0400)]
[driver] Added a commented-out fun test for driver messages
The fun test prints to the Windows boot screen forever.
Shao Miller [Wed, 8 Jul 2009 03:31:08 +0000 (23:31 -0400)]
[debug] Improve DBG() macro
DBG() is a hook which calls xDbgPrint() and then DbgPrint(). The macro
uses the ternary operator to accomplish the hook, and produces a code
path which can never yield false. The compiler should optimize the
resulting code, thus saving any additional cost in space. The hook is
thus accomplished for free. It's a hook in the sense that args from DBG()
are passed through to DbgPrint(), but not before we inject another
function call with unrelated and position-dependent args.
Shao Miller [Tue, 7 Jul 2009 03:10:51 +0000 (23:10 -0400)]
[aoe] Add missing return path for error condition
We had a code path which freed memory but then used it right afterwards.
Shao Miller [Mon, 6 Jul 2009 02:25:50 +0000 (22:25 -0400)]
[debugging] Add missing #include for bus.c, disk.c, driver.c, protocol.c
Shao Miller [Mon, 6 Jul 2009 02:23:46 +0000 (22:23 -0400)]
[registry] Use new debugging message system
Shao Miller [Mon, 6 Jul 2009 02:13:13 +0000 (22:13 -0400)]
[protocol] Use new debugging message system
Shao Miller [Mon, 6 Jul 2009 02:05:07 +0000 (22:05 -0400)]
[driver] Use new debugging message system
Shao Miller [Mon, 6 Jul 2009 02:02:36 +0000 (22:02 -0400)]
[disk] Use new debugging message system
Shao Miller [Mon, 6 Jul 2009 01:55:18 +0000 (21:55 -0400)]
[bus] Use new debugging message system
Shao Miller [Mon, 6 Jul 2009 01:42:46 +0000 (21:42 -0400)]
[debug] Fix debugging message system to actually work
That's right.
Shao Miller [Sun, 5 Jul 2009 22:20:12 +0000 (18:20 -0400)]
[disk] FIXME: Hack to allow compilation with WinDDK 6001.18001
_EIGHT_BYTE and _READ_CAPACITY_DATA_EX are already available in the
WinDDK 6001.18001 Windows 2000 build environment. This is not likely a
permanent solution.
Shao Miller [Sun, 5 Jul 2009 21:24:45 +0000 (17:24 -0400)]
[aoe] Use new debugging message system
aoe.c now uses the new DBG() macro to output debugging messages. File,
function and line number are automatically output.
Shao Miller [Sun, 5 Jul 2009 18:11:25 +0000 (14:11 -0400)]
[debug] Add DBG() and xDbgPrint() debugging message system
Debug messages can now use DBG() instead of DbgPrint(). File, function and
line number will be automatically included in the debugging output message.
Shao Miller [Fri, 3 Jul 2009 13:18:02 +0000 (09:18 -0400)]
[aoe] Modify debugging output
Debugging messages in aoe.c now clearly indicate which file and function they
belong to.
TODO: Change the debugging message system throughout the driver to avoid
redundancy, but to indicate file and function.
Shao Miller [Fri, 3 Jul 2009 12:12:57 +0000 (08:12 -0400)]
[make_system] DOS2UNIX the main Makefile
Shao Miller [Fri, 3 Jul 2009 12:06:14 +0000 (08:06 -0400)]
[aoe] Add some initial comments
Shao Miller [Wed, 1 Jul 2009 17:23:24 +0000 (13:23 -0400)]
[repository] Another spacing style change for C files
Used 'indent -prs -pcs -kr -l79 -ncs' this time.
Shao Miller [Wed, 1 Jul 2009 16:56:14 +0000 (12:56 -0400)]
[repository] Spacing style change to *.h and *.c files
'indent -prs -pcs -kr -i8 -l80 -ncs' command used on all C files.
Command suggested by Joshua Oreman ("rwcr").
Shao Miller [Wed, 1 Jul 2009 16:49:49 +0000 (12:49 -0400)]
[repository] DOS2UNIX all *.h and *.c files
Shao Miller [Mon, 29 Jun 2009 23:20:47 +0000 (19:20 -0400)]
[repository] Add .gitignore file to ignore built items
Built items should not be noticed by git
Shao Miller [Mon, 29 Jun 2009 22:48:21 +0000 (18:48 -0400)]
[repository] Initial population of WinAoE into git repository
Build environment: MSYS (MingW)
Git environment: Cygwin