Commit graph

22556 commits

Author SHA1 Message Date
Hervé Poussineau b2aeafcad4 Implement CMP_WaitNoPendingInstallEvents
Wait for Pnp manager to finish its job before displaying the 2nd stage setup
Thanks Filip for his precious help on the umpnpmgr.exe side (not thread-safe as Single linked list functions are not implemented in ntdll)

svn path=/trunk/; revision=24365
2006-10-02 18:46:39 +00:00
Ged Murphy 4cfbdb6f63 - Only call SetupDiGetClassDevs once for each class, this makes load time 3 times faster although I'm still not happy with it. We may have to enumerate the drivers in the background.
- use UINT for 1 bit flags, reduce the width a little and check the menu.

svn path=/trunk/; revision=24364
2006-10-02 18:14:58 +00:00
Alex Ionescu 04c5f92621 - Combine SeInit1 and SeInit2 into SeInit since both can be done together now.
- Call PsInitSystem instead of PspInitPhase0, since PsInitsystem is the "external" phase-choosing routine.
- Implement ExComputeTickCountMultiplier to create a 24-bit precision remainder + whole integer of the ms/clock tick used in SharedUserData.
- Set the OS version and Machine Type (i386/PPC (<3 Arty) in SharedUserData.
- Move some HAL calls in Phase 2 (actually Phase 1...), same for KeInit2.
- Break into KDBG a bit earlier.

svn path=/trunk/; revision=24363
2006-10-02 15:52:58 +00:00
Alex Ionescu 06142d4e0d - Setup memory limits in shared user data.
- Loop security descriptors to find NLS data and make a copy of it in kernel pool, because the NLS buffer from NTLDR will be freed on NT. Also discovered a bug in Freeldr where it doesn't allocate ths NLS files sequentially, leaving a hole of 0x1000 between them. Added a hack to compensate (won't break NTLDR booting, just will waste 8KB of memory).
- Allocate the system call count table on checked builds.
- Refactor Ob/Se booting to match more closely NT, and so that we can do Se initialization in one shot.

svn path=/trunk/; revision=24362
2006-10-02 15:05:03 +00:00
Thomas Bluemel 62ac7ad5c9 Fix some warnings
svn path=/trunk/; revision=24361
2006-10-02 13:29:55 +00:00
Alex Ionescu afa1de7c81 - Implement Phase 0 Ex initialization (Resource, Lookaside initialization) and generic Ex initialization routine.
- Clear the crypto exponent on boot-up.
- Set default global flags for checked builds.
- Set NtSystemRoot (SharedUserData) to C:<NT BOOT PATH> on startup.
- Cleanup lookas.c file and implement routines to initialize the system lookaside list in phase 0.

svn path=/trunk/; revision=24360
2006-10-02 13:23:03 +00:00
Thomas Bluemel 526efd2ee7 Define NTOSAPI before including ntddk.h to avoid including function prototypes with dllimport
svn path=/trunk/; revision=24359
2006-10-02 12:22:17 +00:00
Alex Ionescu 7fcf928e38 - Continue implementation of KiRosFrldrLpbToNtLpb by parsing the FreeLDR command line and:
* Removing the ARC Boot path and splitting it into the ARC Boot Device Name, the ARC HAL Device Name, and the NT Boot and HAL Path Names, saved in their respective LoaderBlock pointers.
  * Converting every slash to a space. ("/DEBUGPORT" -> " DEBUGPORT")
  * Now we can fully parse and read NTLDR command lines.
- Update various code in the kernel to:
  * Use LoaderBlock->ArcDeviceNamePath & friends instead of the command line.
  * Stop depending on slashes, and instead use strstr for parameters.

