Fixed lots of issues with mm0 initialization, final one was an oversized do_munmap.

test0 now successfully runs its beginning.
test0 SConscript has a dependency problem.

Issues to be investigated:
- vm_file and vnodes need to be merged fully in all functions.
- libposix shared page references need to be removed.
- Any references to VFS_TID, PAGER_TID need to be removed.
This commit is contained in:
Bahadir Balban
2009-10-06 21:12:45 +03:00
parent ea9c399dda
commit 8a55a80c23
11 changed files with 56 additions and 78 deletions

View File

@@ -9,7 +9,7 @@ sys.path.append('../../../../')
from config.lib import *
from tools.pyelf.lmanext import *
src = [Glob('*.[c]') + Glob('test_exec.S') + Glob('src/*.c') + Glob('src/arch/arm/*.c')]
src = [Glob('*.c') + Glob('test_exec.S') + Glob('src/*.c') + Glob('src/arch/arm/*.c')]
asm_string = \
'''
@@ -41,6 +41,7 @@ test_exec_src = Glob('src/test_exec/*.[cS]')
test_exec_objs = test_exec_env.Object(test_exec_src)
test_exec = test_exec_env.Program('src/test_exec/test_exec', test_exec_objs)
test_exec_asm = Command('test_exec.S', test_exec, generate_incbin_asm)
Depends(test_exec, test_exec_objs)
env.Append(LIBS = ['posix', 'c-userspace'])
env.Append(LINKFLAGS = ['-T' + lma_lds[0].path, '-u_start'])
@@ -49,7 +50,6 @@ env.Replace(PROGSUFFIX = '')
objs = env.Object(src + test_exec_asm)
test0 = env.Program('test0', objs)
elf_wrap_string = \
'''
.align 4
@@ -75,11 +75,8 @@ elf_wrap_env.Append(LINKFLAGS = '-T' + elf_wrapped_lds[0].path)
elf_wrap_objs = elf_wrap_env.Object(elf_wrapped_asm)
test0_elf_elf = elf_wrap_env.Program('test0_elf.elf', elf_wrap_objs)
Depends(test0, objs)
Depends(test0, lma_lds)
Depends(lma_lds, previmage)
Depends(test0, test_exec)
Depends(test0_elf_elf, elf_wrap_objs)
Depends(test0_elf_elf, test0)
Depends(lma_lds, previmage)
Depends(test0_elf_elf, elf_wrapped_lds)
Return('test0_elf_elf')

View File

@@ -16,9 +16,6 @@ void __container_init(void)
/* Generic L4 thread initialisation */
__l4_init();
/* Initialise posix library for application */
libposix_init();
/* Entry to main */
main();
}

View File

@@ -1,24 +1,14 @@
/*
* Simple linker script for userspace or svc tasks.
* Userspace linker script
*
* Copyright (C) 2007 Bahadir Balban
* Copyright (C) 2007 - 2009 Bahadir Balban
*/
/*
* The only catch with this linker script is that everything
* is linked starting at virtual_base, and loaded starting
* at physical_base. virtual_base is the predefined region
* of virtual memory for userland applications. physical_base
* is determined at build-time, it is one of the subsequent pages
* that come after the kernel image's load area.
*/
/* USER_AREA_START, see memlayout.h */
virtual_base = 0x10000000;
physical_base = %s;
__stack = (0x20000000 - 0x1000 - 8); /* First page before the env/args */
/* INCLUDE "include/physical_base.lds" */
/* physical_base = 0x228000; */
__stack = (0x20000000 - 0x1000 - 8); /* First page before the env/args */
offset = virtual_base - physical_base;
ENTRY(_start)
@@ -27,18 +17,32 @@ SECTIONS
{
. = virtual_base;
_start_text = .;
.text : AT (ADDR(.text) - offset) { *(.text.head) *(.text) }
/* rodata is needed else your strings will link at physical! */
.rodata : AT (ADDR(.rodata) - offset) { *(.rodata) }
.rodata1 : AT (ADDR(.rodata1) - offset) { *(.rodata1) }
.data : AT (ADDR(.data) - offset)
{
. = ALIGN(4K);
.text : AT (ADDR(.text) - offset) {
*(.text.head)
*(.text)
}
.rodata : AT (ADDR(.rodata) - offset) {
*(.rodata)
}
.rodata1 : AT (ADDR(.rodata1) - offset) {
*(.rodata1)
}
. = ALIGN(4K);
.data : AT (ADDR(.data) - offset) {
_start_test_exec = .;
*(.testexec)
_end_test_exec = .;
*(.data)
}
.bss : AT (ADDR(.bss) - offset) { *(.bss) }
.got : AT (ADDR(.got) - offset) {
*(.got)
}
.got.plt : AT (ADDR(.got.plt) - offset) {
*(.got.plt)
}
.bss : AT (ADDR(.bss) - offset) {
*(.bss)
}
_end = .;
}

View File

@@ -16,9 +16,6 @@ void __container_init(void)
/* Generic L4 thread initialisation */
__l4_init();
/* Initialise posix library for application */
libposix_init();
/* Entry to main */
main();
}