Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 288 → Rev 289

/SPARTAN/trunk/src/clean.amd64
5,4 → 5,5
 
find ../arch/amd64 -type l | xargs rm
rm ../arch/amd64/src/context_offset.h
rm ../tools/amd64/gencontext
rm ../arch/amd64/_link.ld
rm ../tools/amd64/gencontext
/SPARTAN/trunk/src/Makefile
73,12 → 73,12
-rm Makefile.depend
-$(MAKE) clean
 
kernel.bin: $(arch_objects) $(objects) $(test_objects)
kernel.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile debug/empty_map.o
$(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/empty_map.o -o $@ -Map kernel.map.pre
$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/empty_map.o -o $@ -Map kernel.map.pre
../tools/genmap.py kernel.map.pre debug/real_map.bin
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab debug/real_map.bin debug/real_map.o
$(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/real_map.o -o $@ -Map kernel.map
$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/real_map.o -o $@ -Map kernel.map
 
%.s: %.S
$(CC) $(CPPFLAGS) -E $< >$@
/SPARTAN/trunk/arch/ppc/Makefile.inc
15,7 → 15,7
DEFS=-DARCH=$(ARCH)
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
LFLAGS=-M -no-check-sections -N -T ../arch/ppc/_link.ld
LFLAGS=-M -no-check-sections -N
 
arch_sources= \
arch/context.S \
/SPARTAN/trunk/arch/ia64/Makefile.inc
16,7 → 16,7
DEFS=-DARCH=$(ARCH)
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -mconstant-gp -nostdlib -fno-builtin -fno-unwind-tables -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3
LFLAGS=-EL -M -T ../arch/ia64/_link.ld
LFLAGS=-EL -M
 
 
 
/SPARTAN/trunk/arch/mips/Makefile.inc
15,7 → 15,7
DEFS=-DARCH=$(ARCH)
CPPFLAGS=$(DEFS) -mno-abicalls -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -mips2 -G 0 -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2 -msoft-float
LFLAGS=-mips2 -M -no-check-sections -T ../arch/mips/_link.ld
LFLAGS=-mips2 -M -no-check-sections
 
arch_sources= \
arch/start.S \
/SPARTAN/trunk/arch/amd64/_link.ld
File deleted
/SPARTAN/trunk/arch/amd64/_link.ld.in
0,0 → 1,72
/** AMD64 linker script
*
* umapped section:
* kernel text
* kernel data
* mapped section:
* kernel text
* kernel data
*/
 
#define __ASM__
#include <arch/boot/boot.h>
#include <arch/mm/page.h>
 
OUTPUT_FORMAT(binary)
ENTRY(kernel_image_start)
 
SECTIONS {
.unmapped BOOTSTRAP_OFFSET: AT (BOOTSTRAP_OFFSET) {
unmapped_ktext_start = .;
*(K_TEXT_START);
*(K_TEXT_START_2);
unmapped_ktext_end = .;
 
unmapped_kdata_start = .;
*(K_DATA_START);
unmapped_kdata_end = .;
}
 
.mapped (PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET)+SIZEOF(.unmapped)) : AT (BOOTSTRAP_OFFSET+SIZEOF(.unmapped)) {
ktext_start = .;
*(BOOT_DATA);
*(.text);
ktext_end = .;
 
kdata_start = .;
*(.data); /* initialized data */
*(.rodata*); /* string literals */
hardcoded_load_address = .;
QUAD(ktext_start - SIZEOF(.unmapped));
hardcoded_ktext_size = .;
QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
hardcoded_kdata_size = .;
QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
hardcoded_unmapped_ktext_size = .;
LONG(unmapped_ktext_end - unmapped_ktext_start);
hardcoded_unmapped_kdata_size = .;
LONG(unmapped_kdata_end - unmapped_kdata_start);
*(COMMON); /* global variables */
 
 
 
*(.eh_frame);
*(.bss); /* uninitialized static variables */
*(K_DATA_END);
 
symbol_table = .;
*(symtab.*); /* Symbol table, must be LAST symbol!*/
 
kdata_end = .;
}
 
_hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
_boot_offset = 0x100000;
_ka2pa_offset = 0xffffffff80000000;
_map_address = _ka2pa_offset + _boot_offset;
 
 
e820table_boot = KA2PA(e820table) - BOOT_OFFSET;
e820counter_boot = KA2PA(e820counter) - BOOT_OFFSET;
real_bootstrap_gdtr = PA2KA(real_bootstrap_gdtr_boot);
}
/SPARTAN/trunk/arch/amd64/include/mm/page.h
38,11 → 38,11
#define PAGE_SIZE FRAME_SIZE
 
#ifndef __ASM__
# define KA2PA(x) (((__address) (x)) + 0x80000000)
# define PA2KA(x) (((__address) (x)) - 0x80000000)
# define KA2PA(x) (((__address) (x)) - 0xffffffff80000000)
# define PA2KA(x) (((__address) (x)) + 0xffffffff80000000)
#else
# define KA2PA(x) ((x) + 0x80000000)
# define PA2KA(x) ((x) - 0x80000000)
# define KA2PA(x) ((x) - 0xffffffff80000000)
# define PA2KA(x) ((x) + 0xffffffff80000000)
#endif
 
#define PTL0_INDEX_ARCH(vaddr) (((vaddr)>>39)&0x1ff)
/SPARTAN/trunk/arch/amd64/Makefile.inc
22,8 → 22,11
 
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fno-unwind-tables -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -march=opteron -m64 -mcmodel=kernel -mno-red-zone
LFLAGS=-M -T ../arch/amd64/_link.ld
LFLAGS=-M
 
../arch/amd64/_link.ld: ../arch/amd64/_link.ld.in
$(CC) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
 
arch_sources = arch/dummy.s \
arch/fpu_context.c \
arch/boot/boot.S \
/SPARTAN/trunk/arch/ia32/Makefile.inc
18,7 → 18,7
 
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3
LFLAGS=-M -no-check-sections -T ../arch/ia32/_link.ld
LFLAGS=-M -no-check-sections
 
arch_sources= \
arch/context.s \