bootboot.inc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ;*
  2. ;* x86_64-bios/bootboot.inc
  3. ;*
  4. ;* Copyright (C) 2017 - 2021 bzt (bztsrc@gitlab)
  5. ;*
  6. ;* Permission is hereby granted, free of charge, to any person
  7. ;* obtaining a copy of this software and associated documentation
  8. ;* files (the "Software"), to deal in the Software without
  9. ;* restriction, including without limitation the rights to use, copy,
  10. ;* modify, merge, publish, distribute, sublicense, and/or sell copies
  11. ;* of the Software, and to permit persons to whom the Software is
  12. ;* furnished to do so, subject to the following conditions:
  13. ;*
  14. ;* The above copyright notice and this permission notice shall be
  15. ;* included in all copies or substantial portions of the Software.
  16. ;*
  17. ;* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. ;* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. ;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. ;* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  21. ;* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. ;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. ;* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  24. ;* DEALINGS IN THE SOFTWARE.
  25. ;*
  26. ;* This file is part of the BOOTBOOT Protocol package.
  27. ;* @brief The BOOTBOOT structure
  28. ;*
  29. ; ------ !!! WARNING: MUST MATCH ../bootboot.h !!! ------
  30. bootboot = 8000h
  31. ; this define is in the 18th line of bootboot.h
  32. bootboot_MAGIC equ 'BOOT'
  33. ; minimum protocol level:
  34. ; hardcoded kernel name, static kernel memory addresses
  35. PROTOCOL_MINIMAL equ 0
  36. ; static protocol level:
  37. ; kernel name parsed from environment, static kernel memory addresses
  38. PROTOCOL_STATIC equ 1
  39. ; dynamic protocol level:
  40. ; kernel name parsed from environment, kernel memory addresses parsed from ELF symbols
  41. PROTOCOL_DYNAMIC equ 2
  42. ; big-endian flag
  43. PROTOCOL_BIGENDIAN equ 080h
  44. ; loader types, just informational
  45. LOADER_BIOS equ 0
  46. LOADER_UEFI equ 4
  47. LOADER_RPI equ 8
  48. LOADER_COREBOOT equ 16
  49. ; framebuffer pixel format, only 32 bits supported
  50. FB_ARGB equ 0
  51. FB_RGBA equ 1
  52. FB_ABGR equ 2
  53. FB_BGRA equ 3
  54. ; mmap entry, type is stored in least significant tetrad of size
  55. virtual at 0
  56. mmap_ent.ptr: dq 0
  57. mmap_ent.size: dq 0
  58. end virtual
  59. ; we don't have entry field macros for asm
  60. ; realsize = size & 0xFFFFFFFFFFF0
  61. ; type = size & 0xF
  62. MMAP_USED equ 0
  63. MMAP_FREE equ 1
  64. MMAP_ACPI equ 2
  65. MMAP_MMIO equ 3
  66. INITRD_MAXSIZE equ 16 ; Mb
  67. virtual at bootboot
  68. ; first 64 bytes is platform independent
  69. bootboot.magic: dd 0
  70. bootboot.size: dd 0
  71. bootboot.protocol: db 1
  72. bootboot.fb_type: db 0
  73. bootboot.numcores: dw 0
  74. bootboot.bspid: dw 0
  75. bootboot.timezone: dw 0
  76. bootboot.datetime: dq 0
  77. bootboot.initrd_ptr: dq 0
  78. bootboot.initrd_size: dq 0
  79. bootboot.fb_ptr: dq 0
  80. bootboot.fb_size: dd 0
  81. bootboot.fb_width: dd 0
  82. bootboot.fb_height: dd 0
  83. bootboot.fb_scanline: dd 0
  84. ; the rest (64 bytes) is platform specific
  85. ; x86_64
  86. bootboot.acpi_ptr: dq 0
  87. bootboot.smbi_ptr: dq 0
  88. bootboot.efi_ptr: dq 0
  89. bootboot.mp_ptr: dq 0
  90. bootboot.unused: dq 0,0,0,0
  91. bootboot.mmap:
  92. end virtual