/branches/dynload/boot/tools/pack.py |
---|
0,0 → 1,132 |
#!/usr/bin/env python |
# |
# Copyright (c) 2008 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
""" |
Binary package creator |
""" |
import sys |
import os |
import subprocess |
def usage(prname): |
"Print usage syntax" |
print prname + " <OBJCOPY> <FORMAT> <ARCH> <ALIGNMENT> <UINTPTR>" |
def main(): |
if (len(sys.argv) < 6): |
usage(sys.argv[0]) |
return |
if (not sys.argv[4].isdigit()): |
print "<ALIGNMENT> must be a number" |
return |
objcopy = sys.argv[1] |
format = sys.argv[2] |
arch = sys.argv[3] |
align = int(sys.argv[4], 0) |
uintptr = sys.argv[5] |
workdir = os.getcwd() |
header = file("_components.h", "w") |
data = file("_components.c", "w") |
header.write("#ifndef ___COMPONENTS_H__\n") |
header.write("#define ___COMPONENTS_H__\n\n") |
data.write("#include \"_components.h\"\n\n") |
data.write("void init_components(component_t *components)\n") |
data.write("{\n") |
cnt = 0 |
link = "" |
for task in sys.argv[6:]: |
basename = os.path.basename(task) |
plainname = os.path.splitext(basename)[0] |
path = os.path.dirname(task) |
object = plainname + ".o" |
symbol = "_binary_" + basename.replace(".", "_") |
macro = plainname.upper() |
print task + " -> " + object |
if (align > 1): |
link += "\t\t. = ALIGN(" + ("%d" % align) + ");\n" |
link += "\t\t*(." + plainname + "_image);\n" |
header.write("extern int " + symbol + "_start;\n") |
header.write("extern int " + symbol + "_end;\n\n") |
header.write("#define " + macro + "_START ((void *) &" + symbol + "_start)\n") |
header.write("#define " + macro + "_END ((void *) &" + symbol + "_end)\n") |
header.write("#define " + macro + "_SIZE ((" + uintptr + ") " + macro + "_END - (" + uintptr + ") " + macro + "_START)\n\n") |
data.write("\tcomponents[" + ("%d" % cnt) + "].name = \"" + plainname + "\";\n") |
data.write("\tcomponents[" + ("%d" % cnt) + "].start = " + macro + "_START;\n") |
data.write("\tcomponents[" + ("%d" % cnt) + "].end = " + macro + "_END;\n") |
data.write("\tcomponents[" + ("%d" % cnt) + "].size = " + macro + "_SIZE;\n\n") |
os.chdir(path) |
subprocess.call([objcopy, |
"-I", "binary", |
"-O", format, |
"-B", arch, |
"--rename-section", ".data=." + plainname + "_image", |
basename, os.path.join(workdir, object)]) |
os.chdir(workdir) |
cnt += 1 |
header.write("#define COMPONENTS " + ("%d" % cnt) + "\n\n") |
header.write("typedef struct {\n") |
header.write("\tchar *name;\n\n") |
header.write("\tvoid *start;\n") |
header.write("\tvoid *end;\n") |
header.write("\t" + uintptr + " size;\n") |
header.write("} component_t;\n\n") |
header.write("extern void init_components(component_t *components);\n\n") |
header.write("#endif\n") |
data.write("}\n") |
header.close() |
data.close() |
linkname = "_link.ld" |
link_in = file(linkname + ".in", "r") |
template = link_in.read(os.path.getsize(linkname + ".in")) |
link_in.close() |
link_out = file(linkname, "w") |
link_out.write(template.replace("[[COMPONENTS]]", link)) |
link_out.close() |
if __name__ == '__main__': |
main() |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/dynload/boot/arch/sparc64/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/sparc64/loader/_link.ld.in |
---|
0,0 → 1,23 |
OUTPUT_FORMAT("elf64-sparc") |
ENTRY(start) |
SECTIONS { |
.boot 0x4000: AT (0x4000) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); |
[[COMPONENTS]] |
} |
/DISCARD/ : { |
*(.comment); |
*(.note*); |
} |
} |
/branches/dynload/boot/arch/sparc64/loader/Makefile |
---|
32,6 → 32,8 |
## Toolchain configuration |
# |
BFD_NAME = elf64-sparc |
BFD_ARCH = sparc |
TARGET = sparc64-linux-gnu |
TOOLCHAIN_DIR = /usr/local/sparc64/bin |
43,14 → 45,6 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
71,6 → 65,7 |
SOURCES = \ |
main.c \ |
_components.c \ |
../../../generic/printf.c \ |
../../../generic/string.c \ |
../../../genarch/balloc.c \ |
111,10 → 106,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot boot.disasm Makefile.depend |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
123,4 → 118,4 |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
disasm: image.boot |
$(OBJDUMP) -d image.boot > boot.disasm |
$(OBJDUMP) -d image.boot > image.disasm |
/branches/dynload/boot/arch/ia64/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/ia64/loader/_link.ld.in |
---|
0,0 → 1,26 |
OUTPUT_FORMAT("elf64-ia64-little") |
ENTRY(start) |
SECTIONS { |
.boot 0x4400000: AT (0x4400000) { |
*(BOOTSTRAP); |
[[COMPONENTS]] |
. = ALIGN (16384); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
_got = . ; |
*(.got .got.*); |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); |
} |
/DISCARD/ : { |
*(.comment); |
*(.note*); |
} |
} |
/branches/dynload/boot/arch/ia64/loader/Makefile |
---|
32,6 → 32,8 |
## Toolchain configuration |
# |
BFD_NAME = elf64-ia64-little |
BFD_ARCH = ia64 |
TARGET = ia64-pc-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ia64/bin |
77,6 → 79,7 |
../../../generic/printf.c \ |
../../../generic/string.c \ |
../../../genarch/balloc.c \ |
_components.c \ |
asm.S \ |
boot.S |
95,7 → 98,6 |
$(USPACEDIR)/app/tester/tester \ |
$(USPACEDIR)/app/klog/klog |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
105,7 → 107,6 |
-include Makefile.depend |
hello.efi: image.boot |
make -C gefi/HelenOS PREFIX=$(GEFI_PREFIX) |
cp gefi/HelenOS/hello.efi ../../../../ |
113,17 → 114,17 |
cp gefi/HelenOS/image.bin ../../../../ |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
$(LD) -Map boot.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
depend: |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot boot.disasm Makefile.depend |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend |
make -C gefi/HelenOS clean |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned long" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
132,4 → 133,4 |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
disasm: image.boot |
$(OBJDUMP) -d image.boot > boot.disasm |
$(OBJDUMP) -d image.boot > image.disasm |
/branches/dynload/boot/arch/arm32/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/arm32/loader/_link.ld.in |
---|
0,0 → 1,24 |
OUTPUT_FORMAT("elf32-littlearm") |
ENTRY(start) |
SECTIONS { |
.boot 0x0: AT (0) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.scommon); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
*(.reginfo); |
. = 0x4000; |
*(PT); /* page table placed at 0x4000 */ |
[[COMPONENTS]] |
} |
} |
/branches/dynload/boot/arch/arm32/loader/main.c |
---|
76,9 → 76,10 |
version_print(); |
component_t components[COMPONENTS]; |
bootinfo_t bootinfo; |
init_components(components); |
bootinfo_t bootinfo; |
printf("\nMemory statistics\n"); |
printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
printf(" %L: boot info structure\n", &bootinfo); |
/branches/dynload/boot/arch/arm32/loader/Makefile |
---|
27,21 → 27,25 |
# |
include ../../../../version |
include ../../../../Makefile.config |
include ../../../Makefile.config |
## Toolchain configuration |
# |
BFD_NAME = elf32-littlearm |
BFD_ARCH = arm |
TARGET = arm-linux-gnu |
TOOLCHAIN_DIR = /usr/local/arm/bin |
ifeq ($(COMPILER),native) |
ifeq ($(COMPILER),gcc_native) |
CC = gcc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
else |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
68,24 → 72,23 |
boot.S \ |
asm.S \ |
mm.c \ |
print/gxemul.c \ |
_components.c \ |
../../../generic/printf.c \ |
../../../genarch/division.c |
ifeq ($(MACHINE), gxemul_testarm) |
SOURCES += print/gxemul.c |
endif |
COMPONENTS = \ |
$(KERNELDIR)/kernel.bin \ |
$(USPACEDIR)/srv/ns/ns \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/kbd/kbd \ |
$(USPACEDIR)/srv/console/console \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/vfs/vfs \ |
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
$(USPACEDIR)/srv/devmap/devmap \ |
$(USPACEDIR)/app/init/init \ |
$(USPACEDIR)/app/tetris/tetris \ |
$(USPACEDIR)/app/tester/tester \ |
$(USPACEDIR)/app/klog/klog \ |
$(USPACEDIR)/app/iramfs/iramfs \ |
$(USPACEDIR)/app/iloader/iloader \ |
100,7 → 103,7 |
-include Makefile.depend |
image.boot: depend _components.h _link.ld $(OBJECTS) $(COMPONENT_OBJECTS) |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
depend: |
107,10 → 110,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/dynload/boot/arch/ppc32/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/ppc32/loader/_link.ld.in |
---|
0,0 → 1,21 |
OUTPUT_FORMAT("elf32-powerpc") |
OUTPUT_ARCH(powerpc:common) |
ENTRY(start) |
SECTIONS { |
.boot 0x10000000: AT (0) { |
*(BOOTSTRAP); |
*(REALMODE); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
[[COMPONENTS]] |
} |
} |
/branches/dynload/boot/arch/ppc32/loader/main.c |
---|
96,10 → 96,10 |
{ |
version_print(); |
init_components(); |
component_t components[COMPONENTS]; |
init_components(components); |
unsigned int i; |
for (i = 0; i < COMPONENTS; i++) |
check_align(components[i].start, components[i].name); |
/branches/dynload/boot/arch/ppc32/loader/Makefile |
---|
32,6 → 32,8 |
## Toolchain configuration |
# |
BFD_NAME = elf32-powerpc |
BFD_ARCH = powerpc:common |
TARGET = ppc-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ppc/bin |
43,14 → 45,6 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
72,6 → 66,7 |
SOURCES = \ |
main.c \ |
ofwarch.c \ |
_components.c \ |
../../../genarch/ofw.c \ |
../../../generic/printf.c \ |
asm.S \ |
108,10 → 103,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/dynload/boot/arch/ppc64/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/ppc64/loader/_link.ld.in |
---|
0,0 → 1,27 |
OUTPUT_FORMAT("elf64-powerpc") |
OUTPUT_ARCH(powerpc:common64) |
ENTRY(start) |
SECTIONS { |
.boot 0x0000000010000000: AT (0) { |
*(BOOTSTRAP); |
*(REALMODE); |
*(.text); |
*(.toc); |
*(.opd); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
[[COMPONENTS]] |
} |
/DISCARD/ : { |
*(*); |
} |
} |
/branches/dynload/boot/arch/ppc64/loader/main.c |
---|
96,7 → 96,8 |
{ |
version_print(); |
init_components(); |
component_t components[COMPONENTS]; |
init_components(components); |
unsigned int i; |
/branches/dynload/boot/arch/ppc64/loader/Makefile |
---|
32,6 → 32,8 |
## Toolchain configuration |
# |
BFD_NAME = elf64-powerpc |
BFD_ARCH = powerpc:common64 |
TARGET = ppc64-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ppc64/bin |
43,14 → 45,6 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
72,6 → 66,7 |
SOURCES = \ |
main.c \ |
ofwarch.c \ |
_components.c \ |
../../../genarch/ofw.c \ |
../../../generic/printf.c \ |
asm.S \ |
108,10 → 103,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned long" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/dynload/boot/arch/mips32/loader/pack |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/dynload/boot/arch/mips32/loader/_link.ld.in.ecoff |
---|
0,0 → 1,21 |
OUTPUT_FORMAT("ecoff-littlemips") |
ENTRY(start) |
SECTIONS { |
.boot 0xbfc00000: AT (0) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.scommon); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
*(.reginfo); |
[[COMPONENTS]] |
} |
} |
/branches/dynload/boot/arch/mips32/loader/_link.ld.in.binary |
---|
0,0 → 1,21 |
OUTPUT_FORMAT("binary") |
ENTRY(start) |
SECTIONS { |
.boot 0xbfc00000: AT (0) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.scommon); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
*(.reginfo); |
[[COMPONENTS]] |
} |
} |
/branches/dynload/boot/arch/mips32/loader/main.c |
---|
59,9 → 59,10 |
version_print(); |
component_t components[COMPONENTS]; |
bootinfo_t bootinfo; |
init_components(components); |
bootinfo_t bootinfo; |
printf("\nMemory statistics\n"); |
printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
printf(" %L: boot info structure\n", &bootinfo); |
/branches/dynload/boot/arch/mips32/loader/Makefile |
---|
32,6 → 32,14 |
## Toolchain configuration |
# |
ifeq ($(IMAGE),binary) |
LD_IN = binary |
endif |
ifeq ($(IMAGE),ecoff) |
LD_IN = ecoff |
endif |
BFD_NAME = elf32-tradlittlemips |
BFD_ARCH = mips |
TARGET = mipsel-linux-gnu |
TOOLCHAIN_DIR = /usr/local/mipsel/bin |
43,14 → 51,6 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
72,6 → 72,7 |
SOURCES = \ |
main.c \ |
msim.c \ |
_components.c \ |
../../../generic/printf.c \ |
asm.S \ |
boot.S |
107,11 → 108,14 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _components.c _link.ld _link.ld.in $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
_link.ld.in: _link.ld.in.$(LD_IN) |
cp $< $@ |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |