diff --git a/reactos/base/setup/usetup/bootsup.c b/reactos/base/setup/usetup/bootsup.c
index 354ac7edb43..8540e0eff0a 100644
--- a/reactos/base/setup/usetup/bootsup.c
+++ b/reactos/base/setup/usetup/bootsup.c
@@ -398,6 +398,13 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath,
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 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath,
NULL,
INSERT_LAST,
L"Options",
- L"/DEBUGPORT=COM1 /NOGUIBOOT /SOS");
+ L"/DEBUGPORT=COM1 /SOS");
/* Save the ini file */
IniCacheSave(IniCache, IniPath);
diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
index a600c333550..4bcea64b957 100644
--- a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
+++ b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
@@ -1106,9 +1106,16 @@ PcVideoSync(VOID)
}
VOID
-PcVideoPrepareForReactOS(VOID)
+PcVideoPrepareForReactOS(IN BOOLEAN Setup)
{
- PcVideoSetMode80x50_80x43();
+ if (Setup)
+ {
+ PcVideoSetMode80x50_80x43();
+ }
+ else
+ {
+ PcVideoSetBiosMode(0x12);
+ }
PcVideoHideShowTextCursor(FALSE);
}
diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c
index 21ffa56f20e..26430b55d35 100644
--- a/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c
+++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c
@@ -234,7 +234,7 @@ XboxVideoSync()
}
VOID
-XboxVideoPrepareForReactOS(VOID)
+XboxVideoPrepareForReactOS(IN BOOLEAN Setup)
{
XboxVideoClearScreenColor(MAKE_COLOR(0, 0, 0), TRUE);
}
diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h
index c87e756b936..c6d43074314 100644
--- a/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h
+++ b/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h
@@ -44,7 +44,7 @@ BOOLEAN PcVideoIsPaletteFixed(VOID);
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);
diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
index 4f24dab4766..3eabbe71d81 100644
--- a/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
+++ b/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
@@ -45,7 +45,7 @@ BOOLEAN XboxVideoIsPaletteFixed(VOID);
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);
diff --git a/reactos/boot/freeldr/freeldr/include/machine.h b/reactos/boot/freeldr/freeldr/include/machine.h
index 51996a7a1e5..5b0cf460d97 100644
--- a/reactos/boot/freeldr/freeldr/include/machine.h
+++ b/reactos/boot/freeldr/freeldr/include/machine.h
@@ -52,7 +52,7 @@ typedef struct tagMACHVTBL
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 @@ BOOLEAN MachVideoIsPaletteFixed(VOID);
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 @@ VOID MachHwDetect(VOID);
#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))
diff --git a/reactos/boot/freeldr/freeldr/machine.c b/reactos/boot/freeldr/freeldr/machine.c
index 5d6933fa0ef..f91b4cba750 100644
--- a/reactos/boot/freeldr/freeldr/machine.c
+++ b/reactos/boot/freeldr/freeldr/machine.c
@@ -142,9 +142,9 @@ MachVideoSync(VOID)
}
VOID
-MachVideoPrepareForReactOS(VOID)
+MachVideoPrepareForReactOS(IN BOOLEAN Setup)
{
- MachVtbl.VideoPrepareForReactOS();
+ MachVtbl.VideoPrepareForReactOS(Setup);
}
ULONG
diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c
index cdf4500cc0c..a4f6981c050 100644
--- a/reactos/boot/freeldr/freeldr/reactos/reactos.c
+++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c
@@ -932,7 +932,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
* Now boot the kernel
*/
DiskStopFloppyMotor();
- MachVideoPrepareForReactOS();
+ MachVideoPrepareForReactOS(FrLdrBootType);
FrLdrStartup(0x2badb002);
}
diff --git a/reactos/hal/halx86/generic/generic.rbuild b/reactos/hal/halx86/generic/generic.rbuild
index 7a1d26c7d4b..ec91f940a94 100644
--- a/reactos/hal/halx86/generic/generic.rbuild
+++ b/reactos/hal/halx86/generic/generic.rbuild
@@ -25,7 +25,7 @@
- irql.c
+ irq.s
halinit.c
processor.c
spinlock.c
diff --git a/reactos/hal/halx86/generic/irq.S b/reactos/hal/halx86/generic/irq.S
index 938654768b8..762e7882640 100644
--- a/reactos/hal/halx86/generic/irq.S
+++ b/reactos/hal/halx86/generic/irq.S
@@ -282,7 +282,7 @@ AfterMask:
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 @@ Invalid:
_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 @@ IRQ7:
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 @@ GenericIRQ:
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 @@ _HalEndSystemInterrupt@8:
/* 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 @@ _HalEndSystemInterrupt@8:
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 @@ _@KfLowerIrql@4:
#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 @@ _@KfLowerIrql@4:
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 @@ SkipMask:
#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:
@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 @@ _@KfRaiseIrql@4:
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 @@ InvalidKfRaise:
_KeGetCurrentIrql@0:
/* Return the IRQL */
- movzx eax, byte ptr PCR[KPCR_IRQL]
+ mov eax, PCR[KPCR_IRQL]
ret
.endfunc
@@ -564,15 +563,14 @@ _KeGetCurrentIrql@0:
_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 @@ _KeRaiseIrqlToSynchLevel@0:
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 @@ InvalidSyRaise:
.globl _HalpApcInterrupt
.func HalpApcInterrupt
+Dr_hapc: DR_TRAP_FIXUP
+V86_hapc: V86_TRAP_FIXUP
_HalpApcInterrupt:
/* Create fake interrupt stack */
@@ -679,6 +679,8 @@ DeliverApc:
.globl _HalpDispatchInterrupt
.func HalpDispatchInterrupt
+Dr_hdpc: DR_TRAP_FIXUP
+V86_hdpc: V86_TRAP_FIXUP
_HalpDispatchInterrupt:
/* Create fake interrupt stack */
@@ -688,7 +690,7 @@ _HalpDispatchInterrupt:
push eax
/* Enter interrupt */
- INT_PROLOG hapc, DoPushFakeErrorCode
+ INT_PROLOG hdpc, DoPushFakeErrorCode
.endfunc
.globl _HalpDispatchInterrupt2ndEntry
diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c
index 8c2a5807904..0716522208a 100644
--- a/reactos/ntoskrnl/mm/balance.c
+++ b/reactos/ntoskrnl/mm/balance.c
@@ -14,9 +14,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializeBalancer)
#pragma alloc_text(INIT, MmInitializeMemoryConsumer)
diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c
index 0fc5fcc8b17..920f0151c31 100644
--- a/reactos/ntoskrnl/mm/freelist.c
+++ b/reactos/ntoskrnl/mm/freelist.c
@@ -15,9 +15,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializePageList)
#endif
diff --git a/reactos/ntoskrnl/mm/mdl.c b/reactos/ntoskrnl/mm/mdl.c
index 4947c5c1a98..ba1485498d2 100644
--- a/reactos/ntoskrnl/mm/mdl.c
+++ b/reactos/ntoskrnl/mm/mdl.c
@@ -14,9 +14,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializeMdlImplementation)
#endif
diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c
index d13180d4beb..505497cffc8 100644
--- a/reactos/ntoskrnl/mm/npool.c
+++ b/reactos/ntoskrnl/mm/npool.c
@@ -16,9 +16,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MiInitializeNonPagedPool)
#endif
diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c
index 43f1c4d22a4..3b5fed1dc03 100644
--- a/reactos/ntoskrnl/mm/pagefile.c
+++ b/reactos/ntoskrnl/mm/pagefile.c
@@ -31,9 +31,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitPagingFile)
#endif
diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c
index c2fe4a6801e..07bb850fe3d 100644
--- a/reactos/ntoskrnl/mm/pageop.c
+++ b/reactos/ntoskrnl/mm/pageop.c
@@ -14,9 +14,6 @@
#define NDEBUG
#include
-#undef KeAcquireSpinLock
-#define KeAcquireSpinLock(a,b) { _disable(); *(b) = KfAcquireSpinLock(a); }
-
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializePageOp)
#endif