Poster | Thread |
Wumpus
| |
ROMTAGs and relocation Posted on 8-Oct-2018 16:02:38
| | [ #1 ] |
|
|
|
Member |
Joined: 12-Apr-2018 Posts: 61
From: Unknown | | |
|
| I'm writing a ROM resident module and I'm confused about something.
The RomTag structure is scanned for at boot and among other things, contains the pointers needed to continue scanning and to find the RT_INIT for that module.
That means that it can't be relocatable, right? Those pointers all have to be absolute addresses?
If that's true, how does something like Remus rebuild a ROM in an arbitrary order/location?
|
|
Status: Offline |
|
|
Wumpus
| |
Re: ROMTAGs and relocation Posted on 8-Oct-2018 16:36:49
| | [ #2 ] |
|
|
|
Member |
Joined: 12-Apr-2018 Posts: 61
From: Unknown | | |
|
| I may have thought through this and found my answer, but confirmation would be nice.
I bet I make it relocatable like a normal library and when Remus builds the ROM, it knows where it's supposed to go so it handles relocating it in advance using the relocation info built into all normal libraries.
The reverse of that is probably why it's hard to split a ROM because the relocation info is stripped out. That's why you need a .dat file to match the ROM you want to split.
If that's correct, I'd sure like to hear confirmation from someone who knows.
|
|
Status: Offline |
|
|
Hypex
| |
Re: ROMTAGs and relocation Posted on 9-Oct-2018 11:13:03
| | [ #3 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11181
From: Greensborough, Australia | | |
|
| @Wumpus
Looks like some advanced coding there.
You're right. The RomTag structure has to use absolute pointers as they are used to reference direct memory locations.
Without any relocation info with a hard coded RomTag Remus would need to scan inside the module window and locate absolute references. Unless it does something else. Or already knows info about a limited set of RomTags it uses to relocate it.
With a module like a library built as an executable it can use the relocation info built into the hunks so that's easy enough.
Some more info can be found here: http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0298.html |
|
Status: Offline |
|
|
kolla
| |
Re: ROMTAGs and relocation Posted on 9-Oct-2018 13:46:16
| | [ #4 ] |
|
|
|
Elite Member |
Joined: 20-Aug-2003 Posts: 2859
From: Trondheim, Norway | | |
|
| @Wumpus
Curious, what will your kickstart module do? I kinda wish for a module that can set up some assigns from boot. _________________ B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC |
|
Status: Offline |
|
|
Wumpus
| |
Re: ROMTAGs and relocation Posted on 9-Oct-2018 14:19:18
| | [ #5 ] |
|
|
|
Member |
Joined: 12-Apr-2018 Posts: 61
From: Unknown | | |
|
| @Hypex
I'm pretty sure my second post is correct, I'm just hoping for confirmation.
I've written them before, but that was tested as a separate module first and used Remus to add to the ROM.
This one is a bit odd in that I need to build it for both a static location and for use with Remus for two slightly different use cases.
Sorry if that's cryptic, but I'm not ready to say what it is yet. |
|
Status: Offline |
|
|
Wumpus
| |
Re: ROMTAGs and relocation Posted on 9-Oct-2018 14:21:09
| | [ #6 ] |
|
|
|
Member |
Joined: 12-Apr-2018 Posts: 61
From: Unknown | | |
|
| @kolla
I'd rather not say yet. Hopefully it won't be a lot longer and I'll be releasing the first one. It's actually several ROM modules.
I'm curious about your question though. What's different than just assigning early in startup? |
|
Status: Offline |
|
|
Wumpus
| |
Re: ROMTAGs and relocation Posted on 9-Oct-2018 18:02:43
| | [ #7 ] |
|
|
|
Member |
Joined: 12-Apr-2018 Posts: 61
From: Unknown | | |
|
| @thread
Doobrey answered my question directly.
My assumption in the second post was correct.
It does the relocation in advance when it prepares the ROM image because it knows where that module will be located.
|
|
Status: Offline |
|
|
Hypex
| |
Re: ROMTAGs and relocation Posted on 10-Oct-2018 14:41:15
| | [ #8 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11181
From: Greensborough, Australia | | |
|
| @Wumpus
I agree with you there. I thought you might be corect on that one. |
|
Status: Offline |
|
|