mirror of https://github.com/ipxe/ipxe.git
Windows RIS now gets as far as downloading NTLDR.
parent
6f14c9d169
commit
40d6d3dcf4
|
@ -28,6 +28,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gpxe/uaccess.h>
|
#include <gpxe/uaccess.h>
|
||||||
#include <gpxe/dhcp.h>
|
#include <gpxe/dhcp.h>
|
||||||
|
#include <dhcp_basemem.h>
|
||||||
#include "pxe.h"
|
#include "pxe.h"
|
||||||
#include "pxe_callbacks.h"
|
#include "pxe_callbacks.h"
|
||||||
|
|
||||||
|
@ -85,11 +86,13 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
|
||||||
* sources of options.
|
* sources of options.
|
||||||
*/
|
*/
|
||||||
if ( get_cached_info->BufferLimit == 0 ) {
|
if ( get_cached_info->BufferLimit == 0 ) {
|
||||||
DBG ( " without an external buffer. Aargh." );
|
get_cached_info->Buffer.segment = rm_ds;
|
||||||
goto err;
|
get_cached_info->Buffer.offset =
|
||||||
|
( unsigned int ) ( & __from_data16 ( dhcp_basemem ) );
|
||||||
|
get_cached_info->BufferLimit = sizeof ( dhcp_basemem );
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG ( " to %04x:%04x+%x\n", get_cached_info->Buffer.segment,
|
DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment,
|
||||||
get_cached_info->Buffer.offset, get_cached_info->BufferLimit );
|
get_cached_info->Buffer.offset, get_cached_info->BufferLimit );
|
||||||
|
|
||||||
/* Allocate space for temporary copy */
|
/* Allocate space for temporary copy */
|
||||||
|
@ -121,6 +124,7 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
|
||||||
/* Copy packet to client buffer */
|
/* Copy packet to client buffer */
|
||||||
buffer = real_to_user ( get_cached_info->Buffer.segment,
|
buffer = real_to_user ( get_cached_info->Buffer.segment,
|
||||||
get_cached_info->Buffer.offset );
|
get_cached_info->Buffer.offset );
|
||||||
|
len = dhcppkt.len;
|
||||||
copy_to_user ( buffer, 0, data, len );
|
copy_to_user ( buffer, 0, data, len );
|
||||||
get_cached_info->BufferSize = len;
|
get_cached_info->BufferSize = len;
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,10 @@ static unsigned int pxe_single_blkidx;
|
||||||
* @v port Server port (in network byte order)
|
* @v port Server port (in network byte order)
|
||||||
* @v filename File name
|
* @v filename File name
|
||||||
* @v blksize Requested block size, or 0
|
* @v blksize Requested block size, or 0
|
||||||
|
*
|
||||||
|
* The URI string buffer must be at least @c PXE_URI_LEN bytes long.
|
||||||
*/
|
*/
|
||||||
static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN],
|
static void pxe_tftp_build_uri ( char *uri_string,
|
||||||
uint32_t ipaddress, unsigned int port,
|
uint32_t ipaddress, unsigned int port,
|
||||||
const unsigned char *filename,
|
const unsigned char *filename,
|
||||||
int blksize ) {
|
int blksize ) {
|
||||||
|
@ -73,7 +75,7 @@ static void pxe_tftp_build_uri ( char uri_string[PXE_URI_LEN],
|
||||||
blksize = TFTP_MAX_BLKSIZE;
|
blksize = TFTP_MAX_BLKSIZE;
|
||||||
tftp_set_request_blksize ( blksize );
|
tftp_set_request_blksize ( blksize );
|
||||||
|
|
||||||
snprintf ( uri_string, sizeof ( uri_string ), "tftp://%s:%d%s%s",
|
snprintf ( uri_string, PXE_URI_LEN, "tftp://%s:%d%s%s",
|
||||||
inet_ntoa ( address ), ntohs ( port ),
|
inet_ntoa ( address ), ntohs ( port ),
|
||||||
( ( filename[0] == '/' ) ? "" : "/" ), filename );
|
( ( filename[0] == '/' ) ? "" : "/" ), filename );
|
||||||
}
|
}
|
||||||
|
@ -372,6 +374,9 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
|
||||||
tftp_read_file->FileName, 0 );
|
tftp_read_file->FileName, 0 );
|
||||||
DBG ( " %s", uri_string );
|
DBG ( " %s", uri_string );
|
||||||
|
|
||||||
|
DBG ( " to %08lx+%lx", tftp_read_file->Buffer,
|
||||||
|
tftp_read_file->BufferSize );
|
||||||
|
|
||||||
/* Open URI */
|
/* Open URI */
|
||||||
fd = open ( uri_string );
|
fd = open ( uri_string );
|
||||||
if ( fd < 0 ) {
|
if ( fd < 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue