Changeset 371bd7d in mainline for boot


Ignore:
Timestamp:
2010-03-27T09:22:17Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36a75a2
Parents:
cd82bb1 (diff), eaf22d4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
boot
Files:
1 added
1 deleted
31 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    rcd82bb1 r371bd7d  
    3030#
    3131
     32-include ../Makefile.common
    3233-include ../Makefile.config
    33 -include ../config.defs
    3434
    3535## Paths
     
    4242.PHONY: all build clean generic_clean
    4343
    44 all: ../Makefile.config ../config.h ../config.defs build
     44all: ../Makefile.common ../Makefile.config ../config.h build
    4545
    4646-include arch/$(BARCH)/Makefile.inc
  • boot/arch/amd64/Makefile.inc

    • Property mode changed from 100644 to 100755
    rcd82bb1 r371bd7d  
    2727#
    2828
    29 TMP = distroot
     29include Makefile.common
    3030
    31 INIT_TASKS = \
    32         $(USPACEDIR)/srv/ns/ns \
    33         $(USPACEDIR)/srv/loader/loader \
    34         $(USPACEDIR)/app/init/init \
    35         $(USPACEDIR)/srv/devmap/devmap \
    36         $(USPACEDIR)/srv/bd/rd/rd \
    37         $(USPACEDIR)/srv/vfs/vfs
    38 ifeq ($(RDFMT),tmpfs)
    39         INIT_TASKS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    40 endif
    41 ifeq ($(RDFMT),fat)
    42         INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
    43 endif
     31RD_SRVS += \
     32        $(USPACEDIR)/srv/bd/ata_bd/ata_bd \
     33        $(USPACEDIR)/srv/hw/char/i8042/i8042 \
     34        $(USPACEDIR)/srv/hw/bus/pci/pci \
     35        $(USPACEDIR)/srv/hid/char_mouse/char_ms
    4436
    45 RD_SRVS = \
    46         $(USPACEDIR)/srv/pci/pci \
    47         $(USPACEDIR)/srv/fb/fb \
    48         $(USPACEDIR)/srv/kbd/kbd \
    49         $(USPACEDIR)/srv/console/console \
    50         $(USPACEDIR)/srv/fs/devfs/devfs \
    51         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    52         $(USPACEDIR)/srv/fs/fat/fat \
    53         $(USPACEDIR)/srv/bd/ata_bd/ata_bd \
    54         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    55         $(USPACEDIR)/srv/part/mbr_part/mbr_part
    56 
    57 RD_APPS = \
    58         $(USPACEDIR)/app/edit/edit \
    59         $(USPACEDIR)/app/getvc/getvc \
    60         $(USPACEDIR)/app/redir/redir \
    61         $(USPACEDIR)/app/tetris/tetris \
    62         $(USPACEDIR)/app/tester/tester \
    63         $(USPACEDIR)/app/trace/trace \
    64         $(USPACEDIR)/app/klog/klog \
    65         $(USPACEDIR)/app/bdsh/bdsh
     37MODULES := $(notdir $(COMPONENTS))
    6638
    6739build: $(BASE)/image.iso
    6840
    69 $(BASE)/image.iso: arch/$(BARCH)/grub/stage2_eltorito arch/$(BARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS)
     41$(BASE)/image.iso: arch/$(BARCH)/grub/stage2_eltorito $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS) $(CFG)
    7042        mkdir -p $(TMP)/boot/grub
    7143        cp arch/$(BARCH)/grub/stage2_eltorito $(TMP)/boot/grub/
    72 ifneq ($(RDFMT),tmpfs)
    73         cat arch/$(BARCH)/grub/menu.lst | grep -v "tmpfs" > $(TMP)/boot/grub/menu.lst
    74 endif
    75 ifneq ($(RDFMT),fat)
    76         cat arch/$(BARCH)/grub/menu.lst | grep -v "fat" > $(TMP)/boot/grub/menu.lst
    77 endif
     44       
     45        echo "default 0" > $(TMP)/boot/grub/menu.lst
     46        echo "timeout 10" >> $(TMP)/boot/grub/menu.lst
     47        echo "" >> $(TMP)/boot/grub/menu.lst
     48        echo "title=HelenOS" >> $(TMP)/boot/grub/menu.lst
     49        echo "  root (cd)" >> $(TMP)/boot/grub/menu.lst
     50        for module in $(MODULES) $(INITRD).img ; do \
     51                if [ $$module = kernel.bin ] ; then \
     52                        echo "  kernel /boot/$$module" >> $(TMP)/boot/grub/menu.lst ; \
     53                else \
     54                        echo "  module /boot/$$module" >> $(TMP)/boot/grub/menu.lst ; \
     55                fi \
     56        done
     57       
     58        rm -f $(USPACEDIR)/dist/srv/*
     59        rm -f $(USPACEDIR)/dist/app/*
     60        rm -f $(USPACEDIR)/dist/cfg/net/*
     61       
    7862        cp $(KERNELDIR)/kernel.bin $(TMP)/boot/
    7963        for task in $(INIT_TASKS) ; do \
     
    8670                cp $$file $(USPACEDIR)/dist/app/ ; \
    8771        done
     72        for file in $(NET_CFG) ; do \
     73                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
     74        done
     75       
    8876ifeq ($(RDFMT),tmpfs)
    89         $(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ $(TMP)/boot/initrd.fs
     77        $(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ $(TMP)/boot/$(INITRD).fs
    9078endif
    9179ifeq ($(RDFMT),fat)
    92         $(BASE)/tools/mkfat.py $(USPACEDIR)/dist/ $(TMP)/boot/initrd.fs
     80        $(BASE)/tools/mkfat.py $(USPACEDIR)/dist/ $(TMP)/boot/$(INITRD).fs
    9381endif
    94         $(BASE)/tools/mkhord.py 4096 $(TMP)/boot/initrd.fs $(TMP)/boot/initrd.img
    95         rm $(TMP)/boot/initrd.fs
     82        $(BASE)/tools/mkhord.py 4096 $(TMP)/boot/$(INITRD).fs $(TMP)/boot/$(INITRD).img
     83        rm $(TMP)/boot/$(INITRD).fs
    9684        mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $@ $(TMP)/
    9785
    9886clean:
     87        rm -f $(USPACEDIR)/dist/srv/*
     88        rm -f $(USPACEDIR)/dist/app/*
     89        rm -f $(USPACEDIR)/dist/cfg/net/*
     90
    9991        for file in $(RD_SRVS) ; do \
    10092                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    10395                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    10496        done
     97        for file in $(NET_CFG) ; do \
     98                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     99        done
    105100        rm -fr $(TMP)
    106101        rm -f $(BASE)/image.iso
  • boot/arch/arm32/Makefile.inc

    rcd82bb1 r371bd7d  
    3030
    3131$(BASE)/image.boot:
    32         $(MAKE) -C arch/$(BARCH)/loader
     32        $(MAKE) -C arch/$(BARCH)/loader PRECHECK=$(PRECHECK)
    3333        cp arch/$(BARCH)/loader/image.boot $@
    3434
  • boot/arch/arm32/loader/Makefile

    rcd82bb1 r371bd7d  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
     39        rm -f $(USPACEDIR)/dist/srv/*
     40        rm -f $(USPACEDIR)/dist/app/*
     41        rm -f $(USPACEDIR)/dist/cfg/net/*
     42
    3943        for file in $(RD_SRVS) ; do \
    4044                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4347                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4448        done
    45         rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
     49        for file in $(NET_CFG) ; do \
     50                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     51        done
     52        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4653        find . -name '*.o' -follow -exec rm \{\} \;
    4754        find . -name '*.co' -follow -exec rm \{\} \;
  • boot/arch/arm32/loader/Makefile.build

    rcd82bb1 r371bd7d  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    5151        ../../../genarch/division.c
    5252
    53 COMPONENTS = \
    54         $(KERNELDIR)/kernel.bin \
    55         $(USPACEDIR)/srv/ns/ns \
    56         $(USPACEDIR)/srv/loader/loader \
    57         $(USPACEDIR)/app/init/init \
    58         $(USPACEDIR)/srv/devmap/devmap \
    59         $(USPACEDIR)/srv/bd/rd/rd \
    60         $(USPACEDIR)/srv/vfs/vfs
    61 ifeq ($(RDFMT),tmpfs)
    62         COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    63 endif
    64 ifeq ($(RDFMT),fat)
    65         COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
    66 endif
    67 
    6853OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    6954COMPONENT_OBJECTS := $(addsuffix .co,$(basename $(notdir $(COMPONENTS)))) $(INITRD).co
     
    8065%.o: %.S $(DEPEND)
    8166        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     67ifeq ($(PRECHECK),y)
     68        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     69endif
    8270
    8371%.o: %.c $(DEPEND)
    8472        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     73ifeq ($(PRECHECK),y)
     74        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     75endif
    8576
    8677$(DEPEND):
     78        rm -f $(USPACEDIR)/dist/srv/*
     79        rm -f $(USPACEDIR)/dist/app/*
     80        rm -f $(USPACEDIR)/dist/cfg/net/*
     81
    8782        for file in $(RD_SRVS) ; do \
    8883                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    9085        for file in $(RD_APPS) ; do \
    9186                cp $$file $(USPACEDIR)/dist/app/ ; \
     87        done
     88        for file in $(NET_CFG) ; do \
     89                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    9290        done
    9391ifeq ($(RDFMT),tmpfs)
  • boot/arch/arm32/loader/Makefile.common

    rcd82bb1 r371bd7d  
    3131#
    3232
     33include ../../../Makefile.common
     34
    3335DEPEND = Makefile.depend
    3436DEPEND_PREV = $(DEPEND).prev
     37JOB = image.job
    3538OUTPUT = image.boot
    3639
    3740LINK = _link.ld
    3841COMPS = _components
    39 INITRD = initrd
    4042
    4143KERNELDIR = ../../../../kernel
    4244USPACEDIR = ../../../../uspace
    4345
    44 RD_SRVS = \
    45         $(USPACEDIR)/srv/fb/fb \
    46         $(USPACEDIR)/srv/kbd/kbd \
    47         $(USPACEDIR)/srv/console/console \
    48         $(USPACEDIR)/srv/fs/devfs/devfs \
    49         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    50         $(USPACEDIR)/srv/fs/fat/fat \
    51         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    52         $(USPACEDIR)/srv/part/mbr_part/mbr_part \
    53         $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd
    54 
    55 RD_APPS = \
    56         $(USPACEDIR)/app/edit/edit \
    57         $(USPACEDIR)/app/getvc/getvc \
    58         $(USPACEDIR)/app/redir/redir \
    59         $(USPACEDIR)/app/tetris/tetris \
    60         $(USPACEDIR)/app/tester/tester \
    61         $(USPACEDIR)/app/trace/trace \
    62         $(USPACEDIR)/app/klog/klog \
    63         $(USPACEDIR)/app/bdsh/bdsh
     46RD_SRVS += $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd
  • boot/arch/arm32/loader/Makefile.toolchain

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
    31 
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    3629BFD_NAME = elf32-littlearm
    3730BFD_ARCH = arm
    38 TARGET = arm-linux-gnu
    39 TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32/bin
    4031
    41 ifeq ($(COMPILER),gcc_native)
    42         CC = gcc
    43         AS = as
    44         LD = ld
    45         OBJCOPY = objcopy
    46         OBJDUMP = objdump
    47 endif
    48 
    49 ifeq ($(COMPILER),gcc_cross)
    50         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    51         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    52         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    53         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    54         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    55 endif
     32JOBFILE = ../../../../tools/jobfile.py
    5633
    5734CFLAGS = \
  • boot/arch/ia64/Makefile.inc

    rcd82bb1 r371bd7d  
    3030
    3131$(BASE)/image.boot:
    32         $(MAKE) -C arch/$(BARCH)/loader
     32        $(MAKE) -C arch/$(BARCH)/loader PRECHECK=$(PRECHECK)
    3333        cp arch/$(BARCH)/loader/image.boot $@
    3434
  • boot/arch/ia64/loader/Makefile

    rcd82bb1 r371bd7d  
    2929
    3030include Makefile.common
     31include ../../../../Makefile.common
     32include ../../../../Makefile.config
    3133
    3234.PHONY: all clean
    3335
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     36all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3537        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build
     38        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3739
    3840clean:
    3941        $(MAKE) -C gefi clean
    4042        $(MAKE) -C gefi/HelenOS clean
     43
     44        rm -f $(USPACEDIR)/dist/srv/*
     45        rm -f $(USPACEDIR)/dist/app/*
     46        rm -f $(USPACEDIR)/dist/cfg/net/*
     47
    4148        for file in $(RD_SRVS) ; do \
    4249                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4552                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4653        done
    47         rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(HELLO) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
     54        for file in $(NET_CFG) ; do \
     55                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     56        done
     57        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(HELLO) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4858        find . -name '*.o' -follow -exec rm \{\} \;
    4959        find . -name '*.co' -follow -exec rm \{\} \;
  • boot/arch/ia64/loader/Makefile.build

    rcd82bb1 r371bd7d  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    4949        boot.S
    5050
    51 COMPONENTS = \
    52         $(KERNELDIR)/kernel.bin \
    53         $(USPACEDIR)/srv/ns/ns \
    54         $(USPACEDIR)/srv/loader/loader \
    55         $(USPACEDIR)/app/init/init \
    56         $(USPACEDIR)/srv/devmap/devmap \
    57         $(USPACEDIR)/srv/bd/rd/rd \
    58         $(USPACEDIR)/srv/vfs/vfs
    59 ifeq ($(RDFMT),tmpfs)
    60         COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    61 endif
    62 ifeq ($(RDFMT),fat)
    63         COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
    64 endif
    65 
    6651OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    6752COMPONENT_OBJECTS := $(addsuffix .co,$(basename $(notdir $(COMPONENTS)))) $(INITRD).co
     
    7560$(OUTPUT): $(OBJECTS) $(COMPONENT_OBJECTS) $(LINK)
    7661        $(LD) -no-check-sections -N -T $(LINK) $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
    77         $(MAKE) -C gefi/HelenOS PREFIX=$(GEFI_PREFIX)
     62        $(MAKE) -C gefi/HelenOS
    7863        cp gefi/HelenOS/hello.efi ../../../../
    7964        cp gefi/HelenOS/image.bin ../../../../
     
    8166%.o: %.S $(DEPEND)
    8267        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     68ifeq ($(PRECHECK),y)
     69        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     70endif
    8371
    8472%.o: %.c $(DEPEND)
    8573        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     74ifeq ($(PRECHECK),y)
     75        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     76endif
    8677
    8778$(DEPEND):
     79        rm -f $(USPACEDIR)/dist/srv/*
     80        rm -f $(USPACEDIR)/dist/app/*
     81        rm -f $(USPACEDIR)/dist/cfg/net/*
     82
    8883        for file in $(RD_SRVS) ; do \
    8984                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    9186        for file in $(RD_APPS) ; do \
    9287                cp $$file $(USPACEDIR)/dist/app/ ; \
     88        done
     89        for file in $(NET_CFG) ; do \
     90                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    9391        done
    9492ifeq ($(RDFMT),tmpfs)
  • boot/arch/ia64/loader/Makefile.common

    rcd82bb1 r371bd7d  
    3131#
    3232
     33include ../../../../Makefile.common
     34include ../../../../Makefile.config
     35include ../../../Makefile.common
     36
    3337DEPEND = Makefile.depend
    3438DEPEND_PREV = $(DEPEND).prev
     39JOB = image.job
    3540OUTPUT = image.boot
    3641HELLO = hello.efi
     
    3843LINK = _link.ld
    3944COMPS = _components
    40 INITRD = initrd
    4145
    4246KERNELDIR = ../../../../kernel
    4347USPACEDIR = ../../../../uspace
    4448
    45 RD_SRVS = \
    46         $(USPACEDIR)/srv/fb/fb \
    47         $(USPACEDIR)/srv/kbd/kbd \
    48         $(USPACEDIR)/srv/console/console \
    49         $(USPACEDIR)/srv/fs/devfs/devfs \
    50         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    51         $(USPACEDIR)/srv/fs/fat/fat \
    52         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    53         $(USPACEDIR)/srv/part/mbr_part/mbr_part
    54 
    55 RD_APPS = \
    56         $(USPACEDIR)/app/edit/edit \
    57         $(USPACEDIR)/app/getvc/getvc \
    58         $(USPACEDIR)/app/redir/redir \
    59         $(USPACEDIR)/app/tetris/tetris \
    60         $(USPACEDIR)/app/tester/tester \
    61         $(USPACEDIR)/app/trace/trace \
    62         $(USPACEDIR)/app/klog/klog \
    63         $(USPACEDIR)/app/bdsh/bdsh
     49ifeq ($(MACHINE),i460GX)
     50        RD_SRVS += \
     51                $(USPACEDIR)/srv/hw/char/i8042/i8042 \
     52                $(USPACEDIR)/srv/hid/char_mouse/char_ms
     53endif
  • boot/arch/ia64/loader/Makefile.toolchain

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
    31 
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    3629BFD_NAME = elf64-ia64-little
    3730BFD_ARCH = ia64
    38 TARGET = ia64-pc-linux-gnu
    39 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
    4031
    41 ifeq ($(COMPILER),gcc_native)
    42         CC = gcc
    43         AS = as
    44         LD = ld
    45         OBJCOPY = objcopy
    46         OBJDUMP = objdump
    47         GEFI_PREFIX =
    48 endif
    49 
    50 ifeq ($(COMPILER),icc)
    51         CC = icc
    52         AS = as
    53         LD = ld
    54         OBJCOPY = objcopy
    55         OBJDUMP = objdump
    56         GEFI_PREFIX =
    57 endif
    58 
    59 ifeq ($(COMPILER),gcc_cross)
    60         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    61         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    62         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    63         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    64         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    65         GEFI_PREFIX = $(TOOLCHAIN_DIR)/$(TARGET)-
    66 endif
     32JOBFILE = ../../../../tools/jobfile.py
    6733
    6834CFLAGS = \
  • boot/arch/ia64/loader/gefi/HelenOS/Makefile

    rcd82bb1 r371bd7d  
    2222#
    2323
    24 prefix=$(PREFIX)
    2524include ../Make.defaults
    2625CDIR=$(TOPDIR)/..
     
    3332FORMAT          = efi-app-$(ARCH)
    3433
    35 all:    gefi hello.efi
     34all:    hello.efi
    3635
    3736clean:
     
    4645#When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot
    4746#hello.so: hello.o image.o division.o
    48 hello.so: hello.o image.bin division.o
     47hello.so: hello.o image.bin division.o gefi
    4948#       $(LD) $(LDFLAGS) -Map hello.map hello.o division.o image.o -o hello.so $(LOADLIBES) #link image inside hello
    5049        $(LD) $(LDFLAGS) -Map hello.map hello.o division.o -o hello.so $(LOADLIBES) #dont link image inside hello
     
    6968
    7069gefi:
    71         $(MAKE) -C .. prefix=$(PREFIX)
     70        $(MAKE) -C ..
  • boot/arch/ia64/loader/gefi/Make.defaults

    rcd82bb1 r371bd7d  
    2626# lib and include under the root
    2727#
     28
     29include ../../../../../Makefile.common
     30
    2831INSTALLROOT=/usr/local
    2932
     
    3134
    3235ARCH       = ia64
    33 INCDIR     = -I. -I$(CDIR)/inc -I$(CDIR)/inc/$(ARCH) -I$(CDIR)/inc/protocol 
     36INCDIR     = -I. -I$(CDIR)/inc -I$(CDIR)/inc/$(ARCH) -I$(CDIR)/inc/protocol
    3437CPPFLAGS   = -DCONFIG_$(ARCH)
    3538CFLAGS     = -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -frename-registers -mfixed-range=f32-f127
    3639LDFLAGS    = -nostdlib
    3740INSTALL    = install
    38 
    39 CC         = $(prefix)gcc
    40 AS         = $(prefix)as
    41 LD         = $(prefix)ld
    42 AR         = $(prefix)ar
    43 RANLIB     = $(prefix)ranlib
    44 OBJCOPY    = $(prefix)objcopy
    45 OBJDUMP    = $(prefix)objdump
  • boot/arch/mips32/Makefile.inc

    rcd82bb1 r371bd7d  
    3030
    3131$(BASE)/image.boot:
    32         $(MAKE) -C arch/$(BARCH)/loader
     32        $(MAKE) -C arch/$(BARCH)/loader PRECHECK=$(PRECHECK)
    3333        cp arch/$(BARCH)/loader/image.boot $@
    3434
  • boot/arch/mips32/loader/Makefile

    rcd82bb1 r371bd7d  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
     39        rm -f $(USPACEDIR)/dist/srv/*
     40        rm -f $(USPACEDIR)/dist/app/*
     41        rm -f $(USPACEDIR)/dist/cfg/net/*
     42
    3943        for file in $(RD_SRVS) ; do \
    4044                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4347                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4448        done
    45         rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
     49        for file in $(NET_CFG) ; do \
     50                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     51        done
     52        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4653        find . -name '*.o' -follow -exec rm \{\} \;
    4754        find . -name '*.co' -follow -exec rm \{\} \;
  • boot/arch/mips32/loader/Makefile.build

    rcd82bb1 r371bd7d  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    4848        asm.S \
    4949        boot.S
    50 
    51 COMPONENTS = \
    52         $(KERNELDIR)/kernel.bin \
    53         $(USPACEDIR)/srv/ns/ns \
    54         $(USPACEDIR)/srv/loader/loader \
    55         $(USPACEDIR)/app/init/init \
    56         $(USPACEDIR)/srv/devmap/devmap \
    57         $(USPACEDIR)/srv/bd/rd/rd \
    58         $(USPACEDIR)/srv/vfs/vfs
    59 ifeq ($(RDFMT),tmpfs)
    60         COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    61 endif
    62 ifeq ($(RDFMT),fat)
    63         COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
    64 endif
    6550
    6651OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     
    8166%.o: %.S $(DEPEND)
    8267        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     68ifeq ($(PRECHECK),y)
     69        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     70endif
    8371
    8472%.o: %.c $(DEPEND)
    8573        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     74ifeq ($(PRECHECK),y)
     75        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     76endif
    8677
    8778$(DEPEND):
     79        rm -f $(USPACEDIR)/dist/srv/*
     80        rm -f $(USPACEDIR)/dist/app/*
     81        rm -f $(USPACEDIR)/dist/cfg/net/*
     82
    8883        for file in $(RD_SRVS) ; do \
    8984                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    9186        for file in $(RD_APPS) ; do \
    9287                cp $$file $(USPACEDIR)/dist/app/ ; \
     88        done
     89        for file in $(NET_CFG) ; do \
     90                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    9391        done
    9492ifeq ($(RDFMT),tmpfs)
  • boot/arch/mips32/loader/Makefile.common

    rcd82bb1 r371bd7d  
    3131#
    3232
     33include ../../../Makefile.common
     34
    3335DEPEND = Makefile.depend
    3436DEPEND_PREV = $(DEPEND).prev
    3537RAW = image.raw
     38JOB = image.job
    3639OUTPUT = image.boot
    3740
    3841LINK = _link.ld
    3942COMPS = _components
    40 INITRD = initrd
    4143
    4244KERNELDIR = ../../../../kernel
    4345USPACEDIR = ../../../../uspace
    4446
    45 RD_SRVS = \
    46         $(USPACEDIR)/srv/fb/fb \
    47         $(USPACEDIR)/srv/kbd/kbd \
    48         $(USPACEDIR)/srv/console/console \
    49         $(USPACEDIR)/srv/fs/devfs/devfs \
    50         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    51         $(USPACEDIR)/srv/fs/fat/fat \
    52         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    53         $(USPACEDIR)/srv/part/mbr_part/mbr_part \
    54         $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd
    55 
    56 RD_APPS = \
    57         $(USPACEDIR)/app/edit/edit \
    58         $(USPACEDIR)/app/getvc/getvc \
    59         $(USPACEDIR)/app/redir/redir \
    60         $(USPACEDIR)/app/tetris/tetris \
    61         $(USPACEDIR)/app/tester/tester \
    62         $(USPACEDIR)/app/trace/trace \
    63         $(USPACEDIR)/app/klog/klog \
    64         $(USPACEDIR)/app/bdsh/bdsh
     47RD_SRVS += $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd
  • boot/arch/mips32/loader/Makefile.toolchain

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
     29BFD_ARCH = mips
    3130
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    36 BFD_ARCH = mips
    37 TARGET = mipsel-linux-gnu
    38 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
     31JOBFILE = ../../../../tools/jobfile.py
    3932
    4033ifeq ($(MACHINE),lgxemul)
     
    4639        BFD_NAME = elf32-tradbigmips
    4740        BFD = ecoff-bigmips
    48         TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
    49         TARGET = mips-linux-gnu
    5041endif
    5142
     
    5344        BFD_NAME = elf32-tradlittlemips
    5445        BFD = binary
    55 endif
    56 
    57 ifeq ($(COMPILER),gcc_native)
    58         CC = gcc
    59         AS = as
    60         LD = ld
    61         OBJCOPY = objcopy
    62         OBJDUMP = objdump
    63 endif
    64 
    65 ifeq ($(COMPILER),gcc_cross)
    66         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    67         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    68         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    69         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    70         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    7146endif
    7247
  • boot/arch/ppc32/Makefile.inc

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 TMP = distroot
     29include Makefile.common
    3030
    3131build: $(BASE)/image.iso
     
    4242
    4343arch/$(BARCH)/loader/image.boot:
    44         $(MAKE) -C arch/$(BARCH)/loader
     44        $(MAKE) -C arch/$(BARCH)/loader PRECHECK=$(PRECHECK)
    4545
    4646clean: generic_clean
  • boot/arch/ppc32/loader/Makefile

    rcd82bb1 r371bd7d  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
     39        rm -f $(USPACEDIR)/dist/srv/*
     40        rm -f $(USPACEDIR)/dist/app/*
     41        rm -f $(USPACEDIR)/dist/cfg/net/*
     42
    3943        for file in $(RD_SRVS) ; do \
    4044                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4347                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4448        done
    45         rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
     49        for file in $(NET_CFG) ; do \
     50                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     51        done
     52        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4653        find . -name '*.o' -follow -exec rm \{\} \;
    4754        find . -name '*.co' -follow -exec rm \{\} \;
  • boot/arch/ppc32/loader/Makefile.build

    rcd82bb1 r371bd7d  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    5252        boot.S
    5353
    54 COMPONENTS = \
    55         $(KERNELDIR)/kernel.bin \
    56         $(USPACEDIR)/srv/ns/ns \
    57         $(USPACEDIR)/app/init/init \
    58         $(USPACEDIR)/srv/loader/loader \
    59         $(USPACEDIR)/srv/devmap/devmap \
    60         $(USPACEDIR)/srv/bd/rd/rd \
    61         $(USPACEDIR)/srv/vfs/vfs
    62 ifeq ($(RDFMT),tmpfs)
    63         COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    64 endif
    65 ifeq ($(RDFMT),fat)
    66         COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
    67 endif
    68 
    6954OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    7055COMPONENT_OBJECTS := $(addsuffix .co,$(basename $(notdir $(COMPONENTS)))) $(INITRD).co
     
    8166%.o: %.S $(DEPEND)
    8267        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     68ifeq ($(PRECHECK),y)
     69        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     70endif
    8371
    8472%.o: %.c $(DEPEND)
    8573        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     74ifeq ($(PRECHECK),y)
     75        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     76endif
    8677
    8778$(DEPEND):
     79        rm -f $(USPACEDIR)/dist/srv/*
     80        rm -f $(USPACEDIR)/dist/app/*
     81        rm -f $(USPACEDIR)/dist/cfg/net/*
     82
    8883        for file in $(RD_SRVS) ; do \
    8984                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    9186        for file in $(RD_APPS) ; do \
    9287                cp $$file $(USPACEDIR)/dist/app/ ; \
     88        done
     89        for file in $(NET_CFG) ; do \
     90                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    9391        done
    9492ifeq ($(RDFMT),tmpfs)
  • boot/arch/ppc32/loader/Makefile.common

    rcd82bb1 r371bd7d  
    3131#
    3232
     33include ../../../Makefile.common
     34
    3335DEPEND = Makefile.depend
    3436DEPEND_PREV = $(DEPEND).prev
     37JOB = image.job
    3538OUTPUT = image.boot
    3639
    3740LINK = _link.ld
    3841COMPS = _components
    39 INITRD = initrd
    4042
    4143KERNELDIR = ../../../../kernel
    4244USPACEDIR = ../../../../uspace
    4345
    44 RD_SRVS = \
    45         $(USPACEDIR)/srv/fb/fb \
    46         $(USPACEDIR)/srv/kbd/kbd \
    47         $(USPACEDIR)/srv/console/console \
    48         $(USPACEDIR)/srv/fs/devfs/devfs \
    49         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    50         $(USPACEDIR)/srv/fs/fat/fat \
    51         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    52         $(USPACEDIR)/srv/part/mbr_part/mbr_part
    53 
    54 RD_APPS = \
    55         $(USPACEDIR)/app/edit/edit \
    56         $(USPACEDIR)/app/getvc/getvc \
    57         $(USPACEDIR)/app/redir/redir \
    58         $(USPACEDIR)/app/tetris/tetris \
    59         $(USPACEDIR)/app/tester/tester \
    60         $(USPACEDIR)/app/trace/trace \
    61         $(USPACEDIR)/app/klog/klog \
    62         $(USPACEDIR)/app/bdsh/bdsh
     46RD_SRVS += \
     47        $(USPACEDIR)/srv/hid/adb_mouse/adb_ms \
     48        $(USPACEDIR)/srv/hw/bus/cuda_adb/cuda_adb
  • boot/arch/ppc32/loader/Makefile.toolchain

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
    31 
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    3629BFD_NAME = elf32-powerpc
    3730BFD_ARCH = powerpc:common
    38 TARGET = ppc-linux-gnu
    39 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32/bin
    4031
    41 ifeq ($(COMPILER),gcc_native)
    42         CC = gcc
    43         AS = as
    44         LD = ld
    45         OBJCOPY = objcopy
    46         OBJDUMP = objdump
    47 endif
    48 
    49 ifeq ($(COMPILER),gcc_cross)
    50         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    51         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    52         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    53         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    54         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    55 endif
     32JOBFILE = ../../../../tools/jobfile.py
    5633
    5734CFLAGS = \
  • boot/arch/sparc64/Makefile.inc

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 TMP = distroot
     29include Makefile.common
    3030
    3131ifeq ($(CONFIG_AOUT_ISOFS_B),y)
     
    5555
    5656arch/$(BARCH)/loader/image.boot:
    57         $(MAKE) -C arch/$(BARCH)/loader
     57        $(MAKE) -C arch/$(BARCH)/loader PRECHECK=$(PRECHECK)
    5858
    5959clean: generic_clean
  • boot/arch/sparc64/loader/Makefile

    rcd82bb1 r371bd7d  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
     39        rm -f $(USPACEDIR)/dist/srv/*
     40        rm -f $(USPACEDIR)/dist/app/*
     41        rm -f $(USPACEDIR)/dist/cfg/net/*
     42
    3943        for file in $(RD_SRVS) $(RD_SRVS_GENERIC) ; do \
    4044                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4347                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4448        done
    45         rm -f $(DEPEND) $(DEPEND_PREV) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
     49        for file in $(NET_CFG) ; do \
     50                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     51        done
     52        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4653        find . -name '*.o' -follow -exec rm \{\} \;
    4754        find . -name '*.co' -follow -exec rm \{\} \;
  • boot/arch/sparc64/loader/Makefile.build

    rcd82bb1 r371bd7d  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    5151        asm.S \
    5252        boot.S
    53 
    54 COMPONENTS = \
    55         $(KERNELDIR)/kernel.bin \
    56         $(USPACEDIR)/srv/ns/ns \
    57         $(USPACEDIR)/app/init/init \
    58         $(USPACEDIR)/srv/loader/loader \
    59         $(USPACEDIR)/srv/devmap/devmap \
    60         $(USPACEDIR)/srv/bd/rd/rd \
    61         $(USPACEDIR)/srv/vfs/vfs
    62 ifeq ($(RDFMT),tmpfs)
    63         COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
    64 endif
    65 ifeq ($(RDFMT),fat)
    66         COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
    67 endif
    6853
    6954OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     
    9277%.o: %.S $(DEPEND)
    9378        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     79ifeq ($(PRECHECK),y)
     80        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     81endif
    9482
    9583%.o: %.c $(DEPEND)
    9684        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     85ifeq ($(PRECHECK),y)
     86        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     87endif
    9788
    9889$(DEPEND):
     90        rm -f $(USPACEDIR)/dist/srv/*
     91        rm -f $(USPACEDIR)/dist/app/*
     92        rm -f $(USPACEDIR)/dist/cfg/net/*
     93
    9994        for file in $(RD_SRVS) ; do \
    10095                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    10297        for file in $(RD_APPS) ; do \
    10398                cp $$file $(USPACEDIR)/dist/app/ ; \
     99        done
     100        for file in $(NET_CFG) ; do \
     101                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    104102        done
    105103ifeq ($(RDFMT),tmpfs)
  • boot/arch/sparc64/loader/Makefile.common

    rcd82bb1 r371bd7d  
    3131#
    3232
     33include ../../../Makefile.common
     34
    3335DEPEND = Makefile.depend
    3436DEPEND_PREV = $(DEPEND).prev
     37JOB = image.job
    3538OUTPUT = image.boot
    3639
    3740LINK = _link.ld
    3841COMPS = _components
    39 INITRD = initrd
    4042
    4143KERNELDIR = ../../../../kernel
    4244USPACEDIR = ../../../../uspace
    4345
    44 RD_SRVS = \
    45         $(USPACEDIR)/srv/fb/fb \
    46         $(USPACEDIR)/srv/kbd/kbd \
    47         $(USPACEDIR)/srv/console/console \
    48         $(USPACEDIR)/srv/fs/devfs/devfs \
    49         $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    50         $(USPACEDIR)/srv/bd/file_bd/file_bd \
    51         $(USPACEDIR)/srv/part/mbr_part/mbr_part
    52 
    53 RD_APPS = \
    54         $(USPACEDIR)/app/edit/edit \
    55         $(USPACEDIR)/app/getvc/getvc \
    56         $(USPACEDIR)/app/redir/redir \
    57         $(USPACEDIR)/app/tetris/tetris \
    58         $(USPACEDIR)/app/trace/trace \
    59         $(USPACEDIR)/app/klog/klog \
    60         $(USPACEDIR)/app/bdsh/bdsh
    61 
    6246RD_SRVS_GENERIC = \
    6347        $(USPACEDIR)/srv/fs/fat/fat \
    64         $(USPACEDIR)/srv/cir/fhc/fhc \
    65         $(USPACEDIR)/srv/cir/obio/obio
     48        $(USPACEDIR)/srv/hw/cir/fhc/fhc \
     49        $(USPACEDIR)/srv/hw/cir/obio/obio
    6650
    6751RD_APPS_GENERIC = \
  • boot/arch/sparc64/loader/Makefile.toolchain

    rcd82bb1 r371bd7d  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
    31 
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    3629BFD_NAME = elf64-sparc
    3730BFD_ARCH = sparc
    38 TARGET = sparc64-linux-gnu
    39 TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
    4031
    41 ifeq ($(COMPILER),gcc_native)
    42         CC = gcc
    43         AS = as
    44         LD = ld
    45         OBJCOPY = objcopy
    46         OBJDUMP = objdump
    47 endif
    48 
    49 ifeq ($(COMPILER),gcc_cross)
    50         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    51         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    52         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    53         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    54         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    55 endif
     32JOBFILE = ../../../../tools/jobfile.py
    5633
    5734CFLAGS = \
  • boot/arch/sparc64/loader/asm.S

    rcd82bb1 r371bd7d  
    115115         */
    116116       
     117#if defined (SUN4U)
    117118        /*
    118119         * US3 processors have a write-invalidate cache, so explicitly
     
    128129                call icache_flush
    129130                nop
    130        
     131#endif 
    131132        1:
    132133                membar #StoreStore
  • boot/arch/sparc64/loader/main.c

    rcd82bb1 r371bd7d  
    5757#endif
    5858
    59 /** UltraSPARC subarchitecture - 1 for US, 3 for US3 */
    60 static uint8_t subarchitecture;
     59/** UltraSPARC subarchitecture - 1 for US, 3 for US3, 0 for other */
     60static uint8_t subarchitecture = 0;
    6161
    6262/**
     
    6969static void version_print(void)
    7070{
     71       
    7172        printf("HelenOS SPARC64 Bootloader\nRelease %s%s%s\n"
    7273            "Copyright (c) 2006 HelenOS project\n",
     
    8384#define US_IIIi_CODE   0x15
    8485
    85 /**
    86  * Sets the global variables "subarchitecture" and "mid_mask" to
     86/* max. length of the "compatible" property of the root node */
     87#define COMPATIBLE_PROP_MAXLEN  64
     88
     89/*
     90 * HelenOS bootloader will use these constants to distinguish particular
     91 * UltraSPARC architectures
     92 */
     93#define COMPATIBLE_SUN4U        10
     94#define COMPATIBLE_SUN4V        20
     95
     96/** US architecture. COMPATIBLE_SUN4U for sun4v, COMPATIBLE_SUN4V for sun4u */
     97static uint8_t architecture;
     98
     99/**
     100 * Detects the UltraSPARC architecture (sun4u and sun4v currently supported)
     101 * by inspecting the property called "compatible" in the OBP root node.
     102 */
     103static void detect_architecture(void)
     104{
     105        phandle root = ofw_find_device("/");
     106        char compatible[COMPATIBLE_PROP_MAXLEN];
     107
     108        if (ofw_get_property(root, "compatible", compatible,
     109                        COMPATIBLE_PROP_MAXLEN) <= 0) {
     110                printf("Unable to determine architecture, default: sun4u.\n");
     111                architecture = COMPATIBLE_SUN4U;
     112                return;
     113        }
     114
     115        if (strcmp(compatible, "sun4v") == 0) {
     116                architecture = COMPATIBLE_SUN4V;
     117        } else {
     118                /*
     119                 * As not all sun4u machines have "sun4u" in their "compatible"
     120                 * OBP property (e.g. Serengeti's OBP "compatible" property is
     121                 * "SUNW,Serengeti"), we will by default fallback to sun4u if
     122                 * an unknown value of the "compatible" property is encountered.
     123                 */
     124                architecture = COMPATIBLE_SUN4U;
     125        }
     126}
     127
     128
     129/**
     130 * Detects the subarchitecture (US, US3) of the sun4u
     131 * processor. Sets the global variables "subarchitecture" and "mid_mask" to
    87132 * correct values.
    88133 */
     
    109154}
    110155
     156/**
     157 * Performs sun4u-specific initialization. The components are expected
     158 * to be already copied and boot allocator initialized.
     159 *
     160 * @param base  kernel base virtual address
     161 * @param top   virtual address above which the boot allocator
     162 *              can make allocations
     163 */
     164static void bootstrap_sun4u(void *base, unsigned int top)
     165{
     166        void *balloc_base;
     167        /*
     168         * Claim and map the physical memory for the boot allocator.
     169         * Initialize the boot allocator.
     170         */
     171        balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
     172        (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
     173            BALLOC_MAX_SIZE);
     174        (void) ofw_map(bootinfo.physmem_start + balloc_base, balloc_base,
     175            BALLOC_MAX_SIZE, -1);
     176        balloc_init(&bootinfo.ballocs, (uintptr_t) balloc_base,
     177            (uintptr_t) balloc_base);
     178       
     179        printf("Setting up screens...");
     180        ofw_setup_screens();
     181        printf("done.\n");
     182       
     183        printf("Canonizing OpenFirmware device tree...");
     184        bootinfo.ofw_root = ofw_tree_build();
     185        printf("done.\n");
     186       
     187#ifdef CONFIG_AP
     188        printf("Checking for secondary processors...");
     189        if (!ofw_cpu(mid_mask, bootinfo.physmem_start))
     190                printf("Error: unable to get CPU properties\n");
     191        printf("done.\n");
     192#endif
     193
     194}
     195
     196/**
     197 *  * Performs sun4v-specific initialization. The components are expected
     198 *   * to be already copied and boot allocator initialized.
     199 *    */
     200static void bootstrap_sun4v(void)
     201{
     202        /*
     203         * When SILO booted, the OBP had established a virtual to physical
     204         * memory mapping. This mapping is not an identity (because the
     205         * physical memory starts on non-zero address) - this is not
     206         * surprising. But! The mapping even does not map virtual address
     207         * 0 onto the starting address of the physical memory, but onto an
     208         * address which is 0x400000 bytes higher. The reason is that the
     209         * OBP had already used the memory just at the beginning of the
     210         * physical memory, so that memory cannot be used by SILO (nor
     211         * bootloader). As for now, we solve it by a nasty workaround:
     212         * we pretend that the physical memory starts 0x400000 bytes further
     213         * than it actually does (and hence pretend that the physical memory
     214         * is 0x400000 bytes smaller). Of course, the value 0x400000 will most
     215         * probably depend on the machine and OBP version (the workaround now
     216         * works on Simics). A solution would be to inspect the "available"
     217         * property of the "/memory" node to find out which parts of memory
     218         * are used by OBP and redesign the algorithm of copying
     219         * kernel/init tasks/ramdisk from the bootable image to memory
     220         * (which we must do anyway because of issues with claiming the memory
     221         * on Serengeti).
     222         */
     223        bootinfo.physmem_start += 0x400000;
     224        bootinfo.memmap.zones[0].start += 0x400000;
     225        bootinfo.memmap.zones[0].size -= 0x400000;
     226        printf("The sun4v init finished.");
     227}
     228
     229
    111230void bootstrap(void)
    112231{
    113232        void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
    114         void *balloc_base;
    115233        unsigned int top = 0;
    116234        unsigned int i;
    117235        unsigned int j;
    118236       
    119         version_print();
    120        
    121         detect_subarchitecture();
     237        detect_architecture();
    122238        init_components(components);
    123239       
     
    260376        printf("done.\n");
    261377       
    262         /*
    263          * Claim and map the physical memory for the boot allocator.
    264          * Initialize the boot allocator.
    265          */
    266         balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
    267         (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
    268             BALLOC_MAX_SIZE);
    269         (void) ofw_map(bootinfo.physmem_start + balloc_base, balloc_base,
    270             BALLOC_MAX_SIZE, -1);
    271         balloc_init(&bootinfo.ballocs, (uintptr_t) balloc_base,
    272             (uintptr_t) balloc_base);
    273        
    274         printf("Setting up screens...");
    275         ofw_setup_screens();
    276         printf("done.\n");
    277        
    278         printf("Canonizing OpenFirmware device tree...");
    279         bootinfo.ofw_root = ofw_tree_build();
    280         printf("done.\n");
    281        
    282 #ifdef CONFIG_AP
    283         printf("Checking for secondary processors...");
    284         if (!ofw_cpu(mid_mask, bootinfo.physmem_start))
    285                 printf("Error: unable to get CPU properties\n");
    286         printf("done.\n");
    287 #endif
     378        /* perform architecture-specific initialization */
     379        if (architecture == COMPATIBLE_SUN4U) {
     380                bootstrap_sun4u(base, top);
     381        } else if (architecture == COMPATIBLE_SUN4V) {
     382                bootstrap_sun4v();
     383        } else {
     384                printf("Unknown architecture.\n");
     385                halt();
     386        }
    288387       
    289388        printf("Booting the kernel...\n");
Note: See TracChangeset for help on using the changeset viewer.