Re: [hatari-devel] NetBSD loader for Hatari |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Hi, On 25.7.2022 16.00, Thorsten Otto wrote:
On Sonntag, 24. Juli 2022 20:05:55 CEST Eero Tamminen wrote:Which of the things discussed here you would be interested to do?Already done.
Wow, looks great, thanks!
From the attached patches, the first one should be identically to one i already posted (in case you already applied it). Then are 2 smaller patches that move the definitions to header files, as suggested. And finally a patch to convert the elf symbols to an array and pass it to Symbols_Set.
Would be better to split symbol handling to its own function in netbsd.c.Current symbol code is already removing symbols that duplicate both name & address, but I do not remember why it just counts symbols that duplicate either name or address.
(Maybe it was to avoid mismatches between symbols given both to Hatari, and to profiler output post-processing.)
In case of NetBSD (with no external symbol file), there could be an option in the duplicate symbol check function that would rename identical symbol names for different addresses (add e.g. index suffix to them).
(As to name aliases for same addresses, those can probably remain.)Because symbols are processed before kernel is actually run, IMHO outputting the duplicate cases is not an issue, as it will not hide any debug output from the kernel run itself.
Alternatively there could be another check function option to silence per-symbol duplicate warnings, so that only totals for duplicates are output.
Btw. did you find anything interesting with the symbol data yet?It can be used e.g. for symbol tracing, and one can enable profiling to get kernel backtraces whenever one drops to debugger, to better find out where kernel is stuck, or to post-process profiling data to code callgraphs.
There is also a small patch that fixes a bug when checking for duplicate names (when duplicates were found, the last symbol was also always dropped). And another small to patch adjust the statusbar display acoordingly (TOS 0.0 isn't very informative ;)
Thanks, I'll add relevant parts of these to Hatari before Nicolas releases 2.4.1.
(The actual NetBSD support Thomas wanted only after the .1 fix release.)
BTW, do you know whether linux and/or bsd check the ROM header for the PAL flag? In that case the loader code has to be changed, since it currently only contains a jump to the kernel start.
Upstream Linux assumes MMU, and such Atari devices are with NVRAM, so it does not necessarily need to rely on ROM.
Only place in Linux source I saw referring to "PAL" was NVRAM driver, which provides that info to proc:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/m68k/atari/nvram.c See attached screenshot from Hatari. - Eero
Attachment:
grab0001.png
Description: PNG image
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |