25 May 2022, 22:59 | #41 | |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
|
Quote:
As the PPC on the PCI bus can only access memory located in PCI space I wanted to make sure that those hunks were loaded into memory residing in PCI space. This of course only worked for stuff compiled with the extra stuff in the hunk header (thanks phx for this in vlink. I am talking about 2016 now I think). Original WarpOS stuff needed a patch of the hunk header. Later I just patched LoadSeg() and used InternalLoadSeg() and some other stuff to recognize PPC programs and load them into PPC memory directly. Last edited by Hedeon; 25 May 2022 at 23:08. |
|
26 May 2022, 17:17 | #42 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
When this segment list setup has been taken care of, the HUNK_CODE/HUNK_DATA/HUNK_BSS type hunks will be processed in the order in which they are found in the file. For each such hunk type the loader expects the hunk size to be either smaller than what was allocated or exactly the same. The size of the hunk is really just the number of 32 bit words, no flags are expected or even supported. It is too late to change anything now anyway. The loader will not free and reallocate any part of the segment list. If the size of the hunk is smaller than what was asked for at allocation time, then the memory which was not initialized yet will be filled with 0. This is where things can go really wrong if the load file indicates that the size of the HUNK_CODE/HUNK_DATA/HUNK_BSS type hunk is larger than what was allocated. The loader does not expect this and may end up trashing memory. |
|
27 May 2022, 02:02 | #43 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Quote:
Only with object files the memory flags are passed in this location. Simply because object files have no other place to pass them. Some linkers in the past may have been too lazy to remove the flags there, when writing an executable. Which is usually not a problem (at least with either the CHIP or the FAST flag only), because the upper two bits disappear when multiplying by four, to determine the size in bytes. More interesting (to me) is how the extended memory attributes word is passed in object files, when both bits are set, as I never found anything about it. I assumed that the extra word is passed directly behind the size-word in object files, i.e.: Code:
dc.l HUNK_CODE,HUNKF_CHIP|HUNKF_FAST|size,memattr |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga Exe Hunks | heavy | Coders. General | 4 | 16 August 2007 00:20 |
AmigaDOS hunks documentation & HUNK_OVERLAY | AmiGer | Coders. General | 2 | 06 February 2004 08:00 |
|
|