* better
[mascara-docs.git] / amd64 / bareMetalOS-0.5.2 / pure64.boot0 / bootsector / pxestart.asm
blobeef160a49cdd9ae9b4af0379e7bd5799c2095c40
1 ; =============================================================================
2 ; Pure64 PXE Start -- a 64-bit OS loader written in Assembly for x86-64 systems
3 ; Copyright (C) 2008-2011 Return Infinity -- see LICENSE.TXT
5 ; This is a stub file for chainloading Pure64 and a Kernel via PXE.
7 ; You will need to uncomment the Chainloading lines in pure64.asm
9 ; Windows - copy /b pxestart.bin + pure64.sys + kernel64.sys pxeboot.bin
10 ; Unix - cat pxestart.bin pure64.sys kernel64.sys > pxeboot.bin
12 ; Max size of the resulting pxeboot.bin is 32768 bytes. PXE loads the file to
13 ; address 0x00007C00 (Just like a boot sector).
15 ; File Sizes
16 ; pxestart.bin 1024 bytes
17 ; pure64.sys 6144 bytes
18 ; kernel64.sys 16384 bytes (or so)
19 ; =============================================================================
22 USE16
23 org 0x7C00
25 start:
26 xor eax, eax
27 xor esi, esi
28 xor edi, edi
29 mov ds, ax
30 mov es, ax
31 mov bp, 0x7c00
33 ; Make sure the screen is set to 80x25 color text mode
34 mov ax, 0x0003 ; Set to normal (80x25 text) video mode
35 int 0x10
37 ; Print message
38 mov si, msg_Load
39 call print_string_16
41 jmp 0x0000:0x8000
43 ;------------------------------------------------------------------------------
44 ; 16-bit Function to print a sting to the screen
45 ; input: SI - Address of start of string
46 print_string_16: ; Output string in SI to screen
47 pusha
48 mov ah, 0x0E ; int 0x10 teletype function
49 .repeat:
50 lodsb ; Get char from string
51 cmp al, 0
52 je .done ; If char is zero, end of string
53 int 0x10 ; Otherwise, print it
54 jmp short .repeat
55 .done:
56 popa
57 ret
58 ;------------------------------------------------------------------------------
61 msg_Load db "Loading via PXE... ", 0
63 times 510-$+$$ db 0 ; Pad out for a normal boot sector
65 sign dw 0xAA55
67 times 1024-$+$$ db 0 ; Padding so that Pure64 will be aligned at 0x8000