We are developing an operating system for my personal research
and practical education.
For the academic purpose, this motivation is similar to MINIX,
but we do not focus on theories.
Our main objective is to provide knowledges on hardware-related
programming. This is one of the most difficult and complex parts
when we start the development of operating system from scratch.
We then implement a program loaded and jumped
from the initial program loaded from MBR to 0x7c00.
In this checkpoint, the initial program loader loads
another program (src/boot/arch/x86_64/bootmon.s) stored
in the second sector of the image (aos.img) to 0x9000
using int 13h BIOS call.
It then jumps to that address using far jump call
to execute the program that displays a welcome message.
In this step, we place the initial program loader and the other program (bootmon.s)
are placed at the first and second secotrs in the primary disk, respectively, as follows.
Start End Description
0000 01fd Initial program loader
01fe 01ff Magic (55AA)
0200 03ff The other program (bootmon.s)
The following is the assembly code to load another program
in the second sector and jump to the program.
The following is the almost similar to src/boot/arch/x86_64/diskboot.s
in the checkpoint 0.
The stack is already prepared in the diskboot.s, so this code is
much simpler than that.
In order to compile bootmon.s and write the assembled binary
to the second sector of the disk image, Makefiles become as follows.