Commit graph

29569 commits

Author SHA1 Message Date
Daniel Reimer 3d1fd7beda reactivate kdbg.
svn path=/trunk/; revision=32366
2008-02-14 22:02:57 +00:00
ReactOS Portable Systems Group c47af2fcdf Don't allow code to access the PFN database directly -- instead, always go through MiGetPfnEntry to have a controlled path.
Add assertions to this function, to make sure PFN access is always valid (previous code would sometimes KEBUGCHECK(0) without a real explenation if such cases were encounted -- but developers randomly chose which functions would be protected).
Also, since PFNs are 0-based, do allow Pfn == MmPageArraySize if someone is reading the last PFN on the system.
Finally, protect some of the functions which were accessing the PFN entries outside the PFN list lock.

svn path=/trunk/; revision=32365
2008-02-14 21:19:30 +00:00
ReactOS Portable Systems Group 93c66fb50d One would expect that a function called "MmIsUsablePage" would return whether a not a page is usable. In other words, we are making sure that the page is free/available, so that we may make use of it. Apparently not so -- MmIsUsable page returned if a page was NOT usable, but was instead "already used". The caller's wish was to ensure he was correctly using a used page, not to check if he could start using a usable page. This would just be an annoying gramatical/logic error (but makes "sense" in the way it's used), if it weren't for the fact that MmIsUsablePage also returned TRUE for BIOS pages (which meant, "yes, you are correctly using/overwriting memory we spent time ensuring to mark as reserved/BIOS").
Renamed the function to MmIsPageInUse, and only return TRUE if the page is in use. Like the name says.

svn path=/trunk/; revision=32364
2008-02-14 20:30:31 +00:00
Aleksey Bragin bf3c65f8a3 - Load drivers database (AppPatch/drvmain.sdb), so Windows could use it if needed.
svn path=/trunk/; revision=32363
2008-02-14 20:27:59 +00:00
ReactOS Portable Systems Group 99b1ac6cb9 Fix a couple of off-by-one bugs we recently introduced -- PFNs are one of the only indexes which are actually 0-based, so you really want to loop from 0 to the last page, inclusive (unlike most loops where you would stop *before* the last element index).
svn path=/trunk/; revision=32362
2008-02-14 20:20:44 +00:00
ReactOS Portable Systems Group ee3729d613 Stop lying that the PCR, KUSER_SHARED_DATA, and PDEs are "BIOS" pages, they're USED pages.
Stop initializing fields to 0 if we've already cleared the entire array!
Stop setting arbitrary values for MapCount and ReferenceCount -- both the KPCR, KUSER_SHARED_DATA and PDE are mapped!
Stop saying Video ROM has a reference count, it's the same as BIOS memory, except the MiIsPfnRam function doesn't detect it and we have a hack for it.

svn path=/trunk/; revision=32361
2008-02-14 20:03:33 +00:00
ReactOS Portable Systems Group b4a63ba74a Prepare for getting rid of the Freelist hacks and use memory descriptors instead, by detecting the highest free memory descriptor, and allocating the page array PTEs from there (gets rid of the "LastPage" variable).
svn path=/trunk/; revision=32360
2008-02-14 19:24:02 +00:00
ReactOS Portable Systems Group 7ca0ac88f8 We were looping the memory descriptors in order to find the number of pages that are available to the system, that is to say, your RAM, minus pages that the BIOS said belong to it. This part is good. Next up, we were creating the page array for these pages, up to the highest entry, which we called, the number of pages on the system. This is the problem. Suppose we had 1000 pages somewhere in low memory that were used by the BIOS, we'd now call the total pages RAM - 1000 (correct). However, we'd also set the highest page array entry to RAM - 1000, which is wrong, because esssentially this eats up 10MB of memory, since the top 10MB (which are FREE, usable memory) are never entered into the database. So really, what we want to do is differentiate the TOTAL amount of usable RAM, versus the HIGHEST page that is usable (which is actually what should be the highest entry in the page array). This will reclaim the lost RAM ReactOS has been eating up all these days. But it gets better: eventually, someone noticed ReactOS was eating memory, and added 1MB more to the "total", making the highest entry "1mb higher". This ...kind of... fixes the problem above by giving you one more MB, but what if ReactOS was only eating up 150KB, as was more the case? Then ReactOS would believe that the other 850KB of memory are "Free physical memory", when actually, they're pages that don't even exist. Wow!
Fixed these bugs.

