59 lines
1.0 KiB
Plaintext
59 lines
1.0 KiB
Plaintext
OUTPUT_FORMAT("binary")
|
|
ENTRY(_start)
|
|
|
|
/* props to https://github.com/rust-osdev/bootloader/blob/main/bios/boot_sector/boot-sector-link.ld */
|
|
SECTIONS {
|
|
. = 0x500;
|
|
_stack_start = .;
|
|
. = 0x7c00;
|
|
_stack_end = .;
|
|
|
|
_mbr_start = .;
|
|
.boot :
|
|
{
|
|
*(.boot .boot.*)
|
|
}
|
|
.text :
|
|
{
|
|
*(.text .text.*)
|
|
}
|
|
.rodata :
|
|
{
|
|
*(.rodata .rodata.*)
|
|
}
|
|
.data :
|
|
{
|
|
*(.rodata .rodata.*)
|
|
*(.data .data.*)
|
|
*(.got .got.*)
|
|
}
|
|
_mbr_end = .;
|
|
|
|
. = 0x7c00 + 446;
|
|
_partition_table = .;
|
|
.partition_table :
|
|
{
|
|
/* partition table entry 0 */
|
|
QUAD(0)
|
|
QUAD(0)
|
|
/* partition table entry 1 */
|
|
QUAD(0)
|
|
QUAD(0)
|
|
/* partition table entry 2 */
|
|
QUAD(0)
|
|
QUAD(0)
|
|
/* partition table entry 3 */
|
|
QUAD(0)
|
|
QUAD(0)
|
|
}
|
|
|
|
. = 0x7c00 + 510;
|
|
|
|
.magic_number :
|
|
{
|
|
SHORT(0xaa55) /* magic number for bootable disk */
|
|
}
|
|
|
|
_second_stage_start = .;
|
|
}
|