bios.ld 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* The bootloader will look at this image and start execution at the symbol
  2. designated as the entry point. */
  3. ENTRY(_start)
  4. /* Tell where the various sections of the object files will be put in the final
  5. kernel image. */
  6. SECTIONS
  7. {
  8. /* Begin putting sections at 1 MiB, a conventional place for kernels to be
  9. loaded at by the bootloader. */
  10. . = 1M;
  11. /* First put the multiboot header, as it is required to be put very early
  12. early in the image or the bootloader won't recognize the file format.
  13. Next we'll put the .text section. */
  14. .text BLOCK(4K) : ALIGN(4K)
  15. {
  16. *(.multiboot)
  17. *(.text)
  18. }
  19. /* Read-only data. */
  20. .rodata : ALIGN(4K)
  21. {
  22. *(.rodata)
  23. }
  24. /* Read-write data (initialized) */
  25. .data : ALIGN(4K)
  26. {
  27. *(.data)
  28. }
  29. /* Read-write data (uninitialized) and stack */
  30. .bss : ALIGN(4K)
  31. {
  32. *(COMMON)
  33. *(.bss)
  34. }
  35. .note.gnu.build-id : {
  36. *(.note.gnu.build-id)
  37. }
  38. /* The compiler may produce other sections, by default it will put them in
  39. a segment with the same name. Simply add stuff here as needed. */
  40. }