svn path=/trunk/; revision=32359
2008-02-14 18:33:38 +00:00
ReactOS Portable Systems Group 4f337a6db1 Why divide up the page array into chunks of 128 pages? Why have a nested loop to initialize system memory in chunks of 128 pages? Why zero the array entries in chunks of 128? The page array is now initialized by simply iterating every page on the system, and filling out its entry in the array.
Moved out the division calculations even one more step out of the loop -- now they're really calculated once, instead of 1000 times (an improvement over the 400000 times they were calculated previously).

svn path=/trunk/; revision=32358
2008-02-14 16:59:14 +00:00
ReactOS Portable Systems Group 0ef4d8dcdd Don't loop the page array list THREE times to set it up, ONCE is plenty enough!
Remove the incomprehensible PFN allocation being done for the pages holding the page list array. We now: 1) Find the highest usable RAM page 2) Allocate the PTEs to hold the array from that point on and lower.
Don't do expensive divisions for every single page on the system being looped! Precompute the values ONCE.
Don't set the reference count for the KPCR and KUSER_SHARED_DATA to 0, these are LIVE pages!
Removed the hack which pre-initializes the balancer -- this isn't needed anymore since the initial PTEs are allocated always from RAM now.
Add some comments about the assumptions being made in this code regarding all PCs having the same kind of memory maps.

svn path=/trunk/; revision=32357
2008-02-14 16:40:32 +00:00
ReactOS Portable Systems Group 81d636ae70 The Memory Manager design dictated that every page must be on a linked list, so that it can be removed from that list when dereferenced, and inserted on the free list. This wasn't optimal, because the UsedPageListHead was actually not used for anything else than working set and user-page LRU. Nevertheless, every single page on the system would be on a list (such as the non-pool memory list), even if those lists were ignored. Those lists are all gone now, replaced by the UsedPageListHead. Likewise, the BIOS page list has also been removed.
svn path=/trunk/; revision=32356
2008-02-14 15:36:12 +00:00
Daniel Reimer 14154e1c58 Bug 3053: some slovak translations by Mario Kacmar - kario@szm.sk
Bug 3066: Recent usetup polish translation update by Olaf Siejka - olaf_siejka@o2.pl

svn path=/trunk/; revision=32355
2008-02-14 11:30:14 +00:00
ReactOS Portable Systems Group 7ea9f649ca Remove more dead code from MmInit1. This nugget was trying to free memory allocations between 0x80F50000 and 0x80600000?
[FORMATTING] Make MmInitializePageList readable by human beings.
Remove code in MmInitializePageList which was just repeating what MmInit1 had already done (why?). Remove alignment code which was duplicated (why??).

svn path=/trunk/; revision=32354
2008-02-14 04:44:51 +00:00
ReactOS Portable Systems Group ad3e1b7948 [FORMATTING] Reformat MmInit1.
Also, it seems someone added code to get the First/LastKernPhysAddrs without having them setup (they are setup by the FreeLDR hack-code in freeldr.c, not by "real" bootloaders)... so why set them up in the first place? The code now uses the nice memory-list based routines to get this information instead.
Re-factored some detection and debugging code, cleaned up comments.


