Commit graph

22853 commits

Author SHA1 Message Date
Aleksey Bragin 182fc37942 Revert r24430 changes (by Magnus Olsen) since they are incorrect (additionally confirmed by Filip Navara)
svn path=/trunk/; revision=24471
2006-10-09 15:02:33 +00:00
Thomas Bluemel b79edc3b52 Fix compilation with GCC4
svn path=/trunk/; revision=24470
2006-10-09 14:59:10 +00:00
Thomas Bluemel 2600e04b68 Strings should be const char *. Fixes compilation with GCC4
svn path=/trunk/; revision=24469
2006-10-09 14:54:40 +00:00
Thomas Bluemel b8dd6657bc Strings should be const char *. Fixes compilation with GCC4
svn path=/trunk/; revision=24468
2006-10-09 14:43:16 +00:00
Mindflyer c255fa82a3 Change copyright to 1996-2006, because
a) our earliest version records show 1996
b) we are now in 2006

svn path=/trunk/; revision=24467
2006-10-09 12:37:03 +00:00
Aleksey Bragin b6df2387ba Fix mkhive compiling by adding _NTSYSTEM_ define. This is needed after Thomas' fixes to headers.
svn path=/trunk/; revision=24466
2006-10-09 08:07:19 +00:00
Alex Ionescu 4ffb9d2c3e - Some misc changes to fix some of the 250+ warnings in the MSVC build.
svn path=/trunk/; revision=24465
2006-10-09 05:59:18 +00:00
Alex Ionescu 6951a4887c - Bootvid rewrite by Filip Navara (with some fixes by myself)
- HAL DMA enhancements by Filip Navara.
- CSRSS Console enhancements by Filip Navara.
- Win32k Primitive Queue/Input/Painting/Focus enhancements by Filip Navara.
- Other misc win32k/CSR bug fixes by Filip Navara.
- The new bootvid code has some bugs, but try out a GUI Boot!

svn path=/trunk/; revision=24464
2006-10-09 04:00:34 +00:00
Alex Ionescu 3012ee8072 - Initialize the registry in one shot, and allow it to fail and do the associated CONFIG_INIT_FAILED bugcheck.
- Initialize Io in one shot, with IoInitSystem.
- Locate the system DLL a bit later, since on the boot CD this creates a small incompatibility due to the wrong path being in use.

svn path=/trunk/; revision=24463
2006-10-09 01:16:28 +00:00
Alex Ionescu b772538a22 - Add RtlInitEmptyAnsiString to DDK.
- Fix a pretty bad stack/memory corruption bug related to IoReassignSystemRoot.
- Combine IoInit2 and IoInit3 into IoInitSystem, and make it return a BOOLEAN, and handle error with the appropriate IO1_INIT_FAILED bugcheck. Will combine IoInit1 soon.

