Skip to content

Commit

Permalink
tools/embed: set physical addresses properly
Browse files Browse the repository at this point in the history
The physical and virtual addresses might be different.
Don't assume they are equal, read and align the physical address.
  • Loading branch information
matheusmoreira committed Sep 21, 2024
1 parent 4ecdb72 commit bf4e88b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/tools/lone-embed.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ set_segment(struct elf *elf, struct lone_elf_header *header,

address = align_to_page(elf, elf->limits.end.virtual);
lone_elf_segment_write_virtual_address(header, segment, address);

address = align_to_page(elf, elf->limits.end.physical);
lone_elf_segment_write_physical_address(header, segment, address);

size = elf->data.size;
Expand Down

0 comments on commit bf4e88b

Please sign in to comment.