Disk Image Manipulation Tool
-
- Member
- Posts: 199
- Joined: Sat Jun 28, 2008 6:44 pm
Disk Image Manipulation Tool
For short 'imagetools'.
Back when I started with OSDev, I wanted to use Grub as a bootloader. However, I found it very tedious and time consuming to have to attach to a loopback device to write a disk label, then disconnect and reattach at a specific offset for the first partition and then mounting/copying files... time I could have spent debugging and testing. I was using a shell script to automate parts of it, but it still wasn't that great and still required me to be superuser to manipulate a disk image. (Which otherwise wouldn't be needed because my emulator runs as a normal user.)
I decided to look into possibilities as to how to alleviate this problem, and eventually came across e2tools. It appears it has been abandoned, as the last modification was over five years ago. This was before the x86_64 boom so it wasn't portable to my architecture of choice, and I attempted to fix it. Overall I disliked the way it was built. Something about introspection of argv[0] to decide functionality just didn't sit right with me. I've decided to remake the same set of tools, but extend them to include support for as many file systems as Linux supports, including all of ext{2,3,4}, xfs, jfs, reiser{3,4} through the support libraries contained in their respective maintenance tools.
Assuming you would have a need for such a tool what things would you like to see in it?
Back when I started with OSDev, I wanted to use Grub as a bootloader. However, I found it very tedious and time consuming to have to attach to a loopback device to write a disk label, then disconnect and reattach at a specific offset for the first partition and then mounting/copying files... time I could have spent debugging and testing. I was using a shell script to automate parts of it, but it still wasn't that great and still required me to be superuser to manipulate a disk image. (Which otherwise wouldn't be needed because my emulator runs as a normal user.)
I decided to look into possibilities as to how to alleviate this problem, and eventually came across e2tools. It appears it has been abandoned, as the last modification was over five years ago. This was before the x86_64 boom so it wasn't portable to my architecture of choice, and I attempted to fix it. Overall I disliked the way it was built. Something about introspection of argv[0] to decide functionality just didn't sit right with me. I've decided to remake the same set of tools, but extend them to include support for as many file systems as Linux supports, including all of ext{2,3,4}, xfs, jfs, reiser{3,4} through the support libraries contained in their respective maintenance tools.
Assuming you would have a need for such a tool what things would you like to see in it?
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Disk Image Manipulation Tool
Support for a simple ramdiskFS (like SFS or TFS or, hell, just a bare file entry list with contiguous data!)
Re: Disk Image Manipulation Tool
PLUGINS!!!
Like being able to load a SO/DLL that you wrote for your own filesystem and being able to load and use it.(Preferably, without having to recompile)
Like being able to load a SO/DLL that you wrote for your own filesystem and being able to load and use it.(Preferably, without having to recompile)
-
- Member
- Posts: 199
- Joined: Sat Jun 28, 2008 6:44 pm
Re: Disk Image Manipulation Tool
I'm pretty sure that this is a linux/BSD program only. Windows doesn't have the libraries, nor the capabilities to do anything like this.earlz wrote:PLUGINS!!!
Like being able to load a SO/DLL that you wrote for your own filesystem and being able to load and use it.(Preferably, without having to recompile)
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Disk Image Manipulation Tool
What, specifically, are you referring to?Windows doesn't have the libraries, nor the capabilities to do anything like this.
-
- Member
- Posts: 199
- Joined: Sat Jun 28, 2008 6:44 pm
Re: Disk Image Manipulation Tool
e2fsprogspcmattman wrote:What, specifically, are you referring to?Windows doesn't have the libraries, nor the capabilities to do anything like this.
xfsprogs
reiserfsprogs
resier4progs
brtfsprogs
mtools
hfsutils
hfsplusutils
dosfstools
need i go on?
Re: Disk Image Manipulation Tool
If you actually completed this and made it stable, I would quite honestly love you long time.
Re: Disk Image Manipulation Tool
gl I'm working on something similar in python. For the core I ended up with something remarkably similar to the VFS in my OS.
Probably the most loved formats would be FAT 12/16/32 & Ext3, as they are what's most commonly used (and if you support Ext3, you support Ext4, which - bar some features - is backwards compatible)
Edit:
Probably the most loved formats would be FAT 12/16/32 & Ext3, as they are what's most commonly used (and if you support Ext3, you support Ext4, which - bar some features - is backwards compatible)
Edit:
Erm, wtf? Image manipulation uses nothing more then the standard library, fopen(), fwrite(), fread(), fseek(), fclose(), strcpy(), memset(), and bitwise operations. I don't see why you think this isn't portable, as it is.I'm pretty sure that this is a linux/BSD program only. Windows doesn't have the libraries, nor the capabilities to do anything like this.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Disk Image Manipulation Tool
He means the libraries for specific file system handling. The tools for managing different filesystems (i.e. mkfs, fsck) on Linux come with libraries that have the filesystem manipulation code, which he's going to use instead of writing his own implementation. If you wanted to port the tools to Windows, you would need those libraries too. The problem is that Windows would never have those libraries, because disks don't act like files, so their only use would be for a tool like this, which seems not to exist.OrOS wrote:Erm, wtf? Image manipulation uses nothing more then the standard library, fopen(), fwrite(), fread(), fseek(), fclose(), strcpy(), memset(), and bitwise operations. I don't see why you think this isn't portable, as it is.I'm pretty sure that this is a linux/BSD program only. Windows doesn't have the libraries, nor the capabilities to do anything like this.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Disk Image Manipulation Tool
Actually, you can open disks for reading and writing on Windows. Heck, you can do it in Python on Windows if you want. You just need administrator privileges.The problem is that Windows would never have those libraries, because disks don't act like files
Re: Disk Image Manipulation Tool
Although your point is valid, you lie Drives can be accessed as files using the internal naming scheme, ex: \\.\PhysicalDrive0
Edit: Argh, beat me to it matt
Edit: Argh, beat me to it matt
-
- Member
- Posts: 199
- Joined: Sat Jun 28, 2008 6:44 pm
Re: Disk Image Manipulation Tool
I think it would be much simpler just to use what is already there instead of reinventing the wheel. I do know of a few mingw32-based remakes of libext2fs, but I still am lacking the windows programming experience.
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Disk Image Manipulation Tool
*starts writing libtfs*
-
- Member
- Posts: 199
- Joined: Sat Jun 28, 2008 6:44 pm
Re: Disk Image Manipulation Tool
s/writing/finding/Troy Martin wrote:*starts writing libtfs*
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Disk Image Manipulation Tool
So is it TFS or PiranhaFS?