CustomBootloader/boot.s

19 lines
642 B
ArmAsm
Raw Normal View History

2022-02-23 21:56:12 +00:00
.code16 # tell the assembler that we're using 16 bit mode
.global init # makes our label "init" available to the outside
init: # this is the beginning of our binary later.
2022-02-24 21:16:57 +00:00
#jmp init # jump to "init"
#ljmpw $0xFFFF, $0 # jumps to the "reset vector", doing a reboot
jmp printhelloworld
printhelloworld:
mov $0xe37, %ax
int $0x10 # video bios interrupt
mov $0xe38, %ax
int $0x10 # video bios interrupt
2022-02-23 21:56:12 +00:00
.fill 510-(.-init), 1, 0 # add zeroes to make it 510 bytes long
# . is current position - start position
.word 0xaa55 # magic bytes that tell BIOS that this is bootable
# x86 is little endian - so bytes are swapped in memory!