svn path=/trunk/; revision=32353
2008-02-14 04:28:41 +00:00
ReactOS Portable Systems Group 44baeebd8a [FORMATTING] Remove dead code (#if 0) and re-organize the file to match kernel standard layout/style.
Get rid of old debugging hacks introduced by ion (rmapready, pageopready, pagingready).

svn path=/trunk/; revision=32352
2008-02-14 03:08:20 +00:00
ReactOS Portable Systems Group 7c1fea060f Don't overwrite the stacks anymore -- set the right pointer in the ARM loader block (remember that stacks are top-down!).
Make a specialized UNIMPLEMENTED for Mm code so we don't go too far into the boot with 100 failures hanging behind our backs, which makes it hard to debug progress.

svn path=/trunk/; revision=32351
2008-02-14 02:33:42 +00:00
ReactOS Portable Systems Group 70fbfefbe5 Say hello to 4KB pages! Removed bring-up 1MB page hacks all over FreeLDR, and setup the kernel pages the same way the x86 build does it -- 6MB from 0x80800000 to 0x80DFFFFF for kernel and drivers.
We still identity map the bottom 0MB of memory with a 1MB page, since this makes the most sense.
We now map the low 8MB of memory to 0x80000000-0x807FFFFF, also with 4KB pages. This area will be discardable after early-init, and contains the early boot structures allocated by FreeLDR.
The Loader Parameter Block and its Extension are now dynamically allocated, instead of being static inside FreeLDR.
Fixed some bugs in the ARM_PTE structure.

svn path=/trunk/; revision=32350
2008-02-14 02:25:25 +00:00
Marc Piulachs 3f38f62b4c -'win32csr' and 'access' localizations by Javier Ramacha
See issue #3028 for more details.

svn path=/trunk/; revision=32349
2008-02-13 21:00:33 +00:00
Johannes Anderwald 773c3b017d - use tchar
- rename dialog to win xp sp2+ name

svn path=/trunk/; revision=32348
2008-02-13 17:51:41 +00:00
Dmitry Chapyshev 356bb09e5b - Fix build
svn path=/trunk/; revision=32347
2008-02-13 17:09:51 +00:00
Dmitry Chapyshev 7bbd9b91ed - Add winhttp.dll from Wine
- Add winhttp.h from Wine
- Add rbuild file for winfax.dll
- Add winhttp and winfax to bootcd

svn path=/trunk/; revision=32346
2008-02-13 16:46:28 +00:00
Dmitry Chapyshev 206e93a129 - Update Russian translation
svn path=/trunk/; revision=32345
2008-02-13 15:38:05 +00:00
Dmitry Chapyshev 1dcbc1bb71 - Synced wine head
svn path=/trunk/; revision=32344
2008-02-13 15:37:13 +00:00
Dmitry Chapyshev 4f86f92b0a - Update Russian translation
- Fix typos

svn path=/trunk/; revision=32343
2008-02-13 15:34:50 +00:00
ReactOS Portable Systems Group ea56f811ec Convert all Mm ASM stubs to C stubs in mm/arm/stubs.c. Now we can see what functions are called.
svn path=/trunk/; revision=32342
2008-02-13 06:43:36 +00:00
ReactOS Portable Systems Group e31c6ada8e Add /arm tree for Memory Manager and stub MmUpdatePageDir in C.
Add exp.c for ARM. Stub out KeContextToTrapFrame in C.
Add thrdini.c for ARM and implement KeArmInitThreadWithContext -- may require changes if the exception frame structure isn't preserving all we need. Stub out KiThreadStartup in C.

svn path=/trunk/; revision=32341
2008-02-13 05:16:14 +00:00
ReactOS Portable Systems Group a177849941 HalInitializeProcessor has no work to do on ARM
svn path=/trunk/; revision=32340
2008-02-13 05:11:35 +00:00
ReactOS Portable Systems Group 0c117eca26 Kill PSEH on ARM
svn path=/trunk/; revision=32339
2008-02-13 05:11:12 +00:00
ReactOS Portable Systems Group 172094a162 First attempt at ARM Exception Frame structure definition
svn path=/trunk/; revision=32338
2008-02-13 05:10:45 +00:00
ReactOS Portable Systems Group 2877ab7568 Just return FALSE in KDCOM on ARM, instead of freezing.
svn path=/trunk/; revision=32337
2008-02-13 04:58:43 +00:00
Timo Kreuzer a8c044b6cb Big ntuser fix:
- rename ObmXxx functions to UserXxx functions
- remove some macros
- move prototypes to object.h
- implement UserreferenceObjectByHandle creating a reference to the object, used for cursoricon stuff so far
- rewrite object manager functions to reasonably handle references
- dereference cursoricons correctly, so they will really get deleted -> fixes a cursoricon leak
- destroy submenus in NtUserDestroyMenu -> fixes a big menu leak
- free the buffer of the menu text -> fixes a mem leak
- delete old bitmaps in NtUserSetCursorContent -> fixes a bitmap leak
- delete monitor object on failure
Now taskmgr doesn't leak memory anymore. we still leak some user handles here and there even after terminating a process, but it's much better now.

svn path=/trunk/; revision=32336
2008-02-13 00:46:23 +00:00
Timo Kreuzer 8e61015f65 BITMAPOBJ_CopyBitmap:
- release lock on failure
- delete created bitmap on failure
- copy flags, fixes a memory leak

svn path=/trunk/; revision=32335
2008-02-12 23:14:07 +00:00
ReactOS Portable Systems Group ed323f3711 We now have a good initialization routine for ARM. We call HalInitializeProcessor (TBD) to setup the board, then we configure the PRCB and PCR. We also setup some global CPU variables and setup minimal interrupt support. The rest of the code follows the x86 design (Create initial thread/process).
There's now a cpu.c for ARM as well, and the cache routines are now there.
KDCOM APIs were marked as kernel stubs, so the kernel was never linking with kdcom. This has been fixed, and boot now stops in kdcom!KdPortInitializeEx since there's no ARM-compatible code.

svn path=/trunk/; revision=32334
2008-02-12 22:50:54 +00:00
ReactOS Portable Systems Group 93970a965e Added cache sweeping code into the HAL, for ARM926EJ-S and ARM1026EJ-S CPUs.
Finished implementation of KiSystemStartup.
Copied KiInitializeKernel from x86 to ARM, removing irrelevant parts. This is our current checkpoint.

svn path=/trunk/; revision=32333
2008-02-12 20:32:23 +00:00
ReactOS Portable Systems Group 0237c83496 QEMU doesn't support TLB Lockdown, so we now use a hack for QEMU and broken CPUs [albeit a portable one ;-)]. PCR access in usermode/kernelmode works.
We now have HalSweepI/Dcache APIs exported and stubbed in the ARM HAL (great, since UNIMPLEMENTED macro now works).
We now setup more of the PCR, including all the cache values required, then we call the HAL sweep functions (TBD).

svn path=/trunk/; revision=32330
2008-02-12 19:01:48 +00:00
Christoph von Wittich 4232dfc7a2 fix some memory and resource leaks
fixes by janderwald and myself

svn path=/trunk/; revision=32329
2008-02-12 18:49:20 +00:00
ReactOS Portable Systems Group e28048569a Fixed some bugs in KeFillFixedEntryTb -- we actually needed to map the PTE into memory (then we can umap it).
We were doing the initial PCR/PDR page allocation completely wrong since we're using 1MB section pages, not 4KB pages (this needs to be fixed later).
Piggyhack arm_kprintf on top of DebugService which we now define. DPRINT1 and ASSERT now work!
Send ARC paths and normalized command-line in the loader parameter block.
Current state:
FreeLoader v3.0 for ARM
Bootargs: rdbase=0x2000000 rdsize=0x1400000
Detecting Hardware...
Loading...
Reading NTOSKRNL.EXE
Reading BOOTVID.DLL
Reading HAL.DLL
Reading HAL.DLL                                                                 
Reading c_1252.nls
Reading c_437.nls
Reading l_intl.nls
Reading scsiport.sys
Reading atapi.sys
Reading buslogic.sys
Reading pci.sys
Reading class2.sys
Reading disk.sys
Reading vfatfs.sys
Reading ndis.sys
Mapped serial port to 0xc00f1000
(ntoskrnl/ke/arm/kiinit.c:135) -----------------------------------------------------
(ntoskrnl/ke/arm/kiinit.c:136) ReactOS 0.4-SVN (Build 20080207-r32151)
(ntoskrnl/ke/arm/kiinit.c:137) Command Line: DEBUG  DEBUGPORT=COM1  BAUDRATE=115200  SOS
(ntoskrnl/ke/arm/kiinit.c:138) ARC Paths: ramdisk(0) \ ramdisk(0) \ReactOS\


svn path=/trunk/; revision=32328
2008-02-12 18:34:33 +00:00
ReactOS Portable Systems Group b8a06afb8c Added arm_kprintf() for early kernel debugging (ARM bringup).
Freeldr maps the "Versatile"'s serial port into virtual
memory now, and C code can just use arm_kprintf().
This is not code that is supposed to remain in the kernel,
it's only needed for bringup, until enough is working so
that standard serial DbgPrint() works through the original
code path.

svn path=/trunk/; revision=32327
2008-02-12 17:45:58 +00:00
Gregor Brunmar 0531986011 Implemented IDirect3D9::GetAdapterDisplayMode()
svn path=/trunk/; revision=32326
2008-02-12 17:30:32 +00:00
Daniel Reimer 1b3b0a7310 Hopefully the last String. Translators. Your turn.
svn path=/trunk/; revision=32325
2008-02-12 17:00:09 +00:00
ReactOS Portable Systems Group f6587f9c6b Fix comments in ksarm.h -- they must be C89.
svn path=/trunk/; revision=32324
2008-02-12 16:32:13 +00:00
ReactOS Portable Systems Group e4d660e795 Write initialization code in assembly -- we load the kernel stack from FreeLDR and jump to C code.
We now have a file for C-code initialization (no reason to use assembly).
We now have some basic TLB routines and intrinsics (not tested).
We also detect if we are running on V4 or V6, and set the TLB and ASID counts respectively.

svn path=/trunk/; revision=32323
2008-02-12 16:22:01 +00:00
Daniel Reimer 22cecfcc97 Beginnings to allow to translate all other Strings. Translators, PLEEASE wait until I am ready before you file Bugs, you can already start to translate, but do not post Bugreports until I am ready adding the last hidden ones.
Thanks to Johannes Anderwald for explaining me why it made more Problems than fix stuff to translate some strings and how to fix it.

svn path=/trunk/; revision=32322
2008-02-12 14:52:36 +00:00
Aleksey Bragin 1565a8ee43 - Kernel's entrypoint is called NtProcessStartup right now, for ReactOS. If this is to be changed, it should be changed for all archs, not only for ARM.
svn path=/trunk/; revision=32321
2008-02-12 13:34:33 +00:00
Johannes Anderwald dd25d44880 - pass the correct path to _strip_gcc_deffile
- automatically create directories for converted def files
- fixes auto-def file generation

svn path=/trunk/; revision=32320
2008-02-12 12:18:23 +00:00
Hervé Poussineau 17e045e905 Fix assertion is pci/fdo.c
svn path=/trunk/; revision=32319
2008-02-12 11:16:05 +00:00
ReactOS Portable Systems Group e5ed1afb69 We now define the cache and id registers in CP15 (C0 Opcode 0 and 1).
We now setup ARM cache information in the loader block.
We now allocate the kernel, interrupt and abort stacks, as well as the idle thread and process, and boot PRCB.
We now allocate the PCR and PDR pages.
We now send the command line to the kernel in the LoaderBlock's load options.

svn path=/trunk/; revision=32318
2008-02-12 09:41:21 +00:00
Daniel Reimer 121e0c645a Bug 3053: some slovak translations by Mario Kacmar, kario@szm.sk
Bug 3051: Italian resources update by Paolo Devoti, devotip@tiscali.it

svn path=/trunk/; revision=32317
2008-02-12 08:44:41 +00:00
ReactOS Portable Systems Group 3e0f927c2c Real fix, this time, hopefully.
svn path=/trunk/; revision=32316
2008-02-12 06:51:39 +00:00
ReactOS Portable Systems Group 1ad36042e5 Fix for x86 build.
svn path=/trunk/; revision=32315
2008-02-12 06:38:41 +00:00