* Introduced new build system variables

{HAIKU,HOST,TARGET}_KERNEL_PIC_{CC,LINK}FLAGS which define the
  compiler/linker flags specifying the kind of position independence
  the kernel shall have. For x86 we had and still have -fno-pic, but the
  PPC kernel has -fPIE (position independent executable) now, as we
  need to relocate it.
* The boot loader relocates the kernel now. Mostly copied the relocation
  code from the kernel ELF loader. Almost completely rewrote the PPC
  specific relocation code, though. It's more correct and more complete now
  (some things are still missing though).
* Added boot platform awareness to the kernel. Moved the generic
  Open Firmware code (openfirmware.c/h) from the boot loader to the kernel.
* The kernel PPC serial debug output is sent to the console for the time
  being.
* The PPC boot loader counts the CPUs now and allocates the kernel stacks
  (made OF device iteration a bit more flexible on the way -- the search
  can be restricted to subtree). Furthermore we really enter the kernel...
  (Yay! :-) ... and crash in the first dprintf() (in the atomic_set()
  called by acquire_spinlock()). kprintf() works, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15756 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-12-30 21:20:07 +00:00
parent 456d0d082b
commit 957a1b17eb
49 changed files with 1085 additions and 63 deletions
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2005, Ingo Weinhold <[email protected]>.
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_BOOT_ARCH_H
#define KERNEL_BOOT_ARCH_H
#include <SupportDefs.h>
#include <boot/elf.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ELF support */
extern status_t boot_arch_elf_relocate_rel(struct preloaded_image *image,
struct Elf32_Rel *rel, int rel_len);
extern status_t boot_arch_elf_relocate_rela(struct preloaded_image *image,
struct Elf32_Rela *rel, int rel_len);
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_BOOT_ARCH_H */
+20
View File
@@ -19,6 +19,15 @@ struct preloaded_image {
addr_range dynamic_section;
struct Elf32_Ehdr elf_header;
struct Elf32_Sym *syms;
struct Elf32_Rel *rel;
int rel_len;
struct Elf32_Rela *rela;
int rela_len;
struct Elf32_Rel *pltrel;
int pltrel_len;
int pltrel_type;
struct Elf32_Sym *debug_symbols;
const char *debug_string_table;
uint32 num_debug_symbols, debug_string_table_size;
@@ -28,4 +37,15 @@ struct preloaded_image {
// the ID field will be filled out in the kernel
};
#ifdef __cplusplus
extern "C" {
#endif
extern status_t boot_elf_resolve_symbol(struct preloaded_image *image,
struct Elf32_Sym *symbol, addr_t *symbolAddress);
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_BOOT_ELF_H */
@@ -8,10 +8,13 @@
#include <SupportDefs.h>
struct kernel_args;
#ifdef __cplusplus
extern "C" {
#endif
/* memory management */
extern status_t arch_set_callback(void);
extern void *arch_mmu_allocate(void *address, size_t size, uint8 protection,
@@ -19,6 +22,15 @@ extern void *arch_mmu_allocate(void *address, size_t size, uint8 protection,
extern status_t arch_mmu_free(void *address, size_t size);
extern status_t arch_mmu_init(void);
/* CPU */
extern status_t boot_arch_cpu_init(void);
/* kernel start */
status_t arch_start_kernel(struct kernel_args *kernelArgs, addr_t kernelEntry,
addr_t kernelStackTop);
#ifdef __cplusplus
}
#endif