Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3491 → Rev 3492

/branches/sparc/boot/boot.config
84,4 → 84,7
! RDFMT (choice)
 
# Preserve A.OUT header in isofs.b
! [ARCH=sparc64] CONFIG_AOUT_ISOFS_B (y/n)
! [ARCH=sparc64] CONFIG_AOUT_ISOFS_B (y/n)
 
# External ramdisk
! [ARCH=sparc64] CONFIG_RD_EXTERNAL (y/n)
/branches/sparc/boot/generic/string.c
39,9 → 39,9
 
/** Return number of characters in a string.
*
* @param str NULL terminated string.
* @param str NULL terminated string.
*
* @return Number of characters in str.
* @return Number of characters in str.
*/
size_t strlen(const char *str)
{
53,16 → 53,17
return i;
}
 
/** Compare two NULL terminated strings
/** Compare two NULL terminated strings.
*
* Do a char-by-char comparison of two NULL terminated strings.
* The strings are considered equal iff they consist of the same
* characters on the minimum of their lengths.
*
* @param src First string to compare.
* @param dst Second string to compare.
* @param src First string to compare.
* @param dst Second string to compare.
*
* @return 0 if the strings are equal, -1 if first is smaller, 1 if second smaller.
* @return 0 if the strings are equal, -1 if first is smaller,
* 1 if second smaller.
*
*/
int strcmp(const char *src, const char *dst)
81,7 → 82,7
}
 
 
/** Compare two NULL terminated strings
/** Compare two NULL terminated strings.
*
* Do a char-by-char comparison of two NULL terminated strings.
* The strings are considered equal iff they consist of the same
88,11 → 89,12
* characters on the minimum of their lengths and specified maximal
* length.
*
* @param src First string to compare.
* @param dst Second string to compare.
* @param len Maximal length for comparison.
* @param src First string to compare.
* @param dst Second string to compare.
* @param len Maximal length for comparison.
*
* @return 0 if the strings are equal, -1 if first is smaller, 1 if second smaller.
* @return 0 if the strings are equal, -1 if first is smaller,
* 1 if second smaller.
*
*/
int strncmp(const char *src, const char *dst, size_t len)
118,9 → 120,9
* If 'src' is shorter than 'len', '\0' is inserted behind the
* last copied character.
*
* @param src Source string.
* @param dest Destination buffer.
* @param len Size of destination buffer.
* @param src Source string.
* @param dest Destination buffer.
* @param len Size of destination buffer.
*/
void strncpy(char *dest, const char *src, size_t len)
{
132,13 → 134,13
dest[i-1] = '\0';
}
 
