Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3397 → Rev 3365

/branches/sparc/boot/genarch/balloc.h
37,11 → 37,11
* (roughly 512 kB and more). SmartFirmware runs on machines
* containing newer versions of UltraSPARC processors. It
* has been observed that the OFW tree is small enough for these
* machines so that it can fit into 128 kB. This is a workaround how
* machines so that it can fit into 256 kB. This is a workaround how
* to get rid of the memory claiming failure.
*/
#if defined (SMART_FIRMWARE)
#define BALLOC_MAX_SIZE (128 * 1024)
#define BALLOC_MAX_SIZE (256 * 1024)
#else
#define BALLOC_MAX_SIZE (1024 * 1024)
#endif
/branches/sparc/boot/arch/sparc64/loader/Makefile
32,14 → 32,10
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
BFD_NAME = elf64-sparc
BFD_ARCH = sparc
TARGET = sparc64-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
TOOLCHAIN_DIR = /usr/local/sparc64/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
102,7 → 98,7
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/app/cli/cli \
$(USPACEDIR)/app/klog/klog
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
/branches/sparc/boot/arch/sparc64/loader/main.c
57,9 → 57,7
/** Print version information. */
static void version_print(void)
{
printf("HelenOS SPARC64 Bootloader\nRelease %s%s%s\n"
"Copyright (c) 2006 HelenOS project\n",
release, revision, timestamp);
printf("HelenOS SPARC64 Bootloader\nRelease %s%s%s\nCopyright (c) 2006 HelenOS project\n", release, revision, timestamp);
}
 
void bootstrap(void)
82,20 → 80,10
printf("Error: no memory detected, halting.\n");
halt();
}
 
/*
* SILO for some reason adds 0x400000 and subtracts
* bootinfo.physmem_start to/from silo_ramdisk_image.
* We just need plain physical address so we fix it up.
*/
if (silo_ramdisk_image) {
silo_ramdisk_image += bootinfo.physmem_start;
silo_ramdisk_image -= 0x400000;
}
printf("\nSystem info\n");
printf(" memory: %dM starting at %P\n",
bootinfo.memmap.total >> 20, bootinfo.physmem_start);
bootinfo.memmap.total >> 20, bootinfo.physmem_start);
 
printf("\nMemory statistics\n");
printf(" kernel entry point at %P\n", KERNEL_VIRTUAL_ADDRESS);
/branches/sparc/boot/arch/sparc64/loader/boot.S
53,15 → 53,6
.ascii "HdrS"
.word 0
.half 0
.half 0
.half 0
.half 0
.global silo_ramdisk_image
silo_ramdisk_image:
.word 0
.global silo_ramdisk_size
silo_ramdisk_size:
.word 0
 
.align 8
1:
/branches/sparc/boot/arch/sparc64/loader/main.h
59,9 → 59,6
ofw_tree_node_t *ofw_root;
} bootinfo_t;
 
extern uint32_t silo_ramdisk_image;
extern uint32_t silo_ramdisk_size;
 
extern bootinfo_t bootinfo;
 
extern void start(void);
/branches/sparc/boot/arch/ppc32/loader/Makefile
32,14 → 32,10
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
BFD_NAME = elf32-powerpc
BFD_ARCH = powerpc:common
TARGET = ppc-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc/bin
TOOLCHAIN_DIR = /usr/local/ppc/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
100,7 → 96,7
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
$(USPACEDIR)/app/cli/cli
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
/branches/sparc/boot/arch/ppc32/loader/main.c
116,11 → 116,15
halt();
}
if (!ofw_screen(&bootinfo.screen))
printf("Warning: unable to get screen properties.\n");
if (!ofw_screen(&bootinfo.screen)) {
printf("Error: unable to get screen properties, halting.\n");
halt();
}
if (!ofw_keyboard(&bootinfo.keyboard))
printf("Warning: unable to get keyboard properties.\n");
if (!ofw_keyboard(&bootinfo.keyboard)) {
printf("Error: unable to get keyboard properties, halting.\n");
halt();
}
printf("\nDevice statistics\n");
printf(" screen at %L, resolution %dx%d, %d bpp (scanline %d bytes)\n", bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline);
/branches/sparc/boot/arch/ppc32/loader/ofwarch.c
39,13 → 39,7
 
void write(const char *str, const int len)
{
int i;
for (i = 0; i < len; i++) {
if (str[i] == '\n')
ofw_write("\r", 1);
ofw_write(&str[i], 1);
}
ofw_write(str, len);
}
 
