mirror of
https://github.com/drasko/codezero.git
synced 2026-03-26 05:51:50 +01:00
Created libc under containers/posix which now all tasks use to build.
There is a problem in the new libc that test0 now misbehaves. Going to be fixed.
This commit is contained in:
@@ -19,6 +19,6 @@
|
||||
|
||||
Import('environment', 'previousImage')
|
||||
|
||||
program = environment['buildTask']('fs0', Glob('*.c') + [Glob(directory + '/*.c') for directory in [ 'src', 'src/lib', 'src/lib/elf', 'src/memfs']], environment, previousImage)
|
||||
program = environment['buildTask']('fs0', Glob('*.c') + [Glob(directory + '/*.[cS]') for directory in [ 'src', 'src/lib', 'src/lib/elf', 'src/memfs']], environment, previousImage)
|
||||
|
||||
Return('program')
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
#ifndef size_t
|
||||
#define size_t int
|
||||
#endif
|
||||
|
||||
void *kmalloc(size_t size);
|
||||
void kfree(void *blk);
|
||||
|
||||
@@ -26,7 +26,7 @@ SECTIONS
|
||||
{
|
||||
. = virtual_base;
|
||||
_start_text = .;
|
||||
.text : AT (ADDR(.text) - offset) { crt0.o(.text) *(.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) }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <l4/lib/list.h>
|
||||
#include <memfs/memfs.h>
|
||||
#include <l4/macros.h>
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
#include <task.h>
|
||||
#include <path.h>
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void handle_fs_requests(void)
|
||||
default:
|
||||
printf("%s: Unrecognised ipc tag (%d) "
|
||||
"received from tid: %d. Ignoring.\n", __TASKNAME__,
|
||||
mr[MR_TAG], sender);
|
||||
mr[MR_TAG], senderid);
|
||||
}
|
||||
|
||||
/* Reply */
|
||||
|
||||
12
containers/posix/fs0/src/crt0.S
Normal file
12
containers/posix/fs0/src/crt0.S
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
.section .text.head
|
||||
.global _start;
|
||||
.type _start,function;
|
||||
.align;
|
||||
|
||||
_start:
|
||||
ldr sp, =__stack
|
||||
bl __container_init
|
||||
1:
|
||||
b 1b
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <l4/lib/list.h>
|
||||
#include <l4/macros.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
|
||||
/*
|
||||
* This reads contents of a file in pages, calling the fs-specific file read function to read-in
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <lib/bit.h>
|
||||
#include <l4/macros.h>
|
||||
#include <l4/config.h>
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
|
||||
/* Emulation of ARM's CLZ (count leading zeroes) instruction */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <lib/malloc.h> // --> This is a local library that statically allocates its heap.
|
||||
#include <l4/macros.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
#include <l4/api/errno.h>
|
||||
|
||||
struct id_pool *id_pool_new_init(int totalbits)
|
||||
|
||||
@@ -18,7 +18,8 @@ Messages that indicate a software error will contain three asterisks (***).
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memcpy(), memset() */
|
||||
#include <stdio.h> /* printf() */
|
||||
|
||||
#include <printf.h>
|
||||
#include <malloc.h>
|
||||
#define _32BIT 1
|
||||
|
||||
/* use small (32K) heap for 16-bit compilers,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <l4/types.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <lib/vaddr.h>
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
|
||||
void vaddr_pool_init(struct id_pool *pool, unsigned long start, unsigned long end)
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ struct superblock *memfs_get_superblock(void *block)
|
||||
return 0;
|
||||
}
|
||||
if (sb->magic != MEMFS_MAGIC) {
|
||||
printf("%s: Magic number not match: %s\n", __FUNCTION__, sb->magic);
|
||||
printf("%s: Magic number not match: %u\n", __FUNCTION__, sb->magic);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user