diff --git a/.gitignore b/.gitignore index 58b85b29..c5194961 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ include/metalsvm/config.inc tools/make_initrd tools/scc_bootinfo.asm newlib/examples/hello +newlib/examples/memtests newlib/examples/jacobi newlib/examples/echo newlib/examples/tests diff --git a/apps/tests.c b/apps/tests.c index 079bb0bc..f0ba1c34 100644 --- a/apps/tests.c +++ b/apps/tests.c @@ -549,6 +549,7 @@ struct testcase_t testcases[] = { // USERSPACE_TC("/bin/jacobi", "Jacobi serial user space app"), USERSPACE_TC("/bin/tests", "Tests user space app"), //USERSPACE_TC("/bin/hello", "Hello userspace app"), + USERSPACE_TC("/bin/memtests", "malloc 8MB"), KERNELSPACE_TC(producer_consumer, "Producer consumer kernel space test"), KERNELSPACE_TC(join_test, "Join kernel space test"), #ifdef CONFIG_ROCKCREEK diff --git a/apps/tests.h b/apps/tests.h index 766238b0..aae7c6d7 100644 --- a/apps/tests.h +++ b/apps/tests.h @@ -47,7 +47,7 @@ //#define START_TESTS //#define START_JACOBI -#define START_CHIEFTEST +//#define START_CHIEFTEST // does our demos require GFX support? //#define CONFIG_GFX diff --git a/newlib/examples/Makefile b/newlib/examples/Makefile index 25019007..82d83374 100644 --- a/newlib/examples/Makefile +++ b/newlib/examples/Makefile @@ -11,13 +11,19 @@ LDFLAGS = default: all -all: hello tests jacobi mshell server client rlogind +all: memtests hello tests jacobi mshell server client rlogind jacobi: jacobi.o $(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm $(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym $(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@ chmod a-x $@.sym + +memtests: memtests.o + $(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm + $(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym + $(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@ + chmod a-x $@.sym tests: tests.o $(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< @@ -56,7 +62,7 @@ client: client.o chmod a-x $@.sym clean: - $(RM) hello tests server client rlogind mshell jacobi hello *.sym *.o *~ + $(RM) hello tests server client rlogind memtests mshell jacobi hello *.sym *.o *~ depend: $(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep diff --git a/newlib/examples/memtests.c b/newlib/examples/memtests.c new file mode 100644 index 00000000..11f45cc4 --- /dev/null +++ b/newlib/examples/memtests.c @@ -0,0 +1,34 @@ +/* + * Copyright 2010 Stefan Lankes, Chair for Operating Systems, + * RWTH Aachen University + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of MetalSVM. + */ + +#include +#include +#include +#include +#include +#include +#include + +/*file descriptor init*/ +#define TEST_SIZE_MB 8 + +int main(int argc, char** argv) +{ + uint8_t* test = malloc(sizeof(char)*TEST_SIZE_MB*1024*1024); +}