From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Charles Perkins Message-ID: References: <8af692a6aa5a1270aab459dd5945364d@plan9.bell-labs.com> Subject: Re: [9fans] non-BIOS boot Date: Fri, 31 May 2002 08:57:02 +0000 Topicbox-Message-UUID: a2fd8b92-eaca-11e9-9e20-41e7f4b1d025 Regarding the limitations of the PC boot process... "David Gordon Hogan" wrote in message news:8af692a6aa5a1270aab459dd5945364d@plan9.bell-labs.com... > > If you dont use the BIOS wouldn't you have to access > > the disk via i/o ports? If so, you would have to adhere to > > the SCSI/ATA standard rather than a more conformed interface > > via int13? If you did have to adhere to the different standards > > wouldnt that mean implementing the drivers in the MBR/PBS? > > I think _I'm_ the one missing something :) Can you fill me > > Good luck fitting that code into the 512 bytes you have to play > with in the MBR. > > The BIOS int13 call gives you enough to get the OS into memory, > then you can run a _real_ driver, tailored to the OS, and not to > the pre-Cambrian qualities of the BIOS. > You'd be suprised what a sufficently motivated person can do with 512 bytes. I know for a fact that you can go all the way to protected mode and (limited) paging using just the master boot record of an IDE hard drive, because I've done it. Now that boot sector doesn't do anything other than remap interrupts, enable A20, set up page tables, switch to protected mode and set up a polling LBA page-in routine for the rest of memory... but hey, after you've got that you can just let the rest of your kernel page itself in in a lesiurely manner with no second stage boot loader or file system grokker required. I wrote the boot pager in an attempt to make an OS that has no file system--just persistent virtual memory. All the boot loaders out there pretty much expect to have a file system of one sort or another to load a kernel image from, and using one of those would have made moot the whole point of the exercise. I've since changed my mind about the evils of structure in secondary storage but the boot pager remains and it's (imo) a pretty neat way to get your kernel running. Anybody who cares to look at it can click on oiuboot.asm at www.memetech.com and/or download a bochs/VMWare booting disk image of it (oiuboot.zip.) Now I am not claiming that stuffing all this into 512 bytes is a good idea, mind you. Merely that it is possible. Chuck Perkins