def get_boot_hart(tree):
    """Get the boot hart if one is specified, otherwise just gets the first hart"""
    metal_boothart = tree.chosen("metal,boothart")
    if metal_boothart:
        return tree.get_by_reference(metal_boothart[0])
    return tree.get_by_path("/cpus").children[0]