How to access a pen drive *directly* using ports like HDs?
Posted: Fri Mar 25, 2011 9:13 am
Hi all!
I have been recently working on my little hobbyist OS "wind". I have developed a simple bootloader using nasm (that initializes into protected mode before jumping to kernel) and using GCC toolchain to program the rest of my kernel and other drivers. I wrote it on a floppy image (an HD image later) and tested it on BOCHS emulator. Now the floppy option is only temporary and HD is too much yet .
Since i have a couple of pendrives and my BIOS can boot from a pendrive i am thinking of writing the image to my pendrive and access the entire **8 GB** space there to keep all kernel and drivers stuff. I want to access and use all the space like on a hard disk!
Now the problem is that i have googled and searched the web about how to access the pendrive space using ports from a protected mode OS code like mine. But i didn't find even a single one! The ralf brown's interrupt requests ref (i think) provides a USB interrupts list but i am doing everything from protected mode code (i have setup protected mode interface for some vesa display in my code instead of using troublesome virtual mode or something!). So real mode interrupts as you can see are useless to me IN ALL WAYS. The only option from protected mode is using ports!
Someone please advice me on this problem. I have a Celeron D (Pentium 5 series) processor and note that **i am not using GRUB**. I use my own bootloader and it works perfectly. Also please tell me if i need to setup an MBR or something on the pendrive to access all the space..
regards
I have been recently working on my little hobbyist OS "wind". I have developed a simple bootloader using nasm (that initializes into protected mode before jumping to kernel) and using GCC toolchain to program the rest of my kernel and other drivers. I wrote it on a floppy image (an HD image later) and tested it on BOCHS emulator. Now the floppy option is only temporary and HD is too much yet .
Since i have a couple of pendrives and my BIOS can boot from a pendrive i am thinking of writing the image to my pendrive and access the entire **8 GB** space there to keep all kernel and drivers stuff. I want to access and use all the space like on a hard disk!
Now the problem is that i have googled and searched the web about how to access the pendrive space using ports from a protected mode OS code like mine. But i didn't find even a single one! The ralf brown's interrupt requests ref (i think) provides a USB interrupts list but i am doing everything from protected mode code (i have setup protected mode interface for some vesa display in my code instead of using troublesome virtual mode or something!). So real mode interrupts as you can see are useless to me IN ALL WAYS. The only option from protected mode is using ports!
Someone please advice me on this problem. I have a Celeron D (Pentium 5 series) processor and note that **i am not using GRUB**. I use my own bootloader and it works perfectly. Also please tell me if i need to setup an MBR or something on the pendrive to access all the space..
regards