现在从freeldr_main模块下手,找到freeldr_main.rbuild文件。
<!DOCTYPE module SYSTEM "http://www.cnblogs.com/../tools/rbuild/project.dtd">
<module name="freeldr_startup" type="objectlibrary">
<include base="freeldr_startup">include</include>
<include base="ntoskrnl">include</include>
<compilerflag>-fno-inline</compilerflag>
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
<directory name="arch">
<if property="ARCH" value="i386">
<directory name="i386">
<file first="true">fathelp.asm</file>
<file>arch.S</file>
</directory>
</if>
<if property="ARCH" value="amd64">
<directory name="amd64">
<file first="true">fathelp.S</file>
<file>arch.S</file>
</directory>
</if>
</directory>
</module>
编译的结果是
C:\react_os>make freeldr_startup
[NASM] boot\freeldr\freeldr\arch\i386\fathelp.asm
[AS] boot\freeldr\freeldr\arch\i386\arch.S
其中freeldr.sys会被引导分区读到到0000:7E00 这个地址,其中如果引导扇区是fat12/16格式时,需要用fathelp.asm(编译出来正好512字节)辅助一下。如果是fat32就不需要这段程序了。
紧接着这个512字节就是arch.S了