Commit Graph

47 Commits

Author SHA1 Message Date
Andrius Štikonas f552c166df Add Makefile for creating images and launching qemu. 2022-08-07 11:38:45 +01:00
Andrius Štikonas 129bfcbd16 Add kaem-optional.hex0. 2022-08-07 00:21:57 +01:00
Andrius Štikonas fc79b4a153 Add kaem-optional M1 and hex2 development prototypes. 2022-08-06 22:02:44 +01:00
Andrius Štikonas bb9ff366a5 Add kaem-optional.S 2022-08-01 00:30:29 +01:00
Andrius Štikonas 9af7fdf9bb kaem-minimal.S: make sure to close files and free pools when exiting. 2022-07-30 10:08:23 +01:00
Andrius Štikonas 0895da7db6 Fix kaem to work with multiple commands. 2022-07-25 19:57:44 +01:00
Andrius Štikonas e51956a58c Zero more of the PE32 header fields. 2022-07-24 22:09:44 +01:00
Andrius Štikonas e68a9cc0bb Add bootstrap-seeds submodule. 2022-07-24 21:20:02 +01:00
Andrius Štikonas e758a69d2b Zero some more DOS header fields. 2022-07-24 21:19:26 +01:00
Andrius Štikonas 9af8890ef5 Fix a comment. 2022-07-24 21:09:12 +01:00
Andrius Štikonas d15b16b729 Replace hex0_AMD64_POSIX.hex0 with efi version. 2022-07-24 13:19:01 +01:00
Andrius Štikonas 54e0c80f9f Fix remaining issues that prevented hex0 from running. 2022-07-24 13:09:34 +01:00
Andrius Štikonas c1df626dc6 Add initial (non-working) versoin of hex0.hex0. 2022-07-24 12:11:56 +01:00
Andrius Štikonas 8e22fee483 Switch to relative addressing of labels. 2022-07-24 10:11:45 +01:00
Andrius Štikonas f6cb8bbf92 Add hex0.hex2. 2022-07-23 21:28:54 +01:00
Andrius Štikonas 05556bbb96 hex0.M1: Fix position of GUID_8 labels. 2022-07-23 21:26:24 +01:00
Andrius Štikonas fe381538f9 Fix copy-paste typo in POP_RAX define. 2022-07-23 20:29:41 +01:00
Andrius Štikonas a8e0dd50a2 Make sure we use 64-bit pointers for stack address. 2022-07-23 20:14:45 +01:00
Andrius Štikonas 3317e845f5 Add hex0.M1. 2022-07-23 18:41:30 +01:00
Andrius Štikonas 93c8c5372c Swap rax and rbx to optimize machine code a bit. 2022-07-23 15:15:40 +01:00
Andrius Štikonas 7f27324a5b Port hex0.S optimizations from stage0-posix. 2022-07-20 22:48:41 +01:00
Andrius Štikonas 85e3b0caef Actually sub esp, 32 is only 3 bytes long, so undo some of the pop rax changes. 2022-07-17 13:53:31 +01:00
Andrius Štikonas bfb164eb68 hex0.S: save another byte when accessing stack contents. 2022-07-17 13:23:18 +01:00
Andrius Štikonas d96dc0e322 hex0.S: optimize setting some immediate values. 2022-07-17 13:13:36 +01:00
Andrius Štikonas e7bd0b67ab hex0.S: Use push rax to allocate stack space instead of sub rsp, 32.
Easier to encode to hex0 and also more efficient for smaller allocations
such as sub rsp, 16.
2022-07-17 12:50:29 +01:00
Andrius Štikonas 1d3ea9e5c0 hex0.S: use r14 to store system->boot->open_protocol rather than system->boot.
Also reuse r14 for rootdir and free up rsi for further optimizations.
2022-07-17 12:30:29 +01:00
Andrius Štikonas f5bae9d646 hex0.S: more stack optimizations.
Pass function arguments with push opcodes which are shorter
than using e.g. "mov qword ptr [rsp+40], 1"
2022-07-17 12:25:27 +01:00
Andrius Štikonas 555caea6c7 hex0.S: move global variables to stack. 2022-07-17 01:48:55 +01:00
Andrius Štikonas 71bca6e471 hex0.S: backport some optimizations from stage0-posix-amd64. 2022-07-16 20:09:53 +01:00
Andrius Štikonas be031a577c Update hex0_AMD64_POSIX.hex0 2022-07-16 18:53:32 +01:00
Andrius Štikonas 4afbfc56cc hex0.S: optimize read/write_byte functions. 2022-07-16 01:06:47 +01:00
Andrius Štikonas 3e95bb7d48 hex0.S: use ret rather than calling system->boot->exit() 2022-07-15 23:09:35 +01:00
Andrius Štikonas 9895b0da06 hex0.S: initial working version, still needs some optimizations. 2022-07-15 22:37:45 +01:00
Andrius Štikonas 159d30e184 hex0.S: open source file for reading. 2022-07-15 00:43:57 +01:00
Andrius Štikonas 34060fc7e5 hex0.S: open target file for writing. 2022-07-14 22:55:42 +01:00
Andrius Štikonas 8a344b7275 hex0.S: add argument parsing and open root device. 2022-07-13 22:47:20 +01:00
Andrius Štikonas 1dc9b13294 Fix a typo in Makefile. 2022-07-12 19:02:57 +01:00
Andrius Štikonas 392d88a183 kaem-minimal: disable uefi watchdog timer. 2022-07-11 22:44:15 +01:00
Andrius Štikonas c5eecd49d5 Add QEMU_KVM variable to let users turn kvm off. 2022-07-11 21:49:05 +01:00
Andrius Štikonas cd51250599 Search for OVMF_IMG in multiple files. 2022-07-11 21:29:10 +01:00
Andrius Štikonas d0e6bdb758 hex0.S: implement open_protocol function. 2022-07-11 01:27:00 +01:00
Andrius Štikonas 9cb1d5b7f0 hex0.S: print hello world as a test. 2022-07-10 22:11:32 +01:00
Andrius Štikonas 081a890e05 Add a skeleton file for eventual assembly port of hex0. 2022-07-10 16:24:23 +01:00
Andrius Štikonas 571ea5e8f0 kaem-minimal: also set load_option_size field. 2022-07-09 00:24:42 +01:00
Andrius Štikonas 6f90a6cd2e Add prototype for kaem-minimal. 2022-07-09 00:09:55 +01:00
Andrius Štikonas c5889ecef0 Add high level prototype for hex0. 2022-07-06 17:53:13 +01:00
Andrius Štikonas 7345e3a962 Initial commit. 2022-07-05 01:36:23 +01:00