mirror of
https://github.com/drasko/codezero.git
synced 2026-03-13 15:51:49 +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:
@@ -2,6 +2,7 @@
|
||||
* Clone test.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
12
containers/posix/test0/src/crt0.S
Normal file
12
containers/posix/test0/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
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
#include <dirent.h>
|
||||
#include <l4lib/os/posix/readdir.h>
|
||||
#include <tests.h>
|
||||
#include <printf.h>
|
||||
|
||||
#define DENTS_TOTAL 50
|
||||
|
||||
void print_fsize(struct stat *s)
|
||||
{
|
||||
printf("%d", s->st_size);
|
||||
printf("%lu", s->st_size);
|
||||
}
|
||||
|
||||
void print_flink(struct stat *s)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <printf.h>
|
||||
|
||||
extern char _start_test_exec[];
|
||||
extern char _end_test_exec[];
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string.h>
|
||||
#include <tests.h>
|
||||
#include <errno.h>
|
||||
#include <printf.h>
|
||||
|
||||
int fileio(void)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <tests.h>
|
||||
#include <l4/macros.h>
|
||||
#include <printf.h>
|
||||
|
||||
int global = 0;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <unistd.h>
|
||||
#include <tests.h>
|
||||
#include <errno.h>
|
||||
#include <printf.h>
|
||||
|
||||
#define PAGE_SIZE 0x1000
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ int shmtest(void)
|
||||
test_printf("Initiating shmget()\n");
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if ((shmids[i] = shmget(keys[i], 27, IPC_CREAT | 0666)) < 0) {
|
||||
test_printf("SHMGET", errno);
|
||||
test_printf("SHMGET: %d", errno);
|
||||
goto out_err;
|
||||
} else
|
||||
test_printf("SHMID returned: %d\n", shmids[i]);
|
||||
@@ -30,7 +30,7 @@ int shmtest(void)
|
||||
test_printf("Now shmat()\n");
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if ((int)(bases[i] = shmat(shmids[i], NULL, 0)) == -1) {
|
||||
test_printf("SHMAT", errno);
|
||||
test_printf("SHMAT: %d", errno);
|
||||
goto out_err;
|
||||
} else
|
||||
test_printf("SHM base address returned: %p\n", bases[i]);
|
||||
@@ -42,7 +42,7 @@ int shmtest(void)
|
||||
test_printf("Now shmdt()\n");
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (shmdt(bases[i]) < 0) {
|
||||
test_printf("SHMDT", errno);
|
||||
test_printf("SHMDT: %d", errno);
|
||||
goto out_err;
|
||||
} else
|
||||
test_printf("SHM detached OK.\n");
|
||||
|
||||
12
containers/posix/test0/src/test_exec/crt0.S
Normal file
12
containers/posix/test0/src/test_exec/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
|
||||
|
||||
@@ -26,7 +26,7 @@ void main(void)
|
||||
{
|
||||
wait_pager(0);
|
||||
if (getpid() == 2) {
|
||||
printf("EXECVE TEST -- PASSED --\n", getpid());
|
||||
printf("EXECVE TEST -- PASSED --\n");
|
||||
printf("\nThread (%d): Continues to sync with the pager...\n\n", getpid());
|
||||
while (1)
|
||||
wait_pager(0);
|
||||
|
||||
Reference in New Issue
Block a user