/** Convert ascii representation to unative_t
/** Convert ascii representation to unative_t.
*
* Supports 0x for hexa & 0 for octal notation.
* Does not check for overflows, does not support negative numbers
*
* @param text Textual representation of number
* @return Converted number or 0 if no valid number ofund
* @param text Textual representation of number.
* @return Converted number or 0 if no valid number found.
*/
unative_t atoi(const char *text)
{
152,9 → 154,9
base = 8;
 
while (*text) {
if (base != 16 && \
((*text >= 'A' && *text <= 'F' )
|| (*text >='a' && *text <='f')))
if (base != 16 &&
((*text >= 'A' && *text <= 'F') ||
(*text >='a' && *text <='f')))
break;
if (base == 8 && *text >='8')
break;
176,5 → 178,28
return result;
}
 
/** Move piece of memory to another, possibly overlapping, location.
*
* @param dst Destination address.
* @param src Source address.
* @param len Number of bytes to move.
*
* @return Destination address.
*/
void *memmove(void *dst, const void *src, size_t len)
{
char *d = dst;
const char *s = src;
if (s < d) {
while (len--)
*(d + len) = *(s + len);
} else {
while (len--)
*d++ = *s++;
}
return dst;
}
 
/** @}
*/
/branches/sparc/boot/generic/string.h
42,6 → 42,7
extern int strncmp(const char *src, const char *dst, size_t len);
extern void strncpy(char *dest, const char *src, size_t len);
extern unative_t atoi(const char *text);
extern void *memmove(void *dst, const void *src, size_t len);
 
#endif
 
/branches/sparc/boot/arch/sparc64/Makefile.inc
26,7 → 26,7
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
TMP=distroot
TMP = distroot
 
ifeq ($(CONFIG_AOUT_ISOFS_B),n)
SILO_PACKAGE=silo.patched.tar.gz
38,13 → 38,23
 
build: $(BASE)/image.iso
 
ifeq ($(CONFIG_RD_EXTERNAL),y)
SILO_CONF_FILTER = cat
else
SILO_CONF_FILTER = grep -v initrd
endif
 
$(BASE)/image.iso: depend arch/$(ARCH)/loader/image.boot
mkdir -p $(TMP)/boot
mkdir -p $(TMP)/HelenOS
cat arch/$(ARCH)/silo/$(SILO_PACKAGE) | (cd $(TMP)/boot; tar xvfz -)
cp arch/$(ARCH)/silo/README arch/$(ARCH)/silo/COPYING arch/$(ARCH)/silo/silo.conf $(TMP)/boot
cp arch/$(ARCH)/silo/README arch/$(ARCH)/silo/COPYING $(TMP)/boot
cat arch/$(ARCH)/silo/silo.conf | $(SILO_CONF_FILTER) >$(TMP)/boot/silo.conf
cp arch/$(ARCH)/loader/image.boot $(TMP)/HelenOS/image.boot
gzip -f $(TMP)/HelenOS/image.boot
ifeq ($(CONFIG_RD_EXTERNAL),y)
cp arch/$(ARCH)/loader/initrd.img $(TMP)/HelenOS/initrd.img
endif
mkisofs -f -G $(TMP)/boot/isofs.b -B ... -r -o $(BASE)/image.iso $(TMP)/
 
depend:
/branches/sparc/boot/arch/sparc64/loader/main.c
36,6 → 36,7
#include <ofw_tree.h>
#include "ofwarch.h"
#include <align.h>
#include <string.h>
 
bootinfo_t bootinfo;
component_t components[COMPONENTS];
64,6 → 65,11
 
void bootstrap(void)
{
void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
void *balloc_base;
unsigned int top = 0;
int i, j;
 
version_print();
init_components(components);
91,6 → 97,13
if (silo_ramdisk_image) {
silo_ramdisk_image += bootinfo.physmem_start;
silo_ramdisk_image -= 0x400000;
/* Install 1:1 mapping for the ramdisk. */
if (ofw_map((void *)((uintptr_t)silo_ramdisk_image),
(void *)((uintptr_t)silo_ramdisk_image),
silo_ramdisk_size, -1) != 0) {
printf("Failed to map ramdisk.\n");
halt();
}
}
printf("\nSystem info\n");
101,20 → 114,68
printf(" kernel entry point at %P\n", KERNEL_VIRTUAL_ADDRESS);
printf(" %P: boot info structure\n", &bootinfo);
unsigned int i;
for (i = 0; i < COMPONENTS; i++)
/*
* Figure out destination address for each component.
* In this phase, we don't copy the components yet because we want to
* to be careful not to overwrite anything, especially the components
* which haven't been copied yet.
*/
bootinfo.taskmap.count = 0;
for (i = 0; i < COMPONENTS; i++) {
printf(" %P: %s image (size %d bytes)\n", components[i].start,
components[i].name, components[i].size);
top = ALIGN_UP(top, PAGE_SIZE);
if (i > 0) {
if (bootinfo.taskmap.count == TASKMAP_MAX_RECORDS) {
printf("Skipping superfluous components.\n");
break;
}
bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr =
base + top;
bootinfo.taskmap.tasks[bootinfo.taskmap.count].size =
components[i].size;
bootinfo.taskmap.count++;
}
top += components[i].size;
}
 
void * base = (void *) KERNEL_VIRTUAL_ADDRESS;
unsigned int top = 0;
j = bootinfo.taskmap.count - 1; /* do not consider ramdisk */
 
printf("\nCopying components\n");
bootinfo.taskmap.count = 0;
for (i = 0; i < COMPONENTS; i++) {
printf(" %s...", components[i].name);
if (silo_ramdisk_image) {
/* Treat the ramdisk as the last bootinfo task. */
if (bootinfo.taskmap.count == TASKMAP_MAX_RECORDS) {
printf("Skipping ramdisk.\n");
goto skip_ramdisk;
}
top = ALIGN_UP(top, PAGE_SIZE);
bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr =
base + top;
bootinfo.taskmap.tasks[bootinfo.taskmap.count].size =
silo_ramdisk_size;
bootinfo.taskmap.count++;
printf("\nCopying ramdisk...");
/*
* Claim and map the whole ramdisk as it may exceed the area
* given to us by SILO.
*/
(void) ofw_claim_phys(base + top, silo_ramdisk_size);
(void) ofw_map(base + top, base + top, silo_ramdisk_size, -1);
memmove(base + top, (void *)((uintptr_t)silo_ramdisk_image),
silo_ramdisk_size);
printf("done.\n");
top += silo_ramdisk_size;
}
skip_ramdisk:
 
/*
* Now we can proceed to copy the components. We do it in reverse order
* so that we don't overwrite anything even if the components overlap
* with base.
*/
printf("\nCopying bootinfo tasks\n");
for (i = COMPONENTS - 1; i > 0; i--, j--) {
printf(" %s...", components[i].name);
 
/*
* At this point, we claim the physical memory that we are
* going to use. We should be safe in case of the virtual
122,30 → 183,34
* SPARC binding, should restrict its use of virtual memory
* to addresses from [0xffd00000; 0xffefffff] and
* [0xfe000000; 0xfeffffff].
*
* XXX We don't map this piece of memory. We simply rely on
* SILO to have it done for us already in this case.
*/
(void) ofw_claim_phys(bootinfo.physmem_start + base + top,
(void) ofw_claim_phys(bootinfo.physmem_start +
bootinfo.taskmap.tasks[j].addr,
ALIGN_UP(components[i].size, PAGE_SIZE));
memcpy(base + top, components[i].start, components[i].size);
if (i > 0) {
bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr =
base + top;
bootinfo.taskmap.tasks[bootinfo.taskmap.count].size =
components[i].size;
bootinfo.taskmap.count++;
}
top += components[i].size;
memcpy((void *)bootinfo.taskmap.tasks[j].addr,
components[i].start, components[i].size);
printf("done.\n");
}
 
printf("\nCopying kernel...");
(void) ofw_claim_phys(bootinfo.physmem_start + base,
ALIGN_UP(components[0].size, PAGE_SIZE));
memcpy(base, components[0].start, components[0].size);
printf("done.\n");
 
/*
* Claim the physical memory for the boot allocator.
* Claim and map the physical memory for the boot allocator.
* Initialize the boot allocator.
*/
(void) ofw_claim_phys(bootinfo.physmem_start +
base + ALIGN_UP(top, PAGE_SIZE), BALLOC_MAX_SIZE);
balloc_init(&bootinfo.ballocs, ALIGN_UP(((uintptr_t) base) + top,
PAGE_SIZE));
balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
(void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
BALLOC_MAX_SIZE);
(void) ofw_map(balloc_base, balloc_base, BALLOC_MAX_SIZE, -1);
balloc_init(&bootinfo.ballocs, (uintptr_t)balloc_base);
 
printf("\nCanonizing OpenFirmware device tree...");
bootinfo.ofw_root = ofw_tree_build();
/branches/sparc/boot/arch/sparc64/loader/Makefile
57,7 → 57,7
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
endif
 
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64 -mno-fpu -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
79,6 → 79,9
asm.S \
boot.S
 
#
# All components that go to image.boot without the ramdisk.
#
COMPONENTS = \
$(KERNELDIR)/kernel.bin \
$(USPACEDIR)/srv/ns/ns \
94,19 → 97,30
COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
#
# Final list of all components that go to image.boot.
#
ALL_COMPONENTS = $(COMPONENTS)
ifeq ($(CONFIG_RD_EXTERNAL),n)
ALL_COMPONENTS += ./initrd.img
endif
 
RD_SRVS = \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/app/klog/klog
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
ALL_COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(ALL_COMPONENTS))))
 
.PHONY: all clean depend
 
114,22 → 128,28
 
-include Makefile.depend
 
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
image.boot: depend _components.h _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS)
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) -o $@
 
