Add HULK header; map virtual memory for HULK bss section
This commit is contained in:
1 parent
c58284761a
commit
15559b0a56
5 files changed
+59
-20
No files matched your search
+10
-4
@@ -19,15 +19,16 @@ KFONT_SIZE = 15
|
||||
|
||||
class HulkBinObj < Builder
|
||||
def run(options)
|
||||
FileUtils.mkdir_p(File.dirname(@target))
|
||||
File.write(@target, <<EOF)
|
||||
.section ".rodata"
|
||||
.balign 4096
|
||||
.global hulk_start
|
||||
hulk_start:
|
||||
.global hulk_bin_start
|
||||
hulk_bin_start:
|
||||
.incbin "#{@sources.first}"
|
||||
.balign 4096
|
||||
.global hulk_end
|
||||
hulk_end:
|
||||
.global hulk_bin_end
|
||||
hulk_bin_end:
|
||||
EOF
|
||||
unless @cache.up_to_date?(@target, nil, @sources, @env)
|
||||
print_run_message("Creating HULK binary object <target>#{@target}<reset>", nil)
|
||||
@@ -86,6 +87,11 @@ hulk_env = env "hulk", use: %w[ldc2 x86_64-elf-gcc] do |env|
|
||||
env.Command("^/hulk.bin", "^/hulk.elf",
|
||||
"CMD" => %W[${OBJCOPY} -O binary ${_SOURCES} ${_TARGET}],
|
||||
"CMD_DESC" => "Convert ELF to binary:")
|
||||
env.add_build_hook do |builder|
|
||||
if builder.target.end_with?(".o")
|
||||
env.Disassemble("#{builder.target}.txt", builder.target)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env|
|
||||
|
||||
Reference in new issue
Block a user