Welcome, Guest. Please login or register.

Author Topic: Extracting files from a kickstart rom  (Read 7105 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #14 on: January 05, 2005, 10:27:00 PM »
I have already downloaded several programs off aminet to attempt to look inside the kickrom file but it mostly comes out as total garbage, I assume that it probably has something to do with the C programming that the rom was also programmed in.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Extracting files from a kickstart rom
« Reply #15 on: January 05, 2005, 11:05:14 PM »
@AF-Domains.net
Quote
Which are the best Assembly and C programming tools to use to disassemble the kick roms with?


The best tool for disassembling on Amiga is ReSource (by The Puzzle Factory, Inc.), a commercial tool dedicated for disassembly.

Quote
I have already downloaded several programs off aminet to attempt to look inside the kickrom file but it mostly comes out as total garbage, I assume that it probably has something to do with the C programming that the rom was also programmed in.

Not really. The problem is that there is no easy way determining which part of the binary is data and which is code. So these tools probably blindly disassemble everything as code, and that will never work.

Even with ReSource you still need to manually "guide" the program, adjust the code/data selection (and data type selection) if and when ReSource automagic disassembly gets it wrong.

This is only very very brief explanation, but I am sure this (and your troubles with initial attemps) give you an idea of the magnitude of the problems you're tacking with.
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #16 on: January 05, 2005, 11:12:18 PM »
I think I have a very good idea of what I am getting myself into.

After browsing the internet for glimpses of the kickrom programming I only found the brief extract of the fake kick 3.5 rom.

The coding that I saw on that site and the coding I get when running one of the many programs on my 1200 is completely different.

If I succeed on being able to reprogram a romfile it won't be distributed anywhere.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Extracting files from a kickstart rom
« Reply #17 on: January 05, 2005, 11:12:23 PM »
@seer

Quote
Ok, this is something I don't understand. I mean, something must read the ROM otherwise the Amiga doesn't work/boot.

True.

Quote
So, doesn't that mean you can make a tool that does almost the same ? Read the rom and extract the needed modules ?

No.



The problem is that the specific modules are absolutely relocated at link stage to fixed memory address, and there is no (easy) way to get the relocation information from the already absolute-address linked ROM.

The grabbed modules would only work when mapped exactly the addresses they were located originally. And if you think for a moment this means that the order of the modules can't be changed (some modules could be left out and holes filled with other things, though).

So the problem is that unless if the ripped modules are made 'relocatable' they cannot be 'moved' from their original address. This work of figuring out the 'relocs' for arbitrary ROM part is extremely hard. It certainly cannot be made 100% automatic (some tools can be made that figure out the obvious cases though, but still a lot of manual work is needed).

I hope this explanation helps and isn't too technical.
 

Offline seer

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 1453
    • Show only replies by seer
Re: Extracting files from a kickstart rom
« Reply #18 on: January 05, 2005, 11:23:55 PM »
I hope this explanation helps and isn't too technical.

Thanks for trying ;-) Let's just say the fixed memory address and absolute-address make it a bit hard to understand the problem. But guess I'm looking at it from a "simpeler point of view".

But I suppose it means that if you read the ROM and dump the info, the links inside the ROM are pointing to a certain "adress", so if you put the code at another adress it won't work anymore.

But then, if you know the correct location, and the intention is to "recreate" the ROM or in this case a merged 1.4 + 3.1 ROM couldn't you dump the files in RAM or disk, then "disasemble" it, and reprogram it a bit or put it back in another ROM and have the correct adresses again ?


Well, I did say I'm looking at it from a very different and simpel POV.



~
Everything you say will be misquoted and used against you.
~
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #19 on: January 05, 2005, 11:30:22 PM »
Would it be possible to copy both roms onto a flashrom and modify them from their instead of dumping them to disk?

I am creating a merged 1.4 and 3.1 rom to add some of the features that were in 1.4 but were never implemented into later versions of the kickstart and also to see if I can improve any part of both of the roms.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Extracting files from a kickstart rom
« Reply #20 on: January 06, 2005, 12:33:00 AM »
@seer
Quote
But I suppose it means that if you read the ROM and dump the info, the links inside the ROM are pointing to a certain "adress", so if you put the code at another adress it won't work anymore.

That's precisely what the problem is.

Quote
But then, if you know the correct location, and the intention is to "recreate" the ROM or in this case a merged 1.4 + 3.1 ROM couldn't you dump the files in RAM or disk, then "disasemble" it, and reprogram it a bit or put it back in another ROM and have the correct adresses again ?

The obvious problem here is that both roms use the *same* addresses, and thus the modules would overlap. It might be possible to find certain combinations that could be merged without overlap, but it's very unlikely you could find really useful combos, esp since traditionally the modules are linked in certain fixed order (that appears to be a side-effect from the link phase).

@AF-Domains.net
Quote
Would it be possible to copy both roms onto a flashrom and modify them from their instead of dumping them to disk?

