qemu-baremetal-cli-args

QEMU part done https://github.com/cirosantilli/linux-kernel-module-cheat/issues/67
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-04-02 01:00:00 +00:00
parent e25e79c26b
commit 637ef640bf
7 changed files with 161 additions and 70 deletions

View File

@@ -56,23 +56,13 @@ Build the baremetal examples with crosstool-NG.
'-mfpu=crypto-neon-fp-armv8', LF,
])
if self.env['emulator'] == 'gem5':
if self.env['machine'] == 'VExpress_GEM5_V1':
entry_address = 0x80000000
uart_address = 0x1c090000
elif self.env['machine'] == 'RealViewPBX':
entry_address = 0x10000
uart_address = 0x10009000
else:
raise Exception('unknown machine: ' + self.env['machine'])
cc_flags.extend([
'-DLKMC_GEM5=1', LF,
'-DLKMC_M5OPS_ENABLE=1', LF,
])
else:
entry_address = 0x40000000
uart_address = 0x09000000
cc_flags.extend(['-D', 'LKMC_QEMU=1', LF])
cc_flags.extend(['-D', 'LKMC_UART0_ADDR={:#x}'.format(uart_address), LF])
cc_flags.extend(['-D', 'LKMC_UART0_ADDR={:#x}'.format(self.env['uart_address']), LF])
cc_flags.extend(self.sh.shlex_split(self.env['ccflags']))
bootloader_src = os.path.join(
self.env['baremetal_source_lib_dir'],
@@ -101,8 +91,8 @@ Build the baremetal examples with crosstool-NG.
link=False,
)
cc_flags.extend([
'-Wl,--section-start=.text={:#x}'.format(entry_address), LF,
'-Wl,--section-start=.lkmc_memory={:#x}'.format(entry_address + 0x1000000), LF,
'-Wl,--section-start=.text={:#x}'.format(self.env['entry_address']), LF,
'-Wl,--section-start=.lkmc_memory={:#x}'.format(self.env['entry_address'] + 0x1000000), LF,
'-T', self.env['baremetal_link_script'], LF,
])
with thread_pool.ThreadPool(