Long story short, this bootloader demonstrates how to load OS kernel written in Pascal!!

However, I have tested it on Linux x64 only, maybe someone can reproduce the steps below in Windows.
This is how I build it:

1. nasm -f bin ./boot.asm -o ./boot.bin 
2. nasm -f elf32 -g ./kernel.asm -o ./kernel.asm.o
3. fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Pi386 -Rintel -Tlinux system.pas
4. fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Pi386 -Rintel -Tlinux console.pas
5. fpc -Aelf -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -Pi386 -Rintel -Tlinux kernel.pas
6. i686-linux-gnu-ld --gc-sections -s -Tlinker.script ./kernel.asm.o ./kernel.o ./system.o ./console.o  -o ./kernel.bin

This is how I run it on emulator:

1. rm -rf ./osfp.bin
2. dd if=./boot.bin >> ./osfp.bin
3. dd if=./kernel.bin >> ./osfp.bin
4. qemu-system-i386 osfp.bin

If successful, you will see the following text on a blank screen:
        
"Freepascal barebone OS booted!
Welcome to Free Pascal community."



References:
https://www.pascalgamedevelopment.com/showthread.php?5608-Has-this-been-done-before-Pascal-OS

https://code.google.com/archive/p/fpos/ (void)

https://wiki.osdev.org/Pascal_Bare_Bones
