30 days self-made operating system second day, 30 days self-made second day
The next day, the author mainly explained and optimized the helloworld system source file compiled by the sink.
In the previous section, commands such as db dw dd resb were used.
The new commands in this section:
ORG loads the program to the address specified in the memory.
JMP jump
MOV assignment
ADD Addition
CMP comparison
JE condition jump
INT Software Terminal command, word: interrupt
Hlt cpu standby
Introduction to CPU registers
16-bit registers:
AX
CX
DX
BX
SP
BP
SI
DI
8-bit registers:
AL
CL
DL
BL
AH
CH
DH
BH
32-bit registers:
EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI
16-bit register:
ES, CS, SS, DS, FS, GS
0x00007c00-0x00007dff: Fill address of the content in the startup zone, as agreed by the hardware vendor
Finally, the author used batch files and Makefile files to simplify the development process.
The assembler and make tools nask are used.
Make is a command tool that explains the commands in Makefile (rules should be said ). The Makefile file describes the compilation sequence and rules of all files in the project. Makefile has its own writing format, keywords, and functions. Just as C has its own format, keywords, and functions. In Makefile, you can use any command provided by the system shell to complete the desired work. Makefile (may be another file name on other systems) is used in most IDE development environments and has become a compilation method for projects.