int ofw_keyboard(keyboard_t *keyboard)
/branches/sparc/boot/arch/mips32/loader/Makefile
32,10 → 32,6
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
ifeq ($(IMAGE),binary)
LD_IN = binary
endif
45,7 → 41,7
BFD_NAME = elf32-tradlittlemips
BFD_ARCH = mips
TARGET = mipsel-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin
TOOLCHAIN_DIR = /usr/local/mipsel/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
104,7 → 100,7
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/app/cli/cli \
$(USPACEDIR)/app/klog/klog
 
 
/branches/sparc/boot/arch/arm32/loader/Makefile
32,14 → 32,10
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
BFD_NAME = elf32-littlearm
BFD_ARCH = arm
TARGET = arm-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin
TOOLCHAIN_DIR = /usr/local/arm/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
105,7 → 101,7
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
$(USPACEDIR)/app/cli/cli
 
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS))))
/branches/sparc/boot/arch/ia32/Makefile.inc
48,8 → 48,8
$(USPACEDIR)/srv/fs/fat/fat \
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh
$(USPACEDIR)/app/cli/cli \
$(USPACEDIR)/app/klog/klog
 
build: $(BASE)/image.iso
 
/branches/sparc/boot/arch/amd64/Makefile.inc
48,7 → 48,7
$(USPACEDIR)/app/tetris/tetris \
$(USPACEDIR)/app/tester/tester \
$(USPACEDIR)/app/klog/klog \
$(USPACEDIR)/app/bdsh/bdsh \
$(USPACEDIR)/app/cli/cli \
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
$(USPACEDIR)/srv/fs/fat/fat
 
/branches/sparc/boot/arch/ia64/loader/Makefile
32,14 → 32,10
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
BFD_NAME = elf64-ia64-little
BFD_ARCH = ia64
TARGET = ia64-pc-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
TOOLCHAIN_DIR = /usr/local/ia64/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
/branches/sparc/boot/arch/ia64/Makefile.inc
28,6 → 28,23
 
#ifeq ($(MACHINE),ski)
 
 
 
#VMAXLMA_SRC = tools/ia64/vmaxlma.c
#build: $(BASE)/kernel.bin
#echo Building SKI
#$(BASE)/kernel.bin: $(KERNELDIR)/kernel.bin vmaxlma
# cp $(KERNELDIR)/kernel.bin $(BASE)/kernel.bin
# ./vmaxlma $(BASE)/kernel.bin
#vmaxlma: $(VMAXLMA_SRC)
# $(CC) $(VMAXLMA_SRC) -o $@
#clean:
# -rm -f $(BASE)/kernel.bin vmaxlma
 
 
#else
 
 
build: $(BASE)/image.boot
 
$(BASE)/image.boot: depend arch/$(ARCH)/loader/image.boot
43,5 → 60,5
make -C arch/$(ARCH)/loader clean COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) "DEFS=$(DEFS)"
-rm -f $(BASE)/image.boot
 
#endif
 
#endif
/branches/sparc/boot/arch/ppc64/loader/Makefile
32,14 → 32,10
## Toolchain configuration
#
 
ifndef CROSS_PREFIX
CROSS_PREFIX = /usr/local
endif
 
BFD_NAME = elf64-powerpc
BFD_ARCH = powerpc:common64
TARGET = ppc64-linux-gnu
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc64/bin
TOOLCHAIN_DIR = /usr/local/ppc64/bin
 
ifeq ($(COMPILER),gcc_native)
CC = gcc
/branches/sparc/boot/tools/ia64/vmaxlma.c
0,0 → 1,75
/*
* Swap VMA and LMA in ELF header.
*
* by Jakub Jermar <jermar@itbs.cz>
*
* GPL'ed, copyleft
*/
 
/*
* HP's IA-64 simulator Ski seems to confuse VMA and LMA in the ELF header.
* Instead of using LMA, Ski loads sections at their VMA addresses.
* This short program provides a workaround for this bug by simply
* swapping VMA and LMA in the ELF header of the executable.
*
* Note that after applying this workaround, you will be able to load
* ELF objects with different VMA and LMA in Ski, but the executable
* will become wronged for other potential uses.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
 
void syntax(char *prg)
{
printf("%s ELF-file\n", prg);
exit(1);
}
 
void error(char *msg)
{
printf("Error: %s\n", msg);
exit(2);
}
 
#define ELF_VMA (0x50/sizeof(unsigned long long))
#define ELF_LMA (0x58/sizeof(unsigned long long))
#define ELF_ENTRY (0x18/sizeof(unsigned long long))
 
#define LENGTH 0x98
 
int main(int argc, char *argv[])
{
int fd;
unsigned long long vma, lma,entry;
unsigned long long *elf;
 
if (argc != 2)
syntax(argv[0]);
fd = open(argv[1], O_RDWR);
if (fd == -1)
error("open failed");
 
elf = mmap(NULL, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if ((void *) elf == (void *) -1)
error("map failed");
lma = elf[ELF_LMA];
elf[ELF_VMA] = lma;
entry = lma;
elf[ELF_ENTRY] = entry;
if (munmap(elf, LENGTH) == -1)
error("munmap failed");
if (close(fd) == -1)
error("close failed");
return 0;
}