It seems to work except I need some way to call c from java normally just use the JNI. But if I use this I have to create a dll,.so libarary. Is their anyway to call c function directly from java using no loadlibrary commands. Basically can native keyword be used exactly like extern in c. Because when I compile with gcj my java is really machine code but from the java code I need away to call back c/asm functions from time to time (i.e for device driver stuff , outportb ,...etc etc)... If I use the JNI then that means I have depended libraries which for kernels / flat binary files is no good.
I can go from c functions to java functions by using extern and using objdump to see what the java function name is to call
that gcj compiled to. But once I am in java code I need a way to call back c/asm code?
If their is no other way then creating a dll,.so and using the JNI interface then is their away to compile in all the dependenc's that JNI would bring so it is a standalone kernel.bin file that allows me to call c/asm from java?
This question is more general.
Is their away to compile in all the depence's lib's ,...etc into a single .exe or bin file so that it will run without having to load anything other then itself.... ???
If so then you could use the same method to compile in the whole c run time libraries ,...math , stdio ,...etc
I am aware that it will get huge very quickly but then you won't have to keep rewritting things like malloc ,...etc etc in your os
Could be as easy as specifying the library in the path to gcc right after --nolib's or nostandardincludes statement.
Always wondered if the kernel.bin would work if you add libraries to it.
I am always using the statement
Code: Select all
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o main.o main.c
then I link with
Code: Select all
ld -T mylinkerscript.ld code1.o code2.o ,...etc
does anybody know?
This is my only problem dll,.so dependences.