memory_raw.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* memory_raw.h - describe the memory map on qemu/coreboot/multiboot/pc */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2002,2007,2008,2009,2013 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_MEMORY_CPU_RAW_HEADER
  20. #define GRUB_MEMORY_CPU_RAW_HEADER 1
  21. /* The scratch buffer used in real mode code. */
  22. #define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000
  23. #define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4)
  24. #define GRUB_MEMORY_MACHINE_SCRATCH_SIZE 0x9000
  25. /* The real mode stack. */
  26. #define GRUB_MEMORY_MACHINE_REAL_STACK (0x2000 - 0x10)
  27. /* The size of the protect mode stack. */
  28. #define GRUB_MEMORY_MACHINE_PROT_STACK_SIZE 0xf000
  29. /* The protected mode stack. */
  30. #define GRUB_MEMORY_MACHINE_PROT_STACK \
  31. (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \
  32. + GRUB_MEMORY_MACHINE_PROT_STACK_SIZE - 0x10)
  33. /* The memory area where GRUB uses its own purpose. This part is not added
  34. into free memory for dynamic allocations. */
  35. #define GRUB_MEMORY_MACHINE_RESERVED_START \
  36. GRUB_MEMORY_MACHINE_SCRATCH_ADDR
  37. #define GRUB_MEMORY_MACHINE_RESERVED_END \
  38. (GRUB_MEMORY_MACHINE_PROT_STACK + 0x10)
  39. /* The code segment of the protected mode. */
  40. #define GRUB_MEMORY_MACHINE_PROT_MODE_CSEG 0x8
  41. /* The data segment of the protected mode. */
  42. #define GRUB_MEMORY_MACHINE_PROT_MODE_DSEG 0x10
  43. /* The code segment of the pseudo real mode. */
  44. #define GRUB_MEMORY_MACHINE_PSEUDO_REAL_CSEG 0x18
  45. /* The data segment of the pseudo real mode. */
  46. #define GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20
  47. #endif