david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/arch/armnommu/core/raw_loader.c

49 lines
1.1 KiB
C

/*
* Copyright (C) 2004 Tobias Lorenz
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifdef RAW_IMAGE
static unsigned long raw_load_addr;
int mach_boot(register unsigned long entry_point)
{
void (*fnc)(void) = (void *) entry_point;
// r0 = 0
// r1 = 625 (machine nr. MACH_TYPE_P2001)
(*fnc)();
return 0; /* We should never reach this point ! */
}
static sector_t raw_download(unsigned char *data, unsigned int len, int eof)
{
memcpy(phys_to_virt(raw_load_addr), data, len);
raw_load_addr += len;
if (!eof)
return 0;
done(1);
printf("Starting program.\n");
mach_boot(RAWADDR);
printf("Bootsector returned?");
longjmp(restart_etherboot, -2);
return 1;
}
static os_download_t raw_probe(unsigned char *data __unused, unsigned int len __unused)
{
printf("(RAW");
// probe something here...
printf(")... \n");
//raw_load_addr = phys_to_virt(_end);
raw_load_addr = RAWADDR;
printf("Writing image to 0x%x\n", raw_load_addr);
return raw_download;
}
#endif