[rendering] Do not write duplicated hashes...
[wikipediardware.git] / doc / QuickStart
blob680193684a5785227d42090dfcf28a7268fc4c6c
1 From an application perspective with an EPSON DMT33E07 evaluation
2 board (EVB).
4 * Build
6 ** Get toolchain
8 wget http://wikipediardware.googlecode.com/svn/trunk/Makefile
9 make gcc
11 export PATH=/PATH/TO/WIKIRDWARE/install/bin:$PATH
13 ** Packages needed for simulators
14 apt-get install --no-install-recommends libqt4-dev
15 apt-get install libncurses5-dev
18 ** Modify config.h
20 Enable the corresponding board config in common/config.h.
23 ** Build the bootloader
25 gfxtool inside of the bootloader has a dependency to libgd2,
26 an 'apt-get install libgd2-xpm-dev' will do.
28 make bootloader
31 To build the bootloader with the rs232 support (it expects 
32 to receive the second stage bootloader via serial connection)
33 run:
35 make bootloader232
38 ** Install the bootloader
40 Now you got binaries built.  To run them on the device, you have to
41 get the hardware ready first.  With DMT33E07, you need to do the
42 following:
44   1. Set pin #3 of SW1 to ON
45   2. Connect to serial port
46   3. Turn on the device
48 Make sure not to have any terminal emulator running (e.g. minicom)
49 before flashing the bootloader:
51 make flash-bootloader
53 Test it:
55   1. Power down the device
56   2. Set pin #3 of SW1 to OFF
57   3. Power up the device
59 If you don't have your SD card inserted, you should see a picture of
60 Homer stating that he couldn't access SD card kernel.  If you do see
61 it, you're on the right track.
63 If not, please refer to the Jumpers section in the User's Manual of
64 DMT33E07 to get your jumpers right.  It should be set to "SD Card,
65 RS232 Booting Supported".  After you're done, try again.
68 ** Build the mbr bootloader
70 Build this bootloader to get advanced bootloader options such as
71 a bootmenu, forth support or loading the kernel via the serial line.
73 make mbr
76 ** Flash mbr
78 make flash-mbr
81 ** Boot via serial line
83 First you need to activate the "boot via serial line".
85 make mbr-rs232
87 Flash mbr as described above. After flashing the board will wait for
88 an incoming kernel file and boot it. You can use picocom to send the
89 kernel. Run "scripts/p33" to connect to the device, reset the board
90 and hit CTRL + A followed by CTRL + S in the picocom terminal to send
91 the kernel file.
94 ** Build the kernel
96 make kernel
98 See "Boot from SD" to get more information about how to install
99 the kernel.
102 ** Wikipedia Index, Articles, etc.
104 The fast way: get everything from
105 https://people.internal.openmoko.org/~zecke/
109 *** Index
111  1. get the wikipedia dump by "make getwikidump".
113  2. use wiki-tools to generate "indexfile.index".
114      bzcat enwiki-latest-pages-articles.xml.bz2 | ./wiki-tools --index
116  3. read the "host-tools/indexing/README" to create the "pedia.idx"
117      and "pedia.jmp".
118      ./create_index.sh ../wiki-tools/indexfile.index
120  4. Put pedia.idx and pedia.jmp into sd card.
123 *** Wikipedia Articles
125 In order to generate the wiki fonts file and the wiki database it is
126 necessary to download & run webkit. Webkit will parse the wikipedia database
127 to retrieve names / sizes / styles of the glyphs that need to be extracted
128 and also remove the HTML markup.
130 The extracted glyphs are packed into one file called 'fontfile.gen'.
131 This file must be compressed by "enlzo" later to improve the loading
132 time.
134  1. You need to install libicu, gperf and sqlite:
135     apt-get install libicu-dev gperf libsqlite3-dev
137  2. Run "make webkit" to checkout webkit revision 41057, apply the patches under
138     host-tools/rendering/patches and build webkit.
140  3. Use GtkLauncher to load host-tools/rendering/base_text.html
141     and several wikipedia articles you like.  For each article,
142     use
143     host-tools/rendering/simple_code.py
144     to generate `smplpedi.cde'.  Rename it according to the result of
145     lsearch.
147  4. Generate font file
148     host-tools/glyphs/mk_fontfile/gen_font_file.py
149     you can get fontfile.gen
151  5. Read minilzo/README.  Build enlzo.
152     enlzo fontfile.gen > fontfile.lzo
153     mv fontfile.new fontfile.gen
155  5. Put fontfile.gen along with the renamed smplpedi.cde files into
156     sd card.
159 ** Boot from SD
161 Prepare a SD card, make a FAT filesystem on it, then copy kernel:
163  1. Create a vfat on the whole device
164     mkfs.vfat -I /dev/YOUR_DEVICE
166  2. cp kernel/mahatma.elf <your sd card>/kernel
168 For example:
170 cp kernel/mahatma.elf /media/disk/kernel
172 Now insert the SD card into the EVB then boot the device.
175 * Development
177 Refer to kernel/* and change code there to see what happens.  Use
178 functions from wiki-lib and gui-lib to write your own application.
179 When you're done, compile it and try it on the device.