Thread: PDOS for Amiga
View Single Post
Old 05 March 2021, 12:37   #57
kerravon
Registered User
 
Join Date: Mar 2021
Location: Ligao, Free World North
Posts: 228
Quote:
Originally Posted by phx View Post
No. The first SDK was long before C90 existed. So it wasn't that common to use prototypes for functions you call. The Kickstart 1.3 SDK was still missing them.
Ok, good point! My interest is all 32-bit environments and C90. Both things needed to happen. So I'd like to "explore the world of computers" armed with these 2 things. So I'm happy to only support a version of AmigaDOS that actually supported C90. I'm also happy to wait until there is sufficient memory available so that I don't need to support virtual memory to do my tasks.

Quote:
That wouldn't work. There is no "Read" in the DOSBase structure. If want to know the details: Every shared library has a Base structure, like DOSBase, which stores some, mostly internal, data for the library. Invisible for C there is a jump-table in front of this structure in memory. For example at offset -42 relative to DOSBase you will find the vector "jmp ReadFunctionInROM", which jumps to the actual Read() function which is valid for your current OS version. Each vector has 6 bytes (jmp-instruction and 32-bit destination address). That's where amiga.lib comes into play. It defines assembler stub functions like:

jsr -42(a6)
Ok, thanks. Can I have a:

#define Read(a,b,c) (int (*)())((char *)DOSBase - 40)(a,b,c)

Also, is there a way of deriving these offsets from this:

http://amigadev.elowar.com/read/ADCD.../node0075.html

I don't know how to convert:

LIBENT Read

into offset 42. No matter which direction I count from.

Quote:
The option in the compiler is different. It is "-o=name".
Thanks. Working now.
kerravon is offline  
 
Page generated in 0.08004 seconds with 11 queries