<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Thomas Miletich</b> <span dir="ltr"><<a href="mailto:thomas.miletich@gmail.com">thomas.miletich@gmail.com</a>></span><br>
Date: Tue, Feb 18, 2014 at 2:16 PM<br>Subject: Re: [ipxe-devel] ipxe image for hard drive booting - ipxe.hd ?<br>To: Håkan Johansson <<a href="mailto:f96hajo@chalmers.se">f96hajo@chalmers.se</a>><br><br><br><p dir="ltr">
If I'm not mistaken ipxe.hd is for hard disk partitions. ipxe.usb contains a partition table and a partition containing ipxe.hd. ipxe.usb is the image file you'll want to use for a whole hard disk(or usb drive).</p>
<p dir="ltr">Thomas</p>
<p dir="ltr"></p><div><div class="h5">On Feb 17, 2014 7:21 PM, "Håkan Johansson" <<a href="mailto:f96hajo@chalmers.se" target="_blank">f96hajo@chalmers.se</a>> wrote:<br>
><br>
><br>
> Hi,<br>
><br>
> I want to be able to put a small ipxe image on a hard drive in a machine to load ipxe, without having to install a bootloader. (Or using a USB stick, as many bioses delete such boot entries if the machine by accident is booted without the stick inserted.) (Basically just 'dd if=ipxe.hd of=/dev/sdX'.) Is ipxe.hd intended for that? Or some other suggested way? Searching the documentation did not come up with a solution.<br>
><br>
> However, ipxe.hd does not work as is, as there is no active partition (marked 0x80). Perhaps this is why it is not built as default?<br>
> ('make bin/ipxe.hd' fixed that.)<br>
><br>
> Below are two ways that made it work for me (on a Dell Optiplex 620 and Dell Dimension 9150 (the first method only tested on the optiplex)).<br>
><br>
> 1)<br>
><br>
> dd if=ipxe.hd of=/dev/sdX<br>
> fdisk /dev/sdX # create a normal partition, starting at<br>
> # sector 2048 and mark it active<br>
> dd if=ipxe.hd of=/dev/sdX1<br>
><br>
> Machine boots and loads IPXE.<br>
><br>
> Here, ipxe.hd is actually placed twice on the harddrive.<br>
><br>
> 2)<br>
><br>
> In the second solution, the MBR (src/arch/i386/prefix/hdprefix.S) partition table is changed so that the first 'partition' includes the ipxe.hd (the MBR itself). The ipxe.hd boot-loader code then sort of finds itself and loads.<br>
><br>
> As far as I understood the loader code, the partition size (end) is not used, so can be some arbitrary dummy value. I guess also zeros, but not tested. Probably makes sense to have some non-zero value to help avoid partitioning tools from using the first part of the disk (ipxe.hd), if one wants to use the hard-drive for other partitions too.<br>
><br>
> Something to include into ipxe?<br>
><br>
> diff --git a/src/arch/i386/prefix/hdprefix.S b/src/arch/i386/prefix/hdprefix.S<br>
> index 876bfe1..5a5a6f1 100644<br>
> --- a/src/arch/i386/prefix/hdprefix.S<br>
> +++ b/src/arch/i386/prefix/hdprefix.S<br>
> @@ -82,6 +82,14 @@ load_failed:<br>
> jmp boot_error<br>
> 10: .asciz "Could not load iPXE\r\n"<br>
><br>
> + .org 446<br>
> + .byte 0x80 /* Active */<br>
> + .byte 0x00, 0x01, 0x00 /* head, sector, cylinder */<br>
> + .byte 0x83 /* Linux :-) */<br>
> + .byte 0x10, 0x10, 0x00 /* dummy end: head, sector, cylinder */<br>
> + .byte 0x00, 0x00, 0x00, 0x00 /* first sector */<br>
> + .byte 0x00, 0x04, 0x00, 0x00 /* number of sectors: 1024 */<br>
> +<br>
> .org 510<br>
> .byte 0x55, 0xaa<br>
><br>
> Best regards,<br>
> Håkan<br></div></div>
> _______________________________________________<br>
> ipxe-devel mailing list<br>
> <a href="mailto:ipxe-devel@lists.ipxe.org" target="_blank">ipxe-devel@lists.ipxe.org</a><br>
> <a href="https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel" target="_blank">https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel</a><br>
><br>
<p></p>
</div><br></div>