Initial mod_perl-2.0 port.
[www.jankratochvil.net.git] / project / captive / doc / Architecture.pm
1 # $Id$
2 # Captive project doc Architecture page Perl template.
3 # Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package project::captive::doc::Architecture;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
22 our $CVS_ID=q$Id$;
23 use strict;
24 use warnings;
25
26 use My::Web;
27 require CGI;
28 BEGIN { Wuse 'project::captive::doc::Macros'; }
29
30
31 sub handler
32 {
33 project::captive::doc::Macros->init(
34                 "title"=>'Captive NTFS Developer Documentation: Architecture',
35                 "rel_prev"=>'About.pm',
36                 "rel_next"=>'Components.pm',
37                 );
38
39
40 print <<"HERE";
41
42
43 <h1>Architecture</h1>
44
45         <p>The principle of the
46         project lies in the glue between
47         <span class="productname">Microsoft Windows NT</span> kernel space
48         environment and $gnulinux user space process environment:</p>
49
50         @{[ doc_img 'arch-W32','Microsoft Windows Subsystems Architecture' ]}
51         @{[ doc_img 'arch-captive','Captive Subsystems Architecture' ]}
52         
53         <h2 id="existing_emulation">Existing Emulation Projects</h2>
54
55                 <p>There were two well-known $freespeech projects emulating W32 subsystems
56                 to reach the compatibility with various W32 components:
57                 $Wine and $ReactOS. Sad moment is that the goals of this project do not fit
58                 very well into any role in those two ones. Therefore this project went
59                 its own way of emulation:</p>
60
61                 <table border="0" width="100%"><tr><td align="center"><table border="1">
62                         <caption>Emulation Projects Characteristics</caption>
63                         <tr>
64                                 <th>@{[ a_href '#guestosnote','Guest-OS' ]}</th>
65                                 <th>@{[ a_href '#hostosnote' ,'Host-OS'  ]}</th>
66                                 <th>Implements</th>
67                                 <th>W32 kernel library</th>
68                                 </tr>
69                         <tr>
70                                 <td>$Wine</td>
71                                 <td>$gnulinux</td>
72                                 <td>W32 user space</td>
73                                 <td><span class="fname">ntdll.dll</span></td>
74                                 </tr>
75                         <tr>
76                                 <td>$ReactOS</td>
77                                 <td><span class="constant">i386</span> hardware</td>
78                                 <td>W32 kernel and user space</td>
79                                 <td><span class="fname">ntoskrnl.exe</span></td>
80                                 </tr>
81                         <tr style="height: 1ex;"><td colspan="4"></td></tr>
82                         <tr>
83                                 <td>this project</td>
84                                 <td>$gnulinux</td>
85                                 <td>W32 kernel</td>
86                                 <td><span class="fname">ntoskrnl.exe</span></td>
87                                 </tr>
88                 </table></td></tr></table>
89
90                 <dl>
91                         <dt id="guestosnote">Guest-OS</dt>
92                         <dd>@{[ a_href 'http://www.vmware.com/support/reference/common/glossary/#guestos','Guest OS' ]}:
93                                 An operating system that runs inside a&nbsp;virtual machine.</dd>
94                         <dt id="hostosnote">Host  OS</dt>
95                         <dd>@{[ a_href 'http://www.vmware.com/support/reference/common/glossary/#hostos' ,'Host  OS' ]}:
96                                 An operating system that runs on the host machine.</dd>
97                 </dl>
98
99                 <p>While $ReactOS provides the necessary W32 kernel subsystem emulation
100                 code we also need to run such @{[ a_href '#guestosnote','Guest-OS' ]} in the
101                 @{[ a_href '#hostosnote','Host-OS' ]} $gnulinux. Initially it was planned to
102                 extend $Wine with the W32 kernel space emulation functionality but
103                 fortunately <span class="author">Steven Edwards</span> pointed to the $ReactOS
104                 which better suits the needs of this project by its already implemented W32
105                 kernel space emulation.</p>
106
107                 <p>The <span id="reactos_nocare">original reasons</span> for developing
108                 $ReactOS still make no sense to the author of this project. Free
109                 implementation of W32 platform standalone running on the machine hardware
110                 is no longer free as most od the W32 applications are usually closed source
111                 and the user still looses its freedom on the application level anyway. Even
112                 in the case of available free applications there still remains the
113                 disadvantage of loosing the Host-OS platform availability if implemented in
114                 the $Wine style. For these ideology incompatibilities not much effort was
115                 made for acceptance the fixes and improvements of $ReactOS by this project.
116                 Moreover new functionality is not being implemented to the $ReactOS part
117                 but it is coded in Gnome style in the project specific source files
118                 place.</p>
119
120                 <p>The most serious problem of $ReactOS is its dependence on the direct
121                 <span class="constant">i386</span> hardware instead of some
122                 @{[ a_href '#hostosnote','Host-OS' ]} as required by the goals of this project.
123                 W32 is designed to be hardware-independent using its
124                 <span class="fname">hal.dll</span>. Unfortunately $ReactOS does not follow
125                 this design and thus there are needed various patches and replaces of its
126                 various parts and its hardware-dependent code. Despite it $ReactOS code
127                 base still made a big asset for this project.</p>
128
129                 <p>Some API functions are provided both by
130                 <span class="fname">ntdll.dll</span> and
131                 <span class="fname">ntoskrnl.exe</span> in W32.
132                 <span class="author">Casper Hornstrup</span> enlightened such functions
133                 calling conventions have to be differentiated as
134                 <span class="fname">ntdll.dll</span> lives in the user space (low address
135                 space &ndash; below <span class="constant">0x80000000</span>) and
136                 <span class="fname">ntoskrnl.exe</span> in the kernel space (high address
137                 space &ndash; above <span class="constant">0x80000000</span>). Although they
138                 contain slightly different set of symbols (functions)
139                 <span class="fname">ntdll.dll</span> still can be considered as a&nbsp;user
140                 space interface to the kernel space implementation by
141                 <span class="fname">ntoskrnl.exe</span>.</p>
142
143                 <p>Currently there are
144                 no plans to ever extend the project's crossplatformity beyond the
145                 <span class="constant">i386</span> processor
146                         (<span class="constant">i386</span> used here as
147                         @{[ a_href 'http://www.intel.com/','Intel' ]} architecture covering 32-bit
148                         processors compatible with <span class="constant">i386</span>,
149                         <span class="constant">i486</span>, ...).</p>
150
151
152         <h2 id="law">Laws and Licensing Conditions</h2>
153
154                 <p>If you are an <span class="productname">authorized user</span> of
155                 <span class="productname">Microsoft Windows NT</span> the laws in some
156                 countries give you the right to fully handle the product in any way you
157                 want. Therefore you can disassemble the product even in the case you had
158                 to agree with the product license forbidding such disassembly as the
159                 country laws override any such license agreement.</p>
160
161                 <h3 id="law_servicepack">Microsoft Service Pack</h3>
162
163                         <p>Sometimes you may have the legal license for
164                         <span class="productname">Microsoft Windows NT</span>
165                         but for various technical reasons you do not have the media and/or
166                         installation ready at the place of intended use of this project.</p>
167
168                         <p>Fortunately <span class="productname">Microsoft</span> provides
169                         $freebeer update packages for its
170                         <span class="productname">Microsoft Windows</span> products called
171                         <span class="productname">Service Packs</span>; the latest one is
172                         <span class="productname">@{[ a_href 'http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/checkedbuild.asp','Microsoft Windows XP Service Pack 1a' ]}</span>.</p>
173
174                         <p>This downloadable file contains the full versions of the essential
175                         files needed for the current stage of this product:
176                         <span class="fname">ntfs.sys</span>
177                         and
178                         <span class="fname">ntoskrnl.exe</span>.
179                         It even contains
180                         <span class="fname">cdfs.sys</span> and
181                         <span class="fname">fastfat.sys</span> for testing purposes.</p>
182
183                         <p><span class="productname">Service Pack</span> also contains
184                         EULA (End User License Agreement) paper disallowing any use of
185                         <span class="productname">Service Pack</span> outside its original
186                         intentions. According to the laws of some countries you need to be
187                         <span class="productname">authorized user</span> of the
188                         <span class="productname">Microsoft Windows XP</span> product to be
189                         allowed to use the files contained in such
190                         <span class="productname">Service Pack</span> without the bindings of its
191                         EULA. Even the interpretation of such laws may vary.</p>
192
193                         <p>It would be a&nbsp;breach of the law by the project author to provide
194                         automatic (=hidden) functionality to download and extract the
195                         <span class="productname">Service Pack</span> files. On the other hand it
196                         is perfectly legal to ask user for his/her confirmation whether he/she is
197                         really the <span class="productname">authorized user</span> of
198                         <span class="productname">Microsoft Windows XP</span> product and
199                         download/extract the <span class="productname">Service Pack</span> files
200                         accordingly.</p>
201
202                         @{[ doc_img 'captive-install-acquire-ask','Microsoft Windows Drivers Acquire Affirmation' ]}
203
204
205 HERE
206
207
208 project::captive::doc::Macros->footer();
209 }
210 1;