; assumptions about the starting envionment cpu 8086 org 0x0000 ; es:bx pxeenv+ structure ; ss:sp functional stack ; during PXE, CS=0000 and IP=7C00 _startup: xor ax, ax push cx ; byte counter push si ; source offset push di ; destination offset push es ; destination segment mov ds, ax mov es, ax mov si, 0x7C00 mov di, 0x0500 mov cx, (_reloc_end) rep movsb pop es pop di pop si pop cx jmp 0x0050:main %include "kernel/main.asm" _reloc_end: