Commit graph

40213 commits

Author SHA1 Message Date
Sir Richard 1cb5c9f019 [NTOS]: Remove debug spew (but keep Flag macros and fixes which fixed other bugs), thanks Timo.
svn path=/trunk/; revision=45063
2010-01-13 21:56:14 +00:00
Timo Kreuzer a12f63e380 [NTOS]
KiExitV86Mode is supposed to return a pointer to the protected mode KTRAP_FRAME. Instead it was returning the value of TrapFrame->Edi, which would be identical to PmTrapFrame->Ebp, which doesn't have any particular meaning. Fix it by returning PmTrapFrame directly. Fixes 2nd stage boot.

svn path=/trunk/; revision=45062
2010-01-13 21:31:55 +00:00
Daniel Reimer 8e24e6be5e Update the Rapps Entries to up to date Versions.
svn path=/trunk/; revision=45061
2010-01-13 16:48:13 +00:00
Daniel Reimer f142f6802c Bug 5072: PATCH: Add ReMooD to ReactOS Application Downloader. (by GhostlyDeath)
Added a German translation myself.

svn path=/trunk/; revision=45060
2010-01-13 15:46:00 +00:00
Sir Richard de10db923c [NTOS]: Fix some bugs and cleanup V8086 code in regards to flags usage.
[NTOS]: Add VDM debug spew to see why there's now an invalid opcode on Windows builds of VMWare and certain QEmu combinations. (Note: the double fault issue is fixed, this is a new issue).

svn path=/trunk/; revision=45057
2010-01-13 03:43:03 +00:00
Timo Kreuzer 1697ed0f17 Add a dummy PSEH2 for amd64
svn path=/trunk/; revision=45055
2010-01-12 23:15:23 +00:00
Timo Kreuzer 40a5eb2996 Enable a few definitions for amd64, too
svn path=/trunk/; revision=45054
2010-01-12 20:30:43 +00:00
Sir Richard 68ca27a00d Patch that fixes VMWare boot (and should fix QEMu/KVM boot on the testbot):
[NTOS]: A trap can get us into a state where DS/ES are invalid, making any pointer dereference (on DS/ES segmented memory, not SS, the stack) crash (and probably double-fault). Therefore, we have to be careful to switch to a good DS/ES before touching the TrapFrame pointer, which we don't have in ESP like the ASM code, but in a DS/ES-segmented register. For V8086 traps we can switch to the good DS/ES immediately, but for other kinds of traps, we actually need to save the current (bad) segments first. So we save them on the stack now, then switch to the good ones, then store the stack values into the trap frame. This is what happens on a non-optimized (-O0) build. On an optimized build, the segments will end up in registers instead, which is fine too (they'll be direct values). The order of instructions is guaranteed since the segment macros are volatile.
[NTOS]: The GPF and Invalid Opcode handlers are performance critical when talking about V8086 traps, because they control the main flow of execution during that mode (GPFs will be issued for any privileged instruction we need to emulate, and invalid opcode might be generated for BOPs). Because of this, we employ a fast entry/exit macro into V8086 mode since we can make certain assumptions. We detect, and use, such scenarios when the V8086 flag is enabled in EFLAGS. However, because we can land in a GPF handler with an invalid DS/ES, as some V8086 code could trample this during BIOS calls for example, we must make sure that we are on a valid DS/ES before dereferencing any pointer. We fixup DS/ES either in KiEnterTrap (for normal entry/exit) or, for V86, in KiEnterV86Trap. Notice the problem: we need to detect which of these to use early on but we can't touch the EFLAGS in the frame because DS/ES could be invalid. Thankfully SS is always guaranteed valid, so stack dereferences are game! We therefore read the EFLAGS here, in assembly, where we can touch ESP as we please. We save this in EDX, which will be used as the second argument for the FASTCALL C trap entry. When we make the fast V86 check, we use the parameter instead of the trap frame, leading us to using the correct trap entry function, which fixes up DS/ES and lets us go on our merry way...
[NTOS]: Make appropriate changes to GENERATE_TRAP_HANDLERS macro.
[NTOS]: Switch to using well-known NT trap handler names (hex-based, double-zeroed) instead of decimal-based trap handler names which are confusing.
[NTOS]: Clean up some debug spew.

svn path=/trunk/; revision=45052
2010-01-12 05:50:45 +00:00
James Tabor 66c33fe237 [Win32k]
- More movement to WND with updates to related files. Removed unused code rewritten others. Review patch.