depend:
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -f _components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend
 
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
_components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS): $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
endif
138,7 → 158,7
endif
../../../../tools/mkhord.py 16384 initrd.fs initrd.img
rm initrd.fs
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) ./initrd.img
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(ALL_COMPONENTS)
 
%.o: %.S
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
/branches/sparc/boot/arch/sparc64/silo/silo.conf
1,3 → 1,4
timeout = 0
image = /HelenOS/image.boot.gz
label = HelenOS
initrd = /HelenOS/initrd.img
/branches/sparc/boot/arch/ia64/loader/Makefile
68,7 → 68,7
endif
 
#-mno-pic means do not use gp + imm22 to address data
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -I../../../../kernel/generic/include -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -I../../../../kernel/generic/include -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
101,6 → 101,7
$(USPACEDIR)/app/init/init \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
122,7 → 123,7
$(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
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend ../../../../image.bin ../../../../hello.efi
/branches/sparc/boot/arch/arm32/loader/Makefile
57,7 → 57,7
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
endif
 
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../.. -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../.. -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
96,14 → 96,17
COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
RD_SRVS = \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
 
120,18 → 123,24
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
 
depend:
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
 
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) _link.ld.in
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
endif
/branches/sparc/boot/arch/ppc32/loader/Makefile
57,7 → 57,7
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
endif
 
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc -msoft-float -m32
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc -msoft-float -m32 -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
91,14 → 91,17
COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
RD_SRVS = \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
 
