Changeset 28fcaee 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:
643640a
Parents:
fd6c8b1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-06-28 13:28:59)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-08-17 12:49:43)
Message:

amd64 boot

Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    rfd6c8b1 r28fcaee  
    3131include Makefile.common
    3232
    33 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(PREBUILD)
     33all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
    3434        $(MAKE) -r -f $(BUILD) PRECHECK=$(PRECHECK)
    3535ifneq ($(POSTBUILD),)
  • boot/Makefile.grub

    rfd6c8b1 r28fcaee  
    2727#
    2828
    29 .PHONY: all build_dist clean
     29.PHONY: all
     30all:
    3031
    31 include Makefile.common
    32 
    33 GRUB = grub/$(BARCH)-$(GRUB_ARCH)
    34 BOOT = $(DISTROOT)/boot
    35 BOOT_CONFIG = $(BOOT)/grub/grub.cfg
    36 
    37 ELTORITO = boot/grub/$(GRUB_ARCH).img
    38 IMAGE = $(DISTROOT)/$(ELTORITO)
    39 
    40 ifeq ($(GRUB_ARCH),pc)
    41         MULTIBOOT_CMD = multiboot
    42         MODULE_CMD = module
    43 endif
    44 ifeq ($(GRUB_ARCH),efi)
    45         MULTIBOOT_CMD = multiboot2
    46         MODULE_CMD = module2
    47 endif
    48 
    49 all: $(POST_OUTPUT)
    50 
    51 $(POST_OUTPUT): build_dist
    52 ifeq ($(GRUB_ARCH),pc)
    53         $(GENISOIMAGE) -J -r -input-charset utf-8 -V "HelenOS-CD" -eltorito-boot $(ELTORITO) -no-emul-boot -boot-info-table -o $@ $(DISTROOT)/
    54 endif
    55 ifeq ($(GRUB_ARCH),efi)
    56         $(GENISOIMAGE) -J -r -input-charset utf-8 -V "HelenOS-CD" --efi-boot $(ELTORITO) -o $@ $(DISTROOT)/
    57 endif
    58 
    59 build_dist: clean $(COMPONENTS)
    60         mkdir -p $(BOOT)
    61         cp -r -L $(GRUB) $(BOOT)/grub
    62 ifeq ($(GRUB_ARCH),efi)
    63         gunzip $(IMAGE)
    64 endif
    65 
    66 ifeq ($(GRUB_LOADER),multiboot)
    67         for module in $(COMPONENTS) ; do \
    68                 cp "$$module" $(BOOT)/ ; \
    69         done
    70 endif
    71 ifeq ($(GRUB_LOADER),chainloader)
    72         cp "$(BOOT_OUTPUT)" $(BOOT)/
    73 endif
    74 
    75         echo "set default=0" > $(BOOT_CONFIG)
    76         echo "set timeout=10" >> $(BOOT_CONFIG)
    77         echo "" >> $(BOOT_CONFIG)
    78 
    79 ifeq ($(GRUB_ARCH),pc)
    80         echo "insmod vbe" >> $(BOOT_CONFIG)
    81         echo "insmod vga" >> $(BOOT_CONFIG)
    82 endif
    83 ifeq ($(GRUB_ARCH),efi)
    84         echo "insmod efi_gop" >> $(BOOT_CONFIG)
    85         echo "insmod efi_uga" >> $(BOOT_CONFIG)
    86 endif
    87         echo "" >> $(BOOT_CONFIG)
    88 
    89         echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(BOOT_CONFIG)
    90 ifeq ($(GRUB_LOADER),multiboot)
    91         for module in $(MODULES) ; do \
    92                 echo "  echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \
    93                 if [ "$$module" = "kernel.elf" ] ; then \
    94                         echo "  $(MULTIBOOT_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \
    95                 else \
    96                         echo "  $(MODULE_CMD) /boot/$$module /boot/$$module" >> $(BOOT_CONFIG) ; \
    97                 fi \
    98         done
    99 endif
    100 ifeq ($(GRUB_LOADER),chainloader)
    101         echo "  echo 'Loading $(BOOT_OUTPUT)'" >> $(BOOT_CONFIG)
    102         echo "  chainloader /boot/$(BOOT_OUTPUT)" >> $(BOOT_CONFIG)
    103         echo "  boot" >> $(BOOT_CONFIG)
    104 endif
    105         echo "}" >> $(BOOT_CONFIG)
    106 
    107 clean:
    108         rm -fr $(DISTROOT)
    109 
    110 include Makefile.initrd
  • boot/arch/abs32le/Makefile.inc

    rfd6c8b1 r28fcaee  
    3131JOB =
    3232MAP =
    33 PREBUILD =
    3433BUILD = Makefile.empty
  • boot/arch/amd64/Makefile.inc

    rfd6c8b1 r28fcaee  
    2727#
    2828
    29 RD_DRV_CFG += \
    30         bus/isa
    31 
    3229POST_OUTPUT = $(ROOT_PATH)/image.iso
    3330BUILD = Makefile.empty
  • kernel/meson.build

    rfd6c8b1 r28fcaee  
    166166endforeach
    167167
     168rd_init_binaries += [[ kernel_elf, 'boot/kernel.elf' ]]
     169
    168170install_files += [[ 'boot', kernel_elf.full_path(), 'kernel.elf' ]]
    169171install_deps += [ kernel_elf ]
  • meson.build

    rfd6c8b1 r28fcaee  
    2222unzip = find_program('unzip')
    2323which = find_program('which')
    24 sh = find_program('sh')
     24sh = [ find_program('sh'), '-x', '-u', '-e' ]
    2525mkext4 = find_program('tools/mkext4.py')
    2626mkfat = find_program('tools/mkfat.py')
     27cp = find_program('cp')
     28
     29genisoimage = find_program('genisoimage', required: false)
     30
     31if not genisoimage.found()
     32        genisoimage = find_program('mkisofs', required: false)
     33endif
     34
     35if not genisoimage.found()
     36        xorriso = find_program('xorriso', required: false)
     37
     38        if xorriso.found()
     39                genisoimage = [ xorriso, '-as', 'genisoimage' ]
     40        else
     41                error('Need genisoimage, mkisofs or xorriso.')
     42        endif
     43endif
     44
    2745
    2846autocheck = generator(find_program('tools/autocheck.awk'),
     
    136154        'UARCH',
    137155        'KARCH',
     156        'BARCH',
     157        'GRUB_ARCH',
    138158]
    139159
     
    275295# Init binaries.
    276296rd_init = [
     297        # IMPORTANT: The order of entries is important for bootloader!
     298        'srv/ns',
     299        'srv/loader',
    277300        'app/init',
     301        'srv/locsrv',
    278302        'srv/bd/rd',
     303        'srv/vfs',
     304        'srv/logger',
    279305        'srv/fs/' + RDFMT,
    280         'srv/loader',
    281         'srv/locsrv',
    282         'srv/logger',
    283         'srv/ns',
    284         'srv/vfs',
    285 ]
     306]
     307
     308# References to the actual binary files. Filled in by uspace.
     309rd_init_binaries = []
    286310
    287311# Binaries allowed on the initrd image when CONFIG_BAREBONE is enabled.
     
    451475        output: 'dist.tag',
    452476        input: [ install_script, install_deps ],
    453         command: [ sh, '-x', '-u', '-e', '@INPUT0@', '@OUTPUT@', dist_dir ],
    454         build_by_default: true,
     477        command: [ sh, '@INPUT0@', '@OUTPUT@', dist_dir ],
    455478)
    456479
     
    471494        input: dist,
    472495        command: initrd_cmd,
     496)
     497
     498rd_init_binaries += [[ initrd_img, 'boot/initrd.img' ]]
     499
     500subdir('boot')
     501
     502custom_target(POST_OUTPUT,
     503        output: POST_OUTPUT,
     504        input: POST_INPUT,
     505        command: [ cp, '@INPUT@', '@OUTPUT@' ],
    473506        build_by_default: true,
    474507)
    475 
  • tools/ew.py

    rfd6c8b1 r28fcaee  
    270270
    271271        if cfg['image'] == 'image.iso':
    272                 cmdline += ' -boot d -cdrom image.iso'
     272                cmdline += ' -boot d -cdrom build/image.iso'
    273273        elif cfg['image'] == 'image.iso@arm64':
    274274                # Define image.iso cdrom backend.
  • uspace/meson.build

    rfd6c8b1 r28fcaee  
    127127                        'c_args': c_args,
    128128                        'link_args': link_args + (static_build ? [ '-static' ] : []),
     129                        'init': rd_init.contains(dir),
    129130                }
    130131        endif
     
    143144                        'c_args': c_args,
    144145                        'link_args': link_args,
     146                        'init': false,
    145147                }
    146148        endif
     
    157159        _build_name = _full_install_path.underscorify()
    158160        _full_build_name = meson.current_build_dir() / _build_name
     161        _is_init = tst.get('init')
    159162
    160163        if link_map
     
    174177        )
    175178
     179        if _is_init
     180                rd_init_binaries += [[ _bin, _full_install_path ]]
     181        endif
     182
    176183        if disassemble
    177184                _disasm = custom_target(_build_name + '.disasm',
Note: See TracChangeset for help on using the changeset viewer.