Commit graph

22051 commits

Author SHA1 Message Date
Alex Ionescu
b23894894d - Get rid of some code.
svn path=/trunk/; revision=23699
2006-08-25 02:22:50 +00:00
Alex Ionescu
35778c9f25 - If SeCaptureSubjectContextEx is called without a process, at least NULL-initialize the context to catch dereferences of invalid pointers.
svn path=/trunk/; revision=23698
2006-08-25 01:04:44 +00:00
Alex Ionescu
7d305ec8e6 - Fix compiling/linking problems.
- Remove KrnlFun entry - IRQs are now done through a typical NT/ROS trap frame and are synchronized and compatible with trap.S.
- Enable 2nd entry interrupt calls in HalBeginSystemInterrupt, since IRQs now use the right trap frame.

svn path=/trunk/; revision=23697
2006-08-25 00:46:41 +00:00
Ged Murphy
31cc308502 add an 'uptime' command.
Available in either Windows or Linux output. (defaulted to Windows)

svn path=/trunk/; revision=23696
2006-08-25 00:33:27 +00:00
Alex Ionescu
425592dd06 - The last piece of the puzzle: we had to initialize the IDR in HalInitProcessor to set it to the default of 0xFFFFFFB so that we don't get IRQ 0 and IRQ 1 until we're ready to handle them, which was causing the clock interrupt to be called too early.
- Remove irqhand.S and all other remaining pieces of deprecated code.

svn path=/trunk/; revision=23695
2006-08-25 00:30:26 +00:00
Alex Ionescu
5d9935a1fa - Got rid of the deprecated stuff left in irq.c and directly implemented it as part of irqhand.S (which is also deprecated).
- Cleaned up irq.c. Fixed file header, function prototypes, includes, etc, and moved general definitions and externs to ke.h

svn path=/trunk/; revision=23694
2006-08-24 23:25:37 +00:00
Johannes Anderwald
52f5a2cccc * handle PSN_APPLY effectively
* remove no longer used callback
* reenable PropSheet_Changed macros
* fix styles for dialog

svn path=/trunk/; revision=23693
2006-08-24 20:55:13 +00:00
Alex Ionescu
fe2d752e93 - Fix some bugs in clock.S
- Enable clock.S versions of KeUpdateSystem/RunTime and export them properly.
- Enable systimer.S to call into kernel's KeUpdateSystemTime.
- Enable Hal's Clock Interrupt during Phase 1.
- Remove most of the code that was still left in irq.c
- Only one large problem remains now, which is the spurious firing of the clock interrupt before we're ready to handle it... I will try to fix this today.

svn path=/trunk/; revision=23692
2006-08-24 19:17:14 +00:00
Andrew Munger
d43585136b DBG=0 fixes, patch by Physicus.
svn path=/trunk/; revision=23691
2006-08-24 18:48:15 +00:00
Christoph von Wittich
3dd85ba73d some more msvc warning fixes
svn path=/trunk/; revision=23690
2006-08-24 17:23:07 +00:00
Hervé Poussineau
cd01646b34 Fix all warnings detected by gcc 4.2
Patch by Thomas Weidenmueller

