-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Input files | ||
file1="build/qemu_esp32c3/kernel.bin" | ||
file2="build/qemu_esp32c3/app0.bin" | ||
output="build/qemu_esp32c3/merged.bin" | ||
|
||
# Base address for the first file | ||
base1=0x0 | ||
|
||
# Get size of the first file | ||
size1=$(stat -f%z "$file1") | ||
|
||
# Calculate next aligned address | ||
start2=65536 | ||
|
||
# Generate padding | ||
padding_size=$((start2 - (size1 + base1))) | ||
dd if=/dev/zero bs=1 count=$padding_size > build/qemu_esp32c3/padding.bin | ||
|
||
# Merge files | ||
cat "$file1" build/qemu_esp32c3/padding.bin "$file2" > "$output" | ||
|
||
# Cleanup | ||
rm build/qemu_esp32c3/padding.bin | ||
|
||
echo "Merged $file1 and $file2 into $output starting at $base1 and $start2" |