Page 1 of 1
Booting of flash drives
Posted: Tue Jun 03, 2008 10:21 am
by Coldberg
Does anyone have any resources on booting from the flash drive (besides the usb mass storage specs), i'd like to see an overview of what i'd have to code for it to work (considering my bootoptions since floppies seem to have started disapearing fromt he face of the earth)
Posted: Tue Jun 03, 2008 1:48 pm
by indiocolifa
Format your USB drive using mtools, make it bootable transferring your boot sector with mformat. It should work if your BIOS supports booting from USB.
For Windows systems, see
http://www.bootdisk.com/pendrive.htm for tips.
I hope that helps...
Posted: Tue Jun 03, 2008 1:53 pm
by indiocolifa
Posted: Fri Jun 06, 2008 12:41 pm
by Coldberg
but as i see it , it works based on emulation , and isn't that bios only ?
if i need to load more files of that usb not actually using the bios ?
Posted: Fri Jun 06, 2008 1:25 pm
by CmpXchg
Well, yes, BIOS will boot your bootsector, and probably your second-stage loader too, and most likely the kernel too.
To load further files without using BIOS you'll need to implement:
-) a USB low-level access driver which actually accesses the USB bus;
-) a USB mass storage device driver which interacts with your flash drive (using the access driver to communicate over USB)
-) Generic FAT16/32 filesystem driver which will rely on the mass storage device driver to read/write sectors.
Challenging, eh?
Posted: Sat Jun 07, 2008 8:05 am
by Coldberg
a bit XD
what about CD-ROM booting ?
i know CD-ROM's come in different types ATAPI (that is standartised i gues so no problem in coding a driver for that) what about SCSI tho ? is that standartised or is it like different for each drive ?
Posted: Sat Jun 07, 2008 9:57 am
by CmpXchg
SCSI is unfortunately not standardized, so we hoobyists can't make drivers for it. Well, if you manage to download a specification, you can try coding some driver, but it won't work on every computer.
So it's best to implement ATAPI instead. Then goes the tedious CD-ROM UDF filesystem...
A good OS should be able to start at least from FAT32 hard drives and from CD-ROMs, in my opinion.
Cheers,
CmpXchg
Posted: Sat Jun 07, 2008 10:53 am
by Masterkiller
I think I'm gonna use USB flash for booting. In the CMOS setup in the boot priority There is option USB-zip and two more USB (I don't remember them now).
When booting from CD-ROM, immediately after the boot AL contains the BIOS number of the device to pass to INT13/AH=03;AH=43; to read. Does booting from USB flash is the same? The virtual PC and bochs does not support USB boot, so could it be possible the same loader code work for USB and CD-ROM (getting BIOS number, using EXTENTED READ INT13/AH=43; Load fixed location of kernet code/data...);
Since I still work on the kernel, I need read/write access anywhere, and due to some problems I prefer this not to be HDD (I don't want to lose the information
);
Posted: Sat Jun 07, 2008 2:34 pm
by Dex
If you want to write a Pmode driver, i would say the easiest to code is the
Hdd, then fdd and cd, which are about the same and the hardest would be the USB.
Anything that users fdd/hdd emulation unless you switch it off (send the right code), stops working in Pmode, BUT and that a big but, when you go back to realmode, emulation works as you left it, this means you can Read/write to a USB key fob or read from the floppy image on a CD, by going to and from real mode at any time.
Posted: Sat Jun 07, 2008 3:40 pm
by Brynet-Inc
CmpXchg wrote:SCSI is unfortunately not standardized, so we hoobyists can't make drivers for it.
That's
not true?
Now, SCSI controllers on the hand... you're right, a driver would have to developed for each chipset, but a generic SCSI layer is possible.
Posted: Sun Jun 08, 2008 12:57 am
by CmpXchg
Brynet-Inc wrote:Now, SCSI controllers on the hand... you're right, a driver would have to developed for each chipset, but a generic SCSI layer is possible.
Yep, the generic SCSI layer is possible, but the access drivers (the ones who perform IN/OUT instructions and handle interrupts) will be different.
To be exact, even the USB PCI config space registers are different for for motherboard (or USB controller), so we generally don't use them, right,
Dex?
Posted: Sun Jun 08, 2008 1:03 am
by Coldberg
i'm just looking for an easy way to boot without using a floppydrive or bios
bios would be nice if i could actually use it but v86 is kicking me in the balls
and i don't feel like switching modes all the time
i decided to go with CD (el-torito no emulation mode)
here's my sketch did i miss anything ?
Posted: Sun Jun 08, 2008 2:14 am
by CmpXchg
This brings us to a discussion on BIOS in PMode. Unfortunately, INT13h services become unavailable in PMode, but there is still some subset of BIOS functions that can be called from PMode, VBE3 or PCIBIOS32, to name some.
Where can I get a full list of these? It could of a lot help to an OS.
@Coldberg: The sketch looks allright. Just thought maybe it's best to start PMode in bootkernel, because you'll need real-mode BIOS to load your ATAPI and ISO-9660 drivers.
Posted: Sun Jun 08, 2008 8:37 am
by Coldberg
this is the monolithic part that goes into the part that gets autoloaded