svn path=/trunk/; revision=24358
2006-10-02 05:40:36 +00:00
Aleksey Bragin 5c112af711 - Add a check to the boot.ini-changing code, to prevent creation of a new ReactOS entry after each installation.
svn path=/trunk/; revision=24356
2006-10-01 21:48:05 +00:00
Aleksey Bragin 5cf4352021 - Implement loading of NLS data, SYSTEM hive data (just simple loading into memory, without any kind of parsing or even checking if that data is correct)
- Add a function for creating a stub of hardware config (config consisting of only one node - root)
- Implement two steps of LPB initialization (names Phase 0 and Phase 1 are used internally by me, and doesn't correspond to anything)
- Implement a WinLdrSetupForNt, which allocates and initializes some specific structures (PCR, TSS, GDT, IDT)
- Respectively enable calls to these functions from LoadAndBootWindows()

svn path=/trunk/; revision=24354
2006-10-01 21:15:15 +00:00
Aleksey Bragin eb998b4eaf - Comment out xbox memory detection for now (until fully switched to NT-style LPB)
- Fix HalpInitializePhase0() prototype
- Add halxbox back to build

svn path=/trunk/; revision=24353
2006-10-01 21:07:25 +00:00
Alex Ionescu 0c1b724e79 - Un-optimize KeGetPcr and make it use fs:20h instead of hard-coding the 0xFF.... address, because someone decided that ROS should have a different KPCR address then NT.
- This gets NTLDR working with ReactOS and I can boot all the way to MmInit1 (which fails due to missing KeMemoryMap & freeldr data).
- Serial port output works with DPRINT1 as well ;-)

