Author: ion
Date: Wed Feb 14 23:30:33 2007
New Revision: 25800
URL:
http://svn.reactos.org/svn/reactos?rev=25800&view=rev
Log:
- Fixup and enable my new HAL IRQL implementation from a couple of months ago, and remove
the temporary Mm hacks from Dmitry Gorbachev, since DPCs don't interrupt
DISPATCH_LEVEL Code anymore.
- This fixes a critical system malfunction and architectural bug, as well as speeds up
ReactOS incredibly -- setup takes seconds again, and boot is almost instantenous (except
the Explorer loading bug).
- Proper fix for bootvid regression that Aleksey "Fixed". Video mode is now
properly setup wether in setup or non-setup mode, so bootvid works again.
- Enable bootvid in freeldr.ini, currently using only /SOS mode since full-screen logo
isn't implemented yet.
Modified:
trunk/reactos/base/setup/usetup/bootsup.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
trunk/reactos/boot/freeldr/freeldr/include/machine.h
trunk/reactos/boot/freeldr/freeldr/machine.c
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
trunk/reactos/hal/halx86/generic/generic.rbuild
trunk/reactos/hal/halx86/generic/irq.S
trunk/reactos/ntoskrnl/mm/balance.c
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/mdl.c
trunk/reactos/ntoskrnl/mm/npool.c
trunk/reactos/ntoskrnl/mm/pagefile.c
trunk/reactos/ntoskrnl/mm/pageop.c
Modified: trunk/reactos/base/setup/usetup/bootsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/bootsup.c (original)
+++ trunk/reactos/base/setup/usetup/bootsup.c Wed Feb 14 23:30:33 2007
@@ -398,6 +398,13 @@
L"SystemPath",
ArcPath);
+ /* Options=/SOS*/
+ IniCacheInsertKey(IniSection,
+ NULL,
+ INSERT_LAST,
+ L"Options",
+ L"/SOS");
+
/* Create "ReactOS_Debug" section */
IniSection = IniCacheAppendSection(IniCache,
L"ReactOS_Debug");
@@ -421,7 +428,7 @@
NULL,
INSERT_LAST,
L"Options",
- L"/DEBUGPORT=COM1 /NOGUIBOOT /SOS");
+ L"/DEBUGPORT=COM1 /SOS");
/* Save the ini file */
IniCacheSave(IniCache, IniPath);
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c Wed Feb 14 23:30:33 2007
@@ -1106,9 +1106,16 @@
}
VOID
-PcVideoPrepareForReactOS(VOID)
-{
- PcVideoSetMode80x50_80x43();
+PcVideoPrepareForReactOS(IN BOOLEAN Setup)
+{
+ if (Setup)
+ {
+ PcVideoSetMode80x50_80x43();
+ }
+ else
+ {
+ PcVideoSetBiosMode(0x12);
+ }
PcVideoHideShowTextCursor(FALSE);
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c Wed Feb 14 23:30:33 2007
@@ -234,7 +234,7 @@
}
VOID
-XboxVideoPrepareForReactOS(VOID)
+XboxVideoPrepareForReactOS(IN BOOLEAN Setup)
{
XboxVideoClearScreenColor(MAKE_COLOR(0, 0, 0), TRUE);
}
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h Wed Feb 14 23:30:33
2007
@@ -44,7 +44,7 @@
VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue);
VOID PcVideoSync(VOID);
-VOID PcVideoPrepareForReactOS(VOID);
+VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup);
ULONG PcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize);
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h Wed Feb 14 23:30:33
2007
@@ -45,7 +45,7 @@
VOID XboxVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
VOID XboxVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue);
VOID XboxVideoSync(VOID);
-VOID XboxVideoPrepareForReactOS(VOID);
+VOID XboxVideoPrepareForReactOS(IN BOOLEAN Setup);
VOID XboxMemInit(VOID);
PVOID XboxMemReserveMemory(ULONG MbToReserve);
Modified: trunk/reactos/boot/freeldr/freeldr/include/machine.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/machine.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/machine.h Wed Feb 14 23:30:33 2007
@@ -52,7 +52,7 @@
VOID (*VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
VOID (*VideoGetPaletteColor)(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue);
VOID (*VideoSync)(VOID);
- VOID (*VideoPrepareForReactOS)(VOID);
+ VOID (*VideoPrepareForReactOS)(IN BOOLEAN Setup);
ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize);
@@ -91,7 +91,7 @@
VOID MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
VOID MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue);
VOID MachVideoSync(VOID);
-VOID MachVideoPrepareForReactOS(VOID);
+VOID MachVideoPrepareForReactOS(IN BOOLEAN Setup);
ULONG MachGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize);
BOOLEAN MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG
SectorCount, int *FsType);
BOOLEAN
@@ -128,7 +128,7 @@
#define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R),
(G), (B))
#define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R),
(G), (B))
#define MachVideoSync() MachVtbl.VideoSync()
-#define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS()
+#define MachVideoPrepareForReactOS(a) MachVtbl.VideoPrepareForReactOS(a)
#define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size))
#define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv),
(Start), (Cnt), (FsType))
#define MachDiskGetSystemVolume(SysPath, RemPath, Dev, Drv, Start, Cnt,
FsType) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev), (Drv), (Start), (Cnt),
(FsType))
Modified: trunk/reactos/boot/freeldr/freeldr/machine.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/machi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/machine.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/machine.c Wed Feb 14 23:30:33 2007
@@ -142,9 +142,9 @@
}
VOID
-MachVideoPrepareForReactOS(VOID)
-{
- MachVtbl.VideoPrepareForReactOS();
+MachVideoPrepareForReactOS(IN BOOLEAN Setup)
+{
+ MachVtbl.VideoPrepareForReactOS(Setup);
}
ULONG
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Wed Feb 14 23:30:33 2007
@@ -932,7 +932,7 @@
* Now boot the kernel
*/
DiskStopFloppyMotor();
- MachVideoPrepareForReactOS();
+ MachVideoPrepareForReactOS(FrLdrBootType);
FrLdrStartup(0x2badb002);
}
Modified: trunk/reactos/hal/halx86/generic/generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/generic…
==============================================================================
--- trunk/reactos/hal/halx86/generic/generic.rbuild (original)
+++ trunk/reactos/hal/halx86/generic/generic.rbuild Wed Feb 14 23:30:33 2007
@@ -25,7 +25,7 @@
<define name="_DISABLE_TIDENTS" />
<define name="_NTHAL_" />
<define name="__USE_W32API" />
- <file>irql.c</file>
+ <file>irq.s</file>
<file>halinit.c</file>
<file>processor.c</file>
<file>spinlock.c</file>
Modified: trunk/reactos/hal/halx86/generic/irq.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?r…
==============================================================================
--- trunk/reactos/hal/halx86/generic/irq.S (original)
+++ trunk/reactos/hal/halx86/generic/irq.S Wed Feb 14 23:30:33 2007
@@ -282,7 +282,7 @@
and PCR[KPCR_IDR], eax
/* Get the current IRQL and mask the IRQs in the PIC */
- movzx eax, byte ptr PCR[KPCR_IRQL]
+ mov eax, PCR[KPCR_IRQL]
mov eax, KiI8259MaskTable[eax*4]
or eax, PCR[KPCR_IDR]
out 0x21, al
@@ -309,9 +309,9 @@
_HalBeginSystemInterrupt@12:
/* Convert to IRQ and call the handler */
- movzx edx, byte ptr [esp+8]
- sub edx, PRIMARY_VECTOR_BASE
- jmp HalpSysIntHandler[edx*4]
+ movzx ebx, byte ptr [esp+8]
+ sub ebx, PRIMARY_VECTOR_BASE
+ jmp HalpSysIntHandler[ebx*4]
IRQ15:
/* This is IRQ 15, check if it's spurious */
@@ -344,12 +344,12 @@
GenericIRQ:
/* Return the current IRQL */
mov eax, [esp+12]
- movzx ecx, byte ptr PCR[KPCR_IRQL]
+ mov ecx, PCR[KPCR_IRQL]
mov [eax], cl
/* Set the new IRQL */
movzx eax, byte ptr [esp+4]
- mov PCR[KPCR_IRQL], al
+ mov PCR[KPCR_IRQL], eax
/* Set IRQ mask in the PIC */
mov eax, KiI8259MaskTable[eax*4]
@@ -359,7 +359,7 @@
out 0xA1, al
/* Check to which PIC the EOI was sent */
- mov eax, edx
+ mov eax, ebx
cmp eax, 8
jnb Pic1
@@ -396,7 +396,7 @@
/* Get the IRQL and check if it's a software interrupt */
movzx ecx, byte ptr [esp+4]
- cmp byte ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
+ cmp dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
jbe SkipMask2
/* Hardware interrupt, mask the appropriate IRQs in the PIC */
@@ -409,7 +409,7 @@
SkipMask2:
/* Set IRQL and check if there are pending software interrupts */
- mov PCR[KPCR_IRQL], cl
+ mov PCR[KPCR_IRQL], ecx
mov eax, PCR[KPCR_IRR]
mov al, SoftIntByteTable[eax]
cmp al, cl
@@ -439,7 +439,7 @@
#endif
/* Disable interrupts and check if IRQL is below DISPATCH_LEVEL */
- cmp byte ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
+ cmp dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
cli
jbe SkipMask
@@ -453,7 +453,7 @@
SkipMask:
/* Set the new IRQL and check if there's a pending software interrupt */
- mov PCR[KPCR_IRQL], cl
+ mov PCR[KPCR_IRQL], ecx
mov eax, PCR[KPCR_IRR]
mov al, SoftIntByteTable[eax]
cmp al, cl
@@ -466,8 +466,8 @@
#if DBG
InvalidIrql:
/* Set HIGH_LEVEL */
- movzx eax, byte ptr PCR[KPCR_IRQL]
- mov byte ptr PCR[KPCR_IRQL], HIGH_LEVEL
+ mov eax, PCR[KPCR_IRQL]
+ mov dword ptr PCR[KPCR_IRQL], HIGH_LEVEL
/* Bugcheck the system */
push 3
@@ -493,8 +493,7 @@
@KfRaiseIrql@4:
/* Get the IRQL */
- xor eax, eax
- mov al, PCR[KPCR_IRQL]
+ mov eax, PCR[KPCR_IRQL]
movzx ecx, cl
#if DBG
@@ -532,13 +531,13 @@
SetIrql:
/* Set the IRQL and return */
- mov PCR[KPCR_IRQL], cl
+ mov PCR[KPCR_IRQL], ecx
ret
#if DBG
InvalidKfRaise:
/* Set to passive */
- mov byte ptr PCR[KPCR_IRQL], PASSIVE_LEVEL
+ mov dword ptr PCR[KPCR_IRQL], PASSIVE_LEVEL
/* Bugcheck the system */
push 9
@@ -555,7 +554,7 @@
_KeGetCurrentIrql@0:
/* Return the IRQL */
- movzx eax, byte ptr PCR[KPCR_IRQL]
+ mov eax, PCR[KPCR_IRQL]
ret
.endfunc
@@ -564,15 +563,14 @@
_KeRaiseIrqlToDpcLevel@0:
/* Get the current IRQL */
- xor eax, eax
- mov al, PCR[KPCR_IRQL]
+ mov eax, PCR[KPCR_IRQL]
/* Set DISPATCH_LEVEL */
- mov byte ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
+ mov dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
#if DBG
/* Make sure we were not higher then dispatch */
- cmp al, DISPATCH_LEVEL
+ cmp eax, DISPATCH_LEVEL
ja InvalidRaise
#endif
ret
@@ -605,13 +603,13 @@
out 0xA1, al
/* Return the old IRQL, enable interrupts and set to DISPATCH */
- mov al, PCR[KPCR_IRQL]
- mov byte ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
+ mov eax, PCR[KPCR_IRQL]
+ mov dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL
popf
#if DBG
/* Validate raise */
- cmp al, DISPATCH_LEVEL
+ cmp eax, DISPATCH_LEVEL
ja InvalidSyRaise
#endif
@@ -632,6 +630,8 @@
.globl _HalpApcInterrupt
.func HalpApcInterrupt
+Dr_hapc: DR_TRAP_FIXUP
+V86_hapc: V86_TRAP_FIXUP
_HalpApcInterrupt:
/* Create fake interrupt stack */
@@ -679,6 +679,8 @@
.globl _HalpDispatchInterrupt
.func HalpDispatchInterrupt
+Dr_hdpc: DR_TRAP_FIXUP
+V86_hdpc: V86_TRAP_FIXUP
_HalpDispatchInterrupt:
/* Create fake interrupt stack */
@@ -688,7 +690,7 @@
push eax
/* Enter interrupt */
- INT_PROLOG hapc, DoPushFakeErrorCode
+ INT_PROLOG hdpc, DoPushFakeErrorCode
.endfunc
.globl _HalpDispatchInterrupt2ndEntry
Modified: trunk/reactos/ntoskrnl/mm/balance.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/balance.c (original)
+++ trunk/reactos/ntoskrnl/mm/balance.c Wed Feb 14 23:30:33 2007
@@ -13,9 +13,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializeBalancer)
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c Wed Feb 14 23:30:33 2007
@@ -14,9 +14,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializePageList)
Modified: trunk/reactos/ntoskrnl/mm/mdl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mdl.c?rev=2580…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mdl.c (original)
+++ trunk/reactos/ntoskrnl/mm/mdl.c Wed Feb 14 23:30:33 2007
@@ -13,9 +13,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializeMdlImplementation)
Modified: trunk/reactos/ntoskrnl/mm/npool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/npool.c?rev=25…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/npool.c (original)
+++ trunk/reactos/ntoskrnl/mm/npool.c Wed Feb 14 23:30:33 2007
@@ -15,9 +15,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MiInitializeNonPagedPool)
Modified: trunk/reactos/ntoskrnl/mm/pagefile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pagefile.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/pagefile.c (original)
+++ trunk/reactos/ntoskrnl/mm/pagefile.c Wed Feb 14 23:30:33 2007
@@ -31,9 +31,6 @@
#define NDEBUG
#include <internal/debug.h>
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitPagingFile)
#endif
Modified: trunk/reactos/ntoskrnl/mm/pageop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pageop.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/pageop.c (original)
+++ trunk/reactos/ntoskrnl/mm/pageop.c Wed Feb 14 23:30:33 2007
@@ -13,9 +13,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializePageOp)