2010-04-16 Sebastien Pouliot <sebastien@ximian.com>
[mono/afaerber.git] / web / mono-beginning.xml
blob6ab1019c225e7d72d90fe330f7c2a8b61294c0b6
1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" []>
4 <article>
6   <articleinfo>
8     <!-- Use "HOWTO", "mini HOWTO", "FAQ" in title, if appropriate -->
9     <title>Running Mono</title>
12     <author>
13        <firstname>Hinne</firstname>
14        <surname>Hettema</surname>
15        <affiliation>
16           <address><email>h.hettema@auckland.ac.nz</email></address>
17        </affiliation>
18      </author>
19     <author>
20        <firstname>Jaime</firstname>
21        <surname>Anguiano Olarra</surname>
22        <affiliation>
23           <address><email>jaime@genuara.ugr.es</email></address>
24        </affiliation>
25      </author>
27      <pubdate>2002-06</pubdate>
29      <!-- Most recent revision goes at the top; list in descending order -->
30      <!-- All dates specified in ISO "YYYY-MM-DD" format -->
31      <revhistory>
32        <revision>
33           <revnumber>0.1</revnumber>
34           <date>2002-06-20</date>
35           <authorinitials>HH</authorinitials>
36           <revremark>First release</revremark>
37        </revision>
38      </revhistory>
40      <!-- Provide a good abstract; a couple of sentences is sufficient -->
41      <abstract>
42         <para>
43         This document describes how to install mono on your Linux system 
44         from the source and describes some simple experiments you can
45         perform with this installation.
46         </para>
47      </abstract>
49   </articleinfo>
52 <sect1 id="intro">
53 <title>Introduction</title>
55 <para>
56 Mono is an open source implementation of the Common Language Infrastructure
57 (CLI) specified in ECMA standard 335. It comes with a C# compiler and
58 provides an extensible platform to develop and run applications that
59 are interoperable with Microsoft .NET.
60 </para>
62 <para>
63 Mono is not finished--it is a project still under development. As a
64 result, installation and configuration may not be as smooth as you
65 will be used to from other Linux applications. Nevertheless, mono is
66 in a state that will allow you to get it up and running and gain
67 experience with it--which is, I would suggest, a very smart thing to do.
68 </para>
70 <para>
71 This document is limited in the following sense: it describes how to
72 download a 'stable' version of mono as a 'tarball' and get it to run on
73 your computer. I'm also assuming you run mono on Linux rather than
74 on Windows. All the examples have been tested on a 'vanilla' Red Hat 7.3 
75 installation.
76 </para>
78 <para>
79 There are two items this document will <emphasis>not 
80 </emphasis> cover: the first is how to self host the mcs compiler 
81 under linux and the second is the graphical user environment 
82 which is implemented as GTK#. These two interesting topics 
83 are the subject of two more howto's that I'm planning.
84 </para>
86 <para>
87 This document is also less useful for two types of people.
88 </para> 
89 <itemizedlist> 
90 <listitem> 
91 <para> 
92 If you are a very inexperienced linux user and want to know what mono is
93 all about, there is an easier way to install mono. Go to mono.baselabs.org
94 and download the rpm's ready for installation on your system. This site also
95 runs a tutorial that is worth reading.
96 </para> 
97 </listitem> 
98 <listitem> 
99 <para> 
100 If you are a very experienced user wanting to contribute to the mono code,
101 you should probably regularly do a CVS download. At the moment, the mono
102 code grows very fast, and the 'stable' releases still appear too slowly.
103 </para>
104 </listitem>
106 </itemizedlist>
108 <para>
109 This document is aimed at the mono beginner, and aims to present a complete
110 view of a minimal installation, which will allow you to experiment with
111 mono to some degree. It also describes some of those experiments. We
112 expect that after reading this document you'll go on to do either of
113 two things:
114 </para>
115 <orderedlist>
116 <listitem>
117 <para>
118 Continue to contribute to the mono project in some shape or form. The
119 website has some ideas and suggestions under the heading 'Contributing'.
120 </para>
121 </listitem>
122 <listitem>
123 <para>
124 Continue to write applications that run in mono. 
125 </para>
126 </listitem>
127 </orderedlist>
129 <para>
130 We hope this document will be useful to you in your first steps with mono.
131 Happy hacking!
132 </para>
134 <sect2 id="note">
135 <title>A note on the development of this document</title>
136 <para>
137 This document is expected to grow into a full 'running mono howto' over time.
138 As of yet, it does not really discuss some of the excellent efforts of others
139 to package mono into an rpm or deb and prepare it for easy installation.
140 It is our aim to include this in future versions of this document.
141 </para>
142 </sect2>
144 <sect2 id="prerequisites">
145 <title>Prerequisites</title>
146 <para>
147 This document assumes you are somewhat familiar with the architecture
148 of the Common Language Infrastructure and the C# programming language.
149 </para>
151 <para>
152 To compile mono on your system, you will also have to satisfy 
153 some dependencies on other software. A list of these are given 
154 on the mono download page. Read through this list to see if 
155 you've got all components. 
156 </para>
158 <para>
159 On a practical note, I had no dependency issues with the 
160 installation of mono 0.12 on a 'standard issue' Red Hat 7.3 build.
161 </para>
163 </sect2>
165 <sect2 id="disclaimer"> <title>Disclaimer</title>
167 <para> 
168 No liability for the contents of this document can be accepted.
169 Use the concepts, examples and information at your own risk.  There may
170 be errors and inaccuracies, that could be damaging to your system.
171 Proceed with caution, and although this is highly unlikely, the author(s)
172 do not take any responsibility.  
173 </para>
175 <para> 
176 All copyrights are held by their by their respective owners,
177 unless specifically noted otherwise.  Use of a term in this document
178 should not be regarded as affecting the validity of any trademark or
179 service mark.  Naming of particular products or brands should not be
180 seen as endorsements.  
181 </para> 
182 </sect2>
184 <!-- Give credit where credit is due...very important --> <sect2
185 id="credits"> <title>Credits / Contributors</title>
187 <para> This document was originally created by Jaime Anguiano Olarra,
188 but has been extensively rewritten. Credits are due to </para>
189 <itemizedlist> 
190 <listitem> 
191 <para>Jaime Anguiano Olarra <email>jaime@geneura.ugr.es</email> 
192 for creating the original version of this document, and in fact 
193 the document that got me through installing mono for the first time.
194 </para> 
195 </listitem> 
196 <listitem>
197 <para>
198 My partner Margaret for support on my more exotic ventures.
199 </para>
200 </listitem>
201 </itemizedlist> 
202 </sect2>
204 <!-- Feedback --> 
205 <sect2 id="feedback"> <title>Feedback</title>
207 <para> 
208 Feedback is most certainly welcome for this document. Send your
209 additions, comments and criticisms to the following email address:
210 <email>mono-docs-list@ximian.com</email>. I am lurking on this list 
211 and will maintain this document as required.  
212 </para> 
213 </sect2>
214 </sect1>
216 <!-- This is the preamble stuff over with the rest of document
217 follows... --> 
218 <sect1 id="installation"> 
219 <title> Installing Mono</title>
221 <sect2 id="obtaining"> 
222 <title>Obtaining Mono</title> 
223 <para> 
224 There are several ways to get Mono running on your computer. This
225 document will discuss only one of those: downloading the source tarball
226 and utilising the make utilities to get mono up and running.  There is
227 only one mono package to worry about if you are just after a 'base' install
228 of mono: the mono runtime. This package, found under the name "mono-x.xx"
229 has got a compiled version of the compiler built in.
230 </para>
232 <para>
233 You'll be able to complete everything in this document if you just install
234 the runtime, but taking a look at the compiler package is well worth the
235 effort. The compiler is written in C# and is 'self hosting' which means it
236 is able to compile itself. 
237 </para>
239 <para>
240 As of this moment, it is my understanding that there are still some issues
241 with the 'self hosting' bit of the compiler on linux, although this is 
242 expected to work in later versions of mono. If you are just interested in
243 finding out how mono will work under linux, I would not worry about the
244 self-hosting bit for now. The self-hosting of the compiler will be the
245 topic of a future howto.
246 </para>
248 <para> 
249 See <ulink url="http://www.go-mono.com/download">the mono download
250 site</ulink> for the source of the tarballs.  
251 </para>
253 <para>
254 This page also lists the current versions of the software 
255 mono depends on. Make sure that your system has all the 
256 required versions, otherwise mono won't compile.
257 </para>
259 <para>
260 At a minimum for mono 0.12, you'll need to:
261 </para>
263 <itemizedlist>
264 <listitem>
265 <para>
266 download and install
267 <ulink url="http//www.freedesktop.org/software/pkgconfig">
268 pkg-config</ulink>.
269 </para>
270 </listitem>
271 <listitem>
272 <para>
273 download and install
274 <ulink url="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">
275 glib 1.3</ulink>.
276 </para>
277 </listitem>
278 </itemizedlist>
280 <para> 
281 Installing the tarballs is done via GNU autoconf and
282 automake. The general upshot of running autoconf and automake is that you
283 can type <command>./configure</command> and then <command> make</command>
284 to do the build.  
285 Typing <command>make install</command> completes the installation of mono
286 on your system.
287 </para>
289 <para>
290 To build the mono runtime package, unzip the tarball to some useful
291 location.  I tend to use <command>/usr/src</command> as the location,
292 but you could really do it anywhere. For the install process, it is
293 also a good idea to be 'root'.  The installation process will shuttle
294 some executables into <command>/usr/local/bin</command> (more about
295 that later).
296 </para>
298 <para>
299 Unzipping the tarballs will have created two directories in <command>
300 /usr/src/</command>, one called something like mono-x.xx and the other 
301 mcs-x.xx. The one called 'mono' is the runtime environment, and this contains
302 all that is initially needed to run mono and investigate its inner workings.
303 </para>
305 <para>
306 To start building the mono runtime, first type <command>./configure</command>.
307 You will see an output like this:
308 </para>
309 <programlisting>
310 [root@taurus mono-0.12]# ./configure
311 loading cache ./config.cache
312 checking host system type... i686-pc-linux-gnu
313 checking target system type... i686-pc-linux-gnu
314 checking build system type... i686-pc-linux-gnu
315 checking for a BSD compatible install... (cached) /usr/bin/install -c
316 checking whether build environment is sane... yes
317 checking whether make sets ${MAKE}... (cached) yes
318 checking for working aclocal... found
321 snip ....
324 checking BASE_DEPENDENCIES_CFLAGS...  -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
325 checking BASE_DEPENDENCIES_LIBS...  -lglib-2.0
326 checking for GC_malloc in -lgc... (cached) no
327 configure: warning: Compiling mono without GC.
328 checking if off_t is 64 bits wide... no
329 checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t... ok
331 snip ...
333 creating Makefile
334 creating mono/Makefile
335 creating mono/utils/Makefile
336 creating mono/metadata/Makefile
337 creating mono/dis/Makefile
338 creating mono/cil/Makefile
339 creating mono/arch/Makefile
340 creating mono/os/Makefile
341 creating mono/os/win32/Makefile
342 creating mono/os/unix/Makefile
343 creating mono/arch/x86/Makefile
344 creating mono/arch/ppc/Makefile
345 creating mono/arch/sparc/Makefile
346 creating mono/arch/arm/Makefile
347 creating mono/interpreter/Makefile
348 creating mono/tests/Makefile
349 creating mono/benchmark/Makefile
350 creating mono/monoburg/Makefile
351 creating mono/monograph/Makefile
352 creating mono/jit/Makefile
353 creating mono/io-layer/Makefile
354 creating mono/handles/Makefile
355 creating runtime/Makefile
356 creating scripts/Makefile
357 creating man/Makefile
358 creating doc/Makefile
359 creating docs/Makefile
360 creating config.h
361 config.h is unchanged
364         GC:     auto
367 [root@taurus mono-0.12]#
368 </programlisting>
371 <para>
372 This means that the configure script has now created all the 
373 makefiles necessary to complete the build on your system. 
374 Note the "GC: auto" at the end of the list of commands. 
375 GC stands for "garbage collection" and it
376 will be addressed in a later section of this document.
377 </para>
378 <para>
379 You are now ready to start the mono "build" process. To kick 
380 this off, you can type <command>make</command> at the 
381 command prompt. You'll see something like this:
382 </para>
384 <programlisting>
385 [root@taurus mono-0.12]# make
386 make  all-recursive
387 make[1]: Entering directory `/usr/src/mono-0.12'
388 Making all in mono
389 make[2]: Entering directory `/usr/src/mono-0.12/mono'
390 Making all in utils
391 make[3]: Entering directory `/usr/src/mono-0.12/mono/utils'
392 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/include/glib-2.0 
393 -I/usr/lib/glib-2.0/include   -I/usr/include/glib-2.0 
394 -I/usr/lib/glib-2.0/include   -I../.. -I../../mono   
395 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE   -g -Wall 
396 -Wunused -Wmissing-prototypes -Wmissing-declarations 
397 -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs 
398 -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings 
399 -c mono-hash.c
401 </programlisting>
402 <para>
403 and this will continue for a while. On my 1 GHz Duron with 256 MB of RAM the 
404 total build process takes about three minutes. All the terrible flags after gcc
405 have essentially been set by the configure script and there is no need to worry
406 about these.
407 </para>
408 <para>
409 To finally install mono, you can type <command>make install</command> 
410 to get a working version of mono. This command will copy the 
411 scripts that run the executables to a place where the operating system
412 will be ale to find them. This location is <command>/usr/local/bin</command>
413 on my system. 
414 </para>
416 </sect2>
418 <sect2 id="garbage_collection">
419 <title> Garbage Collection</title>
420 <para>
421 To make the mint interpreter work with garbage collection, you first need to
422 install a garbage collection package on your system. Mono works with
423 Boehm Garbage collection, which is found at 
424 <ulink url="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">
425 http://www.hpl.hp.com/personal/Hans_Boehm/gc/
426 </ulink>.
427 </para>
429 <para>
430 To get garbage collection to work, I downloaded the source tarball 
431 into <command>/usr/src/</command> and typed <command>./configure</command>
432 followed by <command>make</command> and <command>make install</command>.
433 </para>
435 <para>
436 There is one glitch to work around. The header file for the garbage collection
437 <command>gc.h</command> is found in the <command>/usr/src/gc6.0/include
438 </command> directory (at least on my system). The mono build process will break
439 on this location: it is looking for the header file in some other place called
440 <command>/usr/include/gc/</command> and won't be able to find the correct
441 header file.
442 </para>
444 <para>
445 The solution is to build a symbolic link between these two locations as 
446 follows
447 </para>
449 <programlisting>
450 [root@taurus include]# ln -s /usr/src/gc6.0/include/ /usr/include/gc
451 </programlisting>
453 <para>
454 after which you'll be able to list the directory contents as if they were
455 in <command>/usr/include</command>
456 </para>
458 <programlisting>
459 [root@taurus include]# pwd
460 /usr/include
461 [root@taurus include]# ls /usr/include/gc
462 cord.h                gc_backptr.h  gc_inline.h             javaxfc.h
463 ec.h                  gc_cpp.h      gc_local_alloc.h        leak_detector.h
464 gc                    gc_gcj.h      gc_mark.h               new_gc_alloc.h
465 gc_alloc.h            gc.h          gc_pthread_redirects.h  private
466 gc_amiga_redirects.h  gc_inl.h      gc_typed.h              weakpointer.h
467 [root@taurus include]#
468 </programlisting>
470 <para>
471 To get mono to work with garbage collection, you'll have to rebuild the
472 environment. This is done easily by typing <command>make distclean</command>
473 to clean up any existing executables.
474 </para>
476 <para>
477 Continue the build by typing <command>./configure</command>, and look at
478 the last line. It should read:
479 </para>
481 <programlisting>
483 snip...
485 creating config.h
488         GC:     boehm
491 [root@taurus mono-0.12]#
493 </programlisting>
495 <para>
496 The GC: boehm tells you that garbage collection has been turned on. Now to
497 compile the runtime, you type <command>make</command> and <command> make
498 install</command> as previously.
499 </para>
501 <para>
502 You now have mono working with Garbage Collection.
503 </para>
505 <para>
506 Although my experimentation is incomplete as of this time, I have found some
507 issues with running Garbage Collection continuously, and my recommendation
508 would be to turn it off for now.
509 </para>
511 <para>
512 To turn garbage collection off again, you have to go to the <command>/usr/src
513 </command> directory where you extracted the tarball. Enter the <command>gc6.0
514 </command> directory and type <command>make uninstall</command> to uninstall 
515 Garbage Collection. Then in your <command>mono</command> directory, type
516 <command>make distclean</command> followed by <command>./configure</command>,
517 <command>make</command> and <command>make install</command>.
518 </para>
520 </sect2>
522 </sect1>
524 <sect1 id="running">
525 <title>Running mono</title>
526 <sect2 id="basic">
527 <title>Basic steps</title>
528 <para>
529 To work with mono, you first have to create a C# program. Open up 
530 your favourite editor, and type in the following code:
531 </para>
532 <programlisting>
533 using System;
535 class Hello
537 public static void Main(String[] args)
538         {
539         Console.WriteLine("mono:: is alive and well...");
541         for (int i = 0; i < args.Length; i++)
542                 Console.WriteLine("Argument {0} = {1}", i, args[i]);
543         }
545 </programlisting>
547 <para>
548 Save the file as hello.cs. To compile this into a working program, 
549 type mcs hello.cs. If you get the following:
550 </para>
551 <programlisting>
552 [hinne@taurus hello]$ mcs hello.cs
553 RESULT: 0
554 [hinne@taurus hello]$
555 </programlisting>
556 <para>
557 you know the compile worked fine. If you see some strange error
558 messages including the word 'parser' somewhere, you made a mistake in
559 your program. Fix this up first.
560 </para>
562 <para>
563 You are now ready to execute your first mono program.  To execute 
564 the code, type
565 </para>
567 <programlisting>
568 [hinne@taurus hello]$ mono hello.exe arg1 arg2 arg 3
569 </programlisting>
570 <para>
571 (where we have given some arguments just for fun) and you'll 
572 see the following:
573 </para>
575 <programlisting>
576 mono:: is alive and well...
577 Argument 0 = arg1
578 Argument 1 = arg2
579 Argument 2 = arg
580 Argument 3 = 3
581 RESULT: 0
582 </programlisting>
583 <para>
584 As you can see, mono printed the line "mono:: is alive and well" 
585 and printed the list of arguments. This completes the creation 
586 and execution of your first mono program.
587 </para>
588 </sect2>
590 <sect2 id="interpreter">
591 <title>Interpreter</title>
592 <para>
593 But mono will allow you to do more. First of all, mono is the 
594 compiled mono execution environment which uses the Just in 
595 Time (JIT) compiler. Mono also comes with an interpreted 
596 environment, which can be accessed using the command 'mint' 
597 as follows
598 </para>
599 <programlisting>
600 [hinne@taurus hello]$ mint hello.exe arg1 arg 2
601 mono:: is alive and well...
602 Argument 0 = arg1
603 Argument 1 = arg
604 Argument 2 = 2
605 [hinne@taurus hello]$
606 </programlisting>
607 <para>
608 As you can see, it makes no difference to mono output which 
609 environment you use, but what happens under the hood is very 
610 different. If you use 'mono' as the command line tool, you 
611 call the 'production' execution environment which will read 
612 your portable executable (PE) file, and call the just in 
613 time (JIT) compiler to compile the PE code down to machine 
614 level code (in my case, an x86 architecture) after which 
615 it is executed.
616 </para>
617 <para>
618 If you use mint, the JIT is not used, and the PE code is 
619 interpreted into x86 instructions for execution. In fact, 
620 for our simple 'hello' mint is slightly faster. The point 
621 is that the JIT compiler will take some time to compile the 
622 code of our program and store it in some location in memory, 
623 but the subsequent execution of the code is faster with mono.
624 </para>
625 <para>
627 You can see what happens below (the thing to look for is the 
628 'user' time: 0.1 seconds with mono and 0.06 seconds with mint):
630 </para>
631 <programlisting>
632 [hinne@taurus hello]$ time mono hello.exe arg1 arg 2
633 mono:: is alive and well...
634 Argument 0 = arg1
635 Argument 1 = arg
636 Argument 2 = 2
637 RESULT: 0
639 real    0m0.575s
640 user    0m0.100s
641 sys     0m0.010s
642 [hinne@taurus hello]$ time mint hello.exe arg1 arg 2
643 mono:: is alive and well...
644 Argument 0 = arg1
645 Argument 1 = arg
646 Argument 2 = 2
648 real    0m0.545s
649 user    0m0.060s
650 sys     0m0.000s
651 [hinne@taurus hello]$
652 </programlisting>
653 <para>
654 After this simple run of mono, it is time to play with some options. 
655 I won't cover these in detail since there are quite a few, and also because
656 I assume you downloaded mono to hack it around in the first place. So
657 I'll leave some pointers.
658 </para>
661 <sect3 id="debugging">
662 <title>Debugging</title>
663 <para>
664 Mono supports a debugging option when you specify the "-d" flag while running
665 the runtime. Utilising this flag will get you a significant amount of output,
666 and it may be an idea to specify an output file as well. The interesting aspect
667 of this file is that it allows you to see to some extent (quite precisely,
668 actually) what the JIT compiler is up to.
669 </para>
670 </sect3>
672 <sect3 id="statistics">
673 <title>Statistics</title>
674 <para>
675 It is also possible to collect some runtime statistics on your program. These
676 will give you some idea of the resource utilisation of your program.
677 </para>
678 <programlisting>
679 [hinne@taurus hello]$ mono --stats hello.exe
680 mono:: is alive and well...
681 RESULT: 0
682 Mono Jit statistics
683 Compiled methods:       58
684 Methods cache lookup:   15
685 Method trampolines:     698
686 Basic blocks:           188
687 Max basic blocks:       15
688 Allocated vars:         238
689 Analyze stack repeat:   61
690 Compiled CIL code size: 2450
691 Native code size:       10167
692 Max code size ratio:    7.13 (FileStream::FlushBuffer)
693 Biggest method:         1016 (StreamWriter::Write)
694 Code reallocs:          27
695 Allocated code size:    22073
696 Inlineable methods:     17
697 Inlined methods:        22
699 Created object count:   18
700 Initialized classes:    127
701 Used classes:           37
702 Static data size:       288
703 VTable data size:       8292
704 </programlisting>
705 </sect3>
707 </sect2>
709 <sect2 id="ILAsm_code" >
710 <title>Inspecting IL Assembly code</title>
711 <para>
712 Mono also provides a small tool that will let you disassemble 
713 the executable (.exe) file so you can have a peek 
714 under the hood. This tool is monodis, and is run as 
715 follows:
717 </para>
718 <programlisting>
719 [hinne@taurus hello]$ monodis hello.exe
720 .assembly extern mscorlib
722   .ver 0:0:0:0
724 .assembly 'hello'
726   .hash algorithm 0x00008004
727   .ver  0:0:0:0
729   .class private auto ansi beforefieldinit Hello
730         extends [mscorlib]System.Object
731   {
733     // method line 1
734     .method public hidebysig  specialname  rtspecialname
735            instance default void .ctor()  cil managed
736     {
737         // Method begins at RVA 0x20ec
738         // Code size 7 (0x7)
739         .maxstack 8
740         IL_0000: ldarg.0
741         IL_0001: call instance void System.Object::.ctor()
742         IL_0006: ret
743     } // end of method instance default void .ctor()
745     // method line 2
746     .method public static
747            default void Main(string[] args)  cil managed
748     {
749         // Method begins at RVA 0x20f4
750         .entrypoint
751         // Code size 56 (0x38)
752         .maxstack 5
753         .locals init (
754                 int32   V_0,
755                 int32   V_1)
756         IL_0000: ldstr "mono:: is alive and well..."
757         IL_0005: call void System.Console::WriteLine(string)
758         IL_000a: ldc.i4.0
759         IL_000b: stloc.0
760         IL_000c: ldloc.0
761         IL_000d: ldarg.s 0
762         IL_000f: ldlen
763         IL_0010: clt
764         IL_0012: brfalse IL_0037
766         IL_0017: ldstr "Argument {0} = {1}"
767         IL_001c: ldloc.0
768         IL_001d: box [mscorlib]System.Int32
769         IL_0022: ldarg.s 0
770         IL_0024: ldloc.0
771         IL_0025: ldelem.ref
772         IL_0026: call void System.Console::WriteLine(string, object, object)
773         IL_002b: nop
774         IL_002c: ldloc.0
775         IL_002d: ldc.i4.1
776         IL_002e: add
777         IL_002f: stloc.1
778         IL_0030: ldloc.1
779         IL_0031: stloc.0
780         IL_0032: br IL_000c
782         IL_0037: ret
783     } // end of method default void Main(string[] args)
785   } // end of type Hello
787 [hinne@taurus hello]$
788 </programlisting>
789 <para>
790 This is the listing of the code of your program in a language 
791 called IL assembly, or Common Intermediate Language (CIL). The 
792 CIL provides the portability of the mono platform, and ensures 
793 that code compiled with Microsoft's .NET framework will work 
794 on mono and vice versa. 
795 </para>
796 </sect2>
798 <sect2 id="man_pages">
799 <title>Man pages</title>
801 <para>
802 Mono has man pages already installed, and generally, typing <command>
803 man</command> before the command you wish to execute should help in 
804 getting a list of the options. In many cases, it's still up to you
805 to figure out what they do.
806 </para>
808 </sect2>
811 </sect1>
814 <sect1 id="problems">
815 <title>Problems</title>
816 <para> 
817 With mono being as new as it is, it is likely that you will have some
818 problems with installation. The following are some ideas to help you
819 out in a bind:
820 </para>
822 <orderedlist>
823 <listitem>
824 <para> 
825 See the Ximian Bugzilla page to find out if there is a bug
826 report about your specific issue.
827 </para>
828 </listitem>
830 <listitem>
831 <para>Read this document.  If it does not solve your problem, we want to
832 know about it. Please send a message to the email address listed for
833 feedback at the beginning of the document.</para>
834 </listitem>
836 <listitem>
838 <para> 
839 Visit the mono mailing lists' archives and do a little
840 research in there for threads talking about the problem you have.
841 </para>
842 </listitem>
844 <listitem>
845 <para> 
846 If you still cannot correct the problem, send a message to the
847 mono list. When you do this, please be as precise as possible--i.e.
848 mention the system you are running, the version of mono that you have the 
849 problem with, and give any error codes and other output that might appear.
850 </para>
851 </listitem>
852 </orderedlist>
854 </sect1>
856 <sect1 id="knownproblems">
857 <title>Known Problems</title>
859 <para> mcs fails to compile in Linux.
860 To the best of my knowledge, as of yet mcs cannot compile in Linux. 
861 Try to install the already made packages from 
862 http://mono.baselabs.org/index.php/software. </para>
863 </sect1>
865 <!-- Legal Sections --> <sect1 id="copyright">
866  <title>Copyright and License</title>
868  <!-- The LDP recommends, but doesn't require, the GFDL --> <para>
869      This document, <emphasis>Running mono</emphasis>, is copyrighted
870      (c) 2002 by <emphasis>Hinne Hettema</emphasis> and
871      <emphasis>Jaime Anguiano Olarra</emphasis>.  Permission is
872      granted to copy, distribute and/or modify this document under the
873      terms of the GNU Free Documentation License, Version 1.1 or any later
874      version published by the Free Software Foundation; with no Invariant
875      Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
876      A copy of the license is included in the section entitled "GNU Free
877      Documentation License".
878  </para>
880 <sect2 id="gfdl"> <title>GNU Free Documentation License</title> 
881 <!-- GNU Project - Free Software Foundation (FSF) -->
883 <para>Version 1.1, March 2000</para>
885 <blockquote> <para>Copyright (C) 2000  Free Software Foundation, Inc.
886 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA Everyone is
887 permitted to copy and distribute verbatim copies of this license document,
888 but changing it is not allowed.</para> </blockquote>
890 <sect3 id="gfdl-0"> <title>PREAMBLE</title>
892 <para>The purpose of this License is to make a manual, textbook,
893     or other written document "free" in the sense of freedom: to assure
894     everyone the effective freedom to copy and redistribute it, with
895     or without modifying it, either commercially or noncommercially.
896     Secondarily, this License preserves for the author and publisher
897     a way to get credit for their work, while not being considered
898     responsible for modifications made by others.</para>
900 <para>This License is a kind of "copyleft", which means that
901     derivative works of the document must themselves be free in the
902     same sense.  It complements the GNU General Public License, which
903     is a copyleft license designed for free software.</para>
905 <para>We have designed this License in order to use it for manuals
906     for free software, because free software needs free documentation:
907     a free program should come with manuals providing the same freedoms
908     that the software does.  But this License is not limited to software
909     manuals; it can be used for any textual work, regardless of subject
910     matter or whether it is published as a printed book.  We recommend
911     this License principally for works whose purpose is instruction
912     or reference.</para>
913 </sect3>
915 <sect3 id="gfdl-1"> <title>APPLICABILITY AND DEFINITIONS</title>
917 <para>This License applies to any manual or other work that
918     contains a notice placed by the copyright holder saying it can be
919     distributed under the terms of this License.  The "Document", below,
920     refers to any such manual or work.  Any member of the public is a
921     licensee, and is addressed as "you".</para>
923 <para>A "Modified Version" of the Document means any work
924     containing the Document or a portion of it, either copied verbatim,
925     or with modifications and/or translated into another language.</para>
927 <para>A "Secondary Section" is a named appendix or a front-matter
928     section of the Document that deals exclusively with the relationship
929     of the publishers or authors of the Document to the Document's overall
930     subject (or to related matters) and contains nothing that could fall
931     directly within that overall subject.  (For example, if the Document
932     is in part a textbook of mathematics, a Secondary Section may not
933     explain any mathematics.)  The relationship could be a matter of
934     historical connection with the subject or with related matters, or
935     of legal, commercial, philosophical, ethical or political position
936     regarding them.</para>
938 <para>The "Invariant Sections" are certain Secondary Sections
939     whose titles are designated, as being those of Invariant Sections,
940     in the notice that says that the Document is released under this
941     License.</para>
943 <para>The "Cover Texts" are certain short passages of text that
944     are listed, as Front-Cover Texts or Back-Cover Texts, in the notice
945     that says that the Document is released under this License.</para>
947 <para>A "Transparent" copy of the Document means a
948     machine-readable copy, represented in a format whose specification
949     is available to the general public, whose contents can be viewed and
950     edited directly and straightforwardly with generic text editors
951     or (for images composed of pixels) generic paint programs or
952     (for drawings) some widely available drawing editor, and that is
953     suitable for input to text formatters or for automatic translation
954     to a variety of formats suitable for input to text formatters.
955     A copy made in an otherwise Transparent file format whose markup
956     has been designed to thwart or discourage subsequent modification
957     by readers is not Transparent.  A copy that is not "Transparent"
958     is called "Opaque".</para>
960 <para>Examples of suitable formats for Transparent copies include
961     plain ASCII without markup, Texinfo input format, LaTeX input format,
962     SGML or XML using a publicly available DTD, and standard-conforming
963     simple HTML designed for human modification.  Opaque formats include
964     PostScript, PDF, proprietary formats that can be read and edited
965     only by proprietary word processors, SGML or XML for which the
966     DTD and/or processing tools are not generally available, and the
967     machine-generated HTML produced by some word processors for output
968     purposes only.</para>
970 <para>The "Title Page" means, for a printed book, the title page
971     itself, plus such following pages as are needed to hold, legibly,
972     the material this License requires to appear in the title page.
973     For works in formats which do not have any title page as such,
974     "Title Page" means the text near the most prominent appearance of the
975     work's title, preceding the beginning of the body of the text.</para>
976 </sect3>
978 <sect3 id="gfdl-2"> <title>VERBATIM COPYING</title>
980 <para>You may copy and distribute the Document in any medium,
981     either commercially or noncommercially, provided that this License,
982     the copyright notices, and the license notice saying this License
983     applies to the Document are reproduced in all copies, and that
984     you add no other conditions whatsoever to those of this License.
985     You may not use technical measures to obstruct or control the
986     reading or further copying of the copies you make or distribute.
987     However, you may accept compensation in exchange for copies.  If you
988     distribute a large enough number of copies you must also follow the
989     conditions in section 3.</para>
991 <para>You may also lend copies, under the same conditions stated
992     above, and you may publicly display copies.</para>
993 </sect3>
995 <sect3 id="gfdl-3"> <title>COPYING IN QUANTITY</title>
997 <para>If you publish printed copies of the Document numbering more
998     than 100, and the Document's license notice requires Cover Texts, you
999     must enclose the copies in covers that carry, clearly and legibly,
1000     all these Cover Texts: Front-Cover Texts on the front cover, and
1001     Back-Cover Texts on the back cover.  Both covers must also clearly
1002     and legibly identify you as the publisher of these copies.  The front
1003     cover must present the full title with all words of the title equally
1004     prominent and visible.  You may add other material on the covers
1005     in addition.  Copying with changes limited to the covers, as long as
1006     they preserve the title of the Document and satisfy these conditions,
1007     can be treated as verbatim copying in other respects.</para>
1009 <para>If the required texts for either cover are too voluminous to
1010     fit legibly, you should put the first ones listed (as many as fit
1011     reasonably) on the actual cover, and continue the rest onto adjacent
1012     pages.</para>
1014 <para>If you publish or distribute Opaque copies of the Document
1015     numbering more than 100, you must either include a machine-readable
1016     Transparent copy along with each Opaque copy, or state in or with each
1017     Opaque copy a publicly-accessible computer-network location containing
1018     a complete Transparent copy of the Document, free of added material,
1019     which the general network-using public has access to download
1020     anonymously at no charge using public-standard network protocols.
1021     If you use the latter option, you must take reasonably prudent steps,
1022     when you begin distribution of Opaque copies in quantity, to ensure
1023     that this Transparent copy will remain thus accessible at the stated
1024     location until at least one year after the last time you distribute
1025     an Opaque copy (directly or through your agents or retailers) of
1026     that edition to the public.</para>
1028 <para>It is requested, but not required, that you contact the
1029     authors of the Document well before redistributing any large number
1030     of copies, to give them a chance to provide you with an updated
1031     version of the Document.</para>
1032 </sect3>
1034 <sect3 id="gfdl-4"> <title>MODIFICATIONS</title>
1036 <para>You may copy and distribute a Modified Version of the
1037     Document under the conditions of sections 2 and 3 above, provided
1038     that you release the Modified Version under precisely this License,
1039     with the Modified Version filling the role of the Document, thus
1040     licensing distribution and modification of the Modified Version
1041     to whoever possesses a copy of it.  In addition, you must do these
1042     things in the Modified Version:</para>
1044 <orderedlist numeration="upperalpha"> <listitem><para>Use in the
1045 Title Page
1046       (and on the covers, if any) a title distinct from that of the
1047       Document, and from those of previous versions (which should, if
1048       there were any, be listed in the History section of the Document).
1049       You may use the same title as a previous version if the original
1050       publisher of that version gives permission.</para>
1051 </listitem>
1053 <listitem><para>List on the Title Page,
1054       as authors, one or more persons or entities responsible for
1055       authorship of the modifications in the Modified Version, together
1056       with at least five of the principal authors of the Document (all
1057       of its principal authors, if it has less than five).</para>
1058 </listitem>
1060 <listitem><para>State on the Title page
1061       the name of the publisher of the Modified Version, as the
1062       publisher.</para>
1063 </listitem>
1065 <listitem><para>Preserve all the
1066       copyright notices of the Document.</para>
1067 </listitem>
1069 <listitem><para>Add an appropriate
1070       copyright notice for your modifications adjacent to the other
1071       copyright notices.</para>
1072 </listitem>
1074 <listitem><para>Include, immediately
1075       after the copyright notices, a license notice giving the public
1076       permission to use the Modified Version under the terms of this
1077       License, in the form shown in the Addendum below.</para>
1078 </listitem>
1080 <listitem><para>Preserve in that license
1081       notice the full lists of Invariant Sections and required Cover
1082       Texts given in the Document's license notice.</para>
1083 </listitem>
1085 <listitem><para>Include an unaltered
1086       copy of this License.</para>
1087 </listitem>
1089 <listitem><para>Preserve the section
1090       entitled "History", and its title, and add to it an item stating at
1091       least the title, year, new authors, and publisher of the Modified
1092       Version as given on the Title Page.  If there is no section entitled
1093       "History" in the Document, create one stating the title, year,
1094       authors, and publisher of the Document as given on its Title Page,
1095       then add an item describing the Modified Version as stated in the
1096       previous sentence.</para>
1097 </listitem>
1099 <listitem><para>Preserve the network
1100       location, if any, given in the Document for public access to
1101       a Transparent copy of the Document, and likewise the network
1102       locations given in the Document for previous versions it was
1103       based on.  These may be placed in the "History" section.  You may
1104       omit a network location for a work that was published at least four
1105       years before the Document itself, or if the original publisher of
1106       the version it refers to gives permission.</para>
1107 </listitem>
1109 <listitem><para>In any section entitled
1110       "Acknowledgements" or "Dedications", preserve the section's title,
1111       and preserve in the section all the substance and tone of each
1112       of the contributor acknowledgements and/or dedications given
1113       therein.</para>
1114 </listitem>
1116 <listitem><para>Preserve all the
1117       Invariant Sections of the Document, unaltered in their text and in
1118       their titles.  Section numbers or the equivalent are not considered
1119       part of the section titles.</para>
1120 </listitem>
1122 <listitem><para>Delete any section
1123       entitled "Endorsements".  Such a section may not be included in
1124       the Modified Version.</para>
1125 </listitem>
1127 <listitem><para>Do not retitle any
1128       existing section as "Endorsements" or to conflict in title with
1129       any Invariant Section.</para>
1130 </listitem> </orderedlist> <para>If the Modified Version includes new
1131 front-matter sections
1132     or appendices that qualify as Secondary Sections and contain no
1133     material copied from the Document, you may at your option designate
1134     some or all of these sections as invariant.  To do this, add their
1135     titles to the list of Invariant Sections in the Modified Version's
1136     license notice.  These titles must be distinct from any other section
1137     titles.</para>
1139 <para>You may add a section entitled "Endorsements", provided it
1140     contains nothing but endorsements of your Modified Version by various
1141     parties--for example, statements of peer review or that the text has
1142     been approved by an organization as the authoritative definition of
1143     a standard.</para>
1145 <para>You may add a passage of up to five words as a Front-Cover
1146     Text, and a passage of up to 25 words as a Back-Cover Text, to the end
1147     of the list of Cover Texts in the Modified Version.  Only one passage
1148     of Front-Cover Text and one of Back-Cover Text may be added by (or
1149     through arrangements made by) any one entity.  If the Document already
1150     includes a cover text for the same cover, previously added by you or
1151     by arrangement made by the same entity you are acting on behalf of,
1152     you may not add another; but you may replace the old one, on explicit
1153     permission from the previous publisher that added the old one.</para>
1155 <para>The author(s) and publisher(s) of the Document do not by
1156     this License give permission to use their names for publicity for
1157     or to assert or imply endorsement of any Modified Version.</para>
1158 </sect3>
1160 <sect3 id="gfdl-5"> <title>COMBINING DOCUMENTS</title>
1162 <para>You may combine the Document with other documents released
1163     under this License, under the terms defined in section 4 above for
1164     modified versions, provided that you include in the combination all of
1165     the Invariant Sections of all of the original documents, unmodified,
1166     and list them all as Invariant Sections of your combined work in
1167     its license notice.</para>
1169 <para>The combined work need only contain one copy of this
1170     License, and multiple identical Invariant Sections may be replaced
1171     with a single copy.  If there are multiple Invariant Sections with
1172     the same name but different contents, make the title of each such
1173     section unique by adding at the end of it, in parentheses, the
1174     name of the original author or publisher of that section if known,
1175     or else a unique number.  Make the same adjustment to the section
1176     titles in the list of Invariant Sections in the license notice of
1177     the combined work.</para>
1179 <para>In the combination, you must combine any sections entitled
1180     "History" in the various original documents, forming one section
1181     entitled "History"; likewise combine any sections entitled
1182     "Acknowledgements", and any sections entitled "Dedications".
1183     You must delete all sections entitled "Endorsements."</para>
1184 </sect3>
1186 <sect3 id="gfdl-6"> <title>COLLECTIONS OF DOCUMENTS</title>
1188 <para>You may make a collection consisting of the Document and
1189     other documents released under this License, and replace the
1190     individual copies of this License in the various documents with a
1191     single copy that is included in the collection, provided that you
1192     follow the rules of this License for verbatim copying of each of
1193     the documents in all other respects.</para>
1195 <para>You may extract a single document from such a collection,
1196     and distribute it individually under this License, provided you
1197     insert a copy of this License into the extracted document, and follow
1198     this License in all other respects regarding verbatim copying of
1199     that document.</para>
1200 </sect3>
1202 <sect3 id="gfdl-7"> <title>AGGREGATION WITH INDEPENDENT WORKS</title>
1203 <para>A compilation of the Document or its derivatives with other
1204     separate and independent documents or works, in or on a volume
1205     of a storage or distribution medium, does not as a whole count
1206     as a Modified Version of the Document, provided no compilation
1207     copyright is claimed for the compilation.  Such a compilation is
1208     called an "aggregate", and this License does not apply to the other
1209     self-contained works thus compiled with the Document, on account
1210     of their being thus compiled, if they are not themselves derivative
1211     works of the Document.</para>
1213 <para>If the Cover Text requirement of section 3 is applicable to
1214     these copies of the Document, then if the Document is less than
1215     one quarter of the entire aggregate, the Document's Cover Texts
1216     may be placed on covers that surround only the Document within
1217     the aggregate.  Otherwise they must appear on covers around the
1218     whole aggregate.</para>
1219 </sect3>
1221 <sect3 id="gfdl-8"> <title>TRANSLATION</title>
1223 <para>Translation is considered a kind of modification, so you may
1224     distribute translations of the Document under the terms of section 4.
1225     Replacing Invariant Sections with translations requires special
1226     permission from their copyright holders, but you may include
1227     translations of some or all Invariant Sections in addition to the
1228     original versions of these Invariant Sections.  You may include
1229     a translation of this License provided that you also include the
1230     original English version of this License.  In case of a disagreement
1231     between the translation and the original English version of this
1232     License, the original English version will prevail.</para>
1233 </sect3>
1235 <sect3 id="gfdl-9"> <title>TERMINATION</title> <para>You may not copy,
1236 modify, sublicense, or distribute the
1237     Document except as expressly provided for under this License.
1238     Any other attempt to copy, modify, sublicense or distribute the
1239     Document is void, and will automatically terminate your rights under
1240     this License.  However, parties who have received copies, or rights,
1241     from you under this License will not have their licenses terminated
1242     so long as such parties remain in full compliance.</para>
1243 </sect3>
1245 <sect3 id="gfdl-10"> <title>FUTURE REVISIONS OF THIS LICENSE</title>
1247 <para>The Free Software Foundation may publish new, revised
1248     versions of the GNU Free Documentation License from
1249     time to time.  Such new versions will be similar
1250     in spirit to the present version, but may differ in
1251     detail to address new problems or concerns.  See <ulink
1252     url="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</ulink>.</para>
1254 <para>Each version of the License is given a distinguishing
1255     version number.  If the Document specifies that a particular
1256     numbered version of this License "or any later version" applies
1257     to it, you have the option of following the terms and conditions
1258     either of that specified version or of any later version that has
1259     been published (not as a draft) by the Free Software Foundation.
1260     If the Document does not specify a version number of this License,
1261     you may choose any version ever published (not as a draft) by the
1262     Free Software Foundation.</para>
1263 </sect3>
1265 <sect3 id="gfdl-11"> <title>How to use this License for your
1266 documents</title>
1268 <para>To use this License in a document you have written, include
1269     a copy of the License in the document and put the following copyright
1270     and license notices just after the title page:</para>
1272 <blockquote><para> Copyright (c)  YEAR  YOUR NAME.
1273       Permission is granted to copy, distribute and/or modify this
1274       document under the terms of the GNU Free Documentation License,
1275       Version 1.1 or any later version published by the Free Software
1276       Foundation; with the Invariant Sections being LIST THEIR TITLES,
1277       with the Front-Cover Texts being LIST, and with the Back-Cover
1278       Texts being LIST.  A copy of the license is included in the section
1279       entitled "GNU Free Documentation License".
1280 </para></blockquote>
1282 <para>If you have no Invariant Sections, write "with no Invariant
1283     Sections" instead of saying which ones are invariant.  If you
1284     have no Front-Cover Texts, write "no Front-Cover Texts" instead of
1285     "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.</para>
1287 <para>If your document contains nontrivial examples of program
1288     code, we recommend releasing these examples in parallel under your
1289     choice of free software license, such as the GNU General Public
1290     License, to permit their use in free software.</para>
1291 </sect3> </sect2> </sect1>
1293 </article>