svn path=/trunk/; revision=24352
2006-10-01 20:27:36 +00:00
Alex Ionescu 2855e1f08f - Do MmInit1 in KiInitializeKernel so we can access SharedUserData from it (we'll need to setup the CPU Features there).
- Cleanup some external/prototype mess and put them nicely into headers.

svn path=/trunk/; revision=24351
2006-10-01 19:43:18 +00:00
Aleksey Bragin 3d9d36ccff - Add new type of debug print for windows loader
- Add address conversion routines for windows loader
- Add stubs for PE loading, memory operations
- Add some code to the LoadAndBootWindows()

Some notes:
- The windows loader is going to become some kind of a library in future, shared at least between freeldr and EFI loader.
- The code in windows loader is specific to i386 architecture for now, but I add it to the "freeldr_base". I better separate it a bit later, after discussion with arty (because I hardly want compatibility with loading windows on PPC).

svn path=/trunk/; revision=24350
2006-10-01 19:39:49 +00:00
Alex Ionescu 71e329a125 - Do MmInit1 much earlier in the boot phase (right at the beginning of ExpInitalizeExecutive). This gives us access to things like SharedUserData, which NT has since NTLDR. Will try moving it up even higher.
- Also move some ROS-specific/Freeldr hacks on top of the file so they'll be easier to remove later when needed.
- Fix a bug in ExInitPoolLookasidePointers which was making us overwrite low-memory.
- Initialize NLS tables during Phase 0, so that the associated APIs can work earlier.
- Bugcheck if HAL Phase 0 initialization failed, and force interrupts enabled after the HAL is ready.

svn path=/trunk/; revision=24348
2006-10-01 19:27:10 +00:00
Alex Ionescu 9f40202dfc - Add setupblk.h from TinyKRNL with all the definitions for NT's SETUPLDR structures (SETUP_LOADER_BLOCK and hardware configuration stuff). Update KiRosFrldrLpbToNtLpb to setup the Flags field of this block to "Text-Mode Setup Active" when we know that we're in ROS text mode.
- Update ExpInitializeExecutive to check for a valid setup block and detect text-mode and network installation modes. Use ExpInTextModeSetup instead of SetupMode variable, to make detection compatible with NTLDR.

svn path=/trunk/; revision=24347
2006-10-01 18:27:59 +00:00
Alex Ionescu cbfbbdb7f1 - Implement ExpIsLoaderValid to validate the LOADER_PARAMETER_BLOCK's extension for the right size and version (we currently support 5.2 and over).
- Add code in KiRosFrldrLpbToNtLpb to setup a LOADER_PARAMETER_EXTENSION and set the right version and size.
- Initialize the per-CPU PRCB Paged/NPaged lookaslide pool lists.
- Add code to support application CPUs booting in ExpInitializeExecutive, and pass the loaderblock as a parameter.

svn path=/trunk/; revision=24346
2006-10-01 18:01:38 +00:00
Alex Ionescu 0adfdd1ace - Implement static compile-time assertions and use them for structure field checks. Thanks to Thomas and KJK.
svn path=/trunk/; revision=24345
2006-10-01 15:52:10 +00:00
Alex Ionescu 4f1804b0c0 - Use __readfsdword instead of de-referencing the Boot PCR, which is not queried for Application CPUs. (And put the Goto back where it was). Thanks to Thomas Weidenmueller for noticing.
svn path=/trunk/; revision=24344
2006-10-01 15:22:42 +00:00
KJK::Hyperion 41ecee90f7 Fixed:
- _InterlockedCompareExchange64 (more efficient handling of 64-bit operands)
 - __writecr0, __writecr3, __writecr4 (for real this time)

svn path=/trunk/; revision=24343
2006-10-01 14:49:07 +00:00
Thomas Bluemel 70da417c02 Fix usage of a uninitialized variable, unnecessary goto not replaced by a if(...) statement
svn path=/trunk/; revision=24342
2006-10-01 14:02:08 +00:00
Thomas Bluemel d7978d0054 fix __writecr0, __writecr3 and __writecr4
svn path=/trunk/; revision=24341
2006-10-01 12:33:24 +00:00
Thomas Bluemel 408d13caaa Fix function name (fixes a redefinition error)
svn path=/trunk/; revision=24340
2006-10-01 12:19:36 +00:00
Hervé Poussineau 5895844509 Add ufatx.dll, to be able to create FATX (Xbox file system) partitions
svn path=/trunk/; revision=24339
2006-10-01 10:11:46 +00:00
Hervé Poussineau 72a9a3af12 Rewrite SetupDiGetClassImageListExW and SetupDiGetClassImageIndex which were completly wrong
Add stub for SetupDiDestroyClassImageList
Now, you can see some icons in device manager

svn path=/trunk/; revision=24338
2006-10-01 09:05:19 +00:00
Alex Ionescu ebafbecc80 - Fix Ki386InitializeTss to use dynamic GDT calculated from KiGetMachineBootPointers instead of static internal address. Now NTLDR boots us all the way to HalInitializeProcessor.
svn path=/trunk/; revision=24337
2006-10-01 07:31:33 +00:00
Alex Ionescu 7c753a339a - Put IDT in RW .data section
- Fix Ki386InitializeTss to properly set Boot TSS descriptor data (set it to 32-bits). Also properly setup the DF/NMI Task Gates in the IDT.

svn path=/trunk/; revision=24336
2006-10-01 07:24:24 +00:00
Alex Ionescu 00564d63b7 - Clear KPCR->TEB during bootstrap as well.
- Use KPCR_PROCESSOR_NUMBER instead of 0x130.

svn path=/trunk/; revision=24335
2006-10-01 06:46:08 +00:00
Alex Ionescu aebf830821 - Add two more lines in boot.S which detect boot-by-NTLDR and jump into KiSystemService (I thought FreeLdr didn't use the entrypoint, but it looks like it does, so this hack is needed). Detection is done by checking for the high bit in the PLOADER_PARAMETER_BLOCK pointer, which will be set on NT.
- Fix a double bug in KiSystemStartup. First, we were setting KPCR->Number instead of KPRCB->Number. Second, we were using KeGetPcr instead of __writefsdword. It worked on ROS because KeGetPcr is hard-coded to ROS's KPCR buffer.

svn path=/trunk/; revision=24334
2006-10-01 06:43:26 +00:00
Alex Ionescu 790760dcf4 - Remove all the remaining code in boot.S and make KiRosPrepareForSystemStartup fastcall. Now NtProcessStartup just does a jmp to KiRosPrepareForSystemStartup without any other code.
- Use freeldr's stack during all of freeldr.c, and only switch to the boot stack in KiSystemStartup before calling KiInitializeKernel. This is what NT does as well (it piggybacks on NTLDR's stack until then). This allowed us to clean boot.S and now we can boot from NTLDR properly.

svn path=/trunk/; revision=24333
2006-10-01 06:08:05 +00:00
Alex Ionescu 380f89c205 - Fully use KeLoaderBlock->InLoadOrderListHead for driver loading and symbol lookups, instead of KeLoaderModules/KeLoaderModuleCount. Still not 100% compatible with NTLDR (since it uses BootDriverListHead with a special structure), but much closer to a portable design that doesn't rely on static kernel data.
- Change some internal functions to use UNICODE_STRING instead of PCHAR since this is how LdrEntry->BaseDllName is, and also it's closer to NT Design.

svn path=/trunk/; revision=24331
2006-10-01 05:05:57 +00:00
Hervé Poussineau fbe45c7180 Give enough space to retrieve full device class description
svn path=/trunk/; revision=24326
2006-09-30 23:37:44 +00:00
KJK::Hyperion ae3c3041f4 Fixes to un-break trunk:
* Disabling XBox HAL for now (TEMPORARY MEASURE)
 * Port MP HAL to the new loader structures

svn path=/trunk/; revision=24325
2006-09-30 23:35:17 +00:00
Hervé Poussineau 7227204f68 Better resources handling in serial driver.
All: copy lower device flags to FDO. This prevents the serial mouse to use buffered I/O

svn path=/trunk/; revision=24324
2006-09-30 23:06:51 +00:00
Hervé Poussineau b606a6771c Do not expect a call to AddDevice with a NULL Pdo. Those are not guaranteed
svn path=/trunk/; revision=24323
2006-09-30 22:41:23 +00:00
Hervé Poussineau 3f47783c54 Implement SetupDiGetDriverInstallParamsW
Add support for DI_FLAGSEX_INSTALLEDDRIVER

svn path=/trunk/; revision=24322
2006-09-30 20:42:47 +00:00
Hervé Poussineau b0e0c40c5d i8042prt manages PS/2 ports, not PS/2 devices. Take it into account when browsing devices detected by freeldr.
svn path=/trunk/; revision=24321
2006-09-30 19:09:10 +00:00
Hervé Poussineau c1e52bcfca Fix wrong default registry value, which was possibly leading to non PS/2 keyboard detection at startup
svn path=/trunk/; revision=24320
2006-09-30 17:26:31 +00:00
Thomas Bluemel 41f18c74da Recalculate property sheet sizes after adding/removing sheets.
svn path=/trunk/; revision=24319
2006-09-30 16:31:35 +00:00
Alex Ionescu c25e3321b0 - Complete much more of KiRosFrldrLpbtoNtLpb. We now:
- Create a LDR_DATA_TABLE entry for each module (driver, hal, kernel) and properly fill it out and insert it into the loader block.
  - Use the NLS data block to hold pointers to the NLS tables.
  - Use the ->RegistryBase/Length loader block members to hold pointers to the SYSTEM hive.
  - Create a MEMORY_ALLOCATION_DESCRIPTOR for each type of memory currently used (LoaderNlsData, LoaderRegistrydata, LoaderSystemCode, LoaderHalCode, LoaderBootDriver).
  - Changes are currently UNUSED!
- Revert LOADER_PARAMETER_BLOCK change, it actually really is PNLS_DATA_BLOCK.

svn path=/trunk/; revision=24318
2006-09-30 16:04:23 +00:00
Alex Ionescu 13ccbc28b2 - Re-remove intrinics from winddk.h
- Fix a typo in LOADER_PARAMETER_BLOCK

svn path=/trunk/; revision=24317
2006-09-30 14:57:30 +00:00
Magnus Olsen 10bd13604b adding back __readcr4 and __readcr3 to winddk.h for gcc does not have it. come bit futer build trunk
svn path=/trunk/; revision=24316
2006-09-30 14:43:41 +00:00
KJK::Hyperion 52fb2adb7c Corrected DWORD operand typo (%l -> %k)
svn path=/trunk/; revision=24315
2006-09-30 14:40:12 +00:00
Thomas Bluemel b1a25bba1d Fix GCC4 warnings
svn path=/trunk/; revision=24314
2006-09-30 11:54:37 +00:00
Magnus Olsen 767b7de159 hopply this will fix hal_xbox build not tested.
svn path=/trunk/; revision=24313
2006-09-30 11:33:21 +00:00
Magnus Olsen ce35dd9b7b fix build of blue again gcc does not have _disable and _enable, but MSVC have it.
svn path=/trunk/; revision=24312
2006-09-30 10:52:41 +00:00
Ged Murphy c3a99cfb3e implement refresh, although it runs at a snails pace until the multiple SetupDiGetClassDevs call issue is fixed
svn path=/trunk/; revision=24311
2006-09-30 10:39:36 +00:00
Ged Murphy c2e551ecea stop icon from changing when selected.
This change doesn't seem quite right to me, but it works for now

svn path=/trunk/; revision=24310
2006-09-30 10:31:28 +00:00
Ged Murphy f8df38ff88 add a line at the root of the tree for user ergonomics :)
svn path=/trunk/; revision=24309
2006-09-30 10:18:04 +00:00
Alex Ionescu 540d96660c - Save processor state in the PKPRCB in KiInitializeKernel.
- Set the booting CPU as idle if no next thread was scheduled.
- Raise IRQL to HIGH_LEVEL upon exiting KiInitializeKernel to match the re-lowering to DISPATCH_LEVEL in KiSystemStartup (and subsequent interrupt flush).

svn path=/trunk/; revision=24308
2006-09-30 07:04:49 +00:00