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.

80 lines
3.6 KiB

  1. ;-------------------------------------------------------------------------
  2. ;
  3. ; FILE : ORIGIN.INC
  4. ;
  5. ; This is included in origin.asm and mshead.asm. Contains the equate that
  6. ; is used for ORGing the DOS code.
  7. ;
  8. ; Brief Description of the necessacity of this ORG:
  9. ; -------------------------------------------------
  10. ;
  11. ; A special problem exits when running out of the HMA. The HMA starts at
  12. ; address FFFF:10. There is no place in the HMA with an offset of zero.
  13. ; This means programs running out off the HMA must use non-zero offset base
  14. ; addresses. It also means that if we're running multiple programs from the
  15. ; HMA, the base offset of each segment must atleast be as big as all of the
  16. ; HMA segments that precede it.
  17. ;
  18. ; One solution to this problem to ORG each module at 64K minus its size.
  19. ; For instance a code segment 1234h bytes in length would org'd at edcbh.
  20. ; This gives max. flexibility regarding it's location in the HMA. By
  21. ; selecting segment values between f124h and ffffh it could be located
  22. ; anywhere in the HMA. The problem with this is that programs with such
  23. ; high ORGs would not be able to run in low RAM.
  24. ;
  25. ; A comporomise solution is to set the ORG address somewhere between 0010h
  26. ; and ffffh - their size. In the particular case of the BIOS and the DOS
  27. ; the folloowing solution has been implemented:
  28. ;
  29. ; The Bios Code segment will have a very small offset and run at the very
  30. ; front of the HMA, after the VDISK header. THE Dos Code segment will have
  31. ; a base offset of (700+<min. size off RAM based BIOS>+<min. size of the DOS
  32. ; DATA segment when DOS is running low>). This will reflect the lowest
  33. ; possible physical address at which DOS code will run, while still providing
  34. ; max. possible flexibility in HMA positioning. This offset MUST NOT be
  35. ; smaller then that 20+size of Bios Code segment when running high. This is
  36. ; mostly true.
  37. ;
  38. ; Also this ORG'd value must be communicated to the BIOS. This is done by
  39. ; putting this value after the first jmp instruction in the DOS code in
  40. ; mshead.asm.
  41. ;
  42. ; In order for the stripz utility to know how many zeroes to be stripped
  43. ; out, this value is placed at the beginning of the binary in origin.asm.
  44. ;
  45. ; Revision History:
  46. ;
  47. ; Currently this is being done manually. Therefore any change in the DOS DATA
  48. ; Size or the BIOS size should be reflected here. --- Feb 90
  49. ;
  50. ; BDSIZE.INC contains the equates for BIODATASIZE, BIOCODESIZ and DOSDATASIZ.
  51. ; A utility called getsize will obtain the corresponding values from msdos
  52. ; and msbio.map and update the values in BDSIZ.INC if they are different.
  53. ; DOS should now be built using the batch file makedos.bat which invokes this
  54. ; utility. The FORMAT of BDSIZE.INC should not be changed as getsize is
  55. ; dependant on that. --- Apr 3 '90
  56. ;
  57. ; For ROMDOS, however, there is no need to org the doscode to any location
  58. ; other than zero. Therefore the stripz utility will not need to be used,
  59. ; so the offset will not need to be included at the beginning of the code
  60. ; segment. Also, the BIOS can just assume that the resident code begins
  61. ; at offset zero within the segment.
  62. ;
  63. ;
  64. ;--------------------------------------------------------------------------
  65. ;
  66. BIODATASTART EQU 00700h
  67. include bdsize.inc ; this sets the values:
  68. ; BIODATASIZ
  69. ; BIOCODESIZ
  70. ; DOSDATASIZ
  71. ifndef NEC_98
  72. BYTSTART EQU BIODATASTART+BIODATASIZ+BIOCODESIZ+DOSDATASIZ
  73. PARASTART EQU ((BYTSTART + 0FH) AND (NOT 0FH)) - 40h
  74. else ;NEC_98
  75. BYTSTART EQU BIOCODESIZ
  76. PARASTART EQU (BYTSTART + 0FH) AND (NOT 0FH)
  77. endif ;NEC_98
  78.