baremetal: symlink all programs that currently run on both userland and baremetal

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-21 00:00:00 +00:00
parent 492d9cdf3f
commit 6fe9e5bae7
35 changed files with 138 additions and 109 deletions

View File

@@ -1 +0,0 @@
../lkmc/add.c

View File

@@ -1 +0,0 @@
../lkmc/add.py

View File

@@ -1 +0,0 @@
../lkmc/assert_fail.c

1
baremetal/c/add.c Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/add.c

1
baremetal/c/add.py Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/add.py

1
baremetal/c/assert_fail.c Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/assert_fail.c

1
baremetal/c/hello.c Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/hello.c

1
baremetal/c/infinite_loop.c Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/infinite_loop.c

1
baremetal/c/stderr.c Symbolic link
View File

@@ -0,0 +1 @@
../../lkmc/c/stderr.c

View File

@@ -1 +0,0 @@
../lkmc/hello.c

View File

@@ -1,4 +0,0 @@
int main(void) {
while(1) {}
return 0;
}

View File

@@ -1,22 +1,17 @@
/* Test that input request through serial also works. */
/* Test out of memory. */
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char c;
char *ptr = NULL;
size_t alloc_size = 1;
while (1) {
printf("enter a character\n");
c = getchar();
printf("got: %c\n", c);
ptr = realloc(ptr, alloc_size);
if (ptr == NULL) {
puts("out of memory");
break;
} else {
printf("new alloc of %zu bytes at address 0x%p\n", alloc_size, ptr);
alloc_size <<= 1;
}
}