Jump to content

My compilation techniques

Recommended Posts

You should know that when an executable file is run, the operating system allocates a process to run the file, and the number of processes in parallel is determined by the number of CPU cores. The running event of an executable file will be accepted by the operating system and processes will be established, each process will occupy part of the CPU resources, and the CPU can also initiate I/O requests to the operating system, and then the operating system will mobilize the corresponding driver again, the driver mobilize the hardware, the hardware return information, and then pass back to the CPU step by step. We can theoretically put the operating system and CPU and I/O devices together in a hardware description language file, and then according to this file and another hardware description language file input to generate executable files that can run on this operating system and CPU. However, learning from the previous lesson, I/O devices are not stored in files, only the hardware description part and CPU calculation circuit diagram of the operating system at the beginning of the trigger file are stored, and the virtual memory circuit, I/O devices and the operating system kernel part are not written in files. This approach was chosen not only for its cross-platform nature, but also for its ease of simplification and unitization. We can set the circuit diagram as only OR gate and NOT gate. After my research, it is found that only these two gates can replace all logic operations, and provide interrupt port and virtual memory access port, so that the executable file with good portability can be generated by representing part of the operating system and CPU circuit diagram and input file. More importantly, this unitized design also makes the input files easy to simplify because of only OR and NOT gates and some interfaces. Because it is based on hardware, it may also be used in the field of FPGA in the future. My approach to compilation is to take a simplified part of the operating system and CPU circuit diagram and a preliminary speed and memory simplified input file and summarize it into a series of assembly instructions and initialization data in a minimalist compilation method, and finally into a very performant executable file.

  • Like 7
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
  • Create New...