mirror of
https://github.com/drasko/codezero.git
synced 2026-01-17 21:33:15 +01:00
More changes for cleaner initialization and support for containers.
This commit is contained in:
@@ -16,14 +16,10 @@ extern unsigned long arm_high_vector[];
|
||||
extern unsigned long _end_vectors[];
|
||||
extern unsigned long _start_kip[];
|
||||
extern unsigned long _end_kip[];
|
||||
extern unsigned long _start_ptab[];
|
||||
extern unsigned long _end_ptab[];
|
||||
extern unsigned long _start_init[];
|
||||
extern unsigned long _end_init[];
|
||||
extern unsigned long _bootstack[];
|
||||
extern unsigned long _end_kernel[];
|
||||
extern unsigned long _start_kspace[];
|
||||
extern unsigned long _start_pmd[];
|
||||
extern unsigned long _end_pmd[];
|
||||
extern unsigned long _end_kspace[];
|
||||
extern unsigned long _end[];
|
||||
|
||||
/* Link markers that get modified at runtime */
|
||||
|
||||
@@ -1,36 +1,32 @@
|
||||
/*
|
||||
*
|
||||
* Simple linker script
|
||||
*
|
||||
* Copyright (C) 2007 Bahadir Balban
|
||||
*
|
||||
*/
|
||||
|
||||
/* FIXME:
|
||||
* Currently we can't include cpp #defines in linker script.
|
||||
* Check that below offsets are coherent with offsets.h
|
||||
*/
|
||||
phys_addr_base = 0x100000;
|
||||
kern_offset = 0xF0000000;
|
||||
virt_addr_base = phys_addr_base + kern_offset;
|
||||
kernel_offset = 0xF0000000;
|
||||
kernel_physical = 0x8000;
|
||||
kernel_virtual = kernel_physical + kernel_offset;
|
||||
|
||||
/* A temporary boot stack is used before a proper kernel stack is set up */
|
||||
_bootstack_physical = _bootstack - kern_offset;
|
||||
_bootstack_physical = _bootstack - kernel_offset;
|
||||
|
||||
/* The symbols are linked at virtual addresses. So is _start.
|
||||
* We must set the entry point to a physical address, so that
|
||||
* when the image is loaded, it doesn't jump to a non existing
|
||||
* virtual address.
|
||||
*/
|
||||
_start_physical = phys_addr_base;
|
||||
|
||||
ENTRY(_start_physical)
|
||||
ENTRY(kernel_physical)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = virt_addr_base;
|
||||
. = kernel_virtual;
|
||||
_start_kernel = .;
|
||||
.text : AT (ADDR(.text) - kern_offset)
|
||||
.text : AT (ADDR(.text) - kernel_offset)
|
||||
{
|
||||
_start_text = .;
|
||||
/* Make sure head.S comes first */
|
||||
@@ -41,9 +37,9 @@ SECTIONS
|
||||
}
|
||||
. = ALIGN(4);
|
||||
/* rodata is needed else your strings will link at physical! */
|
||||
.rodata : AT (ADDR(.rodata) - kern_offset) { *(.rodata) }
|
||||
.rodata1 : AT (ADDR(.rodata1) - kern_offset) { *(.rodata1) }
|
||||
.data : AT (ADDR(.data) - kern_offset)
|
||||
.rodata : AT (ADDR(.rodata) - kernel_offset) { *(.rodata) }
|
||||
.rodata1 : AT (ADDR(.rodata1) - kernel_offset) { *(.rodata1) }
|
||||
.data : AT (ADDR(.data) - kernel_offset)
|
||||
{
|
||||
_start_data = .;
|
||||
*(.data)
|
||||
@@ -61,7 +57,7 @@ SECTIONS
|
||||
_end_syscalls = .;
|
||||
_end_data = .;
|
||||
}
|
||||
.bss : AT (ADDR(.bss) - kern_offset)
|
||||
.bss : AT (ADDR(.bss) - kernel_offset)
|
||||
{
|
||||
*(.bss)
|
||||
}
|
||||
@@ -69,19 +65,20 @@ SECTIONS
|
||||
. += 0x2000; /* This is required as the link counter does not seem
|
||||
* to increment for the bss section
|
||||
* TODO: Change this with PAGE_SIZE */
|
||||
|
||||
/* Below part is to be discarded after boot */
|
||||
_start_init = .;
|
||||
.init : AT (ADDR(.init) - kernel_offset)
|
||||
{
|
||||
. = ALIGN(16K); /* For initial pgd */
|
||||
*(.init.pgd)
|
||||
*(.init.data)
|
||||
*(.init.bootmem)
|
||||
}
|
||||
/* Space for boot stack */
|
||||
. += 0x1000;
|
||||
_end_init = .;
|
||||
_bootstack = .;
|
||||
_end_kernel = .;
|
||||
. = ALIGN(1M);
|
||||
.kspace : AT(ADDR(.kspace) - kern_offset)
|
||||
{
|
||||
_start_kspace = .;
|
||||
*(.kspace.pgd)
|
||||
. = ALIGN(4K);
|
||||
_start_pmd = .;
|
||||
*(.kspace.pmd)
|
||||
_end_pmd = .;
|
||||
_end_kspace = .;
|
||||
}
|
||||
_end = .;
|
||||
}
|
||||
|
||||
@@ -137,6 +137,9 @@ void arch_hardware_flush(pgd_table_t *pgd);
|
||||
void add_section_mapping_init(unsigned int paddr, unsigned int vaddr,
|
||||
unsigned int size, unsigned int flags);
|
||||
|
||||
void add_boot_mapping(unsigned int paddr, unsigned int vaddr,
|
||||
unsigned int size, unsigned int flags);
|
||||
|
||||
struct address_space;
|
||||
int delete_page_tables(struct address_space *space);
|
||||
int copy_user_tables(struct address_space *new, struct address_space *orig);
|
||||
|
||||
Reference in New Issue
Block a user