aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2007-01-12 10:12:11 +0000
committerMichael Brown <mcb30@etherboot.org>2007-01-12 10:12:11 +0000
commit112d7f9d79a6f81822b683bc94807ac638364fb3 (patch)
tree99e6b415fe580716f8bd67a5006b8bd6cc89eb3a /src/tests
parent49fc8dcdc3f16d77ec0900af9245f57a56f7652a (diff)
downloadipxe-112d7f9d79a6f81822b683bc94807ac638364fb3.zip
ipxe-112d7f9d79a6f81822b683bc94807ac638364fb3.tar.gz
ipxe-112d7f9d79a6f81822b683bc94807ac638364fb3.tar.bz2
Code used for load buffer and multiboot image testing
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/tftptest.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/tests/tftptest.c b/src/tests/tftptest.c
index 7bdec78..5ddb262 100644
--- a/src/tests/tftptest.c
+++ b/src/tests/tftptest.c
@@ -19,10 +19,14 @@ int test_tftp ( struct net_device *netdev, struct sockaddr_tcpip *target,
uint16_t fbms;
int rc;
+
+ ebuffer_alloc ( &buffer, 0 );
+#if 0
memset ( &buffer, 0, sizeof ( buffer ) );
buffer.addr = real_to_user ( 0, 0x7c00 );
get_real ( fbms, BDA_SEG, BDA_FBMS );
buffer.len = ( fbms * 1024 - 0x7c00 );
+#endif
memset ( &tftp, 0, sizeof ( tftp ) );
udp_connect ( &tftp.udp, target );
@@ -33,11 +37,15 @@ int test_tftp ( struct net_device *netdev, struct sockaddr_tcpip *target,
if ( ( rc = async_wait ( tftp_get ( &tftp ) ) ) != 0 )
return rc;
+ memset ( &image, 0, sizeof ( image ) );
image.data = buffer.addr;
image.len = buffer.len;
- if ( ( rc = elf_load ( &image ) ) == 0 ) {
- printf ( "Got valid ELF image: execaddr at %lx\n",
+ if ( ( rc = multiboot_load ( &image ) ) == 0 ) {
+ printf ( "Got valid multiboot image: execaddr at %lx\n",
image.entry );
+
+ image_exec ( &image );
+
return 0;
}