Rev 9328 | Rev 9330 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9328 | Rev 9329 | ||
---|---|---|---|
Line 171... | Line 171... | ||
171 | thread = Thread(target = run_tests_serially_thread, args = (tests, root_dir)) |
171 | thread = Thread(target = run_tests_serially_thread, args = (tests, root_dir)) |
172 | thread.start() |
172 | thread.start() |
173 | return thread |
173 | return thread |
Line 174... | Line 174... | ||
174 | 174 | ||
- | 175 | def gcc(fin, fout): |
|
175 | def gcc(fin, fout): |
176 | flags = "-m32 -std=c11 -g -O0 -masm=intel -fno-pie" |
- | 177 | defines = "-D_FILE_OFFSET_BITS=64 -DNDEBUG -D_POSIX_C_SOURCE=200809L" |
|
- | 178 | include = "-Iumka -Iumka/linux" |
|
176 | command = f"gcc -m32 -std=c11 -g -O0 -D_FILE_OFFSET_BITS=64 -DNDEBUG -masm=intel -D_POSIX_C_SOURCE=200809L -Iumka -Iumka/linux -fno-pie -c {fin} -o {fout}" |
179 | command = f"gcc {flags} {defines} {include} -c {fin} -o {fout}" |
177 | print(command) |
180 | print(command) |
Line -... | Line 181... | ||
- | 181 | os.system(command) |
|
- | 182 | ||
- | 183 | def build_umka_asm(): |
|
- | 184 | include = "INCLUDE=\"../../programs/develop/libraries/libcrash/hash\"" |
|
- | 185 | flags = "-dUEFI=1 -dextended_primary_loader=1 -dUMKA=1" |
|
- | 186 | files = "umka/umka.asm umka/build/umka.o -s umka/build/umka.fas" |
|
- | 187 | memory = "-m 2000000" |
|
178 | os.system(command) |
188 | os.system(f"{include} fasm {flags} {files} {memory}") |
179 | 189 | ||
180 | def build_umka(): |
190 | def build_umka(): |
181 | if not enable_umka: |
191 | if not enable_umka: |
182 | return |
192 | return |
183 | if os.path.exists("umka_shell"): |
193 | if os.path.exists("umka_shell"): |
- | 194 | return |
|
- | 195 | os.makedirs("umka/build", exist_ok = True) |
|
- | 196 | sources = [ "umka_shell.c", |
|
- | 197 | "shell.c", |
|
- | 198 | "trace.c", |
|
- | 199 | "trace_lbr.c", |
|
- | 200 | "vdisk.c", |
|
- | 201 | "vnet.c", |
|
184 | return |
202 | "lodepng.c", |
- | 203 | "linux/pci.c", |
|
185 | os.makedirs("umka/build", exist_ok = True) |
204 | "linux/thread.c", |
186 | sources = ["umka_shell.c", "shell.c", "trace.c", "trace_lbr.c", "vdisk.c", "vnet.c", "lodepng.c", "linux/pci.c", "linux/thread.c", "util.c"] |
205 | "util.c" ] |
187 | sources = [f"umka/{f}" for f in sources] |
206 | sources = [f"umka/{f}" for f in sources] |
188 | for source in sources: |
207 | for source in sources: |
189 | gcc(source, f"{source}.o") |
- | |
- | 208 | gcc(source, f"{source}.o") |
|
190 | objects = " ".join([ f"{s}.o" for s in sources ]) |
209 | objects = " ".join([ f"{s}.o" for s in sources ]) |
191 | os.system(f"INCLUDE=\"../../programs/develop/libraries/libcrash/hash\" fasm -dUEFI=1 -dextended_primary_loader=1 -dUMKA=1 umka/umka.asm umka/build/umka.o -s umka/build/umka.fas -m 2000000") |
210 | build_umka_asm() |
Line 192... | Line 211... | ||
192 | objects += (" umka/build/umka.o") |
211 | objects += " umka/build/umka.o" |
193 | os.system(f"gcc -m32 -no-pie -o umka_shell -static -T umka/umka.ld {objects}") |
212 | os.system(f"gcc -m32 -no-pie -o umka_shell -static -T umka/umka.ld {objects}") |
194 | 213 |