Sure. But you still need to relocate the other image or they will overlap. And to do that you need to know exactly where to subtract the original address and add the new one (that's what re-relocation is basically: newptr = oldptr - oldbase + newbase).

Quote
I am creating a merged 1.4 and 3.1 rom to add some of the features that were in 1.4 but were never implemented into later versions of the kickstart and also to see if I can improve any part of both of the roms.

You still need to resolve all the relocs for the components you swap / merge.
 

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: Extracting files from a kickstart rom
« Reply #21 on: January 06, 2005, 12:34:40 AM »
Quote

seer wrote:
 the links inside the ROM are pointing to a certain "adress", so if you put the code at another adress it won't work anymore.


Yup

Quote

But then, if you know the correct location, and the intention is to "recreate" the ROM or in this case a merged 1.4 + 3.1 ROM couldn't you dump the files in RAM or disk, then "disasemble" it, and reprogram it a bit or put it back in another ROM and have the correct adresses again ?


Almost..
It depends what you`re putting into the other ROM.
If the replacement code is smaller, then it`s not a problem as you can simply overwrite the old code.
But if the new code is larger, then you`ve got to reorganise the other parts in the rom, to get the new code to fit.
 This is where it gets messy, since that means working out bucketloads of new addresses to be patched.

 But as Piru said, it`s not a trivial task to split up a ROM.You gotta know where one part ends and another starts, which isn`t always obvious  :pissed:
 Some parts are easy, as they only have 6 relocs to find, but graphics.library is a real headache , somewhere around 2500 relocs to sort out... and they vary from rom to rom.

 It ain`t an easy task, it took me over 3 months to get a working 3.9 boot rom, but it`s a lot of fun and a great way to learn more about how the AmigaOS really works.. anyway stay tuned, I`m almost ready for some suckers...erm, beta testers   :evilgrin:
On schedule, and suing
 

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: Extracting files from a kickstart rom
« Reply #22 on: January 06, 2005, 12:43:23 AM »
Quote

AF-Domains.net wrote:
I am creating a merged 1.4 and 3.1 rom to add some of the features that were in 1.4 but were never implemented into later versions of the kickstart


What features in the 1.4 rom ??

Quote

 and also to see if I can improve any part of both of the roms.


Dunno if you can call it an improvement but I`ve been averaging around 2% space saving per resident, and that`s only doing simple optimisations.
 I`ve also managed things like removing the non-FPU code from the maths libs, saving 2kb.
On schedule, and suing
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #23 on: January 06, 2005, 12:45:25 AM »
Just downloaded the ReSourceDemo program off aminet. It kept on giving me recoverable errors on every single computer I have here.

Any other disassmbler/assemblers that would be recommended?
 

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: Extracting files from a kickstart rom
« Reply #24 on: January 06, 2005, 04:07:03 AM »

 IRA isn`t too bad at dissassembly, it does miss a few instructions that are on 020+ CPUS though, leaving them as dc.w $xxxx etc.
 vda68k can catch the ones that IRA can`t do

 For reassembly, give phxass a whirl.
On schedule, and suing
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #25 on: January 09, 2005, 10:50:17 PM »
If I have gone throught this before then I apologise in advance.

Would it be possible to get instructions on how to extract everything from the rom?

If it is in files coding or both it doesn't matter.
 

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: Extracting files from a kickstart rom
« Reply #26 on: January 10, 2005, 12:15:51 AM »
Hang on till tomorrow..I should have something to make life a lot easier  :sealed:

Be warned, it`s docs are crap..I`m not a {bleep}ing novelist  :-)
On schedule, and suing
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #27 on: January 10, 2005, 12:17:25 AM »
It doesn't matter how crappy the documents or instructions are aslong as they just about work.

Thanks
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Extracting files from a kickstart rom
« Reply #28 on: January 10, 2005, 12:23:30 AM »
Quote

Doobrey wrote:
 But as Piru said, it`s not a trivial task to split up a ROM.You gotta know where one part ends and another starts, which isn`t always obvious  :pissed:
 Some parts are easy, as they only have 6 relocs to find, but graphics.library is a real headache , somewhere around 2500 relocs to sort out... and they vary from rom to rom.
 
ehm, not that I got that much experience with hacking things like this (or actually, being a complete N00b), but ehm, since the kickstart rom wasn't included in the H/W of the A1000, there was a kickstart disk. Dunno til which version of the kickstart was released on disk, but surely the adressing on such a kickstart-on-disk is managed differently.
Maybe it's worth checking, for getting more overall insight :-)
And the canary said: \'chirp\'
 

Offline AF-Domains.netTopic starter

  • Technoid
  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 184
  • Country: 00
    • Show only replies by AF-Domains.net
    • AF-Domains.net
Re: Extracting files from a kickstart rom
« Reply #29 from previous page: January 10, 2005, 12:26:41 AM »
With abit of luck I might be able to program an application that will easily allow modification to any sort of kickrom file or disk.

But for now any help is greatly appreciated.