xref: /haiku/src/system/boot/platform/pxe_ia32/pxe_undi.cpp (revision 57a88e1c7901098bae49139b4f1ffe76f807ac16)
1 /*
2  * Copyright 2006, Marcus Overhagen <marcus@overhagen.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include <OS.h>
7 #include <KernelExport.h>
8 #include <string.h>
9 
10 #include "pxe_undi.h"
11 
12 #define TRACE_UNDI
13 #ifdef TRACE_UNDI
14 #	define TRACE(x...) dprintf(x)
15 #else
16 #	define TRACE(x...)
17 #endif
18 
19 
20 PXE_STRUCT *
pxe_undi_find_data()21 pxe_undi_find_data()
22 {
23 	PXE_STRUCT *data = NULL;
24 	for (char *addr = (char *)0x8D000; addr < (char *)0xA0000; addr += 16) {
25 		if (*(uint32 *)addr == 'EXP!' /* '!PXE' */) {
26 			TRACE("found !PXE at %p\n", addr);
27 			data = (PXE_STRUCT *)addr;
28 			break;
29 		}
30 	}
31 	return data;
32 }
33