Welcome, Guest. Please login or register.

Author Topic: execPrivate17()  (Read 975 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline DoobreyTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
execPrivate17()
« on: December 11, 2004, 01:34:10 AM »
The other night, I figured out what execPrivate17() does, and to be honest, I`m left scratching my head over it`s use in OS3.5 and 3.9.

For those that don`t know, that function tries to initialise a rom resident library from an array of library names in exec.
 eg, you tell it to init #2, and it`ll scan the array for the second name, and try and run that libraries init code if it isn`t already running. (It also has a 2nd function, it`ll return a line from the copyright statement if you pass it the complement of the #line you want)

Anyhow.. in 3.1, there were 8 names, and in the 3.9 exec(dunno about 3.5 havent looked yet)that has grown to 10 (added graphics and layers)..BUT, the new names are added to the front of the list.

I found this out the hard way, trying to figure out why some roms I built combining 3.1 parts mixed with 3.9 parts wouldn`t boot..  turns out, some 3.1 parts were calling this private function and getting the wrong library base
 eg, it wanted intuitionbase, but actually got graphicsbase and thinking it was a success, tried calling intuition functions with graphicsbase in a6  :pissed:

So what I`m really asking, is does anyone know why they added them to the front instead of the end of the list?



Edit..
And while I`m here, does anyone know what debugger uses a port called "LLOG"?
On schedule, and suing
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: execPrivate17()
« Reply #1 on: December 11, 2004, 03:01:37 AM »
Sounds like TaggedOpenLibrary().
My Amigas: A500, Mac Mini and PowerBook
 

Offline DoobreyTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: execPrivate17()
« Reply #2 on: December 11, 2004, 03:41:48 AM »
Yup, spot on..

And thanks for making me realise my first post is a complete load of {bleep} ! :lol:

I really shouldn`t code when I`m knackered.. The library lists I mentioned above are exactly the same in exec  v40 upwards (havent checked v39 yet), so nothing has been added, and the stuff about loading up wrong library bases is therefore a load   of twaddle.. (I was wondering how the fanny OS3.9 could boot with a different list..In the immortal words of Homer.."DOH!")

Bugger..now that can only mean there`s still some bugs in my code to be sorted out  :-x
On schedule, and suing
 

Offline seer

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 1453
    • Show only replies by seer
Re: execPrivate17()
« Reply #3 on: December 11, 2004, 09:57:50 AM »
And thanks for making me realise my first post is a complete load of {bleep} !  :lol:

Erm.. If it makes you feel any better, I have no idea what you 2 are talking about and why Itix's response is making you see the error or why it's funny  :-)
~
Everything you say will be misquoted and used against you.
~
 

Offline patrik

Re: execPrivate17()
« Reply #4 on: December 11, 2004, 01:15:25 PM »
@Doobrey:

Sounds like you have a very interesting project going on. How much stuff from 3.9 do you intend to include?


/Patrik
 

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: execPrivate17()
« Reply #5 on: December 11, 2004, 02:13:57 PM »
Quote
I found this out the hard way, trying to figure out why some roms I built combining 3.1 parts mixed with 3.9 parts wouldn`t boot.

How are you regenerating the relocs? Or are you just creating >512KB image and just zapping the matching 3.1 romtags?

I did this for BlizKick some years ago, and there I had to use some extra memory for the modules, since it would not fit 512K.
 

Offline DoobreyTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: execPrivate17()
« Reply #6 on: December 12, 2004, 01:34:55 AM »
@Piru..
 Basically, I spent ages looking at the roms in a hex editor, figuring out where each resident starts and ends.
 From that, I wrote a little app that would scan that area looking for longwords that were between the start and end addresses, and then manually checked them to make sure they were used as an address..great fun when it`s close to 2500 relocs in graphics.library !!

After all that fun, I ended up with a data table that I could use to split a rom into each resident, change all the relocs to be relative to 0 instead of it`s rom address, and save it all out in standard amiga hunk format, complete with a reloc table.

My builder proggy simply allocs 512kb, and then uses it`s own loadseg to reloc each resident module into the memory, then saves the rom image to disk.
I`d hoped to get it finished by Xmas, but as usual, life and work get in the way  :-x

The only minor problem I had was with the ram-handler from OS3.9, which had a BSS hunk in it. But it turned out it wasn`t even used,  as it`s init code just alloc`d some ram of the same size and used that instead. Anyway, a little patch soon sorted that out.

BTW, if anyone`s interested, there`s an old screengrab of it here (bottom half of the waffle!)
On schedule, and suing
 

Offline DoobreyTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: execPrivate17()
« Reply #7 on: December 12, 2004, 01:44:03 AM »
Quote

seer wrote:
Erm.. If it makes you feel any better, I have no idea what you 2 are talking about and why Itix's response is making you see the error or why it's funny  :-)


Well, I think Itix was being waaaaaaaay too polite in pointing out I was talking outta the wrong orifice.
On schedule, and suing
 

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: execPrivate17()
« Reply #8 on: December 12, 2004, 01:52:24 AM »
@Doobrey

Ok, this is pretty much what I did myself once, too. The problem was that there were quite a bit of cases I wasn't 100% sure about (reloc or data). In the end the "derelocated" rom never really worked fully.

If you manage to get it working, congratulations are in order. :-)
 

Offline DoobreyTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: execPrivate17()
« Reply #9 on: December 12, 2004, 02:17:52 AM »
Yup I`ve had the same thing.. some times the new rom worked, other times it didn`t.
 I`m just glad I stumbled across that taggedopenlibrary(), since I was leaving some residents out that I didn`t think were needed (or at least weren`t loaded by a normal OpenLibrary call)and could be loaded from Libs: , such as icon.library.
 It`s wierd, but a rom I built without icon.library worked fine on UAE and also when softkicked on my A4000D, but when tried on an A4000T it refused to boot.

 I`ll just have to figure out what the dependancies are, and include the list in the help file.

BTW, dunno if you remember that question I asked about that sequence of 16 bytes as the end of a rom? I`m not 100% sure, but I got a feeling it`s a sequence of Ramsey register settings.
On schedule, and suing