2024-05-23 20:59:18 +03:00
|
|
|
/* The bootloader will look at this image and start execution at the symbol
|
|
|
|
designated at the entry point. */
|
2024-05-21 18:41:16 +03:00
|
|
|
ENTRY(_start)
|
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
/* Tell where the various sections of the object files will be put in the final
|
|
|
|
kernel image. */
|
2024-05-21 18:41:16 +03:00
|
|
|
SECTIONS
|
|
|
|
{
|
2024-05-23 20:59:18 +03:00
|
|
|
/* The kernel is situated at 1 MiB */
|
|
|
|
. = 1M;
|
2024-05-21 18:41:16 +03:00
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
kernel_start = .;
|
2024-05-21 18:41:16 +03:00
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
/* First put the multiboot header, as it is required to be put very early
|
|
|
|
early in the image or the bootloader won't recognize the file format.
|
|
|
|
Next we'll put the .text section. */
|
|
|
|
.text BLOCK(4K) : ALIGN(4K)
|
|
|
|
{
|
|
|
|
*(.multiboot)
|
|
|
|
*(.text)
|
|
|
|
}
|
2024-05-21 18:41:16 +03:00
|
|
|
|
2024-05-23 20:59:18 +03:00
|
|
|
/* Read-only data */
|
|
|
|
.rodata BLOCK(4K) : ALIGN(4K)
|
|
|
|
{
|
|
|
|
*(.rodata)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read-write data (initialized) */
|
|
|
|
.data BLOCK(4K) : ALIGN(4K)
|
|
|
|
{
|
|
|
|
*(.data)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read-write data (uninitialized) and stack */
|
|
|
|
.bss BLOCK(4K) : ALIGN(4K)
|
|
|
|
{
|
|
|
|
*(.bss)
|
|
|
|
*(.stack)
|
|
|
|
}
|
|
|
|
|
|
|
|
kernel_end = .;
|
|
|
|
}
|