2019-03-13 21:11:19 +01:00
|
|
|
; assumptions about the starting envionment
|
2019-03-10 20:23:09 +01:00
|
|
|
cpu 8086
|
2019-03-23 21:17:47 +01:00
|
|
|
org 0x0000
|
2019-03-23 21:37:18 +01:00
|
|
|
; es:bx pxeenv+ structure
|
2019-03-13 21:11:19 +01:00
|
|
|
; ss:sp functional stack
|
2019-03-10 20:23:09 +01:00
|
|
|
|
2019-03-13 21:11:19 +01:00
|
|
|
; during PXE, CS=0000 and IP=7C00
|
2019-03-23 21:37:18 +01:00
|
|
|
_startup:
|
|
|
|
xor ax, ax
|
2019-03-23 21:54:08 +01:00
|
|
|
|
|
|
|
push cx ; byte counter
|
|
|
|
push si ; source offset
|
|
|
|
push di ; destination offset
|
|
|
|
push es ; destination segment
|
|
|
|
|
2019-03-23 21:37:18 +01:00
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
|
|
|
|
mov si, 0x7C00
|
|
|
|
mov di, 0x0500
|
|
|
|
mov cx, (_reloc_end)
|
|
|
|
rep movsb
|
2019-03-10 20:23:09 +01:00
|
|
|
|
2019-03-23 21:54:08 +01:00
|
|
|
pop es
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop cx
|
|
|
|
|
|
|
|
jmp 0x0050:main
|
2019-03-13 18:28:38 +01:00
|
|
|
|
2019-03-23 21:23:17 +01:00
|
|
|
%include "kernel/main.asm"
|
2019-03-23 21:37:18 +01:00
|
|
|
|
|
|
|
_reloc_end:
|