tool: bender with optional 'serial' UART discovery

By default, bender will not report any serial findings anymore, if not
explicitly asked for with the 'serial' option. Without this option, an
invalid ioport is reported, so that neither the kernel nor Genode core
will make serial output.
This commit is contained in:
Alexander Boettcher 2023-02-07 21:36:56 +01:00 committed by Christian Helmuth
parent 62af32270b
commit 76828f25c5
9 changed files with 34 additions and 27 deletions

View File

@ -18,10 +18,10 @@ code respectively the download source of binaries are described below.
configured via commandline.
The changes are available from
https://github.com/m-stein/morbo.git.
https://github.com/alex-ab/morbo.git.
git branch genode_bender
git commit 3645d67dc0643b8aab008eb76a8e056636e5edee
git commit 77a69185981de373905ae7e9c4ae24cd5cb1ac99
:'pulsar':

Binary file not shown.

View File

@ -8,6 +8,8 @@ proc fiasco_serial_esc_arg { } { return "-serial_esc " }
proc run_boot_string { } { return "\nL4 Bootstrapper" }
proc core_link_address { } { return "0x01000000" }
proc boot_output { } { return "serial" }
##
# Populate boot directory with binaries on fiasco
@ -66,7 +68,7 @@ proc run_boot_dir {binaries} {
#
puts $fh "menuentry 'Genode on L4/Fiasco' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/bootstrap -serial"
puts $fh " module /boot/kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]"
puts $fh " module /boot/sigma0"
@ -87,7 +89,7 @@ proc run_boot_dir {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " exec /boot/bender [boot_output]"
puts $fh " load /boot/bootstrap -serial"
puts $fh " load /boot/kernel -serial -serial_esc -jdb_cmd=JH"
puts $fh " load /boot/sigma0"

View File

@ -24,6 +24,8 @@ proc core_link_address { } {
proc fiasco_serial_esc_arg { } { return "-serial_esc " }
proc boot_output { } { return "serial" }
##
# Reset the target system via the Fiasco.OC kernel debugger
@ -110,7 +112,7 @@ proc run_boot_dir_x86 {binaries} {
#
puts $fh "menuentry 'Genode on Fiasco.OC' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/bootstrap"
puts $fh " module /boot/kernel fiasco [fiasco_serial_esc_arg]"
puts $fh " module /boot/sigma0"
@ -134,7 +136,7 @@ proc run_boot_dir_x86 {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " exec /boot/bender [boot_output]"
puts $fh " load /boot/bootstrap"
puts $fh " load /boot/kernel -serial_esc"
puts $fh " load /boot/sigma0"

View File

@ -5,6 +5,8 @@ proc binary_name_timer { } { return "hw_timer_drv" }
proc run_boot_string { } { return "\nkernel initialized" }
proc boot_output { } { return "serial" }
proc bootstrap_link_address { } {
@ -99,14 +101,14 @@ proc run_boot_dir {binaries} {
exec mkdir -p [run_dir]/boot
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
set options_bender "[boot_output] "
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
#
# Compress Genode image, to be uncompressed by GRUB
#
exec gzip [run_dir]/boot/image.elf
set serial_bender_opt ""
if {[have_include "image/disk"]} {
install_disk_bootloader_to_run_dir
}
@ -117,7 +119,7 @@ proc run_boot_dir {binaries} {
if {[have_include image/uefi]} {
install_uefi_bootloader_to_run_dir
set serial_bender_opt "serial_fallback"
append options_bender " serial_fallback"
}
#
@ -127,7 +129,7 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on base-hw' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender $serial_bender_opt"
puts $fh " multiboot2 /boot/bender $options_bender"
puts $fh " module2 /boot/image.elf.gz image.elf"
puts $fh "}"
close $fh
@ -162,7 +164,7 @@ proc run_boot_dir {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " exec /boot/bender $options_bender"
puts $fh " load /boot/image.elf"
close $fh
@ -177,7 +179,7 @@ proc run_boot_dir {binaries} {
puts $fh "#!ipxe"
install_pxe_bootloader_to_run_dir
puts $fh "kernel boot/bender"
puts $fh "kernel boot/bender $options_bender"
puts $fh "module boot/image.elf"
puts $fh "boot"
close $fh

View File

@ -33,6 +33,8 @@ proc binary_name_timer { } { return "nova_timer_drv" }
proc kernel_files { } { return hypervisor }
proc kernel_output { } { return "novga serial" }
proc boot_output { } { return "serial" }
proc run_boot_string { } {
return "\nHypervisor NOVA "
}
@ -88,14 +90,9 @@ proc run_boot_dir {binaries} {
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
#
# Setup bender and plugins
# Setup bender options, e.g. serial and applying Intel HWP mode
#
set options_bender ""
#
# Apply Intel HWP mode
#
append options_bender " [bender_intel_hwp_mode_option]"
set options_bender "[boot_output] [bender_intel_hwp_mode_option]"
if {[apply_microcode]} {
exec cp bin/micro.code [run_dir]/boot/

View File

@ -4,6 +4,7 @@ proc binary_name_timer { } { return "pit_timer_drv" }
proc kernel_files { } { return okl4 }
proc boot_output { } { return "serial" }
##
# Get the base-okl4 repository
@ -178,7 +179,7 @@ proc run_boot_dir {binaries} {
#
puts $fh "menuentry 'Genode on OKL4' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/image.elf"
puts $fh "}"
close $fh
@ -201,7 +202,7 @@ proc run_boot_dir {binaries} {
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
# load okl4 at 256M to avoid overwritting binary, adjust by need
puts $fh " addr 0x10000000"
puts $fh " exec /boot/bender"
puts $fh " exec /boot/bender [boot_output]"
puts $fh " load /boot/image.elf"
close $fh

View File

@ -7,6 +7,7 @@ proc kernel_files { } { return { pistachio sigma0-pistachio kickstart-pistachio
proc run_boot_string { } { return "\n\r\033\\\[1m\033\\\[33mL4Ka::Pistachio -" }
proc core_link_address { } { return "0x02000000" }
proc boot_output { } { return "serial" }
##
# Populdate boot directory with binaries on pistachio
@ -65,7 +66,7 @@ proc run_boot_dir {binaries} {
#
puts $fh "menuentry 'Genode on L4ka::Pistachio' {"
puts $fh " insmod multiboot"
puts $fh " multiboot /boot/bender"
puts $fh " multiboot /boot/bender [boot_output]"
puts $fh " module /boot/kickstart"
puts $fh " module /boot/kernel"
puts $fh " module /boot/sigma0"
@ -89,7 +90,7 @@ proc run_boot_dir {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " exec /boot/bender [boot_output]"
puts $fh " load /boot/kickstart"
puts $fh " load /boot/kernel"
puts $fh " load /boot/sigma0"

View File

@ -10,6 +10,7 @@ proc binary_name_timer { } {
proc kernel_files { } { return sel4 }
proc boot_output { } { return "serial" }
proc run_boot_string { } { return "\n\rBooting all finished, dropped to user space" }
proc core_link_address { } { return "0x02000000" }
@ -54,8 +55,9 @@ proc run_boot_dir {binaries} {
exec mv [run_dir]/image.elf [run_dir]/boot/image.elf
set options_bender "[boot_output] phys_max=256M"
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
set serial_bender_opt ""
if {[have_include "image/disk"]} {
install_disk_bootloader_to_run_dir
@ -67,7 +69,7 @@ proc run_boot_dir {binaries} {
if {[have_include image/uefi]} {
install_uefi_bootloader_to_run_dir
set serial_bender_opt "serial_fallback"
set options_bender " serial_fallback"
}
#
@ -77,7 +79,7 @@ proc run_boot_dir {binaries} {
puts $fh "menuentry 'Genode on seL4' {"
puts $fh " insmod multiboot2"
puts $fh " multiboot2 /boot/bender phys_max=256M $serial_bender_opt"
puts $fh " multiboot2 /boot/bender $options_bender"
puts $fh " module2 /boot/sel4 sel4 disable_iommu"
puts $fh " module2 /boot/image.elf image.elf"
puts $fh "}"
@ -130,7 +132,7 @@ proc run_boot_dir {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender phys_max=256M"
puts $fh " exec /boot/bender $options_bender"
puts $fh " load /boot/sel4 disable_iommu"
puts $fh " load /boot/image.elf"
close $fh