Hi folks. For a long time I've had my eye on factoring process and kernel
loading out of the system object so that it can be consistent between SE
and FS modes, and while I had a little spare time I decided to try to make
a little progress on that. I ended up going down a bit of a rabbit hole
with the binary loading code, and have now significantly refactored it and
fixed a few random bugs I ran into in the process (and possibly introduced
new ones).

https://gem5-review.googlesource.com/c/public/gem5/+/21469
<https://gem5-review.googlesource.com/c/public/gem5/+/21469/1> et. all

I did some testing by booting Linux on ARM, starting booting Solaris on
SPARC, and running some hello worlds on some ISAs to test out DTB, ELF,
a.out, ECOFF and raw file loading, and these seem to have been successful,
although there weren't any good test cases I could find easily for dynamic
loading.

Now that those classes have been refactored, it should be really feasible
to add some unit tests to the files in that directory. Perhaps that's
something Bobby could take a look at as part of his tour of gem5 and
testing? I don't want to pawn that off on somebody else and may get back to
it myself, but I've spent a lot more time on the refactor than I'd planned
to and need to get back to other things.

One area I think is also probably prime for a refactoring is how symbol
tables are loaded. I think the symbol table class itself could have a
"move()" method like I added elsewhere where you could displace it or
otherwise mutate the addresses in it after the fact. That would get all
that plumbing and extra logic out of the object file loaders and centralize
and generalize it in the symbol table class. That would also make it more
clear what was happening when a symbol table needed to be adjusted for some
reason to, for instance, make it reflect the physical addresses of the
kernel in an early boot, pre-virtual memory environment.

Gabe
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to