2010-02-17

2010-02-17 - Library Loading

Pah, the library loader is broken.  Having determimned much more information about the COFF format (the second time around), I stated work on the Library Loader V2, and it was going well.  After fixing a few little problems, it turns out the allocation is completely messed up; the data area's on the test area, and the bss is nowhere to be seen.  Oh, and everything is a variable, no functions in sight.  Damn!

After just writing an article about how the section table was one-based, I forgot.  The symbols were looking up their sections assuming they were zero-based.  This is why all the symbols were variables and not functions, and also why they were using the wrong pointer as their relative point and ending up on top of each other.

Success!  The test was successful and the DEADBEEF was returned ... Now how to use this technology?

I think I need to change the Command system to use a list instead of an array, and add the ability to add commands on the fly.  Modify the library initialiser to create a Kernel library with an entry point to the add command routine.  Have loaded libraries auto-initialise and add commands.

No comments:

Post a Comment