Rev 5176 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5176 | Rev 5568 | ||
---|---|---|---|
1 | Most programs in the repository are regularly and automatically compiled |
1 | Most programs in the repository are regularly and automatically compiled |
2 | by the autobuild server, compiled binaries are available at |
2 | by the autobuild server, compiled binaries are available at |
3 | http://builds.kolibrios.org. The autobuild server uses the build system Tup, |
3 | http://builds.kolibrios.org. The autobuild server uses the build system Tup, |
4 | data for it are located in files named Tupfile.lua over the repository. |
4 | data for it are located in files named Tupfile.lua over the repository. |
5 | 5 | ||
6 | ------------------------------------------------------------------------------- |
6 | ------------------------------------------------------------------------------- |
7 | 7 | ||
8 | Q1. I want to build one program and I don't want to know anything about Tup. |
8 | Q1. I want to build one program and I don't want to know anything about Tup. |
9 | Q2. I want to build one program using Tup. |
9 | Q2. I want to build one program using Tup. |
10 | Q3. I want to add a program to the autobuild. |
10 | Q3. I want to add a program to the autobuild. |
11 | Q4. I want to build the entire system. |
11 | Q4. I want to build the entire system. |
12 | Q5. I'm sure that I want to build the entire system. |
12 | Q5. I'm sure that I want to build the entire system. |
13 | The autobuild server does this, after all. |
13 | The autobuild server does this, after all. |
14 | Q6. I don't want to keep a zoo of compilers and tools required for Q5, |
14 | Q6. I don't want to keep a zoo of compilers and tools required for Q5, |
15 | but I still want to build as many programs as possible with what I have. |
15 | but I still want to build as many programs as possible with what I have. |
- | 16 | Q7. I have modified the source code of the kernel, one driver or one program |
|
- | 17 | and want to test changes. |
|
16 | 18 | ||
17 | ------------------------------------------------------------------------------- |
19 | ------------------------------------------------------------------------------- |
18 | 20 | ||
19 | Q1. I want to build one program and I don't want to know anything about Tup. |
21 | Q1. I want to build one program and I don't want to know anything about Tup. |
20 | A1. Fine. You will need a corresponding compiler, obviously. |
22 | A1. Fine. You will need a corresponding compiler, obviously. |
21 | 23 | ||
22 | * For a FASM program, get FASM at http://flatassembler.net/download.php. |
24 | * For a FASM program, get FASM at http://flatassembler.net/download.php. |
23 | To compile, find the main .asm file of the program and run |
25 | To compile, find the main .asm file of the program and run |
24 | path/to/fasm |
26 | path/to/fasm |
25 | The compiler will automatically select the name for output, using |
27 | The compiler will automatically select the name for output, using |
26 | base name of input and extension based on file format. Though, you can |
28 | base name of input and extension based on file format. Though, you can |
27 | give also output name explicitly, as the second argument. |
29 | give also output name explicitly, as the second argument. |
28 | 30 | ||
29 | If the compiler produces an error "file not found" regarding 'lang.inc', |
31 | If the compiler produces an error "file not found" regarding 'lang.inc', |
30 | the program can be compiled using different languages of interface. |
32 | the program can be compiled using different languages of interface. |
31 | Create a file 'lang.inc' in the same folder as |
33 | Create a file 'lang.inc' in the same folder as |
32 | lang fix en |
34 | lang fix en |
33 | Here the last word selects the language. Valid languages are |
35 | Here the last word selects the language. Valid languages are |
34 | en, ru, et, it, sp. Not all programs provide all translations, |
36 | en, ru, et, it, sp. Not all programs provide all translations, |
35 | en should always be available, ru is the most frequent after en. |
37 | en should always be available, ru is the most frequent after en. |
36 | 38 | ||
37 | * For a NASM program, get NASM at http://www.nasm.us/. |
39 | * For a NASM program, get NASM at http://www.nasm.us/. |
38 | To compile, find the main .asm file of the program and run |
40 | To compile, find the main .asm file of the program and run |
39 | path/to/nasm -f bin -o |
41 | path/to/nasm -f bin -o |
40 | Multi-language is rarely supported in this category, but you could still |
42 | Multi-language is rarely supported in this category, but you could still |
41 | see sometimes an error "file not found" regarding 'lang_nasm.inc'. If so, |
43 | see sometimes an error "file not found" regarding 'lang_nasm.inc'. If so, |
42 | create a file 'lang_nasm.inc' in the same folder as |
44 | create a file 'lang_nasm.inc' in the same folder as |
43 | %define lang 'en' |
45 | %define lang 'en' |
44 | Read the entry about fasm for description of valid languages. |
46 | Read the entry about fasm for description of valid languages. |
45 | 47 | ||
46 | * For a c-- program, try to avoid compiling it and instead rewrite the code |
48 | * For a c-- program, try to avoid compiling it and instead rewrite the code |
47 | in a normal language like assembler or C. If you absolutely need |
49 | in a normal language like assembler or C. If you absolutely need |
48 | to compile, note that the compiler has been abandoned long ago, so |
50 | to compile, note that the compiler has been abandoned long ago, so |
49 | don't look for an official site. It is possible to find the compiler |
51 | don't look for an official site. It is possible to find the compiler |
50 | somewhere on http://board.kolibrios.org, but be prepared to several tries |
52 | somewhere on http://board.kolibrios.org, but be prepared to several tries |
51 | because there are several slightly different compiler versions, not all of |
53 | because there are several slightly different compiler versions, not all of |
52 | which are able to build all programs. |
54 | which are able to build all programs. |
53 | There is no Linux version, but Windows version runs fine under Wine. |
55 | There is no Linux version, but Windows version runs fine under Wine. |
54 | 56 | ||
55 | * For a GCC program, get the toolchain at |
57 | * For a GCC program, get the toolchain at |
56 | http://ftp.kolibrios.org/users/Serge/new/Toolchain/. |
58 | http://ftp.kolibrios.org/users/Serge/new/Toolchain/. |
57 | 59 | ||
58 | Under Windows, you need the package with "msys" in name and MinGW; |
60 | Under Windows, you need the package with "msys" in name and MinGW; |
59 | after installing MinGW, unpack the package to |
61 | after installing MinGW, unpack the package to |
60 | \MinGW\msys\1.0\home\autobuild\tools\win32, the package assumes |
62 | \MinGW\msys\1.0\home\autobuild\tools\win32, the package assumes |
61 | exactly this path. Run MinGW shell. |
63 | exactly this path. Run MinGW shell. |
62 | 64 | ||
63 | Under Linux, you need the package with "linux" in name |
65 | Under Linux, you need the package with "linux" in name |
64 | and runtime library cloog; e.g. for Debian-based distributives |
66 | and runtime library cloog; e.g. for Debian-based distributives |
65 | use apt-get install libcloog-isl4. Unpack the package to |
67 | use apt-get install libcloog-isl4. Unpack the package to |
66 | /home/autobuild/tools/win32, the package assumes exactly this path. |
68 | /home/autobuild/tools/win32, the package assumes exactly this path. |
67 | 69 | ||
68 | In both MinGW and Linux, make sure that the command |
70 | In both MinGW and Linux, make sure that the command |
69 | /home/autobuild/tools/win32/bin/kos32-gcc |
71 | /home/autobuild/tools/win32/bin/kos32-gcc |
70 | invokes the compiler. |
72 | invokes the compiler. |
71 | 73 | ||
72 | If the program uses libraries, you will also need to either compile |
74 | If the program uses libraries, you will also need to either compile |
73 | them separately or download SDK, if they are included to SDK. |
75 | them separately or download SDK, if they are included to SDK. |
74 | Compiling is ultimately a sequence of calls to kos32-gcc and kos32-ld, |
76 | Compiling is ultimately a sequence of calls to kos32-gcc and kos32-ld, |
75 | but filling exact parameters can be tricky, so maybe you want to |
77 | but filling exact parameters can be tricky, so maybe you want to |
76 | use Tup - proceed to Q2/A2 - or Make, if a maintainer has provided |
78 | use Tup - proceed to Q2/A2 - or Make, if a maintainer has provided |
77 | Makefile. |
79 | Makefile. |
78 | 80 | ||
79 | * For a MSVC program, get the compiler as a part of Visual Studio, |
81 | * For a MSVC program, get the compiler as a part of Visual Studio, |
80 | Express Edition is fine, or as a part of Windows SDK. |
82 | Express Edition is fine, or as a part of Windows SDK. |
81 | For obvious reasons, there is no Linux version, but the compiler runs fine |
83 | For obvious reasons, there is no Linux version, but the compiler runs fine |
82 | under Wine. |
84 | under Wine. |
83 | 85 | ||
84 | If the program uses libraries, you will also need to either compile |
86 | If the program uses libraries, you will also need to either compile |
85 | them separately or download SDK, if they are included to SDK. |
87 | them separately or download SDK, if they are included to SDK. |
86 | Compiling is ultimately a sequence of calls to cl.exe and link.exe, |
88 | Compiling is ultimately a sequence of calls to cl.exe and link.exe, |
87 | but filling exact parameters can be tricky, so maybe you want to |
89 | but filling exact parameters can be tricky, so maybe you want to |
88 | use Tup - proceed to Q2/A2 - or Make, if a maintainer has provided |
90 | use Tup - proceed to Q2/A2 - or Make, if a maintainer has provided |
89 | Makefile. |
91 | Makefile. |
90 | 92 | ||
91 | * For any language, if the program is KolibriOS binary, the compiled binary |
93 | * For any language, if the program is KolibriOS binary, the compiled binary |
92 | can optionally be compiled with kpack. Windows version of kpack |
94 | can optionally be compiled with kpack. Windows version of kpack |
93 | can be downloaded at http://diamond.kolibrios.org/prg/kpack.exe, |
95 | can be downloaded at http://diamond.kolibrios.org/prg/kpack.exe, |
94 | Linux version can be compiled from sources at |
96 | Linux version can be compiled from sources at |
95 | (repository)/programs/other/kpack/linux. |
97 | (repository)/programs/other/kpack/linux. |
96 | 98 | ||
97 | * The kernel can optionally be compiled with kerpack. |
99 | * The kernel can optionally be compiled with kerpack. |
98 | Linux version can be compiled from sources at |
100 | Linux version can be compiled from sources at |
99 | (repository)/programs/other/kpack/kerpack_linux. |
101 | (repository)/programs/other/kpack/kerpack_linux. |
100 | There is no Windows version. |
102 | There is no Windows version. |
101 | 103 | ||
102 | Q2. I want to build one program using Tup. |
104 | Q2. I want to build one program using Tup. |
103 | A2. You will still need the corresponding compiler as described in Q1/A1. |
105 | A2. You will still need the corresponding compiler as described in Q1/A1. |
104 | You will also need Tup, get it at http://gittup.org/tup/index.html. |
106 | You will also need Tup, get it at http://gittup.org/tup/index.html. |
105 | Make sure that the corresponding compiler is somewhere in PATH |
107 | Make sure that the corresponding compiler is somewhere in PATH |
106 | and can be invoked without explicit path. For Linux, note that |
108 | and can be invoked without explicit path. For Linux, note that |
107 | all programs are invoked without extension, like |
109 | all programs are invoked without extension, like |
108 | fasm |
110 | fasm |
109 | or |
111 | or |
110 | kos32-gcc |
112 | kos32-gcc |
111 | with one exception: MSVC linker is invoked as link.exe to avoid conflict |
113 | with one exception: MSVC linker is invoked as link.exe to avoid conflict |
112 | with link from coreutils. Under Linux, c--, cl, link.exe should be scripts |
114 | with link from coreutils. Under Linux, c--, cl, link.exe should be scripts |
113 | invoking Wine with the corresponding binary. The interaction tup+wine |
115 | invoking Wine with the corresponding binary. The interaction tup+wine |
114 | does not work by default; ultimately, invoking scripts should be like: |
116 | does not work by default; ultimately, invoking scripts should be like: |
115 | c--: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/C--.exe $* |
117 | c--: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/C--.exe $* |
116 | cl: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/cl.exe -I/path/to/cl/include $* |
118 | cl: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/cl.exe -I/path/to/cl/include $* |
117 | link.exe: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/link.exe $* |
119 | link.exe: WINEDEBUG=-all LD_PRELOAD=/path/to/nosetsid.so /path/to/wine /path/to/link.exe $* |
118 | where nosetsid.so is compiled as a 32-bit shared library |
120 | where nosetsid.so is compiled as a 32-bit shared library |
119 | from C file with one line "int setsid() { return -1; }". |
121 | from C file with one line "int setsid() { return -1; }". |
120 | 122 | ||
121 | If the program does not use any libraries, run |
123 | If the program does not use any libraries, run |
122 | tup init |
124 | tup init |
123 | in the directory with the program. Then, |
125 | in the directory with the program. Then, |
124 | tup |
126 | tup |
125 | without arguments will build the program with default settings. |
127 | without arguments will build the program with default settings. |
126 | Subsequent runs will not do anything unless any file that was used |
128 | Subsequent runs will not do anything unless any file that was used |
127 | during the compilation - not necessarily the main file - is changed; |
129 | during the compilation - not necessarily the main file - is changed; |
128 | after that, the program will be recompiled. |
130 | after that, the program will be recompiled. |
129 | By default, tup will not track files outside the directory with "tup init"; |
131 | By default, tup will not track files outside the directory with "tup init"; |
130 | if tracking files in program directory is not sufficient for you, |
132 | if tracking files in program directory is not sufficient for you, |
131 | consider adding updater.full_deps=1 to tup config - see tup manual |
133 | consider adding updater.full_deps=1 to tup config - see tup manual |
132 | for details, for Linux it requires setting tup as suid root - or extending |
134 | for details, for Linux it requires setting tup as suid root - or extending |
133 | tup data to the entire repository as described in Q6/A6. |
135 | tup data to the entire repository as described in Q6/A6. |
134 | 136 | ||
135 | Settings can be configured using the file tup.config. Look to |
137 | Settings can be configured using the file tup.config. Look to |
136 | tup.config.template in the repository root for complete list; |
138 | tup.config.template in the repository root for complete list; |
137 | for most programs, only CONFIG_LANG and CONFIG_KPACK_CMD have effect. |
139 | for most programs, only CONFIG_LANG and CONFIG_KPACK_CMD have effect. |
138 | 140 | ||
139 | If the program uses libraries or helper files for gcc/msvc and you don't |
141 | If the program uses libraries or helper files for gcc/msvc and you don't |
140 | want to build everything at once like Q6/A6, set |
142 | want to build everything at once like Q6/A6, set |
141 | CONFIG_HELPERDIR=. |
143 | CONFIG_HELPERDIR=. |
142 | in tup.config, copy programs/use_gcc.lua or programs/use_msvc.lua |
144 | in tup.config, copy programs/use_gcc.lua or programs/use_msvc.lua |
143 | and helpers for used libraries, if any, to the directory of the program. |
145 | and helpers for used libraries, if any, to the directory of the program. |
144 | use_gcc.lua and use_msvc.lua do not require additional configuration; |
146 | use_gcc.lua and use_msvc.lua do not require additional configuration; |
145 | in helpers for used libraries, set path to library in the first line. |
147 | in helpers for used libraries, set path to library in the first line. |
146 | Since copied helpers are local files not for the repository, you may use |
148 | Since copied helpers are local files not for the repository, you may use |
147 | absolute pathes specific for your machine. |
149 | absolute pathes specific for your machine. |
148 | This was designed so that no repository files need to be modified: |
150 | This was designed so that no repository files need to be modified: |
149 | Tupfile.lua for the program is able to use either local helpers when |
151 | Tupfile.lua for the program is able to use either local helpers when |
150 | CONFIG_HELPERDIR is set, or repository helpers when the entire repository |
152 | CONFIG_HELPERDIR is set, or repository helpers when the entire repository |
151 | is built. |
153 | is built. |
152 | You will also need compiled libraries. If they are included in SDK, use them. |
154 | You will also need compiled libraries. If they are included in SDK, use them. |
153 | Otherwise, compile them using the same process. Note that for a library, |
155 | Otherwise, compile them using the same process. Note that for a library, |
154 | "tup init" needs to be called in the library directory with include/ and lib/, |
156 | "tup init" needs to be called in the library directory with include/ and lib/, |
155 | even if Tupfile.lua is present only in src/; libraries will be put in lib/. |
157 | even if Tupfile.lua is present only in src/; libraries will be put in lib/. |
156 | 158 | ||
157 | Q3. I want to add a program to the autobuild. |
159 | Q3. I want to add a program to the autobuild. |
158 | A3. Select a program from repository which uses same language and libraries. |
160 | A3. Select a program from repository which uses same language and libraries. |
159 | Copy Tupfile.lua from that program to your program. |
161 | Copy Tupfile.lua from that program to your program. |
160 | Change names of source and binary files accordingly. |
162 | Change names of source and binary files accordingly. |
161 | If external files are referenced, correct relative pathes accordingly: |
163 | If external files are referenced, correct relative pathes accordingly: |
162 | e.g. when programs/develop/libraries/menuetlibc_example/Tupfile.lua |
164 | e.g. when programs/develop/libraries/menuetlibc_example/Tupfile.lua |
163 | references ../../../use_menuetlibc.lua, it resolves to |
165 | references ../../../use_menuetlibc.lua, it resolves to |
164 | programs/use_menuetlibc.lua, if your program is built by |
166 | programs/use_menuetlibc.lua, if your program is built by |
165 | programs/other/super_program/Tupfile.lua, the path should be |
167 | programs/other/super_program/Tupfile.lua, the path should be |
166 | ../../use_menuetlibc.lua. Commit. |
168 | ../../use_menuetlibc.lua. Commit. |
167 | 169 | ||
168 | After that, the program will be built regularly. |
170 | After that, the program will be built regularly. |
169 | To include the binary in kolibri.img or kolibri.iso, add it to one of |
171 | To include the binary in kolibri.img or kolibri.iso, add it to one of |
170 | lists in data/Tupfile.lua. Select the section corresponding to the used |
172 | lists in data/Tupfile.lua. Select the section corresponding to the used |
171 | language so that people who build images without your compiler would still |
173 | language so that people who build images without your compiler would still |
172 | be able to do so. |
174 | be able to do so. |
173 | 175 | ||
174 | Q4. I want to build the entire system. |
176 | Q4. I want to build the entire system. |
175 | A4. Why? Even the person who has configured the autobuild server does not build |
177 | A4. Why? Even the person who has configured the autobuild server does not build |
176 | everything on her computer. |
178 | everything on her computer. |
177 | 179 | ||
178 | If you want to create your own image of the system, it is much simpler to |
180 | If you want to create your own image of the system, it is much simpler to |
179 | start from existing one and modify it, building only what is necessary. |
181 | start from existing one and modify it, building only what is necessary. |
- | 182 | Look for Q7/A7 for details of that approach. |
|
180 | If you don't know how to modify an image, don't expect that the build |
183 | If you don't know how to modify an image, don't expect that the build |
181 | system will magically do it for you. The build system uses mtools for |
184 | system will magically do it for you. The build system uses mtools for |
182 | image manipulation; if you have configured mtools, you can just use them |
185 | image manipulation; if you have configured mtools, you can just use them |
183 | directly. There are also other ways of image manipulation, which would |
186 | directly. There are also other ways of image manipulation, which would |
184 | be closed for you once you decide to become attached to the build system. |
187 | be closed for you once you decide to become attached to the build system. |
185 | 188 | ||
186 | If you want to verify or debug your changes in Q3/A3, it is normally |
189 | If you want to verify or debug your changes in Q3/A3, it is normally |
187 | sufficient to build just what you have changed as in Q2/A2. |
190 | sufficient to build just what you have changed as in Q2/A2. |
188 | To be extra sure, you can build from the repository root as in Q6/A6 |
191 | To be extra sure, you can build from the repository root as in Q6/A6 |
189 | limiting to your compiler and FASM for some helper tasks; |
192 | limiting to your compiler and FASM for some helper tasks; |
190 | any possible differences between this mode and actions of the autobuild |
193 | any possible differences between this mode and actions of the autobuild |
191 | server are due to environment issues, like Windows vs Linux, |
194 | server are due to environment issues, like Windows vs Linux, |
192 | and would not be resolved anyway. |
195 | and would not be resolved anyway. |
193 | 196 | ||
194 | If you just want it, note that the full build requires all compilers |
197 | If you just want it, note that the full build requires all compilers |
195 | listed in Q1/A1 and Linux. MinGW and Cygwin will not help you. |
198 | listed in Q1/A1 and Linux. MinGW and Cygwin will not help you. |
196 | 199 | ||
197 | Q5. I'm sure that I want to build the entire system. |
200 | Q5. I'm sure that I want to build the entire system. |
198 | The autobuild server does this, after all. |
201 | The autobuild server does this, after all. |
199 | A5. The autobuild server has one concrete configuration with 64-bit Linux. |
202 | A5. The autobuild server has one concrete configuration with 64-bit Linux. |
200 | The developers are slightly interested in compiling programs in different |
203 | The developers are slightly interested in compiling programs in different |
201 | systems, but nobody needs portability of actions that only one server |
204 | systems, but nobody needs portability of actions that only one server |
202 | does anyway. |
205 | does anyway. |
203 | 206 | ||
204 | So, don't expect support from developers. Though, here goes the instruction |
207 | So, don't expect support from developers. Though, here goes the instruction |
205 | in interest of completeness. |
208 | in interest of completeness. |
206 | 209 | ||
207 | * Configure all compilers as described in Q2/A2. |
210 | * Configure all compilers as described in Q2/A2. |
208 | * Configure kpack and kerpack as described in Q2/A2. |
211 | * Configure kpack and kerpack as described in Q2/A2. |
209 | They are optional for Q2/A2, but required here, |
212 | They are optional for Q2/A2, but required here, |
210 | the image just could not contain all programs in unpacked form. |
213 | the image just could not contain all programs in unpacked form. |
211 | * Configure mtools, so that mformat, mmd and mcopy are somewhere in PATH. |
214 | * Configure mtools, so that mformat, mmd and mcopy are somewhere in PATH. |
212 | * Configure mkisofs. |
215 | * Configure mkisofs. |
213 | * For full duplication of the autobuild server configure build variants: |
216 | * For full duplication of the autobuild server configure build variants: |
214 | create directories build-eng, build-rus, ... in the root of repository for |
217 | create directories build-eng, build-rus, ... in the root of repository for |
215 | every subdirectory in data/ except data/common. Create files |
218 | every subdirectory in data/ except data/common. Create files |
216 | build-eng/tup.config, build-rus/tup.config, ... with |
219 | build-eng/tup.config, build-rus/tup.config, ... with |
217 | CONFIG_BUILD_TYPE=eng, rus, ... correspondingly. This will switch |
220 | CONFIG_BUILD_TYPE=eng, rus, ... correspondingly. This will switch |
218 | to out-of-tree builds for every variant. If one build type is sufficient |
221 | to out-of-tree builds for every variant. If one build type is sufficient |
219 | for you, you may skip this step. |
222 | for you, you may skip this step. |
220 | * Run |
223 | * Run |
221 | tup init |
224 | tup init |
222 | in the root of repository. |
225 | in the root of repository. |
223 | * Run |
226 | * Run |
224 | tup |
227 | tup |
225 | anywhere inside repository. |
228 | anywhere inside repository. |
226 | * If everything went good, there should be files kolibri.img and kolibri.iso |
229 | * If everything went good, there should be files kolibri.img and kolibri.iso |
227 | in every build-* directory. When you want to update, |
230 | in every build-* directory. When you want to update, |
228 | rerun tup without arguments. |
231 | rerun tup without arguments. |
229 | 232 | ||
230 | Q6. I don't want to keep a zoo of compilers and tools required for Q5, |
233 | Q6. I don't want to keep a zoo of compilers and tools required for Q5, |
231 | but I still want to build as many programs as possible with what I have. |
234 | but I still want to build as many programs as possible with what I have. |
232 | A6. |
235 | A6. |
233 | * Configure all compilers you want to use as described in Q2/A2. |
236 | * Configure all compilers you want to use as described in Q2/A2. |
234 | * Create tup.config in the root of repository. Disable all compilers you |
237 | * Create tup.config in the root of repository. Disable all compilers you |
235 | don't want to use there; comments in tup.config.template should help you. |
238 | don't want to use there; comments in tup.config.template should help you. |
236 | * Optionally, configure kpack and kerpack as described in Q2/A2. |
239 | * Optionally, configure kpack and kerpack as described in Q2/A2. |
237 | * Run |
240 | * Run |
238 | tup init |
241 | tup init |
239 | in the root of repository. |
242 | in the root of repository. |
240 | * Run |
243 | * Run |
241 | tup |
244 | tup |
242 | anywhere inside repository. |
245 | anywhere inside repository. |
- | 246 | ||
- | 247 | Q7. I have modified the source code of the kernel, one driver or one program |
|
- | 248 | and want to test changes. |
|
- | 249 | A7. First, you need to build the corresponding binary as described in Q1/A1 or |
|
- | 250 | Q2/A2. |
|
- | 251 | To test a program, it is sufficient to put it to some place accessible |
|
- | 252 | to the working KolibriOS and just run it from there. Drivers are loaded |
|
- | 253 | from the folder /rd/1/drivers/, which is initialized from kolibri.img, |
|
- | 254 | so testing a driver requires either copying the compiled binary to |
|
- | 255 | /rd/1/drivers manually between KolibriOS startup and loading driver or |
|
- | 256 | inserting the driver to the image kolibri.img outside of KolibriOS. |
|
- | 257 | Testing the kernel or an auto-loading driver requires modifying the image. |
|
- | 258 | ||
- | 259 | There are several possible approaches for writing to kolibri.img. |
|
- | 260 | * From inside KolibriOS, write to /rd/1 and then save the ramdisk image. |
|
- | 261 | * On Linux, there is a package named "mtools", |
|
- | 262 | https://www.gnu.org/software/mtools/ . It can be available in the |
|
- | 263 | repository of your Linux distribution or it can be compiled manually. |
|
- | 264 | Compiling mtools for Windows is not impossible, but not supported either. |
|
- | 265 | Using mtools: |
|
- | 266 | mdir -i kolibri.img [ |
|
- | 267 | lists contents of the given directory of the image or the root directory |
|
- | 268 | if |
|
- | 269 | mcopy -moi kolibri.img |
|
- | 270 | inserts the file |
|
- | 271 | reverse order of the arguments, it extracts the corresponding file. |
|
- | 272 | * On Linux with root privileges, the standard mount command can be used: |
|
- | 273 | mount -t vfat -o loop kolibri.img |
|
- | 274 | maps contents of kolibri.img under the directory |
|
- | 275 | hiding whatever was in |
|
- | 276 | umount |
|
- | 277 | * On Windows with administrator privileges, the driver ImDisk |
|
- | 278 | http://www.ltr-data.se/opencode.html/#ImDisk can be used: |
|
- | 279 | imdisk -a -m A: -t file -f kolibri.img |
|
- | 280 | maps contents of kolibri.img to the virtual disk A:. When done, use |
|
- | 281 | imdisk -d -m A: |