From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Bellard Subject: Re: Bootability Date: Tue, 04 Jun 2002 08:57:06 +0000 Sender: linux-8086-owner@vger.kernel.org Message-ID: <3CFC80E2.4081D82B@ascend.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" To: Riley Williams Cc: Neil Holmes , Michael McConnell , Linux 8086 Bootkit bootloader can install MBR, Minix bootblocks and is 8086 clean. MS-DOS, ELKS and Linux/i386 version are available with CHS, LBA or IDE disk driver. At boot time you can choose the partition (including extended partition) and the hard drive to boot with ALT hot key. Neil Holmes is working on it. # ./bootkit -i stdmbr -b /tmp/oldmbr -pascal Riley Williams wrote: > > Hi Michael. > > > An issue I've found is, if a hard disc (or HD image for emulator > > users) is completely blank, even when partitioned it will not boot - > > it seems like it needs an MBR to be placed on the first 256 bytes of > > /dev/bda. > > I hope you mean the first 512 bytes (one sector) rather than the half > sector you mention above. > > For reference, the format of the first sector of a PC disk is as > follows: > > Offsets Description > ~~~~~~~ ~~~~~~~~~~~ > 0000-01BC Boot program > 01BD Checksum of boot program > 01BE-01FD Partition table > 01FE Hex 0x55 > 01FF Hex 0xAA > > That 0x55/0xAA in the last two sectors is the "Boot Signature" and > indicates that the disk has been formatted. Both the ELKS and Linux > fdisk programs handle the partition table and boot signatures correctly, > but neither supplies a boot program of any sort, and it's for this > reason that it is necessary to use MS-DOS's fdisk program to initialise > the boot program and checksum before putting ELKS on board. > > > Are there any plans to implement a mechanism of writing an MBR (such > > as LILO's bootloader or DOS's fdisk /mbr) ? > > That I can't advise on...would you like to have a go at writing the > specifications for such a program? Here's the obvious ones: > > 1. The entire program must fit in the 445 bytes available. > > 2. The program must be fully relocatable, in that all data references > must be relative to CS:IP as that's the only sure address. > > 3. The program must be able to boot ANY partition irrespective of > operating system by loading it at 0x7C0:0 and then jumpint to > 0x7C0:0 to run it. That's where boot sectors expect to be when > control is handed to them, according to the comments in the > Linux kernel's boot sector.