diff --git a/examples/build-bochs/startup.o b/examples/build-bochs/startup.o deleted file mode 100644 index 2b10651..0000000 Binary files a/examples/build-bochs/startup.o and /dev/null differ diff --git a/examples/build-bochs/sum/grub/boot/grub/grub.cfg b/examples/build-bochs/sum/grub/boot/grub/grub.cfg deleted file mode 100644 index 7875a7c..0000000 --- a/examples/build-bochs/sum/grub/boot/grub/grub.cfg +++ /dev/null @@ -1,7 +0,0 @@ -set timeout=0 -set default=0 - -menuentry "CoRedOS" { - multiboot /boot/system.elf - boot -} diff --git a/examples/build-bochs/sum/grub/boot/system.elf b/examples/build-bochs/sum/grub/boot/system.elf deleted file mode 100755 index 0f90384..0000000 Binary files a/examples/build-bochs/sum/grub/boot/system.elf and /dev/null differ diff --git a/examples/build-bochs/sum/module.aot b/examples/build-bochs/sum/module.aot deleted file mode 100644 index b5a9c59..0000000 Binary files a/examples/build-bochs/sum/module.aot and /dev/null differ diff --git a/examples/build-bochs/sum/module.wasm b/examples/build-bochs/sum/module.wasm deleted file mode 100755 index ee2712c..0000000 Binary files a/examples/build-bochs/sum/module.wasm and /dev/null differ diff --git a/examples/build-bochs/sum/module_host.c b/examples/build-bochs/sum/module_host.c deleted file mode 100644 index 1b22749..0000000 --- a/examples/build-bochs/sum/module_host.c +++ /dev/null @@ -1,75 +0,0 @@ -// https://github.com/bytecodealliance/wasm-micro-runtime/blob/WAMR-2.4.4/doc/embed_wamr.md - -// #include -#include - -#include "lib.c" - -// #include "bh_read_file.h" -#include "bh_platform.h" -#include "wasm_export.h" - -#include "module_wasm.c" - -#define STACK_SIZE (8 * 1024) -#define HEAP_SIZE (8 * 1024) - -// TODO: Set this up so the lsp actually finds the includes... - -MAIN() { - char error_buf[128]; - wasm_module_t module; - wasm_module_inst_t module_inst; - wasm_function_inst_t func; - wasm_exec_env_t exec_env; - uint32 stack_size = 8 * 1024; - uint32 heap_size = 8 * 1024; - - /* initialize the wasm runtime */ - RuntimeInitArgs init_args; - memset(&init_args, 0, sizeof(init_args)); - - init_args.mem_alloc_type = Alloc_With_System_Allocator; - if (!wasm_runtime_full_init(&init_args)) { - return; - } - - /* parse the WASM file from buffer and create a WASM module */ - module = wasm_runtime_load(build_bochs_sum_module_aot, build_bochs_sum_module_aot_len, error_buf, - sizeof(error_buf)); - - /* create an instance of the WASM module (WASM linear memory is ready) */ - module_inst = wasm_runtime_instantiate(module, stack_size, heap_size, - error_buf, sizeof(error_buf)); - - /* lookup a WASM function by its name, the function signature can NULL here */ - func = wasm_runtime_lookup_function(module_inst, "wasm_module"); - - /* create an execution environment to execute arbitrary WASM functions */ - exec_env = wasm_runtime_create_exec_env(module_inst, stack_size); - - /* arguments are always transferred in 32-bit element */ - uint32 args[1]; - - /* call an arbitrary WASM function */ - MARKER(start_trace); - if (!wasm_runtime_call_wasm(exec_env, func, 0, args)) { - /* function wasn't called correctly */ - POSIX_PRINTF("Failed to call function 'wasm_module'!\n"); - } - MARKER(stop_trace); - - POSIX_PRINTF("Sum: %d\n!", args[0]); - - /* the return value is stored in args[0] */ - if (args[0] == 100) { - MARKER(ok_marker); - } else { - MARKER(fail_marker); - } - - wasm_runtime_destroy_exec_env(exec_env); - wasm_runtime_deinstantiate(module_inst); - wasm_runtime_unload(module); - wasm_runtime_destroy(); -} diff --git a/examples/build-bochs/sum/module_wasm.c b/examples/build-bochs/sum/module_wasm.c deleted file mode 100644 index 542c59a..0000000 --- a/examples/build-bochs/sum/module_wasm.c +++ /dev/null @@ -1,68 +0,0 @@ -unsigned char build_bochs_sum_module_aot[] = { - 0x00, 0x61, 0x6f, 0x74, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x3e, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0x38, 0x36, 0x5f, 0x36, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x7f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, - 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x47, 0x10, - 0x48, 0xba, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x48, 0x8b, - 0x88, 0x78, 0x01, 0x00, 0x00, 0x8b, 0x80, 0xd0, 0x01, 0x00, 0x00, 0x83, - 0xc0, 0xf0, 0x48, 0x89, 0x54, 0x01, 0x08, 0xb8, 0x64, 0x00, 0x00, 0x00, - 0xc3, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x00, 0x5f, 0x5f, 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x63, - 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x77, 0x61, 0x73, 0x6d, - 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x0d, 0x00, 0x5f, 0x5f, 0x64, 0x73, 0x6f, 0x5f, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x0b, 0x00, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x65, - 0x6e, 0x64, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x00, - 0x5f, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x6c, 0x6f, 0x77, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0d, 0x00, 0x5f, 0x5f, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x5f, 0x5f, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x00, 0x5f, 0x5f, 0x68, 0x65, - 0x61, 0x70, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x0b, 0x00, 0x5f, 0x5f, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x65, - 0x6e, 0x64, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0e, 0x00, - 0x5f, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x61, 0x73, - 0x65, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0d, 0x00, - 0x5f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x73, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x16, 0x00, - 0x5f, 0x5f, 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -unsigned int build_bochs_sum_module_aot_len = 776; diff --git a/examples/build-bochs/sum/system.elf b/examples/build-bochs/sum/system.elf deleted file mode 100755 index 0f90384..0000000 Binary files a/examples/build-bochs/sum/system.elf and /dev/null differ diff --git a/examples/build-bochs/sum/system.iso b/examples/build-bochs/sum/system.iso deleted file mode 100644 index eafd1af..0000000 Binary files a/examples/build-bochs/sum/system.iso and /dev/null differ diff --git a/examples/build-bochs/sum/system.o b/examples/build-bochs/sum/system.o deleted file mode 100644 index a43414b..0000000 Binary files a/examples/build-bochs/sum/system.o and /dev/null differ