Changeset a73a1453 in mainline


Ignore:
Timestamp:
2019-08-17T12:49:43Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
512579c
Parents:
5b586b9
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-06-28 17:53:10)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-08-17 12:49:43)
Message:

arm64 wip

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm64/Makefile.inc

    r5b586b9 ra73a1453  
    2727#
    2828
    29 BOOT_OUTPUT = image.boot
    30 POST_OUTPUT = $(ROOT_PATH)/image.iso
    31 POSTBUILD = Makefile.grub
    32 GRUB_LOADER = chainloader
    33 
    34 BFD_NAME = elf64-littleaarch64
    35 # Request binary BFD output. The ARM64 port manually prepares the .text
    36 # section to look as a PE file than can be loaded on EFI systems.
    37 BFD_OUTPUT = binary
    38 
    39 BITS = 64
    40 ENDIANESS = LE
    41 
    42 # UEFI binaries should be relocatable, the EFI boot service LoadImage() will
    43 # rebase the boot file using the .reloc information in the image if it cannot
    44 # load the binary at its preferred address. The ARM64 port does not provide this
    45 # information in its PE file (that would require manually creating it) but
    46 # instead the boot code is compiled with the -fpic option and the bootloader
    47 # relocates itself at runtime.
    48 #
    49 # N.B. The UEFI guarantees for AArch64 that during boot time the primary
    50 # processor is in the execution mode that has unaligned access enabled. The
    51 # -mstrict-align option is therefore not needed.
    52 EXTRA_CFLAGS = -fpic -fvisibility=hidden
    53 EXTRA_LDFLAGS = -Wl,-shared
    54 
    55 SOURCES = \
    56         arch/$(BARCH)/src/asm.S \
    57         arch/$(BARCH)/src/main.c \
    58         arch/$(BARCH)/src/relocate.c \
    59         $(COMPS).o \
    60         genarch/src/efi.c \
    61         generic/src/gzip.c \
    62         generic/src/inflate.c \
    63         generic/src/kernel.c \
    64         generic/src/memstr.c \
    65         generic/src/payload.c \
    66         generic/src/printf.c \
    67         generic/src/printf_core.c \
    68         generic/src/str.c \
    69         generic/src/tar.c \
    70         generic/src/version.c \
    71         generic/src/vprintf.c
     29BUILD = Makefile.empty
     30POSTBUILD = Makefile.empty
  • boot/grub/meson.build

    r5b586b9 ra73a1453  
    55dist_dirname = 'grub_dist'
    66
    7 build_dist_text = []
    8 build_dist_deps = []
    9 foreach init : rd_init_binaries
    10         target = 'boot/' + run_command(basename, init[1], check: true).stdout().strip()
     7if GRUB_LOADER == 'multiboot'
     8        build_dist_text = []
     9        build_dist_deps = []
     10        foreach init : rd_init_binaries
     11                target = 'boot/' + run_command(basename, init[1], check: true).stdout().strip()
    1112
    12         build_dist_text += install_snippet.format(init[0].full_path(), target)
    13         build_dist_deps += init[0]
    14 endforeach
     13                build_dist_text += install_snippet.format(init[0].full_path(), target)
     14                build_dist_deps += init[0]
     15        endforeach
     16
     17        LOADS = [ 'echo \'Loading kernel\'' ]
     18        LOADS += [ MULTIBOOT_CMD + ' /boot/kernel.elf' ]
     19
     20        MODULES = rd_init + [ 'boot/initrd.img' ]
     21
     22        foreach module : MODULES
     23                module = '/boot/' + run_command(basename, module, check: true).stdout().strip()
     24                LOADS += 'echo \'Loading @0@\''.format(module)
     25                LOADS += '@0@ @1@ @1@'.format(MODULE_CMD, module)
     26        endforeach
     27endif
     28
     29if GRUB_LOADER == 'chainloader'
     30        # init binaries are already part of the chainloaded boot image.
     31        build_dist_text = [ install_snippet.format(boot_image.full_path(), 'boot/' + boot_image_name) ]
     32        build_dist_deps = [ boot_image ]
     33
     34        LOADS = [
     35                'echo \'Loading ' + boot_image_name + '\'',
     36                'chainloader /boot/' + boot_image_name,
     37                'boot',
     38        ]
     39endif
    1540
    1641build_dist_sh = configure_file(
     
    2045)
    2146
    22 
    23 MODULES = rd_init + [ 'boot/initrd.img' ]
    2447
    2548if GRUB_ARCH == 'pc'
     
    3154        MODULE_CMD = 'module2'
    3255        INSMODS = [ 'insmod efi_gop', 'insmod efi_uga' ]
    33 endif
    34 
    35 if GRUB_LOADER == 'multiboot'
    36         LOADS = [ 'echo \'Loading kernel\'' ]
    37         LOADS += [ MULTIBOOT_CMD + ' /boot/kernel.elf' ]
    38 
    39         foreach module : MODULES
    40                 module = '/boot/' + run_command(basename, module, check: true).stdout().strip()
    41                 LOADS += 'echo \'Loading @0@\''.format(module)
    42                 LOADS += '@0@ @1@ @1@'.format(MODULE_CMD, module)
    43         endforeach
    44 endif
    45 
    46 if GRUB_LOADER == 'chainloader'
    47         LOADS = [
    48                 'echo \'Loading ' + BOOT_OUTPUT + '\'',
    49                 'chainloader /boot/' + BOOT_OUTPUT,
    50                 'boot',
    51         ]
    5256endif
    5357
  • meson.build

    r5b586b9 ra73a1453  
    4949        arguments: [ '@INPUT@' ],
    5050        output: '@PLAINNAME@.check.c',
     51        capture: true,
     52)
     53
     54gzip = generator(find_program('gzip',
     55        arguments: [ '--no-name', '-9', '--stdout', '@INPUT@' ]
     56        output: '@PLAINNAME@.gz',
    5157        capture: true,
    5258)
  • meson/arch/arm64/meson.build

    r5b586b9 ra73a1453  
     1#
     2# Copyright (c) 2015 Petr Pavlu
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
     28
    129arch_uspace_c_args = [ '-D__LE__', '-fno-omit-frame-pointer' ]
    230arch_kernel_c_args = arch_uspace_c_args + [ '-march=armv8-a+nofp+nosimd', '-mgeneral-regs-only' ]
    331arch_kernel_link_args = [ '-nostdlib' ]
    432arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
     33
     34
     35# UEFI binaries should be relocatable, the EFI boot service LoadImage() will
     36# rebase the boot file using the .reloc information in the image if it cannot
     37# load the binary at its preferred address. The ARM64 port does not provide this
     38# information in its PE file (that would require manually creating it) but
     39# instead the boot code is compiled with the -fpic option and the bootloader
     40# relocates itself at runtime.
     41#
     42# N.B. The UEFI guarantees for AArch64 that during boot time the primary
     43# processor is in the execution mode that has unaligned access enabled. The
     44# -mstrict-align option is therefore not needed.
     45arch_boot_c_args = arch_uspace_c_args + [ '-fpic', '-fvisibility=hidden', '-fno-function-sections' ]
     46arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ]
    547
    648
  • tools/ew.py

    r5b586b9 ra73a1453  
    273273        elif cfg['image'] == 'image.iso@arm64':
    274274                # Define image.iso cdrom backend.
    275                 cmdline += ' -drive if=none,file=image.iso,id=cdrom,media=cdrom'
     275                cmdline += ' -drive if=none,file=build/image.iso,id=cdrom,media=cdrom'
    276276                # Define scsi bus.
    277277                cmdline += ' -device virtio-scsi-device'
Note: See TracChangeset for help on using the changeset viewer.