115,18 → 118,24
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
 
depend:
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
 
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
endif
/branches/sparc/boot/arch/amd64/Makefile.inc
40,21 → 40,24
INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
RD_SRVS = \
$(USPACEDIR)/srv/pci/pci \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat
$(USPACEDIR)/app/bdsh/bdsh
 
build: $(BASE)/image.iso
 
$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_TASKS)
$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS)
mkdir -p arch/$(ARCH)/iso/boot/grub
cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
ifneq ($(RDFMT),tmpfs)
67,9 → 70,12
for task in $(INIT_TASKS) ; do \
cp $$task arch/$(ARCH)/iso/boot/ ; \
done
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
$(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ arch/$(ARCH)/iso/boot/initrd.fs
endif
81,8 → 87,11
mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -fr arch/$(ARCH)/iso
-rm -f $(BASE)/image.iso
/branches/sparc/boot/arch/ppc64/loader/Makefile
57,7 → 57,7
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
endif
 
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64 -msoft-float -m64
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64 -msoft-float -m64 -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
89,6 → 89,7
$(USPACEDIR)/app/init/init \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
104,7 → 105,7
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
 
depend:
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend
/branches/sparc/boot/arch/mips32/loader/Makefile
63,7 → 63,7
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
endif
 
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mhard-float -mips3
CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mhard-float -mips3 -pipe
 
ifdef REVISION
CFLAGS += "-DREVISION=\"$(REVISION)\""
96,18 → 96,20
COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
RD_SRVS = \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/app/klog/klog
 
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
 
121,18 → 123,24
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
 
depend:
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -f _components.h _components.c _link.ld _link.ld.in $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
 
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) _link.ld.in
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs
endif
/branches/sparc/boot/arch/ia32/Makefile.inc
40,20 → 40,23
INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
endif
 
RD_TASKS = \
RD_SRVS = \
$(USPACEDIR)/srv/pci/pci \
$(USPACEDIR)/srv/fb/fb \
$(USPACEDIR)/srv/kbd/kbd \
$(USPACEDIR)/srv/console/console \
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/srv/fs/fat/fat
 
RD_APPS = \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/trace/trace \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
 
build: $(BASE)/image.iso
 
$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_TASKS)
$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS)
mkdir -p arch/$(ARCH)/iso/boot/grub
cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
ifneq ($(RDFMT),tmpfs)
66,9 → 69,12
for task in $(INIT_TASKS) ; do \
cp $$task arch/$(ARCH)/iso/boot/ ; \
done
for task in $(RD_TASKS) ; do \
cp $$task $(USPACEDIR)/dist/sbin/ ; \
for file in $(RD_SRVS) ; do \
cp $$file $(USPACEDIR)/dist/srv/ ; \
done
for file in $(RD_APPS) ; do \
cp $$file $(USPACEDIR)/dist/app/ ; \
done
ifeq ($(RDFMT),tmpfs)
$(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ arch/$(ARCH)/iso/boot/initrd.fs
endif
80,8 → 86,11
mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
 
clean:
-for task in $(RD_TASKS) ; do \
rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \
-for file in $(RD_SRVS) ; do \
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
done
-for file in $(RD_APPS) ; do \
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
done
-rm -fr arch/$(ARCH)/iso
-rm -f $(BASE)/image.iso