# My First OS # Building Boot Floppy # 1. Compile file # gcc -c myos.s # 2. Link and Locate the file # ld -Ttext 0x0 -s --oformat binary myos.o -o myos # 3 Copying myos into boot sector of floppy # dd if=myos of=/dev/fd0 # Size of myos is 512 bytes .code16 .text .global _start _start: #Initialize ds movw $0x7c0, %ax movw %ax, %ds # %ds = 0x7c0 #Initialize es movw $0xB800,%ax movw %ax, %es # Initilized es to 0xb800 display base address #displaying msg1 movw $(end_msg1-msg1), %cx # length of string msg1 movw $msg1, %si # offset of msg1 from 0x7c0 base movw $160*11+5*2,%di # offset of destination from 0xb800 1: movb (%si),%al # Move the contents pointed by si in al movb %al,%es:(%di) # Move the al contents at address referenced by di incw %si # increment si incw %di # increment di movb $0x42,%es:(%di) # set background and forground color incw %di # increment di decw %cx # loop jnz 1b #displaying msg2 movw $(end_msg2-msg2), %cx # length of string msg1 movw $msg2, %si # offset of msg1 from 0x7c0 base movw $160*12+5*2,%di # offset of destination from 0xb800 1: movb (%si),%al # Move the contents pointed by si in al movb %al,%es:(%di) # Move the al contents at address referenced by di incw %si # increment si incw %di # increment di movb $0x42,%es:(%di) # set background and forground color incw %di # increment di decw %cx # loop jnz 1b #halting the machine hlt msg1: .ascii " ************ MYOS by Madhuri ************* " end_msg1: msg2: .ascii " ***** Remove floppy and Reboot the machine ********** " end_msg2: .org 510 boot_flag: .word 0xAA55