Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.2 KiB

  1. Building NT fdisk's boot code
  2. -----------------------------
  3. The master boot code is contained in the file x86mboot.c, which is
  4. #include'd into fd_nt.c. The boot code is in the form of an array
  5. (named x86BootCode) of unsigned chars, which is refered to by code in
  6. fd_nt.c when fdisk needs to lay boot code on the disk.
  7. The x86mboot.c file is generated by different means depending on the
  8. compilation host (ie, whether you're building on x86 or MIPS).
  9. The following applies to x86 ONLY:
  10. ----------------------------------
  11. The master boot code is built from the x86mboot.asm and x86mboot.msg
  12. files in i386 by running masm386 over these files to produce x86mboot.obj.
  13. Then link_60 is run over x86mboot.obj to produce x86mboot.com. The boot code
  14. is at offset 1280 in this file (1280 = 600h-100h. 600h is where the boot
  15. code is assembled, and 100h is where a .com file is loaded by DOS.) It is
  16. of length 0x1be (512 byte sector - 64-byte partition table - signature word).
  17. The tool bin2c.exe (in sdktoosl) is run over x86mboot.com to generate
  18. i386\x86mboot.c.
  19. The following applies to MIPS ONLY:
  20. -----------------------------------
  21. On MIPS, the best we can do is check in the 'finished' product of the
  22. x86 process, namely x86mboot.c, into the mips directory (we cannot run
  23. masm386 or link_60 on MIPS!). If, however, the i386\x86mboot.asm or .msg
  24. files are newer than mips\x86mboot.c, then that means that someone changed
  25. the boot code but did not check in the .c file to mips\x86mboot.c. So we
  26. generate an error message.
  27. The correct action when receiving this error message is to go to an x86
  28. machine, bget or build the i386\x86mboot.c file, and check that file
  29. into mips\x86mboot.c. Then sync on the MIPS machine.
  30. Our build process generates a -I parameter to the compiler based on
  31. the compilation environement (ie, -Imips\ or -Ii386\). This allows fdisk
  32. to simply '#include "x86mboot.c"' and get either the generated file on x86
  33. or the file under source control for MIPS. This way we maintain at least
  34. a semblance of the correct dependencies should the x86mboot.msg file be
  35. translated, etc.