Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] The ultimate ros amd64 bringup #361

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
91c8699
[NTOS:IO] Fix parsing of resource lists
tkreuzer Jan 28, 2018
ff1eaad
[NTOS:MM] Make sure to call MmInitializeProcessAddressSpace() from th…
tkreuzer Jan 29, 2018
15a08e8
[NTOS:MM] In the x64 version of MmCreateProcessAddressSpace() zero ou…
tkreuzer Jan 29, 2018
cce3d16
[NTOS:MM] Fix ViewSize parameter passed to MiInsertVadEx() from MiCre…
tkreuzer Jan 29, 2018
286b2fb
[NTOS:MM] On x64 reserve the address range between FFFF800000000000 a…
tkreuzer Jan 29, 2018
12002d4
[HAL] Fix some 64 bit warnings
tkreuzer Jan 29, 2018
546c05b
[NTOS:OB] Fix some 64 bit warnings
tkreuzer Jan 29, 2018
1bc15af
[CRT] Use chkstk_ms.s on x64 builds
tkreuzer Jan 29, 2018
1f6d61b
[CRT] Remove the x64 asm version of sqrt from build
tkreuzer Jan 29, 2018
9e097de
[NTOS:IO] Fix a warning on MSVC builds
tkreuzer Jan 29, 2018
aedb9f6
[NTOS:MM] SLIST handling for kernel stacks
tkreuzer Feb 4, 2018
d139743
[NTOS:MM] Handle PPEs und PXEs as well in MmInitializeProcessAddressS…
tkreuzer Feb 4, 2018
25064d0
[NTOS:MM] Simplify and fix x64 version of MiGetPteForProcess(), fix M…
tkreuzer Feb 4, 2018
75e11df
[NTOS:MM] Fix session space initialization on x64
tkreuzer Feb 4, 2018
13ef07a
[NTOS:MM] Fix paged pool initialization on x64
tkreuzer Feb 4, 2018
03920b1
[NTOS:MM] Fix paged pool expansion
tkreuzer Feb 4, 2018
235566d
[NTOS:SE] Fix SeSetSecurityDescriptorInfoEx to avoid pool corruption …
tkreuzer Feb 4, 2018
1e326fb
[CMAKE] Add baseaddress_msvc_x64.cmake
tkreuzer Feb 4, 2018
c4fbc15
[CSRSRV] Fix type of ViewSize parameter passed to NtMapViewOfSection
tkreuzer Feb 4, 2018
29db059
[NTOS:KE] Implement KiConvertToGuiThread, KeSwitchKernelStack and sup…
tkreuzer Feb 4, 2018
c24203c
[NTOS:KE] Save and restore previous mode in KiZwSystemService and fix…
tkreuzer Feb 5, 2018
c9d1f6a
[NTOS:KE] Implement KiGetUserModeStackAddress() and KeUserModeCallback()
tkreuzer Feb 5, 2018
e503f53
[HAL][NTOS][I8042PRT] Add some hacks related to resource conflicts
tkreuzer Feb 5, 2018
9335f8f
[NTOS:MM] HACK: comment out an ASSERT that still fails on x64
tkreuzer Feb 5, 2018
4b4a334
[REACTOS] Fix many 64 bit warnings
tkreuzer Feb 6, 2018
945d807
[ENVIRON] Fix x64 build
tkreuzer Feb 6, 2018
a26ae1d
[BOOTLIB] Fix 64 bit warnings
tkreuzer Feb 6, 2018
bd078ab
[NTOS:KE] Improve kernel stack switching on GUI system calls
tkreuzer Feb 6, 2018
7749bdc
Fix indentation
tkreuzer Feb 6, 2018
177b3e7
Addendum to session space stuff
tkreuzer Feb 7, 2018
52721c2
Remove a trailing white space
tkreuzer Feb 7, 2018
fbec870
[NDK] Update x64 version of KEXCEPTION_FRAME
tkreuzer Feb 9, 2018
d5bdd7e
[NTOS:KE] Change the logic of KeSwitchKernelStack and friends to be s…
tkreuzer Feb 9, 2018
4351118
[ASM] Add initial version of kxamd64.inc
tkreuzer Feb 9, 2018
5b1588c
[NDK] Add UCALLOUT_FRAME definition
tkreuzer Feb 10, 2018
1dc22b6
[NTOS:KE] Move KiInitializeUserApc to usercall.c
tkreuzer Feb 10, 2018
8366b2c
[NTOS:KE] Simplify KiInitializeUserApc
tkreuzer Feb 10, 2018
29d20df
[NTOS:KE] Implement x64 version of user callback code
tkreuzer Feb 10, 2018
10e086b
[NDK] Fix the type of KPROCESS::ActiveProcessors
tkreuzer Feb 10, 2018
3252ac3
Silence annoying UNIMPLEMENTED messages
tkreuzer Feb 10, 2018
66eb02c
[NTOS:MM] Remove obsolete x64 debug print
tkreuzer Feb 10, 2018
c93d924
[NTOS:PS] Fix an issue with PROCESS_DEVICEMAP_INFORMATION size on 64…
tkreuzer Feb 10, 2018
c3380ef
[NTDLL] Delete obsolete file amd64/stubs.c
tkreuzer Feb 11, 2018
c249c15
[NTOS:PS] On x64 don't fail in NtSetInformationProcess with ProcessUs…
tkreuzer Feb 11, 2018
8b48097
[WIN32K] Fix ULONG/SIZE_T issue
tkreuzer Feb 11, 2018
e7e7e40
[NTOS:KE] Silence KiRundownThread, it has nothing to do
tkreuzer Feb 11, 2018
a9fc91d
[VIDEOPRT] Don't try to use NtVdmControl on x64
tkreuzer Feb 11, 2018
6e0a3be
[VIDEOPRT] [FORMATTING] No code change
tkreuzer Feb 11, 2018
f062e2d
[VIDEOPRT] Call IntInt10CallBios from VideoPortInt10, instead of code…
tkreuzer Feb 11, 2018
21177bb
[VIDEOPRT] Fixes for x64
tkreuzer Feb 11, 2018
ebe9bc4
[NDK] Add BIOS call API for amd64
tkreuzer Feb 11, 2018
c8bd63f
[FAST486] DWORD -> ULONG, so it can be used in kernel mode
tkreuzer Feb 11, 2018
4c80d83
[HAL] Implement amd64 BIOS call support
tkreuzer Feb 11, 2018
96f3020
[VIDEOPRT] Implement support for INT10 on x64 using the newly impleme…
tkreuzer Feb 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion win32ss/drivers/videoprt/dispatch.c
Expand Up @@ -103,6 +103,7 @@ IntVideoPortDispatchOpen(
{
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
PVIDEO_PORT_DRIVER_EXTENSION DriverExtension;
NTSTATUS Status;

TRACE_(VIDEOPRT, "IntVideoPortDispatchOpen\n");

Expand All @@ -117,7 +118,12 @@ IntVideoPortDispatchOpen(
Csrss = (PKPROCESS)PsGetCurrentProcess();
INFO_(VIDEOPRT, "Csrss %p\n", Csrss);

IntInitializeVideoAddressSpace();
Status = IntInitializeVideoAddressSpace();
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "IntInitializeVideoAddressSpace() failed: 0x%lx\n", Status);
return Status;
}

CsrssInitialized = TRUE;
}
Expand Down
65 changes: 50 additions & 15 deletions win32ss/drivers/videoprt/int10.c
Expand Up @@ -22,6 +22,7 @@
#include "videoprt.h"

