A free Windows-compatible Operating System - mirrored from GitHub
Find a file
Timo Kreuzer 2a5f6261a5 [FREELDR]
Convert freeldr and setupldr to PE format.
Previously freeldr was a raw binary file, which made handling by the bootsector very easy, but it disqualified it from proper debugging with gdb using symbols. This is possible with having unstripped PE files.
As we don't have any space to do proper PE loading from the bootsector (I already had to trim some strings to get enough space for the new jump code), we need to make sure, that the PE file doesn't contain a .bss section, which is achieved by a linker script. The next thing is to make sure, we don't have any symbols in the output file, because they would make freeldr too big to be loaded into memory and they are useless anyway. On the other hand we like to keep the symbols in the .nostrip.sys files if requested, as this is the primary purpose. This is in theory not a problem, as we could simply strip the file at the end, but binutils throw a monkey wrench in our plans: both strip and objcopy disrespect the file alignment and create unaligned sections, that don't naturally match their VAs. This is solved by hacking rbuild to do invoke ld 2 times, one time without and one time with the symbols (if requested).
Now the bootsectors also got some changes: instead of jumping to the loading address (0x8000) they get the address of the entry point from the image optional header. This is slightly simplified, by assuming the NtHeader begins at offset 0xE0. This finally allows source level debugging of freeldr with gdb.

svn path=/trunk/; revision=48124
2010-07-19 23:18:31 +00:00
irc Give Techbot the ability to check for and ghost existing bots, then rename itself 2008-08-10 13:06:58 +00:00
reactos [FREELDR] 2010-07-19 23:18:31 +00:00
rosapps Forgot to remove the old libpng. 2010-07-12 19:07:39 +00:00
rostests [W32KNAPI] - More tests to NtUserGetIconInfo 2010-07-18 16:57:32 +00:00
wallpaper