Skip to content
Snippets Groups Projects
Commit ab713c09 authored by Avi Kivity's avatar Avi Kivity
Browse files

main: select shared object to run as payload via command line

Rest of the command line becomes arguments for the payload.
parent f40afc19
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,7 @@ loader.img: boot.bin loader.elf
$(call quiet, dd if=boot.bin of=$@ > /dev/null 2>&1, DD $@ boot.bin)
$(call quiet, dd if=loader.elf of=$@ conv=notrunc seek=128 > /dev/null 2>&1, \
DD $@ loader.elf)
$(call quiet, $(src)/scripts/imgedit.py setargs $@ java.so Hello, IMGEDIT $@)
loader.bin: arch/x64/boot32.o arch/x64/loader32.ld
$(call quiet, $(LD) -nostartfiles -static -nodefaultlibs -o $@ \
......
......@@ -289,9 +289,12 @@ void* do_main_thread(void *_args)
debug(fmt("nanosleep(100000) -> %d") % (t2 - t1));
// load_tests(prog);
prog->add_object("java.so");
auto av = args->av;
auto ac = args->ac;
prog->add_object(av[0]);
++av, --ac;
auto main = prog->lookup_function<void (int, char**)>("main");
main(args->ac, args->av);
main(ac, av);
while (true)
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment