- Implement Bus and I/O space read and write support.
- Implement support for AUTOENABLE, DISABLE and NOUMEX subparameters to /debug. Add the missing string scan and set and respect the related globals properly. Add support for disabling the debugger and suspending breakpoints.
- Add and implement KdIsThisAKdTrap to determine if the kernel debugger can't ignore a particular trap -- returns true for software breakpoints and debug service calls (DbgPrint for example). Called from KiDispatchException to determine whether to override NOUMEX (otherwise, DbgPrint and friends will kill user mode applications). Stub this for KDBG as it implements its own scheme for ignoring user mode.
- KiDispatchException: Clean up some goto and support NOUMEX. Also don't check if KiDebugRoutine is NULL -- it will never be.
- KdEnableDebuggerWithLock should initialize the debugger even if KdDisableCount is 0 (but only if called internally) as this means that the debugger was never initialized in the first place. Required for AUTOENABLE and for enabling the debugger during a bugcheck. Add the globals to kdbg too but don't set or respect them there as kdbg does not support it.
- Enable KdEnableDebugger and implement KdDisableDebugger for KD as KdDisableDebuggerWithLock is now implemented.
- Only build kdmemsup.c if KDBG is defined.
svn path=/trunk/; revision=43530
- Implement FatiOpenExistingFcb.
- Make FatGetFcbUnicodeName supporting DCBs.
- Implement FF_OpenW wrapper around FullFAT to support opening files/dirs using a unicode name.
svn path=/trunk/; revision=43528
- Add a function to read the dirent and return status of that object - does it exist, is it a file or a directory.
- Branch according to this in FatiCreate and try to open either an existing file or an existing directory. Directory open is stubbed.
svn path=/trunk/; revision=43513
- Paged pool PTEs are demand zero PTEs while the memory hasn't been accessed -- this is the only type of fault supported.
- Because paged pool PDEs are also demand-paged, added code to handle demand paging of PDEs as well.
- Also, because paged pool is non-resident, but can be accessed from any process, we need a mechanism to sync up the kernel's page directory with the per-process one, on demand. This is done at startup, but other processes may have paged in paged pool that another process knows nothing about when he faults.
- Similar to the hack ReactOS Mm uses, but done properly.
- This is what that shadow system page directory is finally being used for.
- Assert if we get a user-mode fault, a transition fault, or a soft fault, since these shouldn't happen.
- Disable APCs while dispatching faults, and pseudo-use the working set lock.
- Assert if we get write errors on read-only pages, since we don't use those in ARM3 yet.
- Assert if we have a paged out PTE, this shouldn't happen yet.
- Enable test to see if we can touch a paged pool allocation.
svn path=/trunk/; revision=43507
- Allocation does not support paged pool expansion yet, so we're limited to the initial 4MB that are initialized on startup.
- This only tests the raw page allocation routines so touching memory will fail as we don't handle paged pool faults yet.
- Nothing excercises this code path other than some simple tests while booting.
svn path=/trunk/; revision=43503
- Fix reading the incorrect pool type when freeing pool. The PoolType in the entry is offset by 1, so it can be either 1 for NonPaged or 2 for paged. This used to give us index 0 for nonpaged (correct), and index -1 for paged (oops!). Mask by 3 instead, so we get 0 and 1.
svn path=/trunk/; revision=43489
- Check for ARM3-owned memory areas during a page fault, and crash the system as this shouldn't happen yet.
- Use portable PTE macro instead of setting the owner bit directly, fixing an ARM port build issue.
svn path=/trunk/; revision=43488
- Remove overflow failure case, this isn't checked for string validation
- Adapt page check to let the full string be checked in case of overflow
See issue #4861 for more details.
svn path=/trunk/; revision=43487
- Add a new memory area type: MEMORY_AREA_OWNED_BY_ARM3. This will allow us to instruct the ReactOS Memory MAnager to "Back. The Fuck. Off." during page faults and such, so we can handle page faults inside ARM3-owned PTEs ourselves.
- Right now, all ARM3 PTEs and data is nonpaged, so no page faults should happen, but this may change in the future.
- Also will allow us to manage our own PDEs so we can do on-demand inpage instead of syncing with the ReactOS Mm hack cache.
- Create all memory areas in one shot in MmCreateSystemMemoryAreas (get rid of MiInitPageDirectoryMap and MiInitPagedPool memory area creation).
- Mark all of ours as owned by ARM3.
- Make them all static.
- The only non-ARM3 one right now is paged pool, we own all the other static areas.
- Move this code into mm, instead of mm/ARM3, since memory areas are not an ARM3 concept.
- Also create memory areas for session space, session view, and other ARM3 memory ranges, so nobody touches those ranges.
- Dump the kernel address space after all this is done, in a MmDbg function in mm.
- This cleans up ARM3 of some ROS-specific code, and also collapses Phase 1 and 2 into a single phase.
svn path=/trunk/; revision=43486
- Initialize PreviousStackBase/Limit to NULL in BasepCreateStack. Previously this bug was hidden because those values were ignored by the kernel.
svn path=/trunk/; revision=43485
- Initialize the paged pool guarded mutex.
- Add helper routines ExLock/UnlockPool to either acquire the NPP QSL or the PP GM depending on the pool descriptor, instead of hardcoding the NPP QSL.
- Implement InitializePool for the PagedPool case.
- Now call InitializePool for PagedPool as well.
svn path=/trunk/; revision=43482
- Add ARM3/mmsup.c for miscellaneous function helper functions.
- Implemented:
- Move MmIsRecursiveIoFault, MmIsThisanNtAsSystem and MmQuerySystemSize. These belong here.
- Unimplemented:
- Move MmSetBankedSection and fix the prototype. This should probably go somewhere else later.
- Move MmAdjustWorkingSetSize and fix the prototype. This should probably go in procsup.c later.
- Move MmMapUserAddressesToPage. This should also probably go in procsup.c later.
- Move MmSetAddressrangeModified and MmIsNonPagedsystemAddressValid. These should probably go somewhere else later.
svn path=/trunk/; revision=43481
- MiDoMappedcopy: The MDL should have 16 pages total, so MI_MAPPED_COPY_PAGES should be 14, not 16, to account for the MDL page itself, and the extra add-on page.
- MiDoMappedCopy: Check for working set quota exception.
- NtRead/WriteVirtualMemory: Do not attempt to do any work if the size is 0.
- NtRead/WriteVirtualMemory: Do not return SEH status if we fail to write the number of bytes read/written -- return the function status.
- NtProtectVirtualMemory: Protect the memory while attached to the target process.
- NtProtectVirtualMemory: Do not return SEH status if we fail to write the number of bytes protected -- return the function status.
- NtLock/UnlockVirtualMemory: Fix incorrect function definition. The last parameter is a bitfield. The middle two parameters are pointers, not values.
- VirtualLock/Unlock: Fix calling NtLock/UnlockVirtualMemory with new correct function definitions. Call with MAP_PROCESS.
- NtLock/UnlockVirtualMemory: Apply SEH. Validate flags. Validate parameters.
- NtLock/UnlockVirtualMemory: Attach to the process while doing the operation. Reference the process.
- NtLock/UnlockVirtualMemory: Check for SE_LOCK_MEMORY_PRIVILEGE if MAP_SYSTEM is specified.
- Move MAP_SYSTEM and MAP_PROCESS from ntifs.h to mmtypes.h in NDK.
- NtLock/UnlockVirtualMemory: Return success and semi-legitimate return values saying nothing was actually done.
- NtFlushVirtualMemory: Apply SEH. Validate flags. Validate parameters. Call MmFlushVirtualMemory.
- NtFlushVirtualMemory: Reference the process.
- NtFlushVirtualMemory: Return success and semi-legitimate return values indicating nothing was flushed.
- NtGetWriteWatch: Fix function prototype.
- NtGet/ResetWriteWatch: Apply SEH instead of hacked parameter checks. Validate parameters.
- NtGet/ResetWriteWatch: Reference the process.
- NtGet/ResetWriteWatch: Return semi-legitimate return values indicating nothing was written to.
- These APIs are now owned by ARM3.
svn path=/trunk/; revision=43480
- Add a helper function for reading (mapping) volume's stream file object.
- Read a boot sector during volume mounting, unpack it and store values in Vcb->Bpb for later usage. In particular, a volume's serial number being empty problem is fixed now. Volume label is still empty.
- Silence more non-important debug prints.
svn path=/trunk/; revision=43477
- Set up PEB and TEB under SEH to handle possible paging errors (which are legitimate).
- Also touch the image under SEH to handle image paging errors (also legitimate).
- Should avoid kernel panics in cases where the executable is damaged, invalid, or impossible to page in.
- Initialize more PEB fields.
- Add new INITIAL_PEB structure to support fork() in the future. Also fixes the fact we don't create a PEB for the system process anymore.
- Create PEB while attached to the process.
- Handle UP-only images, and set correct affinity mask in the PEB.
- Set session ID instead of session structure (currently zero).
- Set correct TIB version in the TEB. Due to a historical oddity, the NT TIB identifies itself as '0x1e00', which is 30 shifted 8 bits. 30 is the version identifier of OS/2 3.0, the original 32-bit target of the Windows NT effort.
- Handle initial TEB correctly for fork().
- Move AWE APIs to procsup.c instea of section.c since they are unrelated.
- Move the rewritten PEB/TEB functions to ARM3's procsup.c.
svn path=/trunk/; revision=43476