flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
rhyno_dagreat
I have a USB flash drive, and I'd like to put a homemade OS on it. How could I make it bootable/store data in the first sector and everything?
Thanks! |
|||
![]() |
|
smiddy
Can you provide information on the system that you intend to use to create the boot disk? That will help in defining your needs a little better.
I am about to start down this journey myself, BTW. I intend to use WinImage to create the image, and use Bochs to insure the MBR, and VBR are setup correctly, then I am going to start using it as my platform tester. I think the most generic sense is treat the USB drive as any other HDD, making certain your BIOS supports booting from it, and direct accessing it, without a USB driver, per se. |
|||
![]() |
|
zhak
i did some trick that is fine for me. all my project (source, tools, etc.) is on a usb memory stick. i compile a HDD image each time i compile my OS source code. when i need to run it under bochs, i just boot from that image. i've also installed grub on my usb memory stick and configured it to boot from the HDD image. so i can boot my OS on a physical PC. sometimes i run it under VMWare, and i just configure it to use the whole disk as hdd and choose my usb stick. so, using grub i can load my OS on any environment. it's pretty convenient
|
|||
![]() |
|
Dex4u
I writen a fasm win32 program to add boot sector to usb drive for both floppy and hdd emulation.
I can post the code, if i can find. You can try the program here: http://www.dex4u.com/USBboot.htm |
|||
![]() |
|
smiddy
Thanks Dex! A quick look-see it appears to be 16 bit FAT, yes? Have you done anything with 32 bit FAT?
|
|||
![]() |
|
Dex4u
It was just a safety thing, i thought that if you had to format the drive fat16 first, i could test for that, as well as that its a usb drive.
I did not want to nuke there usb external hard drive, if they press yes to the wrong drive letter. So you can just mod the code to write to fat32 too or even fat64. It would be a case of moding the one line of code. I will PM you a link to the code and remember i program in windows very little. [EDIT] I have PM you. |
|||
![]() |
|
booter
rhyno_dagreat wrote: I have a USB flash drive, and I'd like to put a homemade OS on it. How could I make it bootable/store data in the first sector and everything? Use Int 13 function 42h to read your OS by absolute LBA address to make it BIOS independent. In fact, you should update MBR with the new LBA address each time you write your OS to the USB, or better do it once and then update the OS image file without moving it. |
|||
![]() |
|
smiddy
Thanks Dex...
I saw that there was some 64 bit FAT verbiage on the net, but I haven't looked at it with any critical eyes yet. I did see it wasn't supported by Microsoft, but then again, that is no big deal either. I was hoping to save me some coding time. I am refreshing my memory on FAT entirely and will be coding my own versions eventually. I'm nearly done setting up my test environment, this code will help in that vain. ![]() -smiddy |
|||
![]() |
|
rhyno_dagreat
Sorry for the late reply - I'm using a msi E7235 laptop with a Intel Core 2 Duo 2.0GHz processor in it.
Can I just use WinImage to write the binary file to the USB directly as if I were to do it to a floppy disk, or because it's different hardware I need to do something entirely? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.