flat assembler
Message board for the users of flat assembler.
Index
> Windows > discardable / IMAGE_SCN_MEM_DISCARDABLE a piece of advice |
Author |
|
baldr 05 Nov 2010, 17:14
asmfan,
Sections are page-aligned, what good this will do? Discardable (or "pure" for code) segments were significant hints in Win16, NT memory manager doesn't depend on them (probably — I'm still studying WRK). |
|||
05 Nov 2010, 17:14 |
|
revolution 05 Nov 2010, 17:24
My Win XP SP2 box never discards any sections. I used to always put relocations at the end and mark them as discardable, but they were always present in the memory space. So I later "discarded" that idea and just started using the relocation section as uninitialised data overlapping the relocations.
It does make some debuggers go a bit mental sometimes |
|||
05 Nov 2010, 17:24 |
|
asmfan 05 Nov 2010, 22:34
Keep studying WRK - a good habit.
Hint is mainly for R0 than R3. R0 x32 much more restricted in memory than per-process R0 VM area. @Segments. They are flat since you mentioned them. Sections are units of PEs contiguous allocations of pages of same characteristics. discarded sections (if they're at the very end of image) under R0 are freed from (system) PTEs after initialization. relocation section as uninitialised data overlapping the relocations A piece of code how sizes are calculated. Some $ usage and then addition of the rest of uninit? |
|||
05 Nov 2010, 22:34 |
|
revolution 06 Nov 2010, 00:50
Code: section 'mixed' data readable writeable virtual var1 dd ? ;... uninit_end=$ end virtual data fixups end data if uninit_end - $ > 0 rb uninit_end - $ end if |
|||
06 Nov 2010, 00:50 |
|
baldr 06 Nov 2010, 09:13
Discardable (or pure code) segments in Win16 mean that their contents can be discarded as a whole and reloaded on demand from file (i.e. they're immutable). NT paging makes this unusable. Yes, I've seen sections with IMAGE_SCN_MEM_DISCARDABLE bit set that (almost, but not completely) outlive OS runtime.
|
|||
06 Nov 2010, 09:13 |
|
asmfan 06 Nov 2010, 10:33
baldr study WRK more. As well as Intel mans. Segmentation and paging are different mechanisms of different processes of memory management. Don't confuse OS with h/w behavior.
Here's about sections that OS provides. IMAGE_SCN_MEM_DISCARDABLE is still and yet well used by some clever guys in MS dev. Look into every .sys build with DDK/WDK for IMAGE_SCN_MEM_DISCARDABLE flag and make right decisions regarding use of it and sections with flag positions in PE files. And yet "secret" to you purpose of all of this.*) *) hint WRK gives answers for this. Keep studying. |
|||
06 Nov 2010, 10:33 |
|
baldr 06 Nov 2010, 13:22
asmfan,
Those code fragments in mminit.c and sysload.c don't resemble true discardable behavior of Win16 segments. Looks like a shim to me (additional checks for section's name make me firm in my opinion). |
|||
06 Nov 2010, 13:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.