/[meta-cvs]/meta-cvs/F-630781CCC64798E3553FA4638EBB57A4
ViewVC logotype

Contents of /meta-cvs/F-630781CCC64798E3553FA4638EBB57A4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Mar 8 02:21:02 2008 UTC (6 years, 1 month ago) by kaz
Branch: MAIN
CVS Tags: mcvs-1-1-98, HEAD
Changes since 1.1: +1 -1 lines
Whitespace change.
1 Porting Meta-CVS
2
3 Meta-CVS versions prior to 1.1.1 are more portable, but require a C
4 compiler in order to build, which is used to build a shim library that
5 is linked into CLISP, and which provides a stable, platform-independent
6 target API for the rest of the application. These older versions of
7 Meta-CVS have been reported to run on FreeBSD and Solaris. Newer Meta-CVS
8 releases target the operating system directly, using the CLISP foreign
9 function capabilities, without any intervening shim. On Linux, it refers
10 directly to functions in "libc.so.6" and on Cygwin it refers directly to
11 "cygwin1.dll". This is not only more efficient, but it eliminates the
12 need to compile any C and to link a custom CLISP image.
13
14 But it also means that that for each platform, the system glue code has
15 to be carefully tweaked. For instance, each POSIX-like platform has a
16 different layout for the C types struct dirent and struct stat. Some
17 binary interfaces differ. For instance, on glibc2, there isn't actually
18 a stat function in the library, but something called __xstat, which has
19 an extra argument. Actually, Meta-CVS uses __xstat64, the large-file
20 version of stat.
21
22 By targetting the binary interfaces directly, all that Meta-CVS needs
23 is CLISP. Its installation needs no special packages, and no C header
24 files have to be processed; the definitions of the binary interfaces
25 are contained within Meta-CVS.
26
27 All of the platform glue is in code/clisp-ffi.lisp module.
28
29 The binary interfaces for things like dirent and stat were deduced by
30 reading the platform header files, plus trial-and-error. The bindings
31 can be tested interactively. After building a Meta-CVS image, you can
32 run the resulting memory image with CLISP:
33
34 $ clisp -M code/mcvs.mem
35 [1]> (defparameter *d* (unix-funcs:opendir "."))
36 *D*
37 [2]> (unix-funcs:readdir *d*)
38 #S(UNIX-FUNCS:DIRENT :INO 243536 :OFF 12 :RECLEN 24 :TYPE 4 :NAME ".")
39 [3]> (unix-funcs:readdir *d*)
40 #S(UNIX-FUNCS:DIRENT :INO 551756 :OFF 24 :RECLEN 24 :TYPE 4 :NAME "..")
41 [4]> (unix-funcs:readdir *d*)
42 #S(UNIX-FUNCS:DIRENT :INO 243537 :OFF 36 :RECLEN 24 :TYPE 4 :NAME "MCVS")
43 [5]> (unix-funcs:readdir *d*)
44 #S(UNIX-FUNCS:DIRENT :INO 632863 :OFF 48 :RECLEN 24 :TYPE 4 :NAME "code")
45 [6]> (unix-funcs:readdir *d*)
46 #S(UNIX-FUNCS:DIRENT :INO 243579 :OFF 60 :RECLEN 24 :TYPE 8 :NAME "TODO")

  ViewVC Help
Powered by ViewVC 1.1.5