Subversion Repositories HelenOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 3037 → Rev 3042

/branches/tracing/kernel/generic/include/lib/rd.h
66,16 → 66,18
#define RE_UNSUPPORTED 2 /* Non-supported image (e.g. wrong version) */
 
/** RAM disk header */
typedef struct {
struct rd_header {
uint8_t magic[RD_MAGIC_SIZE];
uint8_t version;
uint8_t data_type;
uint32_t header_size;
uint64_t data_size;
} rd_header;
} __attribute__ ((packed));
 
extern int init_rd(rd_header * addr, size_t size);
typedef struct rd_header rd_header_t;
 
extern int init_rd(rd_header_t *addr, size_t size);
 
#endif
 
/** @}
/branches/tracing/kernel/generic/include/ipc/ipc.h
211,6 → 211,8
 
#define IPC_MAX_PHONES 16
 
#include <synch/spinlock.h>
#include <synch/mutex.h>
#include <synch/waitq.h>
 
struct answerbox;
231,7 → 233,7
 
/** Structure identifying phone (in TASK structure) */
typedef struct {
SPINLOCK_DECLARE(lock);
mutex_t lock;
link_t link;
struct answerbox *callee;
ipc_phone_state_t state;
/branches/tracing/kernel/generic/src/main/kinit.c
178,7 → 178,7
if (!ipc_phone_0)
ipc_phone_0 = &utask->answerbox;
} else {
int rd = init_rd((rd_header *) init.tasks[i].addr,
int rd = init_rd((rd_header_t *) init.tasks[i].addr,
init.tasks[i].size);
if (rd != RE_OK)
/branches/tracing/kernel/generic/src/lib/rd.c
42,7 → 42,6
#include <mm/frame.h>
#include <sysinfo/sysinfo.h>
#include <ddi/ddi.h>
#include <print.h>
#include <align.h>
 
static parea_t rd_parea; /**< Physical memory area for rd. */
52,7 → 51,7
* and information about the share is provided as sysinfo values to the userspace
* tasks.
*/
int init_rd(rd_header * header, size_t size)
int init_rd(rd_header_t *header, size_t size)
{
/* Identify RAM disk */
if ((header->magic[0] != RD_MAG0) || (header->magic[1] != RD_MAG1) ||
80,10 → 79,7
if ((hsize % FRAME_SIZE) || (dsize % FRAME_SIZE))
return RE_UNSUPPORTED;
if (dsize % FRAME_SIZE)
return RE_UNSUPPORTED;
 
if (hsize > size)
return RE_INVALID;
/branches/tracing/kernel/generic/src/ipc/sysipc.c
169,7 → 169,7
/* In case of forward, hangup the forwared phone,
* not the originator
*/
spinlock_lock(&answer->data.phone->lock);
mutex_lock(&answer->data.phone->lock);
spinlock_lock(&TASK->answerbox.lock);
if (answer->data.phone->state == IPC_PHONE_CONNECTED) {
list_remove(&answer->data.phone->link);
176,7 → 176,7
answer->data.phone->state = IPC_PHONE_SLAMMED;
}
spinlock_unlock(&TASK->answerbox.lock);
spinlock_unlock(&answer->data.phone->lock);
mutex_unlock(&answer->data.phone->lock);
}
 
if (!olddata)
/branches/tracing/kernel/generic/src/ipc/ipc.c
37,7 → 37,9
* First the answerbox, then the phone.
*/
 
#include <synch/synch.h>
#include <synch/spinlock.h>
#include <synch/mutex.h>
#include <synch/waitq.h>
#include <synch/synch.h>
#include <ipc/ipc.h>
141,7 → 143,7
*/
void ipc_phone_connect(phone_t *phone, answerbox_t *box)
{
spinlock_lock(&phone->lock);
mutex_lock(&phone->lock);
 
phone->state = IPC_PHONE_CONNECTED;
phone->callee = box;
150,7 → 152,7
list_append(&phone->link, &box->connected_phones);
spinlock_unlock(&box->lock);
 
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
}
 
/** Initialize a phone structure.
159,7 → 161,7
*/
void ipc_phone_init(phone_t *phone)
{
spinlock_initialize(&phone->lock, "phone_lock");
mutex_initialize(&phone->lock);
phone->callee = NULL;
phone->state = IPC_PHONE_FREE;
atomic_set(&phone->active_calls, 0);
262,9 → 264,9
{
answerbox_t *box;
 
spinlock_lock(&phone->lock);
mutex_lock(&phone->lock);
if (phone->state != IPC_PHONE_CONNECTED) {
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
if (call->flags & IPC_CALL_FORWARDED) {
IPC_SET_RETVAL(call->data, EFORWARD);
_ipc_answer_free_call(call);
279,7 → 281,7
box = phone->callee;
_ipc_call(phone, box, call);
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
return 0;
}
 
298,11 → 300,11
answerbox_t *box;
call_t *call;
spinlock_lock(&phone->lock);
mutex_lock(&phone->lock);
if (phone->state == IPC_PHONE_FREE ||
phone->state == IPC_PHONE_HUNGUP ||
phone->state == IPC_PHONE_CONNECTING) {
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
return -1;
}
box = phone->callee;
321,7 → 323,7
}
 
phone->state = IPC_PHONE_HUNGUP;
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
 
return 0;
}
447,7 → 449,7
while (!list_empty(&box->connected_phones)) {
phone = list_get_instance(box->connected_phones.next,
phone_t, link);
if (!spinlock_trylock(&phone->lock)) {
if (SYNCH_FAILED(mutex_trylock(&phone->lock))) {
spinlock_unlock(&box->lock);
interrupts_restore(ipl);
DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD);
461,7 → 463,7
phone->state = IPC_PHONE_SLAMMED;
 
if (notify_box) {
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
spinlock_unlock(&box->lock);
interrupts_restore(ipl);
 
482,7 → 484,7
goto restart_phones;
}
 
spinlock_unlock(&phone->lock);
mutex_unlock(&phone->lock);
}
 
spinlock_unlock(&box->lock);
625,7 → 627,10
/* Print opened phones & details */
printf("PHONE:\n");
for (i = 0; i < IPC_MAX_PHONES; i++) {
spinlock_lock(&task->phones[i].lock);
if (SYNCH_FAILED(mutex_trylock(&task->phones[i].lock))) {
printf("%d: mutex busy\n", i);
continue;
}
if (task->phones[i].state != IPC_PHONE_FREE) {
printf("%d: ", i);
switch (task->phones[i].state) {
650,7 → 655,7
printf("active: %d\n",
atomic_get(&task->phones[i].active_calls));
}
spinlock_unlock(&task->phones[i].lock);
mutex_unlock(&task->phones[i].lock);
}
 
 
669,7 → 674,7
}
/* Print answerbox - calls */
printf("ABOX - DISPATCHED CALLS:\n");
for (tmp=task->answerbox.dispatched_calls.next;
for (tmp = task->answerbox.dispatched_calls.next;
tmp != &task->answerbox.dispatched_calls;
tmp = tmp->next) {
call = list_get_instance(tmp, call_t, link);
/branches/tracing/kernel/arch/amd64/include/memstr.h
88,7 → 88,7
"movq %3, %0\n\t"
"addq $1, %0\n\t"
"1:\n"
: "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2)
: "=a" (ret), "=&S" (d0), "=&D" (d1), "=&c" (d2)
: "0" (0), "1" (src), "2" (dst), "3" ((unative_t)cnt)
);
110,7 → 110,7
asm volatile (
"rep stosw\n\t"
: "=&D" (d0), "=&c" (d1), "=a" (x)
: "=&D" (d0), "=&c" (d1), "=&a" (x)
: "0" (dst), "1" ((unative_t)cnt), "2" (x)
: "memory"
);
132,7 → 132,7
asm volatile (
"rep stosb\n\t"
: "=&D" (d0), "=&c" (d1), "=a" (x)
: "=&D" (d0), "=&c" (d1), "=&a" (x)
: "0" (dst), "1" ((unative_t)cnt), "2" (x)
: "memory"
);
/branches/tracing/kernel/arch/mips32/include/atomic.h
63,7 → 63,7
" sc %0, %1\n"
" beq %0, %4, 1b\n" /* if the atomic operation failed, try again */
" nop\n"
: "=r" (tmp), "=m" (val->count), "=r" (v)
: "=&r" (tmp), "=m" (val->count), "=&r" (v)
: "i" (i), "i" (0)
);
 
/branches/tracing/kernel/arch/ia32/include/memstr.h
94,7 → 94,7
"movl %3, %0\n\t"
"addl $1, %0\n\t"
"1:\n"
: "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2)
: "=a" (ret), "=&S" (d0), "=&D" (d1), "=&c" (d2)
: "0" (0), "1" ((unative_t) src), "2" ((unative_t) dst), "3" ((unative_t) cnt)
);
116,7 → 116,7
asm volatile (
"rep stosw\n\t"
: "=&D" (d0), "=&c" (d1), "=a" (x)
: "=&D" (d0), "=&c" (d1), "=&a" (x)
: "0" (dst), "1" (cnt), "2" (x)
: "memory"
);
138,7 → 138,7
asm volatile (
"rep stosb\n\t"
: "=&D" (d0), "=&c" (d1), "=a" (x)
: "=&D" (d0), "=&c" (d1), "=&a" (x)
: "0" (dst), "1" (cnt), "2" (x)
: "memory"
);
/branches/tracing/tools/cygwin_symlink_patch.sh
File deleted
/branches/tracing/tools/fix_symlinks.sh
0,0 → 1,24
#!/bin/bash
 
# by Alf
# This script solves malfunction of symlinks in cygwin
#
# Download sources from repository and than run this script to correct symlinks
# to be able compile project
 
 
if uname | grep 'CYGWIN' > /dev/null; then
echo "Good ... you have cygwin"
else
echo "Wrong. This script is only for cygwin"
exit
fi
for linkName in `find . ! -iwholename '.*svn*' ! -type d -print`; do
if head -n 1 $linkName | grep '^link' > /dev/null; then
linkTarget=`head -n 1 $linkName | sed 's/^link //'`
echo $linkName " -> " $linkTarget
rm $linkName
ln -s "$linkTarget" "$linkName"
fi
done
/branches/tracing/tools/mktmpfs.py
0,0 → 1,101
#!/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.
#
"""
TMPFS creator
"""
 
import sys
import os
import struct
 
def align_up(size, alignment):
"Align upwards to a given alignment"
return (((size) + ((alignment) - 1)) & ~((alignment) - 1))
 
def usage(prname):
"Print usage syntax"
print prname + " <ALIGNMENT> <PATH> <IMAGE>"
 
def main():
if (len(sys.argv) < 4):
usage(sys.argv[0])
return
if (not sys.argv[1].isdigit()):
print "<ALIGNMENT> must be a number"
return
align = int(sys.argv[1], 0)
path = os.path.abspath(sys.argv[2])
if (not os.path.isdir(path)):
print "<PATH> must be a directory"
return
header_size = align_up(18, align)
payload_size = 0
outf = file(sys.argv[3], "w")
outf.write(struct.pack("<" + ("%d" % header_size) + "x"))
for root, dirs, files in os.walk(path):
relpath = root[len(path):len(root)]
for name in files:
canon = os.path.join(relpath, name)
outf.write(struct.pack("<BL" + ("%d" % len(canon)) + "s", 1, len(canon), canon))
payload_size += 5 + len(canon)
fn = os.path.join(root, name)
size = os.path.getsize(fn)
rd = 0;
outf.write(struct.pack("<L", size))
payload_size += 4
inf = file(fn, "r")
while (rd < size):
data = inf.read(4096);
outf.write(data)
payload_size += len(data)
rd += len(data)
inf.close()
for name in dirs:
canon = os.path.join(relpath, name)
outf.write(struct.pack("<BL" + ("%d" % len(canon)) + "s", 2, len(canon), canon))
payload_size += 5 + len(canon)
aligned_size = align_up(payload_size, align)
if (aligned_size - payload_size > 0):
outf.write(struct.pack("<" + ("%d" % (aligned_size - payload_size)) + "x"))
outf.seek(0)
outf.write(struct.pack("<4sBBLQ", "HORD", 1, 1, header_size, aligned_size))
outf.close()
 
if __name__ == '__main__':
main()
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/branches/tracing/tools/config.py
1,6 → 1,6
#!/usr/bin/env python
#
# Copyright (c) 2006 Ondrej Palkovsky
# Copyright (c) 2006 Ondrej Palkovsky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
/branches/tracing/uspace/lib/libc/arch/mips32/include/atomic.h
64,7 → 64,7
" sc %0, %1\n"
" beq %0, %4, 1b\n" /* if the atomic operation failed, try again */
/* nop */ /* nop is inserted automatically by compiler */
: "=r" (tmp), "=m" (val->count), "=r" (v)
: "=&r" (tmp), "=m" (val->count), "=&r" (v)
: "i" (i), "i" (0)
);
 
/branches/tracing/uspace/srv/pci/update-ids
2,15 → 2,14
 
wget http://pciids.sourceforge.net/v2.2/pci.ids
 
cat >pci_ids.h <<EOF
cat > pci_ids.h <<EOF
/* DO NOT EDIT, THIS FILE IS AUTOMATICALLY GENERATED */
char *pci_ids[] = {
EOF
 
cat pci.ids | grep -v '^#.*' | grep -v '^$' | tr \" \' | sed -n 's/\(.*\)/"\1",/p' >>pci_ids.h
cat pci.ids | grep -v '^#.*' | grep -v '^$' | tr \" \' | sed -n 's/\(.*\)/"\1",/p' >> pci_ids.h
 
cat >>pci_ids.h <<EOF
cat >> pci_ids.h <<EOF
""
};
EOF
 
/branches/tracing/HelenOS.config
44,7 → 44,7
@ "msim" MSIM
@ "simics" Simics
@ "bgxemul" GXEmul big endian
@ "lgxemul" GXEmul little endia
@ "lgxemul" GXEmul little endian
@ "indy" Sgi Indy
! [PLATFORM=mips32] MACHINE (choice)
 
/branches/tracing/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/tracing/boot/arch/sparc64/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/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 \
112,10 → 107,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 $@
124,4 → 119,4
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
 
disasm: image.boot
$(OBJDUMP) -d image.boot > boot.disasm
$(OBJDUMP) -d image.boot > image.disasm
/branches/tracing/boot/arch/ia64/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/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
 
96,7 → 99,6
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog
 
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
 
106,7 → 108,6
 
-include Makefile.depend
 
 
hello.efi: image.boot
make -C gefi/HelenOS PREFIX=$(GEFI_PREFIX)
cp gefi/HelenOS/hello.efi ../../../../
114,17 → 115,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 $@
133,4 → 134,4
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
 
disasm: image.boot
$(OBJDUMP) -d image.boot > boot.disasm
$(OBJDUMP) -d image.boot > image.disasm
/branches/tracing/boot/arch/arm32/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/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/tracing/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,29 → 72,27
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/fs/fat/fat \
$(USPACEDIR)/srv/devmap/devmap \
$(USPACEDIR)/app/init/init \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/sctrace/sctrace \
$(USPACEDIR)/app/tetris/tetris
$(USPACEDIR)/app/klog/klog
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
101,17 → 103,17
 
-include Makefile.depend
 
image.boot: depend _components.h _link.ld $(OBJECTS) $(COMPONENT_OBJECTS)
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS)
$(LD) -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 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/tracing/boot/arch/ppc32/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/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/tracing/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 \
109,10 → 104,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/tracing/boot/arch/ppc64/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/boot/arch/ppc64/loader/main.c
96,8 → 96,9
{
version_print();
init_components();
component_t components[COMPONENTS];
init_components(components);
unsigned int i;
for (i = 0; i < COMPONENTS; i++)
/branches/tracing/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 \
109,10 → 104,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/tracing/boot/arch/mips32/loader/pack
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/branches/tracing/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/tracing/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/tracing/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/tracing/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
109,11 → 110,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 $@