svn path=/trunk/; revision=45051
2010-01-12 05:25:22 +00:00
Sir Richard 1f21afc098 [NTOS]: Bring back a simplified GPF handler just for V8086 opcode detection and V8086 exit, to see if this resolves testbot booting.
svn path=/trunk/; revision=45048
2010-01-11 19:41:50 +00:00
Sir Richard 0feb759f62 [NTOS]: Switch to a slightly (perhaps, hopefully?) safer version of V86 entry/exit to see if this fixes the buildbot boot (suffice it to say, the original code works fine on my test machine, but since half the developers seem to be using GCC 4.4 and the others GCC 4.1, I wouldn't be surprised if there's compiler subtleties involved).
svn path=/trunk/; revision=45046
2010-01-11 18:26:46 +00:00
Sir Richard f81a3c4918 Trap Handlers in C Patch 9 of 12:
[NTOS]: Fix a logic bug in KiExitTrap: Always only restore segments if we came from user-mode (since they might be bogus on a kernel transition as they're not always saved), even if the caller wants segment restore.
    [NTOS]: Small perf boot: do a JMP, not a CALL into C handling code.
    [NTOS]: Make KiGetTickCount/KiCallbackReturn handled in C (as stubs).
    [NTOS]: Implement KeSynchronizeExecution in C. Move Kei386SpinOnSpinLock to C stub.
    [NTOS]: Implement overall architecture for handling hardware interrupts in C. Not used yet, since it needs C code in HAL.

svn path=/trunk/; revision=45045
2010-01-11 17:44:09 +00:00
Michael Martin 166f26af89 [usb/usbehci]
- EhciDefferedRoutine: Fix late night brain fart by filling the members of the WorkItemData before queuing the work item.

svn path=/trunk/; revision=45043
2010-01-11 08:36:12 +00:00
James Tabor 24533102e6 [Win32k]
- More movement to WND with updates to related files. Added new scroll and get/post message routines. In the mix we did moved to the MONITOR structure.

svn path=/trunk/; revision=45042
2010-01-11 07:36:48 +00:00
Sir Richard 9da88c7fda [NTOS]: Put ASM macros back since the HAL also uses them.
svn path=/trunk/; revision=45041
2010-01-11 06:41:19 +00:00
Sir Richard 2efed8ef89 Trap Handlers in C Patch 8 of X:
[NTOS]: Implement KiCoprocessorError in C.
   [NTOS]: Make NMI handler fully C, now that the other parts are C too.
   [NTOS]: Delete more ASM macros and code that are now unused.

svn path=/trunk/; revision=45040
2010-01-11 06:08:11 +00:00
Steven Edwards 2eab477b33 my once a year commit, update email address
svn path=/trunk/; revision=45039
2010-01-11 05:58:59 +00:00
Sir Richard 0fc870d7d9 Trap handlers in C patch 7 of X:
[NTOS]: Implement GPF handler (trap 13) in C. This was by far the most complex one of them, since it also servces two complex purposes: to handle V86 emulation since the real-mode code will generate GPFs during privileged instructions, and it will detect an illegal IRET, check if it's the known V8086 Exit IRET, and then jump to V86 exit code.
    [NTOS]: Get rid of even more V8086 assembly since the GPF handler is now C. Deleted the entire V8086 assembly file.
    [NTOS]: Get rid of a bunch of helper ASM functions that nobody is using anymore since almost all the trap handlers are in C.

svn path=/trunk/; revision=45038
2010-01-11 05:53:57 +00:00
Sir Richard 38de4a0a1c [NTOS]: Rewrite BIOS Call (V8086) Entry/Exit routines in C. Only 4 lines of ASM stub remain. This wasn't fun... the stack dancing alone gives you headaches. Who ever thought of dynamically sized trap frames!
svn path=/trunk/; revision=45037
2010-01-11 03:47:17 +00:00
Matthias Kupfer 2741b8149a - fixes issue with cancel button
- fixes problems with unattended mode
- temporarily enable device listing (setupapi)

svn path=/trunk/; revision=45036
2010-01-10 23:22:01 +00:00
Matthias Kupfer 36ecaaeee0 -set fix line endings to preserve windows line endings
svn path=/trunk/; revision=45035
2010-01-10 20:43:27 +00:00
James Tabor 88855c3acd [Win32k]
- When locking and unlocking regions, no need to use probe to check attribute space first before read or write access. The exception handling is a feature.

svn path=/trunk/; revision=45034
2010-01-10 19:06:07 +00:00
James Tabor 30dc8768b1 - Update credits.
svn path=/trunk/; revision=45033
2010-01-10 18:52:17 +00:00
Sylvain Petreolle 8ced7ca170 unbreak build
svn path=/trunk/; revision=45032
2010-01-10 17:50:50 +00:00
Sir Richard 15b66143d6 [NTOS]: Implement all V8086 Opcode emulation in C instead of ASM.
svn path=/trunk/; revision=45029
2010-01-10 15:40:00 +00:00
Sir Richard ff8920ffc1 [NTOS]: Simplify trap exit code.
[NTOS]: Move some stuff in appropriate headers.
[NTOS]: Write V86 fast entry/exit traps, needed for later.

svn path=/trunk/; revision=45028
2010-01-10 15:00:44 +00:00
Sir Richard f61b9c9113 [NTOS]: Implement KiAdjustEsp0 in C.
[NTOS]: Temporarily remove FPU save/restore instructions since they seem to be smashing the stack and breaking boot.

svn path=/trunk/; revision=45027
2010-01-10 14:32:19 +00:00
Matthias Kupfer 1ab6f5ad16 - fixes damaged format of comment
svn path=/trunk/; revision=45026
2010-01-10 13:54:14 +00:00
Matthias Kupfer 5682230cf2 - Fixes a hidden pointer/reference problem with LoadGenentry function, which causes the crash at this point
svn path=/trunk/; revision=45025
2010-01-10 13:38:46 +00:00
Michael Martin 433baa7b5e [usb/usbehci]
- Fix WorkItem Context to pass in Device Extension and the IoWorkItem so it may be freed.

svn path=/trunk/; revision=45024
2010-01-10 12:24:01 +00:00
Michael Martin 72ed9b6854 [usb/usbehci]
- DeviceArrivalWorkItem: Check the device object returned from IoGetAttachedDeviceReference. if its the PDO, deref and return.
- Pass upper attached device object pointer to the completion routine.
- ArrivalNotificationCompletion: Dereference the upper attached device object before returning.

svn path=/trunk/; revision=45023
2010-01-10 11:08:51 +00:00
Michael Martin f579412d32 [usb/usbehci]
- StartDevice: Remove ASSERT for unhanded resource types. 
- Add case for CmResourceTypeDevicePrivate, and do nothing for it for now, will fix later if needed.
- Fixes crash on windows.

svn path=/trunk/; revision=45022
2010-01-10 09:03:53 +00:00
James Tabor 3d60e751ce [Win32k]
- Removed NtUserGetScrollInfo and replaced it, move more type names in window object to WND.

svn path=/trunk/; revision=45021
2010-01-10 07:50:57 +00:00
Eric Kohl ba16f69763 Removed outdated email addresses.
svn path=/trunk/; revision=45020
2010-01-09 22:43:16 +00:00
Eric Kohl b4f5a3e1a1 Reverted some coding-style changes as per Alekseys request.
svn path=/trunk/; revision=45019
2010-01-09 21:57:00 +00:00
Eric Kohl 1145a26d92 Fix indentation and coding style. No code changes.
svn path=/trunk/; revision=45018
2010-01-09 20:51:33 +00:00
Michael Martin ce0ab52c93 [usb/usbehci]
- Added numerous structures required for Asynchronous Lists used to communicate with controller. Needs much more work.
- Implement initial retrieving Device and String Descriptors from USB devices.
- Fixed improper handling of Queued IRPs that was causing crashes.
- For now, always queue the Irp if the request is a Urb of type Get Descriptor.
- Reorganized code to trim down source files.

svn path=/trunk/; revision=45017
2010-01-09 19:28:29 +00:00
Sir Richard f1e6ecbc60 Trap handlers in C patch 6 of X:
[NTOS]: Implement Trap 7 and 16 in C. These are the last two FPU/NPX traps. Not really good with x86 FPU stuff, so there might be some mistakes to look over later.
    [NTOS]: Fixed a bug in Trap 19 handler (forgot to write CR0 back).

svn path=/trunk/; revision=45014
2010-01-09 15:07:44 +00:00
James Tabor 1b346fdad3 [User32]
- Add corrected behavior for SetWindowRgn, delete region object after setting windows region. See bug 4980.
- After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle. In particular, do not delete this region handle. The system deletes the region handle when it no longer needed.
- References : http://msdn.microsoft.com/en-us/library/dd145102(VS.85).aspx

svn path=/trunk/; revision=45013
2010-01-09 06:16:51 +00:00
Martin Fuchs 34689ba8c7 avoid warning messages on Explorer startup when missing configuration files
svn path=/trunk/; revision=45011
2010-01-08 21:51:43 +00:00
Sir Richard 8d89e2b027 Trap handlers in C Patch 5 of X:
[NDK]:  Add FSW defines for FPU exception bits.
    [NTOS]: Convert trap 19 (XMMI exception) to C.

svn path=/trunk/; revision=45010
2010-01-08 19:24:10 +00:00
Sir Richard 733c152673 Trap handlers in C Patch 4 of X:
[NTOS]: Implement trap 6 (invalid opcode) in C.

svn path=/trunk/; revision=45008
2010-01-08 18:45:04 +00:00
Sir Richard 8323208ddf Trap Handlers in C Patch 3 of X (Patch by Sir_Richard <ros.arm@reactos.org>):
[NTOS]: Fix a bug in the assertion handler.
    [NTOS]: Implement page fault trap (14) in C instead of ASM.
    [NTOS]: Implement V8086 trap entry/exit, we were hitting these during page faults in Ke386CallBios for video reset during GUI boot.

svn path=/trunk/; revision=45005
2010-01-08 18:21:47 +00:00
Kamil Hornicek b308ece644 - fix build, spotted by Stefan
svn path=/trunk/; revision=45003
2010-01-08 16:06:33 +00:00
ReactOS Portable Systems Group 0940d6e34a Trap Handlers in C Patch 2 of X (Patch by Sir_Richard <ros.arm@reactos.org>):
[NTOS]: Convert Trap 0, 1, 3, 4, 5, 8, 10, 11, 12, 15, 17, 2C (Assertion) and 2D (Debug) to C. Tested INT3 and still works as expected, and obviously DbgPrint is still functionning (0x2D). The other traps are mainly programming errors such as bound overflow or integer overflow, so we need some test cases, but they should work. Note the 3-4 lines of C for what used to be dozens of ASM lines.
    [NTOS]: Fix infinite loop in KiCheckForApcDelivery.

Stefan Ginsberg: Could you please implement the relevant Extended GCC ASM into MSVC?
   

svn path=/trunk/; revision=45002
2010-01-08 15:16:00 +00:00
Martin Fuchs 34ad648d58 define _tcscpy_s and _tsplitpath_s again for native VC++ builds
svn path=/trunk/; revision=45001
2010-01-08 15:10:50 +00:00
ReactOS Portable Systems Group ba415f6e7b Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm@reactos.org>):
[NTOS]: The kernel normally does not save FPU state during Ring 0 transitions since the FPU should not be used. The one exception is when a kernel debugger is attached. Unfortunately, the latter check in ReactOS results in even "print on the serial line" to count as "debugger attached", and thus FPU state was almost always saved, slowing down traps significantly.
    [NTOS]: The kernel also does not typically save DRx (debug) registers unless they were in use. During an exception dispatch, they are zeroed out, and later during trap exit, if any debug register is set, DR7 is updated to enable that hardware breakpoint. Unfortunately, the code to clear the debug registers had a bug: DR2 was never cleared. Because DR2 ended up being a random stack value during trap frame generation, this caused a bogus address to be added to DR2, and DR7 would then enable the 2nd hardware breakpoint. This caused the kernel to always save DRx state, which is slow, and worse, could cause random hardware breakpoints to fire.
    [NTOS]: Start implementing trap handling in C. ASM trap handlers will now only be 5 lines of assembly including a function call to a C handler. All C handling code uses maximum two arguments and is all FASTCALL for efficiency.
    [NTOS]: Implement C versions of TRAP_PROLOG and TRAP_EPILOG. Implement C version of Ki386EoiHelper. Implement C version of CommonDispatchException (and helper) and KiFatalSystemException. Implement C version of CHECK_FOR_APC_DELIVER. Implement trap debugging checks as a separate entity instead of always doing them.
    [NTOS]: Add missing intrinsics for DS/ES/GS segment query.

The kernel is now ready for some trap handling to be done in C. Due to the FPU/Debug fixes and relaxation of paranoid debug checks, the C code will likely be faster than the original assembly.

svn path=/trunk/; revision=45000
2010-01-08 15:04:19 +00:00
Martin Fuchs 873a68e758 temporarily revert to query "defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER)"
svn path=/trunk/; revision=44999
2010-01-08 14:48:22 +00:00
Martin Fuchs e09bb852c0 update XMLStorage to 2010 version
svn path=/trunk/; revision=44998
2010-01-08 13:59:15 +00:00
Martin Fuchs 449aa18843 fix TCHAR array initialization
svn path=/trunk/; revision=44996
2010-01-08 13:19:48 +00:00