Disk Images: Difference between revisions

4,525 bytes added ,  29 days ago
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (→‎Tools: Alfabetized the lists)
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
(34 intermediate revisions by 17 users not shown)
Line 1:
The best way for hobbyist os developers to test their systems is to use programs like [[QEMU]], [[Bochs]], [[VMWareVMware]] or [[Microsoft Virtual PC|VirtualPCVirtual PC]].
 
All of these common tools rely on using disk images (either floppy or hard disk). A disk image is nothing more than a file whose content reflects the layout of a disk and that the tool will use as if it was a physical device. E.g. A floppy image typically is 1.44MB large and its 512 first bytes consist of the 'floppy's boot sector. The different sub-pages should tell you how to create such images from real disks and use them under the most common operating systems.
Line 39:
| {{No}}
| Anything supported by Windows
 
|-
| [[FUSE]] <sup>[[#Note1|1]]</sup>
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| Literally anything, including your own FS
 
|-
Line 47 ⟶ 55:
| {{Yes}}
| [[HFS]] HFS+ HFS+J HFSX [[FAT]] [[UFS]]
 
|-
| [[ImDisk]]
| {{No}}
| {{Yes}}
| {{No}}
| {{No}}
| Anything supported by Windows
 
|-
Line 55 ⟶ 71:
| {{Yes}}
| Anything supported by the kernel
 
|-
| [[MagicISO]]
| {{No}}
| {{Yes}}
| {{No}}
| {{No}}
| ISO 9660, Rock Ridge, HFS/HFS+, Joilet, UDF, XBOX DVD FS
 
|-
Line 71 ⟶ 95:
| {{Yes}}
| [[FAT]]
 
|-
| [https://www.fysnet.net/ultimate/index.htm Ultimate]
| {{No}}
| {{Yes}}
| {{No}}
| {{No}}
| [[MBR]], [[GPT]], [https://www.fysnet.net/fysos_embr.htm eMBR], [[ISO 9660]], [[FAT]], [[ExFAT]], [[NTFS]], [https://www.fysnet.net/leanfs/index.php LEAN], [https://www.fysnet.net/fysfs.htm FYSFS], [[SFS]], [[Ext2]]
 
|-
Line 89 ⟶ 121:
 
|}
 
<small id="Note1">Note 1: FUSE is not an application, but a shared library and a set of applications; one for each file system. You can also write your own if you'd like. They are easy to use as they mount a disk partition or image file on a directory, and you can manipulate the files in the image with standard tools afterwards.</small>
 
 
If you want to write/burn an image to media you can use one of the following tools:
Line 114 ⟶ 149:
| {{No}}
| Floppy images only
 
|-
| [https://gitlab.com/bztsrc/usbimager/ USBImager]
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| very small, dependency-free and has a simple GUI
 
|}
Line 121 ⟶ 164:
You can use 'dd' to create a blank floppy image.
 
<syntaxhighlight lang="bash">
<pre>
dd if=/dev/zero of=floppy.flp bs=512 count=28882880
</syntaxhighlight>
</pre>
 
== CD images ==
 
As of version 0.95, GNU [[GRUB]] comes with support for no-emulation [[El-Torito]] CD boot. Creating a CD image is much easier than working with floppy images and trying to stuff GRUB in them (and you get 650 meg more space too). Putting GRUB on a CD is now a simple matter of making a skeleton directory tree for the CD filesystem layout, copying the "stage2_eltorito" file in there, and running mkisofs with a specialized command line. See the GRUB 0.95 info node [http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD-ROMCD_002dROM.html Installation > Making a GRUB bootable CD-ROM] for details. Much more humane than those floppy games.
 
There is also a tutorial about creating a [[Bootable El-Torito CD with GRUB Legacy|no-emulation El-Torito CD with GRUB]].
 
== Handling of Partition Tables in images. ==
 
At the time of writing, only Apple's [[hdiutil]] and Plan 9's [http://9p.io/magic/man2html/8/partfs partfs] can handle the mounting of partitions inside of an image cleanly. Linux requiresusers somecan use [[Loopback Device|a hackshack]] to skip over the MBR sector. andIn general, you can solve the partitioning information problem by using a separate image for one partition, then insert it into a larger image with partitioning data at the right place. This works because offsets are generally relative to the start of the so-onpartition.
 
There's a tutorial on [[Bootable Disk]]s.
 
== Images with preinstalled GRUB ==
Line 137 ⟶ 184:
If you are looking for a ready-made floppy image with GRUB already installed, such has been set up by MartinBaute, and is available from the following mirrors:
 
* ClickerLibOSDK project at http://prdownloadsdownload.sourceforgeberlios.netde/clickerlibosdk/grub_diskfd.zip?downloadimg.bz2 (GRUB 0.96) [broken link]
* Clicker project at http://sourceforge.net/projects/clicker/files/miscellaneous/GRUB%20bootdisk%20(by%20Solar)/solar_grub_disk.zip/download (GRUB 0.95)
* LibOSDK project at http://download.berlios.de/libosdk/fd.img.bz2
* Ubuntu "grub-rescue-pc" package at http://packages.ubuntu.com/trusty/i386/grub-rescue-pc/download (GRUB2 2.00) [broken link]
 
The imageimages hashave GRUB stage1 / stage2 and an empty config file set up, so all you have to do is adding your binaries and editing the config file (see the [http://www.gnu.org/software/grub/manual GRUB manual] for details).
 
The CD/DVD image on rdos.net has an embedded bootable floppy image and the required files in the root directory.
 
The Ubuntu "grub-rescue-pc" package is GRUB2, and has floppy, CDROM, and USB images.
 
== Pre-made Images to test your code with ==
 
The following is a list of pre-made images of various partitioning schemes and file systems.
 
The purpose of this list is to include images for testing your partitioning and file system code. In other words, can your code find and mount the given partitions/file systems on these images.
 
This is not a 'vanity' list, a list to simply add your image file. The ideal purpose of this list is for images with intentionally numerous partitions and/or partitioning schemes, and other types of images. However, images with single partitions are allowed. Please make sure--to the best of your knowledge--the partitioning scheme and file systems are correctly implemented before adding to this list. The intent is for others to '''test their code on your image''', not to '''test your image with their code.'''
 
You are welcome to add your image URL, but please keep in mind the purpose of this list.
 
* Please compress the image and point the URL to the compressed image. ZIP, GZ/BZ, etc.
* Please do not include many other files. Keep it to the disk image itself. If you wish to include the source, place the source on the disk image itself.
* Please use (somewhat) permanent links. Do not add your image file if the URL will be broken in the near future.
 
{| {{Wikitable}}
|-
| URL/Name
! Partition Scheme
! Sector Size
! File System(s)
! Compressed
! Uncompressed
! Notes
 
|-
| [https://www.fysnet.net/ultimate/demodisk.zip Ultimate Test]
| [https://www.fysnet.net/fysos_embr.htm eMBR]
| 512
| [[FAT]], [[ExFAT]], [https://www.fysnet.net/leanfs/index.php LEAN], [https://www.fysnet.net/fysfs.htm FYSFS], [[SFS]], [[Ext2]]
| 5.5 Meg
| 165 Meg
| Test image for [https://www.fysnet.net/ultimate/index.htm Ultimate] disk viewer
 
|-
| [https://www.fysnet.net/zips/fysos.zip fysos]
| [[GPT]], floppy
| 512
| [[FAT]]
| 8.2 Meg
| 10 Meg/1.44 Meg
| Single FAT 16 file system partition with a GPT partitioning Scheme
 
|-
| [https://www.fysnet.net/ultimate/four_k_sects.zip Ultimate Test (4k)]
| [[GPT]]
| 4096
| [[FAT]], [https://www.fysnet.net/leanfs/index.php LEAN]
| 8.6 Meg
| 86 Meg
| FAT 16 & Lean file systems partitioned with a GPT partitioning Scheme (Using 4k Sector sizes)
Boot EFI only. Legacy will not read 4k sector sizes.
 
|}
 
== Links ==
 
* Related thread in the forum: [[Topic:10549]] You gonna find a nifty trick Brendan uses to build his own iso images - with NASM. (download missing)
* John Burger's [[User:Johnburger/Demo|Demonstration]] uses [[User:Johnburger/Demo/Pad/ISO/ISO|NASM source code]] to build his own ISO images too.
 
[[Category:FAQ]]