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

Commits on Feb 5, 2018

  1. Configuration menu
    Copy the full SHA
    91c8699 View commit details
    Browse the repository at this point in the history
  2. [NTOS:MM] Make sure to call MmInitializeProcessAddressSpace() from th…

    …e x64 version of MiInitMachineDependent()
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    ff1eaad View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    15a08e8 View commit details
    Browse the repository at this point in the history
  4. [NTOS:MM] Fix ViewSize parameter passed to MiInsertVadEx() from MiCre…

    …atePebOrTeb()
    
    The size is in bytes, not in pages! On x86 we got away with it, since PEB and TEB require only a single page and the 1 passed to MiInsertVadEx() was aligned up to PAGE_SIZE. On x64 this doesn't work, since the size is 2 pages.
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    cce3d16 View commit details
    Browse the repository at this point in the history
  5. [NTOS:MM] On x64 reserve the address range between FFFF800000000000 a…

    …nd FFFFF68000000000 in MiInitSystemMemoryAreas()
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    286b2fb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    12002d4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    546c05b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1bc15af View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1f6d61b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9e097de View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    aedb9f6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d139743 View commit details
    Browse the repository at this point in the history
  13. [NTOS:MM] Simplify and fix x64 version of MiGetPteForProcess(), fix M…

    …mGetPageFileMapping, remove obsolete functions.
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    25064d0 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    75e11df View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    13ef07a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    03920b1 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    235566d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1e326fb View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c4fbc15 View commit details
    Browse the repository at this point in the history
  20. [NTOS:KE] Implement KiConvertToGuiThread, KeSwitchKernelStack and sup…

    …port for win32k syscalls in KiSystemCallHandler
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    29db059 View commit details
    Browse the repository at this point in the history
  21. [NTOS:KE] Save and restore previous mode in KiZwSystemService and fix…

    … restoring the trap frame
    tkreuzer committed Feb 5, 2018
    Configuration menu
    Copy the full SHA
    c24203c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    c9d1f6a View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    e503f53 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    9335f8f View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2018

  1. Configuration menu
    Copy the full SHA
    4b4a334 View commit details
    Browse the repository at this point in the history
  2. [ENVIRON] Fix x64 build

    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    945d807 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a26ae1d View commit details
    Browse the repository at this point in the history
  4. [NTOS:KE] Improve kernel stack switching on GUI system calls

    To be 100% correct and not rely on assumptions, stack switching can only be done when all previous code - starting with the syscall entry point - is pure asm code, since we can't rely on the C compiler to not use stack addresses in a way that is not transparent. Therefore the new code uses the same mechanism as for normal system calls, returning the address of the asm function KiConvertToGuiThread, which is then called like an Nt* function would be called normally. KiConvertToGuiThread then allocated a new stack, switches to it (which is now fine, since all the code is asm), frees the old stack, calls PsConvertToGuiThread (which now will not try to allocate another stack, since we already have one) and then jumps into the middle of KiSystemCallEntry64, where the system call is handled again.
    Also simplify KiSystemCallEntry64 a bit by copying the first parameters into the trap frame, avoiding to allocate additional stack space for the call to KiSystemCallHandler, which now overlaps with the space that is allocated for the Nt* function.
    Finally fix the locations where r10 and r11 are stored, which is TrapFrame->Rcx and TrapFrame->EFlags, based on the situation in user mode.
    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    bd078ab View commit details
    Browse the repository at this point in the history
  5. Fix indentation

    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    7749bdc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    177b3e7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    52721c2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fbec870 View commit details
    Browse the repository at this point in the history
  9. [NTOS:KE] Change the logic of KeSwitchKernelStack and friends to be s…

    …tandards conforming
    
    The previous version (like the x86 one) used a combination of C and asm code, called from C code to switch the stack. This is problematic, since there is no guarantee what assumptions C code makes about the stack (i.e. it can place any kind of stack pointers into registers or on the stack itself.) The new algorithm returns back to the systemcall entry point in asm, which then calls KiConvertToGuiThread, which is also asm and calls KeSwitchKernelStack ...
    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    d5bdd7e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4351118 View commit details
    Browse the repository at this point in the history
  11. [NDK] Add UCALLOUT_FRAME definition

    On x86 there are no assembly constants that give us hints how the structure looks like, but we know the layout, so take the names from the x64/arm version.
    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    5b1588c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1dc22b6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8366b2c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    29d20df View commit details
    Browse the repository at this point in the history
  15. [NDK] Fix the type of KPROCESS::ActiveProcessors

    Also fix related logic in KiSwapProcess
    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    10e086b View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    3252ac3 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    66eb02c View commit details
    Browse the repository at this point in the history
  18. [NTOS:PS] Fix an issue with PROCESS_DEVICEMAP_INFORMATION size on 64 …

    …bit builds
    
    The PROCESS_DEVICEMAP_INFORMATION  union has 2 fields, one is a handle, the other one is a structure of 36 bytes (independent of architecture). The handle forces 64 bit alignment on 64 bit builds, making the structure 4 bytes bigger than on 32 bit builds. The site is checked in NtQueryInformationProcess (case ProcessDeviceMap). The expected size on x64 is the size of the Query structure without alignment. autocheck correctly passes the site of the Query union member, while smss passes the full size of PROCESS_DEVICEMAP_INFORMATION. Packing the structure is not an option, since it is defined in public headers without packing. Using the original headers sizeof(PROCESS_DEVICEMAP_INFORMATION) is 0x28, sizeof(PROCESS_DEVICEMAP_INFORMATION::Query) is 0x24.
    tkreuzer committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    c93d924 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2018

  1. Configuration menu
    Copy the full SHA
    c3380ef View commit details
    Browse the repository at this point in the history
  2. [NTOS:PS] On x64 don't fail in NtSetInformationProcess with ProcessUs…

    …erModeIOPL information class, instead just don't do anything.
    tkreuzer committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    c249c15 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8b48097 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e7e7e40 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a9fc91d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6e0a3be View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f062e2d View commit details
    Browse the repository at this point in the history
  8. [VIDEOPRT] Fixes for x64

    tkreuzer committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    21177bb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ebe9bc4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c8bd63f View commit details
    Browse the repository at this point in the history
  11. [HAL] Implement amd64 BIOS call support

    The code uses FAST486 to emulate the BIOS code.
    tkreuzer committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    4c80d83 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    96f3020 View commit details
    Browse the repository at this point in the history