Lab Exercise 1: Boot Loader
Lab Exercise 1: Boot Loader
Lab Exercise 1: Boot Loader
Objective
• To learn how an operating system is loaded in
the main memory
• A boot sector must contain “0x55” as its 510th byte and “0xaa”
as its 511th byte
Step 3:
Convert the bootable binary to bootable image using “dd” command
dd if=boot.bin bs=512 of=outputboot.img
Step 4:
Use the bootable image to start a new vm to check your bootloader
Sample Code
[BITS 16] ;tell the assembler that its a 16 bit code
[ORG 0x7C00] ;Origin, tell the assembler that where
the code will be in memory after it is
been loaded
JMP $ ;infinite loop
TIMES 510 - ($ - $$) db 0 ;fill the rest of sector with 0
DW 0xAA55 ; add boot signature at the end
of bootloader
Example 2 :Print a Character BootLoader