Re: [hatari-devel] NetBSD loader for Hatari

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Sonntag, 24. Juli 2022 18:10:41 CEST Eero Tamminen wrote:

> I think elf.h stuff

> could be split to a common header, instead of being inlined to both

> loader files.

 

Yes, maybe. I did this already for ARAnyM, too.

 

>There's code that stuffs data to "symtab", but that does not appear to

>be used anywhere?

 

That is used by the kernel. The symtab is copied to the end of the kernel, along with a changed ELF hdr that reflects the new offsets. An end of this symtab is passed to the kernel start in register A1; the start address is expected by the kernel to be at its own end address.

I've hacked this up by looking what the elf loader in loadbsd does (https://github.com/NetBSD/src/blob/trunk/sys/arch/atari/stand/tostools/libtos/elf.c ) and how that information is passed to the kernel entry point (https://github.com/NetBSD/src/blob/trunk/sys/arch/atari/stand/tostools/libtos/bsdstart.S )

 

>no checks whether that is valid memory range (= is there

>enough RAM for it)?

 

There is a check for this, after calculating the symbol size.

 

>It would be great if symbol data would work

 

Yes, i know. Shouldn't be too hard, since the kernel is already in memory. Just have to watch out for the values; as already said, the kernel moves itself in memory before doing anything else, and possibly moves itself again to TT-RAM. Only issue would be that the debugger symbol command needs a filename, so you may have to write the map to a temporary file.

 

 



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/