svn path=/trunk/; revision=24462
2006-10-08 23:46:26 +00:00
Alex Ionescu 2b1ade4723 - Remove InitSharedUserDataPage since this entire function is not needed anymore due to the recent ARC improvements.
- Call IoAssignDriverLetters with the proper parameters, and give it a chance to update the SystemRoot path (although our version doesn't yet do this).

svn path=/trunk/; revision=24461
2006-10-08 22:50:26 +00:00
Alex Ionescu d4b5fef3d6 - Finalize ARC Boot changes:
* Rename IoCreateArcNames to IopCreateArcNames and set it to NTAPI, as well as pass the loader block as a parameter.
  * Reduce buffers to 128 bytes, since ARC Paths don't get longer then that.
  * Optimize stack usage by using a single ANSI_STRING instead of 3 or 4.
  * Optimize stack usage by using a single ansi buffer, not 2 or more.

svn path=/trunk/; revision=24458
2006-10-08 21:38:45 +00:00
Alex Ionescu b5f79593de - Optimize IopApplyRosCdromArcHack by not searching for the second copy of ntoskrnl if we already found the first.
- Also optimize stack usage by only using an ANSI buffer instead of having another Unicode buffer and unicode strings. Saves 530 bytes of stack.

svn path=/trunk/; revision=24457
2006-10-08 21:16:20 +00:00
Alex Ionescu 5e214ceaa0 - Part 2.5 of ARC Boot changes. Re-factor IoCreateArcNames not to use a list-entry of detected disk from pool that gets looped and de-referenced, but instead use a simple loop which calls a function that gets disk information one-by-one (IopGetDiskInformation), so that it's used on the spot instead of allocated, linked, and retrieved later.
- Inline IopAssignArcNamesToDisk to reduce some stack size abuse and too much parameter shuffling.
- Stack use is still very inefficient, will fix next.

svn path=/trunk/; revision=24456
2006-10-08 21:09:00 +00:00
Thomas Bluemel 73c2dc5053 Some header fixes
svn path=/trunk/; revision=24454
2006-10-08 20:28:03 +00:00
Alex Ionescu 1047de88bf - Greatly simplify and optimize IoCreateArcNames by using ARC data from FreeLDR/NTLDR (now nearly 100% compatible!) instead of querying registry data (which FreeLdr had already set up, so we cached those values like ntldr does).
- Last step is to stop using a list of drives and pool allocated entries, to optimize memory usage and re-factor the code.

svn path=/trunk/; revision=24453
2006-10-08 19:59:53 +00:00
Alex Ionescu c537eb20f2 - Have FreeLDR fill out ARC_DISK_SIGNATURE information for each detected disk, as it's filling the registry.
- Add code to KiRosFrldrLpbToLpb to convert this array to the official ARC_DISK_INFORMATION structure that contains LIST_ENTRYies for each ARC_DISK_SIGNATURE, and initialize the ArcDiskSignatureListHead.
- The end result will be that in the next patch we can remove a bunch of registry-reading code in IoCreateArcNames.

svn path=/trunk/; revision=24452
2006-10-08 19:34:16 +00:00
Alex Ionescu 7a1b73cf84 - Part 2 of ARC boot changes: Major modifications done to the existing code, as well as re-formatting and cleanup. Floppy ARC names are not created anymore (they don't exist), and CD-ROM ARC name is only created 1) when there is a boot CD and 2) only for the boot CD. This mimics NT functionality.
- Optimize some code paths, mostly by not querying the whole GET_DRIVE_GEOMETRY IRP twice and reducing some buffer usage. Also re-factor some code better into smaller functions.
- Document and work around currently FreeLDR incompatibility (lack of ARC_DISK_INFORMATION) data in LoaderBlock.

svn path=/trunk/; revision=24451
2006-10-08 16:58:03 +00:00
Aleksey Bragin b234cb305e - Add dumping boot drivers list, remove unneded comment
- Implement WinLdrScanRegistry() (based on freeldr's already existing implementation) which searches for boot-loading drivers
- Implement WinLdrAddDriverToList() - it correctly fills an entry in the BootDriversList in LoaderParameterBlock

svn path=/trunk/; revision=24444
2006-10-08 10:06:06 +00:00
Aleksey Bragin 3c3080f16b - Add simple support functions to be able to use more RTL in FreeLdr
svn path=/trunk/; revision=24442
2006-10-08 08:54:44 +00:00
Alex Ionescu 6d262bb755 - Whoops, don't call IopReassignSystemRoot twice.
svn path=/trunk/; revision=24441
2006-10-08 07:59:30 +00:00
Alex Ionescu 66f4128216 - Part 1 of ARC boot cleanups/changes: Create a valid \\SystemRoot symbolic link as the system is booting, which points to the ARC name, then, once drivers have loaded, re-assign it to the proper NT Device name. Added proper security descriptors and flags to symbolic links, as well as proper bugchecks when required.
- Kept and cleaned up the ROS hack for CD-ROM boot.

svn path=/trunk/; revision=24440
2006-10-08 07:53:37 +00:00
Alex Ionescu 9307f32ce3 - More re-shuffling of initialization calls, including enabling access to the blue screen much much earlier (no point in doing it so late, but this change is not that useful since soon we'll have bootvid).
- Split Po init in two, so the early Po init (which we'll need to do eventually) doesn't depent on the later Po init (which uses a PnP notification which depends on the Io system).
- Make I/O initialize quite a bit later.

svn path=/trunk/; revision=24439
2006-10-08 04:47:26 +00:00
Alex Ionescu 4b00ba5d4d - Inline and make some slight correctiions to KiInitailizeSystemClock, since it's based on the Ex subsystem, not Ke. Add code for boot-time timezone bias, but currently disabled because I need to implement a function to read configuration registry data at startup.
- Improve Init bugchecks to give the exact module that failed. Add Kd initilization in the same block as the other subsystems.
- Rename and re-arrange some initlization calls.

svn path=/trunk/; revision=24438
2006-10-08 04:05:27 +00:00
Alex Ionescu 9088db842e - Stub LdrVerifyMappedImageMatchesChecksum.
- Separate locating the system DLL from initializing it.
- Implement split-phase PsInitSystem for Phase 0 and 1, and make system dll initialization as part of phase 1.
- Add MmVerifyImageIsOkForMpUse and MmCheckSystemImage to validate the system DLL.
- Add a separate bugcheck for each failure in PsLocateSystemDll, matching with the NT bugchecks that would occur.

svn path=/trunk/; revision=24437
2006-10-08 02:10:34 +00:00
Alex Ionescu ebd9a573ec - In NTLDR boot, try to get the first kernel physical address from the loader entries.
- Fixup HAL's image base in the loader parameter block, since we load it at a different place then freeldr tells us.
- We've reached a dead end in NTLDR compatibility. Out memory manager initialization code makes some assumptions which are totally incompatible with the page table state that NTLDR gives us.

svn path=/trunk/; revision=24436
2006-10-08 00:04:03 +00:00
Alex Ionescu 378f64d047 - FreeLDR: Create the loader entry for ntoskrnl now that FreeLDR PE-loads it since last year. This lets us remove a large hack in ntoskrnl which was manually creating the entry and filling it in.
- Rename some LastKrnl... addresses into MmFreeLdr to easily identify them, and remove the need to use MmFreeLdrMemLower and MmFreeLdrPageDirectoryStart.
- Remove the static KERNEL_BASE definition based on a GCC-specific external. Everything now uses the actual module entry's saved base address.
- Fix a Ps Initialization hack and properly set the boot PDE.
- Add a hack for NTLDR's lack of MmFreeLdrMemHigher and MmFreeLdrPageDirectoryEnd.

svn path=/trunk/; revision=24435
2006-10-07 22:23:35 +00:00
Ged Murphy f8fa7d16f8 move the string parsing routine into it's own function so it can be used with DeviceProblemWizard_RunDLL when required.
svn path=/trunk/; revision=24434
2006-10-07 15:02:43 +00:00
Ged Murphy 71bc38ca20 testing ros-diffs
svn path=/trunk/; revision=24433
2006-10-07 14:35:22 +00:00
Aleksey Bragin a40bc5ff5f - Add structure for describing boot-loaded drivers
svn path=/trunk/; revision=24432
2006-10-07 13:07:25 +00:00
Alex Ionescu b53f179583 - Fix calls to HvInitializeHive
svn path=/trunk/; revision=24431
2006-10-06 23:11:49 +00:00
Magnus Olsen 2db2156bb3 Fixed control apps windows, Let me known if it create any regress.
svn path=/trunk/; revision=24430
2006-10-06 21:59:42 +00:00
Aleksey Bragin 41c8741041 - Load and initialize in-memory registry
- Query NLS file names from registry instead of hardcoding
- Move loading of NLS data to WinLdrLoadAndScanSystemHive()

svn path=/trunk/; revision=24429
2006-10-06 21:20:36 +00:00
Alex Ionescu e2295b6e85 - Fix calls to HvInitializeHive due to my last patch. Proof that Fireball doesn't properly test his commits... I broke Freeldr building before his commit, yet he commited it anyway even though freeldr couldn't build ;). Just kidding.
svn path=/trunk/; revision=24428
2006-10-06 20:52:50 +00:00
Aleksey Bragin 0b9fa0e21a - Make arc-path passed to the kernel look a bit more correct (still a hack of course)
- Add KdCom.dll loading along with ntoskrnl.exe and hal.dll
- Move registry-related code to a new file wlregistry.c
- WinLdrLoadAndScanSystemHive() is going to combine loading, initializing and parsing registry. NLS / OEM font data loading is marked with FIXMEs now, since it needs going into that routine (because registry tells the file names, not hardcoding them)

svn path=/trunk/; revision=24427
2006-10-06 20:28:55 +00:00
Alex Ionescu 9bfa61479f - Add PROFILE_ACPI_DOCKING_STATE.
- Fix HvInitialize definition to match more closely NT's since I need some of the extra parameters for the cm rewrite.
- Implement ExInitializePushLock and ExConvertPushLockSharedToExclusive macros.

svn path=/trunk/; revision=24426
2006-10-06 19:29:25 +00:00
Ged Murphy 6318f42ad0 fix a TCHAR brain lapse...
svn path=/trunk/; revision=24425
2006-10-06 17:10:57 +00:00
Ged Murphy 2380e7bb33 implemented DeviceProperties_RunDLLW and DeviceProperties_RunDLLA
svn path=/trunk/; revision=24424
2006-10-06 16:08:54 +00:00
Alex Ionescu a4c366b659 - Add internal EX_CALLBACK Object to NDK. (Callback blocks are a new NT 5.2 kernel mechanism much like RunOncs blocks in Vista user-mode). They're managed by rundown protection and fast-referencing through interlocked calls to push/pop/sychrnonize system callbacks.
- Add ObOpenObjectByName to NDK, since this API is not documented in official headers.

svn path=/trunk/; revision=24422
2006-10-06 06:36:35 +00:00
Alex Ionescu 45d84c9668 - Guard some current cmlib includes against new cm branch
- Remove NTSYSAPI from NtBuildNumber definition in NDK.

svn path=/trunk/; revision=24416
2006-10-05 23:01:38 +00:00
Alex Ionescu 8859463623 - Remove SMSS's code for signaling the "init" event.
- Make ExpInitNls responsible for NLS initialization in Phase 0 as well, to clean up the code in ExpInitailizeExecutive a bit.
- Initialize the system time/clock in Phase 1, not in Phase 0.
- Do HAL Phase1 initialization as the first step in Phase 1 initialization, then initialize the system clock (since the HAL's RTC is now configured).
- Do Ob Phase 1 init in Phase 1 initialization, not in phase 0.
- Do Ke Phase 1 init after HAL, Ob and Ex phase 1 inits.
- Initialize NLS for Phase 1 after Ke Phase 1, instead of much later.

svn path=/trunk/; revision=24414
2006-10-05 16:38:58 +00:00
Alex Ionescu 093d1a3aba - Get rid of the completely convoluted way that Phase 1 initialization was being ended, with umpteen events and waits and timeouts all synchronized from user-mode and do a simple 5-second wait to determine if smss started OK or not.
- Promote the Phase 1 initialization thread by jumping directly into the zero-page thread, and remove manual zero-page thread initialization code since we simply jump into its main routine.
- 100 less lines of code :)

svn path=/trunk/; revision=24413
2006-10-05 16:14:28 +00:00
Alex Ionescu eb8c705ce9 - Put all Phase 1 Ex* Initialization in ExpInitSystemPhase1 and clean up associated deprecated calls.
- Call ExpInitializePushLocks since we weren't doing this before.

svn path=/trunk/; revision=24412
2006-10-05 15:13:59 +00:00
Alex Ionescu 3f66fcf605 - Rewrite ExpLoadInitialProcess by inlining and simplifying what the call to RtlCreateProcsesParameters should do, and also create our own custom environment with the same arguments that NT's smss gets.
- This optimizes booting as well as gets use the differnet SESSIONY_INITIALIZATION_FAILED, where Y is a number representing which step of the process parameter/envieonment creation failed.

svn path=/trunk/; revision=24411
2006-10-05 14:49:20 +00:00
Aleksey Bragin 3727f8fc7d - Add #ifdef DEBUG / #endif to fix compile. FreeLdr's debug macros needs some improvement in the future...
svn path=/trunk/; revision=24410
2006-10-05 09:15:44 +00:00
Alex Ionescu 5162751ab3 - Use KeLoaderBlock for registry hive loading.
- Get rid of the CACHED_MODULE array and associated structures and stop using them, get rid of ParseAndCacheLoadedModules. Stop using KeLoadedModules and KeLoadedModuleCount outside of freeldr.c.
- Except for MmInit1, the kernel should now be totally isolated from FreeLDR-specific data.

svn path=/trunk/; revision=24409
2006-10-05 02:02:27 +00:00
Alex Ionescu 0bfcd77883 - Implement ExpInitNls to initialize the NLS Section using the new semantics recently implemented. Works pretty much like the previous code in rtl/nls.c except it uses the new variable names as well as maps a view of the NLS Table into the system process.c
- Delete rtl/nls.c and all the associated deprecated code.
- Do MmInit1 and SharedUserData stuff *after* initializing the initial thread, to avoid an ASSERT during bootup.

svn path=/trunk/; revision=24408
2006-10-05 01:44:54 +00:00
Ged Murphy 52d60b023b add a few more icons to the device imagelist
svn path=/trunk/; revision=24407
2006-10-04 22:29:18 +00:00
Christoph von Wittich a387e6f9f8 -removed unused var
svn path=/trunk/; revision=24406
2006-10-04 22:06:00 +00:00
Aleksey Bragin b103aa1ece - Add most needed memory-manipulating functions. Some places are really crappy (like WinLdrSetProcessorContext's IDT filling), will be fixed soon.
- FIXME: Since FreeLdr doesn't really keep track of which memory is of which type, this code has a massive hack for guessing the memory type, which is incorrect for future usage

svn path=/trunk/; revision=24405
2006-10-04 21:58:36 +00:00