ReacOS启动分析
1.代码从MBR启动(boot\freeldr\bootsect\dosmbr.asm)
2.转到硬盘启动分区(boot\freeldr\bootsect\fat32.asm),它负责寻找freeldr.sys。找到后加载到0000:8000h,然后找到freeldr.sys的入口地址。
3.代码跳转到_mainCRTStartup代码(boot\freeldr\freeldr\arch\i386\fathelp.asm)。
4._mainCRTStartup是三个字节的16位代码,跳转到boot\freeldr\freeldr\arch\i386\Arch.S中的RealEntryPoint。
5.RealEntryPoint切换到保护模式,设置启动参数,然后执行函数_BootMain。
6.BootMain已经变成C语言了。