Rev 9323 | Rev 9327 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9323 | Rev 9326 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | from threading import Thread |
13 | from threading import Thread |
Line 14... | Line 14... | ||
14 | 14 | ||
15 | sys.path.append('test') |
15 | sys.path.append('test') |
Line -... | Line 16... | ||
- | 16 | import common |
|
- | 17 | ||
16 | import common |
18 | enable_umka = False |
17 | 19 | ||
Line 18... | Line 20... | ||
18 | def log(s, end = "\n"): |
20 | def log(s, end = "\n"): |
19 | print(s, end = end, flush = True) |
21 | print(s, end = end, flush = True) |
Line 156... | Line 158... | ||
156 | def run_tests_serially(tests, root_dir): |
158 | def run_tests_serially(tests, root_dir): |
157 | thread = Thread(target = run_tests_serially_thread, args = (tests, root_dir)) |
159 | thread = Thread(target = run_tests_serially_thread, args = (tests, root_dir)) |
158 | thread.start() |
160 | thread.start() |
159 | return thread |
161 | return thread |
Line -... | Line 162... | ||
- | 162 | ||
- | 163 | def gcc(fin, fout): |
|
- | 164 | 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}" |
|
- | 165 | print(command) |
|
- | 166 | os.system(command) |
|
- | 167 | ||
- | 168 | def build_umka(): |
|
- | 169 | if not enable_umka: |
|
- | 170 | return |
|
- | 171 | if os.path.exists("umka_shell"): |
|
- | 172 | return |
|
- | 173 | os.makedirs("umka/build", exist_ok = True) |
|
- | 174 | 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"] |
|
- | 175 | sources = [f"umka/{f}" for f in sources] |
|
- | 176 | for source in sources: |
|
- | 177 | gcc(source, f"{source}.o") |
|
- | 178 | objects = " ".join([ f"{s}.o" for s in sources ]) |
|
- | 179 | 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") |
|
- | 180 | objects += (" umka/build/umka.o") |
|
- | 181 | os.system(f"gcc -m32 -no-pie -o umka_shell -static -T umka/umka.ld {objects}") |
|
160 | 182 | ||
161 | if __name__ == "__main__": |
183 | if __name__ == "__main__": |
Line 162... | Line 184... | ||
162 | root_dir = os.getcwd() |
184 | root_dir = os.getcwd() |
163 | 185 | ||
164 | # Check available tools |
186 | # Check available tools |
165 | tools = (("qemu-system-i386", "qemu-system-x86"), |
187 | tools = (("qemu-system-i386", "qemu-system-x86"), |
Line 166... | Line 188... | ||
166 | ("fasm", "fasm")) |
188 | ("fasm", "fasm")) |
- | 189 | check_tools(tools) |
|
167 | check_tools(tools) |
190 | |
168 | 191 | prepare_test_img() |
|
169 | prepare_test_img() |
192 | build_umka() |