-
Notifications
You must be signed in to change notification settings - Fork 19
Generating executable files from scratch
Cameron Swinoga edited this page Jun 9, 2017
·
18 revisions
The first step in getting the operating system to execute arbitrary assembly is to figure out what types of executable files your operating system supports. Since I would be developing my compiler on Linux, the suitable Executable and Linkable Format (ELF) was chosen. There is a veritable wealth of information on the composition of ELF files, however since the ELF standard is very large and overarching it is not a simple matter to be able to pick and choose what is needed to get a bare minimum example working. As such, I am writing this as a compendium of all the research and piecing together that I did to be able to write YABFC.
- http://www.skyfree.org/linux/references/ELF_Format.pdf - ELF file format specification
- https://github.com/corkami/pics/blob/master/binary/elf101/elf101-64.pdf - Visualization of how an ELF file goes together
-
http://nullprogram.com/blog/2016/11/17/ - "A Magnetized Needle and a Steady Hand", making an ELF file with
echo
commands - https://defuse.ca/online-x86-assembler.htm - x86 intel-style instruction assembler