modperl bootstrap
[www.jankratochvil.net.git] / project / captive / Index.html.pl
1 #! /usr/bin/perl
2
3 # $Id$
4 # Main page of 'My::Project::captive'
5 # Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; exactly version 2 of June 1991 is required
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
20
21 package project::captive::Index;
22 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
23 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
24 our $CVS_ID=q$Id$;
25 use strict;
26 use warnings;
27
28 BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
29 use My::Web;
30 use My::Project;
31 use project::captive::ListItem;
32
33
34 my $W=My::Project->init_project(
35                 "__PACKAGE__"=>__PACKAGE__,
36                 "ListItem"=>\@project::captive::ListItem::ListItem,
37                 "head_css"=>"
38 .reqpkg { font-style: italic; }
39 .stuff  { font-style: italic; font-size: larger; margin-left: 20%; margin-right: 10%; }
40 .re     { font-style: italic; }
41 ",
42                 );
43
44
45 print vskip("10ex")."<h1 align=\"center\">!!! DO NOT DISCLOSE - **************** !!!</h1>\n".vskip("10ex");
46
47 print <<"HERE";
48 <h1>The First Read/Write NTFS for Free Operating Systems</h1>
49 <h1>The First Free Microsoft Windows Kernel API Emulation</h1>
50 HERE
51
52 my @stuff=(
53                 "A lot of people claim themselves as Windows Programmers.\n"
54                                 ." Now I can finally join them - I also wrote my own Microsoft Windows.",
55                 "Why do they need <a href=\"http://www.winsupersite.com/reviews/winserver2k3_gold2.asp\">5000 developers</a>"
56                                 ." to write Microsoft Windows when it is just One Man Show task?",
57
58
59
60                 "My first Microsoft Windows program ever written? Some 'helloworld'?"
61                                 ." <span class=\"quote\">hal.dll</span>.",
62                 );
63
64 print "<p class=\"stuff\">$_</p>\n" for (@stuff);
65 print vskip "3ex";
66
67
68 print <<'HERE';
69 <table border="1" align="center" style="text-align: center;"><tr><th>Distribution</th>
70                 <th>Installation Case #1<br />Filesystem and installer<br />(recommended)</th>
71                 <th>Installation Case #2<br />Manual installation<br />(filesystem available)</th>
72                 <th>Installation Case #3<br />Command-line client<br />(no filesystem access)</th></tr>
73 HERE
74 my %pkg=(
75                 1=>[qw(captive captive-lufs captive-install lufs gnome-vfs-httpcaptive ntfsprogs ntfsprogs-gnomevfs)],
76                 2=>[qw(captive captive-lufs                 lufs)],
77                 3=>[qw(captive)],
78                 );
79 my %reqpkg=(
80                 1=>[qw(glib2 gnome-vfs2 ORBit2 libxml2 openssl popt          libgnomeui)],
81                 2=>[qw(glib2 gnome-vfs2 ORBit2 libxml2 openssl popt)],
82                 3=>[qw(glib2 gnome-vfs2 ORBit2 libxml2 openssl popt readline)],
83                 );
84 my %version=(
85                 map(($_=>["0.9","0"]),qw(captive captive-lufs captive-install)),
86                 "lufs"=>["0.9.6","1captive1"],
87                 "gnome-vfs-httpcaptive"=>["2.3.8captive2","0"],
88                 "ntfsprogs"=>["200309071734","1captive1"],
89                 "ntfsprogs-gnomevfs"=>["1.0","0"],
90                 );
91 my %has_rh8=(map(($_=>1),qw(
92                 gnome-vfs-httpcaptive
93                 captive
94                 captive-lufs
95                 captive-install
96                 )));
97 my %has_mdk91=(map(($_=>1),qw(
98                 gnome-vfs-httpcaptive
99                 lufs
100                 captive
101                 captive-lufs
102                 captive-install
103                 )));
104 my %has_devel=(map(($_=>1),qw(
105                 ntfsprogs
106                 )));
107 my %pkg_nosrc=(map(($_=>1),qw(
108                 captive-lufs
109                 captive-install
110                 )));
111 my @dist=(
112                 {
113                         "name"=>"Red Hat 9<br />Shrike i386",
114                         "out"=>sub {
115                                 my($pkg,$version_base,$version_ext)=@_;
116                                         my $file="$pkg-$version_base-$version_ext.i386.rpm";
117                                         my $r=a_href "dist/$file",$file;
118                                         (my $filedev=$file)=~s/^\Q$pkg\E-/${pkg}-devel-/;
119                                         $r.="<br />".a_href("dist/$filedev",$filedev) if $has_devel{$pkg};
120                                         return $r;
121                                 },
122                         },
123                 {
124                         "name"=>"Red Hat 8<br />Psyche i386",
125                         "out"=>sub {
126                                 my($pkg,$version_base,$version_ext)=@_;
127                                         my $file="$pkg-$version_base-$version_ext".(!$has_rh8{$pkg} ? "" : "rh8").".i386.rpm";
128                                         my $r=a_href "dist/$file",$file;
129                                         (my $filedev=$file)=~s/^\Q$pkg\E-/${pkg}-devel-/;
130                                         $r.="<br />".a_href("dist/$filedev",$filedev) if $has_devel{$pkg};
131                                         if ($pkg eq "captive-install") {
132                                                 for (qw(libxml2-2.5.4-1.i386.rpm libxml2-python-2.5.4-1.i386.rpm)) {
133                                                         $r.="<br />".a_href('ftp://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/'.$_,$_)." of Red Hat 9";
134                                                         }
135                                                 }
136                                         return $r;
137                                 },
138                         },
139                 {
140                         "name"=>"Mandrake 9.1<br />Bamboo i586",
141                         "out"=>sub {
142                                 my($pkg,$version_base,$version_ext)=@_;
143                                         my $file="$pkg-$version_base-$version_ext".(!$has_mdk91{$pkg} ? ".i386.rpm" : "mdk91.i586.rpm");
144                                         my $r=a_href "dist/$file",$file;
145                                         (my $filedev=$file)=~s/^\Q$pkg\E-/${pkg}-devel-/;
146                                         $r.="<br />".a_href("dist/$filedev",$filedev) if $has_devel{$pkg};
147                                         return $r;
148                                 },
149                         },
150                 {
151                         "name"=>"Red Hat .src.rpm<br />(of 9 - Shrike)",
152                         "out"=>sub {
153                                 my($pkg,$version_base,$version_ext)=@_;
154                                         return () if $pkg_nosrc{$pkg};
155                                         my $file="$pkg-$version_base-$version_ext.src.rpm";
156                                         return $file,$file;
157                                 },
158                         },
159                 {
160                         "name"=>"Debian GNU/Linux<br />'unstable' i386",
161                         "out"=>sub {
162                                 my($pkg,$version_base,$version_ext)=@_;
163                                         $version_ext=~s/^\d+//;
164                                         my $file="${pkg}_$version_base".($version_ext=~/^\d+$/ ? "" : $version_ext)."_i386.deb";
165                                         my $r=a_href "dist/$file",$file;
166                                         (my $filedev=$file)=~s/^\Q$pkg\E_/${pkg}-dev_/;
167                                         $r.="<br />".a_href("dist/$filedev",$filedev) if $has_devel{$pkg};
168                                         return $r;
169                                 },
170                         },
171                 {
172                         "name"=>"Debian GNU/Linux<br />sources",
173                         "out"=>sub {
174                                 my($pkg,$version_base,$version_ext)=@_;
175                                         return () if $pkg_nosrc{$pkg};
176                                         $version_ext=~s/^\d+//;
177                                         my $file="${pkg}_$version_base".($version_ext=~/^\d+$/ ? "" : $version_ext);
178                                         return CGI::escapeHTML($file).":"
179                                                         .' '     .a_href("dist/$file.dsc",".dsc","size"=>0)
180                                                         .'&nbsp;'.a_href("dist/$file.tar.gz",".tar.gz");
181                                 },
182                         },
183                 {
184                         "name"=>"Sources (.tar.gz)",
185                         "out"=>sub {
186                                 my($pkg,$version_base,$version_ext)=@_;
187                                         return () if $pkg_nosrc{$pkg};
188                                         $version_ext=~s/^\d+//;
189                                         my $file="$pkg-$version_base".($version_ext=~/^\d+$/ ? "" : $version_ext).".tar.gz";
190                                         return $file,$file;
191                                 },
192                         },
193                 );
194
195 for my $dist (@dist) {
196         print "<tr>";
197                 print "<td>".$dist->{"name"}."</td>";
198                 for my $case (1,2,3) {
199                         print "<td>";
200                         print join("<br />",map({ my $pkg=$_;
201                                 my($file,$text)=&{$dist->{"out"}}($pkg,@{$version{$pkg}});
202                                 (!defined $text ? ($file) || () : (a_href("dist/$file",$text)));
203                                 } @{$pkg{$case}}));
204                         print "</td>";
205                         }
206         print "</tr>\n";
207         }
208 print <<'HERE';
209 </table>
210 HERE
211
212 print vskip "3ex";
213
214 print <<"HERE";
215 <h1>Installation notes</h1>
216
217 <p>You should first run <b>captive-install-acquire</b> command to check your
218 available Microsoft Windows drivers versions. Now you can execute:</p>
219
220 <blockquote>
221 <p class="quote"># mount -t captive-ntfs /dev/hda1 /mnt/dosc</p>
222 </blockquote>
223
224 <h2>Package version conflicts</h2>
225
226 <dl>
227
228 <dt><a href="http://lufs.sourceforge.net/lufs/">lufs</a></dt>
229 <dd><p><b>'captive' version required</b>: Although you may already have the
230 original package installed you must replace it by the local 'captive'-marked
231 version containing some 'captive'-essential fixes and extensions.</p></dd>
232
233 <dt><a href="http://linux-ntfs.sourceforge.net/">ntfsprogs</a></dt>
234 <dd><p><b>Original version >=200309071734 sufficient</b>:
235 The package downloadable here has no code patches - you can freely use the
236 original version instead.  Unfortunately the last public release is
237 <b>1.7.1</b> while this project requires at least
238 <a href="http://linux-ntfs.sourceforge.net/snapshots/">snapshot</a> version
239 <b><a href="http://linux-ntfs.sourceforge.net/snapshots/ntfsprogs-200309071734.tar.bz2">200309071734</a></b>
240 which is not packaged (.rpm/.deb) yet. Packaged versions are provided here for
241 your convenience.</p></dd>
242
243 </dl>
244
245
246 <h2>LUFS kernel driver module</h2>
247
248 <p><a href="http://lufs.sourceforge.net/lufs/">LUFS</a> (Linux Userland File
249 System) needs Linux kernel module driver (<i>lufs.o</i>) compatible with your
250 running Linux kernel. Binary driver is supplied already precompiled for many
251 Linux kernel versions in the binary packages above (<b>.i386.rpm</b> and
252 <b>_i386.deb</b> archives).</p>
253
254 <p>If you cannot <b>mount</b>(8) your NTFS filesystem you should run <span
255 class="quote">/usr/share/lufs/prepmod</span> to see the reasons. It is always
256 recommended to upgrade to latest stable kernel supplied by your GNU/Linux
257 distribution vendor. In the case you are running kernel not supported by the
258 precompiled set of binary modules you should install package
259 <b>kernel-source</b> (Red Hat) or <b>kernel-headers</b> (Debian) matching your
260 Linux kernel version (<b>rpm&nbsp;-q&nbsp;kernel</b>) and re-run <span
261 class="quote">/usr/share/lufs/prepmod</span>.</p>
262
263
264 <h2>The First Free Microsoft Windows Kernel API Emulation</h2>
265
266 <p>Compatibility with existing binary Microsoft Windows file system drivers was
267 reached. Microsoft Windows kernel system components required by these drivers
268 were analyzed and successfuly emulated in the GNU/Linux operating system.
269 Project brings Microsoft Windows kernel emulation framework to support even
270 other types Microsoft Windows drivers in the future.</p>
271
272 <dl>
273         <dt>Emulation principle equivalent</dt>
274         <dd>
275                 <p>@{[ a_href('http://www.winehq.com/','Wine Project') ]}</p>
276                 <p>No code could be shared - Wine emulates only Microsoft Windows userland.
277                 Filesystem drivers completely belong to Microsoft Windows kernelland.</p>
278         </dd>
279
280         <dt>Closed-source read-only-crippled @{[ '$0' ]} equivalent for Microsoft Windows</dt>
281         <dd>
282                 <p>@{[ a_href('http://www.sysinternals.com/ntw2k/freeware/ntfswin98.shtml',
283                                 'NTFS for Windows 98') ]}</p>
284                 <p>There is a @{[ a_href('http://www.sysinternals.com/images/screenshots/ntfs98ap.gif',
285                                 'diagram') ]} showing exactly the principle of Captive NTFS project.
286                 There is apparently disabled read/write functionality in <i>NTFS for
287                 Windows 98</i> as the same company also sells the following product sharing
288                 the same codebase:</p>
289         </dd>
290
291         <dt>Closed-source read/write @{[ '$299' ]} equivalent for MS-DOS</dt>
292         <dd>
293                 <p>@{[ a_href('http://www.winternals.com/products/repairandrecovery/ntfsdospro.asp',
294                                 'NTFSDOS Professional') ]}</p>
295                 <p>This product is the most close equivalent to Captive NTFS but it is
296                 a commercial product, closed-source and it has filesystem interface only
297                 for MS-DOS.</p>
298         </dd>
299
300         <dt>The only real competition: Closed-source read/write @{[ '$299' ]} equivalent</dt>
301         <dd>
302                 <p>@{[ a_href('http://www.vmware.com/download/workstation.html',
303                                 'VMware Workstation') ]}</p>
304                 <p>Original Microsoft Windows operating system can be run inside a virtual
305                 machine running under GNU/Linux and share the read-write NTFS disk by using
306                 a network file sharing through a&nbsp;VMware virtual network card.</p>
307                 <p>You need @{[ '$299' ]} for this product and you need to
308                 give up your system security by running un<a href="#sandbox">sandbox</a>ed
309                 closed-source program in your GNU/Linux.</p>
310         </dd>
311 </dl>
312
313
314 <h2>Security</h2>
315
316 <p><b>Re: <a href="http://linux-ntfs.sourceforge.net/info/ntfs.html#7.7">7.7
317                 Can't we write a wrapper for Windows' driver?</a></<b></p>
318
319 <p class="re">&gt; It sounds like a great idea, to start with, but there are numerous
320 problems.</p>
321
322 <p><span class="re">&gt; The largest technical problem is joining the Windows
323 system DLL to the Linux VFS. It could be done, but it wouldn't be pretty.</span><br />
324 Yep. :-)</p>
325
326 <p><span class="re">&gt; It would have to run as part of the kernel which would mean
327 that if it went wrong it could crash the machine. With no source, we might not
328 be able to work around the problem.</span><br />
329 <a name="sandbox">Nope</a>,
330 @{[ a_href('http://lufs.sourceforge.net/lufs/','Linux Userland File System (LUFS)') ]}
331 moves the filesystem implementation to UNIX userland where the Microsoft
332 Windows filesystem is completely unarmed by Captive jail of chroot(2),
333 setuid(2) and setrlimit(2). There only remains one narrow connection to the rest of
334 system (by CORBA/ORBit). The filesystem's life environment gets kill(2)ed when
335 UNIX is no longer satisfied with it. Safety similiar to
336 @{[ a_href('http://www.vmware.com/solutions/security.html','VMware sandbox') ]}.</p>
337
338 <p><span class="re">&gt; The next major problem is compati<!--orig. text typo-->bility.
339 Which version of the Windows system file would we use? Picking one would limit
340 its use, making the wrapper versatile for all of them would be a programming
341 nightmare.</span><br />
342 Microsoft Windows NTFS filesystem driver is capable of accessing older formats
343 of the filesystem. This project currently runs Microsoft Windows XP version,
344 porting to Microsoft Windows 2003 Server expected. (Microsoft Windows upgrades
345 NTFS disk filesystem to its own version during complete CD-ROM Microsoft
346 Windows system installation - such operation is not threat this project use.)</p>
347
348 <p><span class="re">&gt; And it gets worse. The legal implications of
349 distributing Windows systems files would cause problems.</span><br />
350 User must be careful to obey all licensing restrictions according to his
351 local country laws.<br />
352 <span class="re">&gt; Also the proprietary nature of the driver would mean that
353 the other kernel coders would not investigate any problems if someone had used
354 the NTFS wrapper.</span><br />
355 It does not apply to this project due to the implemented
356 <a href="#sandbox">filesystem separation</a>.</p>
357
358 @{[ vskip "3ex" ]}
359
360 <h1>See also</h1>
361 <ul>
362         <li>@{[ a_href('Preview.html.pl','Technology Preview') ]}</li>
363         <li>@{[ a_href('doc/','Developer Documentation') ]}</li>
364         <li>@{[ a_href('apiref/','API Reference Manual') ]} (fragment)</li>
365         <li>
366                 @{[ a_href('http://cvs.jankratochvil.net/viewcvs/priv/captive/','CVS repository ViewCVS') ]}
367                 (@{[ a_href('http://cvs.jankratochvil.net/viewcvs/priv/reactos/?only_with_tag=captive','ReactOS branch part') ]})
368                 </li>
369         <li>@{[ a_href('Thanks.html.pl','Thanks') ]}</li>
370         <li>@{[ a_href('Resources.html.pl','Related Pages') ]}</li>
371 </ul>
372
373 @{[ vskip "3ex" ]}
374
375 <p class="stuff">
376         Why did I install Microsoft Windows and wrote such disgusting piece of code?<br />
377         I expect @{[ a_href($W->{"top_dir"}."/CV.html.pl","yet another challenging task") ]}, !
378 </p>
379 HERE
380
381
382 My::Web->footer();