OS development for USB stick: some questions
My only O / S development experience before this was to create "Hello World" running from a floppy drive.
Now I need to develop a simple O / S to boot from a USB stick. And I have several roadblocks:
-
How can I write to the "sector" of the bootable USB stick? Are there any tools?
-
Do you know of any good tutorials or guides aimed at USB booting?
-
I need to be able to read files on USB; What is the standard file system on a USB stick? FAT? Does Linux natively use FAT to store / read files on USB?
NB: I'm only doing this for learning all the low level dirty tricks, so I don't want linux on a stick to do the job.
source to share
- There is no special boot sector, you just write the MBR up to the first 512 bytes on the flash drive.
- There are many tutorials at Pendriveinux.com
- FAT works in most (if not all) cases. While Linux can handle FAT, you can simply create another partition on the USB stick, which is ext2 (or any other non-journal filesystem), and let Linux work on it. The IT Solutions Knowledge Base contains an article on how to create a permanent installation of a BackTrack flash drive using an ext2 partition.
source to share
Just some answers from my head (as I often deal with low-level disk structure):
-
You can just use a good hex editor that will let you write directly to disk (like HxD ), or roll your own application that uses the CreateFile API (or the Linux equivalent).
-
You can check out something like BartPE , which allows you to make an XP bootable image on a USB device.
-
USB drives are 99% FAT. Linux does support FAT natively for reading a USB stick.
source to share
Just add information. Mac on Stick will be a useful thing. You can get a basic idea of the file structure etc. With close examination, you should be able to solve most of the above problems. :)
source to share