svn path=/trunk/; revision=23689
2006-08-24 16:58:12 +00:00
Christoph von Wittich
0c186af160 fixed some warnings (patch by w3seek)
svn path=/trunk/; revision=23688
2006-08-24 16:39:14 +00:00
Hervé Poussineau
71391c6a4f Build usbdriver without warning, at least with gcc 3.4.2
svn path=/trunk/; revision=23687
2006-08-24 16:21:16 +00:00
Christoph von Wittich
6db46bea8e fixed some warnings
svn path=/trunk/; revision=23686
2006-08-24 16:06:12 +00:00
Aleksey Bragin
342cd42b44 Fix a lot of annoying warnings, leaving basically only ehci.c and gendrv.c as big warnings providers
svn path=/trunk/; revision=23685
2006-08-24 12:58:52 +00:00
Aleksey Bragin
2036235837 Dmitry Philippov: Implement SmProcessFileRenameList()
svn path=/trunk/; revision=23684
2006-08-24 11:06:48 +00:00
Aleksey Bragin
1b82756b34 Temporary fix a call to KeUpdateSystemTime(), passing third CLOCK_INCREMENT's value (100000) as third param.
svn path=/trunk/; revision=23683
2006-08-24 09:32:32 +00:00
Aleksey Bragin
be7b345087 Fix compiling
svn path=/trunk/; revision=23682
2006-08-24 09:01:22 +00:00
Alex Ionescu
721fa0869e - Add more missing offsets to asm.h (as always, taken from ks386.inc)
- Fix incorrect KPCR_PRCB_DPC_ROUTINE_ACTIVE which was totally wrong (And could've caused a crash in the context swicher)
- Also fix the definition of KRCB which was off-by-4 after about offset ~0x500. It wasn't causing problems because assembly code only used < 0x500.
- Write the ASM implementation of KeUpdateRunTime (not used yet).

svn path=/trunk/; revision=23681
2006-08-24 07:48:50 +00:00
Alex Ionescu
065837f112 - Make KeUpdateSystemTime independent, so that it returns and exits from the current ROSterrupt by itself.
- Make KeUpdateRunTime increase the interrupt count, check for V86 as well as for user-mode by using the CS and EFLAGS (isntead of PreviousMode), also only request DPCs if DpcInterruptRequested isn't already set, and only perform Quantum End if this isn't the idle thread.
- Add clock.S which will have the clock interrupt handlers of the kernel (UpdateSystemTime and UpdateRunTime) and ultimately replace the only reason irqhand.S is still around (the clock interrupt). Implement the current version of KeUpdateSystemTime in assembly, with stack optimizations since we'll be called from the HAL later.

svn path=/trunk/; revision=23680
2006-08-24 06:52:33 +00:00
Alex Ionescu
5e7ef1d665 - Update KeUpdateSystemTime to use variable increments.
- Update KeTickCount properly instead of an ugly timecast hack.
- Also update UserSharedData->TickCount.
- Get rid of KiRawTicks.
- Properly update KiTickOffset at the end.

svn path=/trunk/; revision=23679
2006-08-24 06:27:29 +00:00
Alex Ionescu
8b82c0d641 - Write a basic Clock Interrupt handler in the HAL (doesn't deal with changing increments yet, just like current ROS). It will call KeUpdateSystemTime once ready.
- Implement KeDisconnectInterrupt with the new implementation.
- Put Clock Interrupt initialization in the right place (might still be too late: must investigate more).
- Added a debug print when unexpected interrupts are called, just noticed this happens on my checked machine, and it's a useful tracing tool.

svn path=/trunk/; revision=23678
2006-08-24 05:36:50 +00:00
Alex Ionescu
15899302f6 - Completely re-implement IRQ support (KeInitialize/Connect/Disconnect) interrupt using the same model as NT. Implementation was done by analyzing various of my systems at runtime with WinDBG and tracing through some of the code and dumping relevant objects.
- Uses new code added to trap.s for generic dispatching, as well as the NT implementation which copies a "template" into the ->DispatchCode array of every KINTERRUPT object.
- Also adds support for chained interrupts, but this hasn't been tested yet. Floating interrupts are not supported on NT it seems, so I haven't implemented those at all.
- KiDisableInterrupt not yet re-implemented, and timer code is still piggybacked on the old implementation.

svn path=/trunk/; revision=23677
2006-08-24 02:53:40 +00:00
Alex Ionescu
c8c71fcd5c - Implement Chained and Normal generic interrupt handlers.
- Make generated handlers have a proper .func symbol for symbol data.
- Make IDT writable, the page shouldn't be read-only.
- Change some symbol names.

svn path=/trunk/; revision=23676
2006-08-24 01:53:54 +00:00
Aleksey Bragin
b899ba11ba - Add a new level of debug verbosity
- Fix a bunch of warnings by Thomas and me

svn path=/trunk/; revision=23675
2006-08-23 22:17:09 +00:00
Alex Ionescu
5870fa3d6c - Enable the code in KeInitializeInterrupt that copies the Interrupt Template to the KINTERRUPT object and modifies the template pointer to point to the KINTERRUPT.
- Add the template code in trap.s.

svn path=/trunk/; revision=23674
2006-08-23 19:02:00 +00:00
Alex Ionescu
abe9e92dcf - Get rid of some large debugging functions that were called at all times, and don't manually deliver user APCs anymore, since the HAL handles it now.
svn path=/trunk/; revision=23673
2006-08-23 18:09:44 +00:00
Alex Ionescu
da725d9d30 - Fix some bugs in INT_PROLOG so that it can be used in cases like Unexepcted interrupts, where we don't want to push a fake error code, and want to use our own parameter.
svn path=/trunk/; revision=23672
2006-08-23 18:02:52 +00:00
Hervé Poussineau
daedfda3d4 Allow to change more easily the prefix of remote interface functions in services.exe
This is a step to share this file with Samba-TNG
Thanks to Elrond from Samba-TNG for help

svn path=/trunk/; revision=23671
2006-08-23 17:57:34 +00:00
Alex Ionescu
c0ad9f32d3 - [AUDIT] After spending some time looking at the current HAL, I believe it to be clean and written by authors which had knowledge of system internals and have always used clean-rooming. As well, the difference in implementation, complete and utter incompatibility with NT as well as the presence of some Linux-based code confirms this.
- Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way, and since the HAL didn't include its own NDK file, the compiler didn't realize this. Calls of these functions might've experienced serious problems.
- Also fix HalHandleNmi and HalInitSystem definitions.
- Add stub code to actually setup the Clock Interrupt.

svn path=/trunk/; revision=23670
2006-08-23 17:28:39 +00:00
Alex Ionescu
8401f43ab0 - Switch PRIMARY_VECTOR_BASE to 0x30 instead of 0x40, as it should be.
svn path=/trunk/; revision=23669
2006-08-23 16:58:43 +00:00
Aleksey Bragin
7ad1947410 - Unmess header files a little - create one header file (usbdriver.h) which includes all other needed headers, also splitting a bit.
Also split out the roothub driver and device manager from hub.c (which was over 4500 SLOC)
- Enable PCH usage
- Reduced a few warnings

svn path=/trunk/; revision=23668
2006-08-23 12:36:08 +00:00
Aleksey Bragin
edaf50a0e7 Add accidentally deleted line (a call to WideCharToMultiByte() )
svn path=/trunk/; revision=23667
2006-08-23 08:24:37 +00:00
Alex Ionescu
4ade91ae66 - Kill two more hacks. IDR isn't hacked at 0xFFFFFFA on startup anymore, and the PIC is correctly set to 0xFA at startup.
svn path=/trunk/; revision=23666
2006-08-23 06:59:11 +00:00
Alex Ionescu
7fa6c080b5 - Enable 2nd entry for HalEndSystemInterrupt but not actually using the optimized 2nd entry since ROS IRQs are currently built with a completely different trap frame.
svn path=/trunk/; revision=23665
2006-08-23 06:51:54 +00:00
Alex Ionescu
9ac4b05366 - Fix some IDR->IRR bugs.
- Enable 2ndEntry for HalpEndSoftwareInterrupt (pending interrupt inside an interrupt).

svn path=/trunk/; revision=23664
2006-08-23 06:42:25 +00:00
Alex Ionescu
280da54a61 - Switch HalEndSystemInterrupt to ASM version and get completely rid of the irql.C file.
svn path=/trunk/; revision=23663
2006-08-23 06:38:46 +00:00
Alex Ionescu
a82987f860 - Switch to ASM version of KfLowerIrql
svn path=/trunk/; revision=23662
2006-08-23 06:35:33 +00:00
Alex Ionescu
de56d52a1b - Fix bugs in ASM version of KfLowerIrql (not yet used)
- Fix bugs in INT_PROLOG.
- Fix an important bug in TRAP_EPILOG which was causing register restoration to happen at all times (such as in Kei386EoiHelper/KiServiceExit2 when it shouldn't happen).
- Add DRx restoration from trap frame, if DR7 is set.
- Added and fixed some debugging assertions in TRAP_EPILOG.

svn path=/trunk/; revision=23661
2006-08-23 06:33:52 +00:00
Alex Ionescu
c30a8d1cd4 - Duplicate code between the remaining functions (KfLowerIRql and HalEndSystemInterrupt) so testing the switch to their ASM versions will be easier.
- Use same table as in ASM code.

svn path=/trunk/; revision=23660
2006-08-23 01:23:11 +00:00
Alex Ionescu
955d04b6ff - Disable interrupts while in HalpLowerIrql
- Properly handle IRR.
- Call IRR Handlers through the SWINT table.

svn path=/trunk/; revision=23659
2006-08-23 01:07:14 +00:00
Alex Ionescu
9f38dc5900 - Deliver APCs through a proper interrupt gate as well.
svn path=/trunk/; revision=23658
2006-08-23 00:51:08 +00:00
Alex Ionescu
44804d565e - Call KiDispatchInterrupt through an interrupt gate instead of directly.
svn path=/trunk/; revision=23657
2006-08-23 00:49:35 +00:00
Alex Ionescu
bbd5e3237f - Remove HalpEndSystemInterrupt since we were already doing that code in HalpLowerIrql.
svn path=/trunk/; revision=23656
2006-08-23 00:39:52 +00:00
Alex Ionescu
a2c9ae57c3 - Use the IRR to determine APC delivery.
svn path=/trunk/; revision=23655
2006-08-22 23:41:39 +00:00
Alex Ionescu
132b7c834f - Add the code necessary in the C version of KeLowerIRql to properly mask the PIC, and enable #ifed code in ASM KeRaiseIrql to mask the PIC, since it now works.
svn path=/trunk/; revision=23654
2006-08-22 22:45:45 +00:00
Alex Ionescu
fcdd76f501 - Get rid of the peculiar idea that the HAL should manually hack into ntoskrnl through a hack export and hackishly call the registered device interrupt handlers. This is why computers have a PIC in the first place...
svn path=/trunk/; revision=23653
2006-08-22 22:20:02 +00:00
Alex Ionescu
fcda0db1c6 - Switch to ASM version of HalEnableSystemInterrupt
svn path=/trunk/; revision=23652
2006-08-22 22:13:01 +00:00
Alex Ionescu
f5f0688575 - Use the IDR in the PCR intead of a local picmask.
- Use ASM version of HalBeginSystemInterrupt.

svn path=/trunk/; revision=23651
2006-08-22 22:10:52 +00:00
Aleksey Bragin
23b6ae75fb Dmitry Philippov:
- Add a test case for a multisz value which has zero-sized strings
- Add a test case for query registry delete

All tests are known to be passed on Windows XP SP2

svn path=/trunk/; revision=23650
2006-08-22 21:45:57 +00:00