Booting of flash drives
Booting of flash drives
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)
-
- Member
- Posts: 41
- Joined: Sat May 24, 2008 12:41 pm
- Location: La Plata, Argentina
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...
For Windows systems, see http://www.bootdisk.com/pendrive.htm for tips.
I hope that helps...
-
- Member
- Posts: 41
- Joined: Sat May 24, 2008 12:41 pm
- Location: La Plata, Argentina
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
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?
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?
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
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
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
- Masterkiller
- Member
- Posts: 153
- Joined: Sat May 05, 2007 6:20 pm
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 );
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 );
ALCA OS: Project temporarity suspended!
Current state: real-mode kernel-FS reader...
Current state: real-mode kernel-FS reader...
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.
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.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
That's not true?CmpXchg wrote:SCSI is unfortunately not standardized, so we hoobyists can't make drivers for it.
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.
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
Yep, the generic SCSI layer is possible, but the access drivers (the ones who perform IN/OUT instructions and handle interrupts) will be different.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.
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?
Last edited by CmpXchg on Sun Jun 08, 2008 2:07 am, edited 1 time in total.
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 ?
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 ?
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
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.
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.