[plt-scheme] Re: oracle driver for PLT?

From: Thomas Chust (chust at web.de)
Date: Wed Sep 23 06:49:00 EDT 2009

2009/9/23 Sigrid <keydana at gmx.de>:
> [...]
> As for the network vs. FFI approach, I was searching the Oracle
> documentation for it and it seems to me that the network approach is
> impossible, as it uses a proprietary network protocol (called TTC)
> from Oracle.
> [...]

Hello,

since it is a network protocol and there is no transport layer
encryption involved, as far as I know, it is virtually impossible to
keep the protocol a secret. You can always look at the network traffic
and reverse engineer the data flow using a tool like Wireshark
(http://www.wireshark.org/), even if there is no documentation of the
transport layer data structures at all. However, Wireshark even comes
with protocol analysis code for Oracle database connections so having
a look at the source code of the relevant plug in could be helpful.

> [...]
> may I ask a very stupid question: I don't really know how to find out
> whether a library uses 32bit or 64bit (even I don't know, is this a
> feature of a single library, or of the system)? Could you tell me how
> to find out such things on a Mac?
> [...]

One way of finding out whether binaries are 64bit or 32bit, which
should be relatively portable across different Unices, is to use the
file command line tool. Here is an example of what the output looks
like on a Linux system running on an UltraSparc processor:

  $ file /opt/chicken/bin/csi # 32-bit executable
  /opt/chicken/bin/csi: ELF 32-bit MSB executable, SPARC32PLUS, V8+
Required, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.6.8, not stripped

  $ file /opt/chicken64/bin/csi # 64-bit executable
  /opt/chicken64/bin/csi: ELF 64-bit MSB executable, SPARC V9, relaxed
memory ordering, version 1 (SYSV), dynamically linked (uses shared
libs), for GNU/Linux 2.6.8, not stripped

Whether a system supports both 32-bit and 64-bit binaries depends on
the kernel and the availability of system libraries for both modes.
Funny combinations, such as a 64-bit kernel only supporting 32-bit
user mode code, are not unheard of, but Linux and MacOS X on ix86
compatible, 64-bit capable processors do support a mixed mode user
land. Each process has to use either 32-bit or 64-bit libraries
exclusively, since the setting which mode is active is part of the
task state and usually directly linked to hardware settings of the
processor and memory management unit; linking a program with some
32-bit libraries and some 64-bit libraries at the same time is not
possible — at least not without a fair amount of assembler hacking and
usage of probably undocumented kernel features ;-)

Ciao,
Thomas


-- 
All these theories, diverse as they are, have two things in common: They
explain the observed facts, and they are completely and utterly wrong.
                               -- Terry Pratchett, "The Light Fantastic"


Posted on the users mailing list.