#include <ndk/kefuncs.h>
#include <ndk/halfuncs.h>

#define NDEBUG
#include <debug.h>
Expand Down Expand Up @@ -158,8 +159,9 @@ IntInt10AllocateBuffer(
OUT PUSHORT Off,
IN OUT PULONG Length)
{
PVOID MemoryAddress;
NTSTATUS Status;
#ifdef _M_IX86
PVOID MemoryAddress;
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;
SIZE_T Size;
Expand Down Expand Up @@ -205,6 +207,10 @@ IntInt10AllocateBuffer(
IntDetachFromCSRSS(&CallingProcess, &ApcState);

return NO_ERROR;
#else
Status = x86BiosAllocateBuffer(Length, Seg, Off);
return NT_SUCCESS(Status) ? NO_ERROR : ERROR_NOT_ENOUGH_MEMORY;
#endif
}

VP_STATUS
Expand All @@ -214,8 +220,9 @@ IntInt10FreeBuffer(
IN USHORT Seg,
IN USHORT Off)
{
PVOID MemoryAddress = (PVOID)((ULONG_PTR)(Seg << 4) | Off);
NTSTATUS Status;
#ifdef _M_IX86
PVOID MemoryAddress = (PVOID)((ULONG_PTR)(Seg << 4) | Off);
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;
SIZE_T Size = 0;
Expand All @@ -233,6 +240,10 @@ IntInt10FreeBuffer(
IntDetachFromCSRSS(&CallingProcess, &ApcState);

return Status;
#else
Status = x86BiosFreeBuffer(Seg, Off);
return NT_SUCCESS(Status) ? NO_ERROR : ERROR_INVALID_PARAMETER;
#endif
}

VP_STATUS
Expand All @@ -244,6 +255,7 @@ IntInt10ReadMemory(
OUT PVOID Buffer,
IN ULONG Length)
{
#ifdef _M_IX86
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;

Expand All @@ -258,6 +270,12 @@ IntInt10ReadMemory(
IntDetachFromCSRSS(&CallingProcess, &ApcState);

return NO_ERROR;
#else
NTSTATUS Status;

Status = x86BiosReadMemory(Seg, Off, Buffer, Length);
return NT_SUCCESS(Status) ? NO_ERROR : ERROR_INVALID_PARAMETER;
#endif
}

VP_STATUS
Expand All @@ -269,6 +287,7 @@ IntInt10WriteMemory(
IN PVOID Buffer,
IN ULONG Length)
{
#ifdef _M_IX86
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;

Expand All @@ -283,16 +302,25 @@ IntInt10WriteMemory(
IntDetachFromCSRSS(&CallingProcess, &ApcState);

return NO_ERROR;
#else
NTSTATUS Status;

Status = x86BiosWriteMemory(Seg, Off, Buffer, Length);
return NT_SUCCESS(Status) ? NO_ERROR : ERROR_INVALID_PARAMETER;
#endif
}

#if defined(_M_IX86)
VP_STATUS
NTAPI
IntInt10CallBios(
IN PVOID Context,
IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
{
#ifdef _M_AMD64
X86_BIOS_REGISTERS BiosContext;
#else
CONTEXT BiosContext;
#endif
NTSTATUS Status;
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;
Expand Down Expand Up @@ -321,7 +349,11 @@ IntInt10CallBios(
FALSE,
NULL);

#ifdef _M_AMD64
Status = x86BiosCall(0x10, &BiosContext) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double trailing semi-colon.

#else
Status = Ke386CallBios(0x10, &BiosContext);
#endif

KeReleaseMutex(&VideoPortInt10Mutex, FALSE);

Expand All @@ -346,17 +378,6 @@ IntInt10CallBios(

return ERROR_INVALID_PARAMETER;
}
#else
VP_STATUS
NTAPI
IntInt10CallBios(
IN PVOID Context,
IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
{
DPRINT1("Int10 not available on non-x86!\n");
return ERROR_INVALID_FUNCTION;
}
#endif

/* PUBLIC FUNCTIONS ***********************************************************/

Expand All @@ -369,10 +390,24 @@ VideoPortInt10(
IN PVOID HwDeviceExtension,
IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
{
INT10_BIOS_ARGUMENTS Int10BiosArguments;
VP_STATUS Status;

if (!CsrssInitialized)
{
return ERROR_INVALID_PARAMETER;
}

return IntInt10CallBios(NULL, BiosArguments);
/* Copy arguments to other format */
RtlCopyMemory(&Int10BiosArguments, BiosArguments, sizeof(BiosArguments));
Int10BiosArguments.SegDs = 0;
Int10BiosArguments.SegEs = 0;

/* Do the BIOS call */
Status = IntInt10CallBios(NULL, &Int10BiosArguments);

/* Copy results back */
RtlCopyMemory(BiosArguments, &Int10BiosArguments,sizeof(BiosArguments));

return Status;
}
3 changes: 1 addition & 2 deletions win32ss/drivers/videoprt/services.c
Expand Up @@ -46,7 +46,6 @@ VideoPortQueryServices(

switch (ServicesType)
{
#if defined(_M_IX86)
case VideoPortServicesInt10:
if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 ||
Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE))
Expand All @@ -64,7 +63,7 @@ VideoPortQueryServices(
return NO_ERROR;
}
break;
#endif

case VideoPortServicesAGP:
if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 &&
Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) ||
Expand Down