Skip to content

Commit 37ff520

Browse files
committed
Split first stage into multiple output sections
1 parent fd1b5be commit 37ff520

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

real_mode/linker.ld

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ SECTIONS {
66
. = 0x7c00;
77
_stack_end = .;
88

9-
.bootloader :
9+
_bootloader_start = .;
10+
.boot :
11+
{
12+
*(.boot)
13+
}
14+
.text :
1015
{
11-
*(.boot-first-stage)
1216
*(.text .text.*)
17+
}
18+
.data :
19+
{
1320
*(.rodata .rodata.*)
1421
*(.data .data.*)
1522
*(.got)
16-
. = 0x7c00 + 510;
23+
}
24+
25+
. = 0x7c00 + 510;
26+
.magic_number :
27+
{
1728
SHORT(0xaa55) /* magic number for bootable disk */
1829
}
1930
_bootloader_end = .;

real_mode/src/boot.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.section .boot-first-stage, "awx"
1+
.section .boot, "awx"
22
.global _start
33
.intel_syntax noprefix
44
.code16

0 commit comments

Comments
 (0)