Alfred M. Szmidt wrote: > I don't see any difference between > * "talk to Linux through syscalls" > * "using dlopen, dlsym and all this stuff" in both cases I dont require > compier to do anything, but there is a way to ask GPL code to do your > stuff. Quite a simillar. > > Do you see the difference between telnetd and telnet? This is how > glibc and Linux interaction looks like.
Communication between glibc and kernel. for writing a text --- Fig. 1 --------------------------------------------------- # write our string to stdout movl $4,%eax # system call number (sys_write) movl $1,%ebx # first argument: file handle (stdout) movl $msg,%ecx # second argument: pointer to message to write movl $len,%edx # third argument: message length int $0x80 # call kernel --- code from http://linuxant.hit.bg/Assembly-HOWTO-6.html --- Communication between program and and kernel on platform without interrupts --- Fig. 2 --------------------------------------------------- # write our string to stdout movl $4,%eax # number of system call movl $1,%ebx # first argument: file handle (stdout) movl $msg,%ecx # second argument: pointer to message to write movl $len,%edx # third argument: message length movl [0x00A0],%efx # load adress of syscall - syscall table # is in memory from adress 0x0000. Each # adress is 4 bytes long jump %efx # call kernel syscall number 4 --- code from http://linuxant.hit.bg/Assembly-HOWTO-6.html --- Communication between program and library. --- Fig. 3 --------------------------------------------------- # write our string to stdout movl $4,%eax # number telling function what should it do. In this case write a text movl $1,%ebx # first argument: file handle (stdout) movl $msg,%ecx # second argument: pointer to message to write movl $len,%edx # third argument: message length movl [%egx+0xA],%efx # in register %egx is base address of # functions table. Each # address is 4 bytes long jump %efx # call function print of dynamic library --- code from http://linuxant.hit.bg/Assembly-HOWTO-6.html --- ... nope, dont see the difference. In both cases I fill some registers and jump to specified place. The only difference is that since kernel is always in memory, I defined a memory range for its function adress table, while program can stay on hard drive, so its memory range for functions will be dynamic. > I think that you can use GPL through linking. Why? because kernel > does it and I dont see difference between two lines above. > > Linux does not, please stop insisting that it does. > The moment I will stop will be moment I will understand it. Actually I am lying I will stop now because this leads nowhere. It is clear that you do not got my point and I as it seems nor did I got yours. If after 57 mails I still don't get it. Quite a bad message, at least for my brain. I am really gratefull to all of you for showing me the correct way and for spending your time on your answers, however it seems that I am blind. And not persistent enough. I am especially gratefull to Alexander Terekhov for providing me with link to softwarecombinations060403.pdf, I will definitelly read it. _______________________________________________ gnu-misc-discuss mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnu-misc-discuss
