#1
Posted 04 December 2011 - 03:08 PM
Then You can mount .img with imdisk and then format it as fat32 or ntfs. Then You can copy files to it and unmount it.
If the resulting image still has some free space, this space can be gzipped wery well because it is repeated zeros.
Nice progressbar
Util was written in pure assembler (http://<span style=...ler.net</span>/).
I
#2
Posted 04 December 2011 - 03:55 PM
Maybe giving some more info might be of use.
- The image assumes a disk geometry of n/255/63
- Toggling the FAT32/NTFS results in partition ID of (respectively) 0C (FAT32 LBA mapped) and 07 (NTFS).
- The disk signature is written (and it is fixed to 88888888)
- No MBR code is written, ONLY the Disk signature, the partition table and the magic bytes 55AA.
- The "size" is IGNORED for anything below 8,225,280 (1x255x63x512=8,225,280)
Issues? or Features?:
- If you input a size of 10,000 Kilobytes, the resulting image will be nonetheless 8,225,280 bytes
- If you input a size of 100,000 Kilobytes, the resulting image will be 98,703,360
In other words, your input is rounded down to nearest multiple of 8,225,280, i.e. a multiple of a cylinder with 255 heads and 63 sectors.
Wonko
#3
Posted 04 December 2011 - 06:07 PM
Perhaps, you should explain us what is "pure assembler"
#4
Posted 04 December 2011 - 08:06 PM
Some Ice-Aged programmers used it to write functions which
- Run fast
- Need only some memory to run.
But it is still valid that assembly code is much faster.
@Divetoxx: Cogratulations!
Peter
#5
Posted 04 December 2011 - 08:45 PM
Thanks a lot for sharing Your useful tool.
Best wishes T.
#6
Posted 04 December 2011 - 10:32 PM
Yes, You are right! These are features which I codedMaybe giving some more info might be of use.
And let me say a few words about no MBR code is written. I prefer to use my .img with grub4dos this way:
title Windows 7 RAMDISK find --set-root /my7.img.gz map --mem-min=4G map --mem /my7.img.gz (hd0) map --hook root (hd0,0) chainloader /bootmgr
This is my menu.lst code. "chainloader /bootmgr" works great without any MBR and BR code! But If I will use my.img as boot HDD in virtualbox, for example, I will write real MBR and BR codes. I have found very nice utility named "BOOTICE" written by Pauly (If I am not mistaken, He is a Chinese programmist and He isn't speak English.) BOOTICE can write MBR and BR directly to .img file! It's great!
Yes! I don't know what can I do with user input smaller than 1 cylinder... So I round it.In other words, your input is rounded down to nearest multiple of 8,225,280, i.e. a multiple of a cylinder with 255 heads and 63 sectors.
I know that Microsoft forgot this geometry and now consider 1 cylinder has 1 head and 2048 sectors, but It's not important for RAM disks - we don't need an alignment of RAM partitions!
#7
Posted 05 December 2011 - 09:42 AM
This statement needs a small correction.Yes! I don't know what can I do with user input smaller than 1 cylinder... So I round it.
I know that Microsoft forgot this geometry and now consider 1 cylinder has 1 head and 2048 sectors, but It's not important for RAM disks - we don't need an alignment of RAM partitions!
The CHS geometry is a "legacy" set of values that have no real meaning since a few years, when LBA became largely used.
Due to a number of reasons which include compatibility with older OS and some lazyness from MS programmers, they still need to be valid for some configurations to work.
The 2048 is NOT 2048x1, but rather CHS 0/33/32 on a c/h/63 geometry, as (33-1)*63+32=2048.
No hard disk has actually a "geometry" that is "accessible" byt the OS, it is in any case a "virtual" geometry set in firmware or, if you prefer a "translated" geometry from the "real" (UNknown) internal one to the "standard" n/255/63.
The new 2048 alignment is IMNSHO a meaningless choice, see here for some reference:
http://reboot.pro/9897/
http://reboot.pro/9897/page__st__4
An alignment on a multiple of 4kb (8x512 bytes sectors) is needed on the new 4 Kb sector hard disks, some have a jumper to add a virtual sector so that legacy tool can start on an offset of 64 instead of 63.
If the scope is using the image with any pre-Vista OS or as RAM disk, there is NO problem whatsoever with using the n/255/63 geometry.
Wonko
#8
Posted 05 December 2011 - 10:23 AM
Is there a utility that will create a formatted VHD in one go?
#9
Posted 05 December 2011 - 10:34 AM
I HOPE that by "VHD" you mean a Virtual Hard Disk image and NOT a "VHD" (which is the Connectix/Microsoft format).In what way is this different from qemu-img.exe which can create many different formats of VHD (except it is command line program).
Please to avoid confusion do not use "VHD" for anything but the specific format .
If you mean a formatted RAW image, you can use my half @ssed batch Mbrbatch/mkimg under 32 bit :Is there a utility that will create a formatted VHD in one go?
http://reboot.pro/3191/
qemu-img creates "empty" images, there is No partition tables in them.
It basically creates a 00 filled file (in the case of non-RAW formats like VMDK/VHD it adds the header/footer etc., but NO data inside the actual image).
Clonedisk is "better" in this respect since it is GUI:
http://reboot.pro/8480/
Wonko
#10
Posted 06 December 2011 - 08:18 PM
...and for all SSD and flash disks too, because it drastically speeds up r/w operations. I'm using .img file as RAM disk, so the first partition starts at 63 sector, not 2048An alignment on a multiple of 4kb (8x512 bytes sectors) is needed on the new 4 Kb sector hard disks
Machine code is something like that: B8 01 02That is machine code.
Some Ice-Aged programmers used it to write functions which
Run fast
Need only some memory to run.
Assembler code is something like this: mov ax, 0201
It looks like a language
Greatest assembler feature is full contol over all that your program doing.
Using high-level languages You build Your programs from bricks, using low-level (assembler) You build even not from grain of sand but from atoms.
"Pure" means not assembler fragments in C++ or Delphi, but whole source written in assembler language and compiled using assembler compiler such as TASM, MASM, NASM or FASM.Perhaps, you should explain us what is "pure assembler"
I prefer Flat Assembler due to it is new, modern and very easy-to-use compiler. You only need two files: first, the fasm.exe and second, your.asm source code, that's all! Result is your.exe executable file which may be windows GUI application.
I am sorry, I still haven't found good manuals explaining VHD format. I know one difference between a fixed VHD and an image of HDD partition is the last 512-bytes sector of VHD with special structure. Can anybody tell me about this structure format?In what way is this different from qemu-img.exe which can create many different formats of VHD (except it is command line program).
So my util produces only an image of one HDD partition (with MBR before, as it is on real HDD).
I am not sure it is possible to mount VHD with imdisk...
Edited by Divetoxx, 06 December 2011 - 08:29 PM.
#11
Posted 06 December 2011 - 08:51 PM
"Pure" means not assembler fragments in C++ or Delphi, but whole source written in assembler language and compiled using assembler compiler such as TASM, MASM, NASM or FASM.
Yes, moving the whole assembly code to a separate module instead of using inline assembly ( like asm fragments in high-level languages ) is preferable. I agree with you. Fasm is another good choice. Unfortunately, with pure assembly some other people mean assembly code stripped of high-level constructs. Modern assembly gains efficiency with HLL elements.
#12
Posted 06 December 2011 - 11:06 PM
But for different reasons, and BTW, and JFYI, it applies to NTFS and NOT necessarily to other filesystems:...and for all SSD and flash disks too, because it drastically speeds up r/w operations. I'm using .img file as RAM disk, so the first partition starts at 63 sector, not 2048
http://www.msfn.org/...n-its-clusters/
Sure .I am sorry, I still haven't found good manuals explaining VHD format. I know one difference between a fixed VHD and an image of HDD partition is the last 512-bytes sector of VHD with special structure. Can anybody tell me about this structure format?
So my util produces only an image of one HDD partition (with MBR before, as it is on real HDD).
I am not sure it is possible to mount VHD with imdisk...
Just like you can with grub4dos, last sector (footer) is simply ignored (we are talking ONLY of FIXED size VHD's).
The footer format is quite plain, our in-house utility Clonedisk has this feature, but the format is well documented:
http://www.mcgrane.c...-VHD-Files.aspx
http://jim.studt.net...es-or-even-vmdk
There is also the small tool by karyonix, here (which includes C source):
http://reboot.pro/9715/
From the mouth of the wolf:
http://technet.micro...y/bb676673.aspx
Wonko
#13
Posted 07 December 2011 - 10:24 PM
#14
Posted 11 March 2012 - 08:12 PM
#15
Posted 12 March 2012 - 08:04 AM
Questions>
Any success with VHD Creation?
Can you make it easier to input a size. For Example
Type in a number in also MB,GB, TB. It could be a drop down menu or something on the right side.
#16
Posted 12 March 2012 - 08:39 AM
1. What will image file be called?
2. What folder will it be in?
3. I run app in Win 7 64-bit OS and set size of 340000 NTFS - and click Create - nothing seems to happen?
#17
Posted 12 March 2012 - 07:42 PM
I am sorry Still no success because of my busynessAny success with VHD Creation?
I am planning it... For example, I think about input in "cylinders"...Can you make it easier to input a size.
#18
Posted 12 March 2012 - 07:50 PM
Oh, thank You very much! I didn't test it in 64-bit OS'es and I'm sad... Is it possible that Win 7 64-bit doesn't support Win32 API? Or may be some functions have additional parameters or security descriptors... I will test and debug my util in 64-bit Win. The save file dialog (with name and path fields) should appear after pressing the button "Create"...1. What will image file be called? 2. What folder will it be in? 3. I run app in Win 7 64-bit OS and set size of 340000 NTFS - and click Create - nothing seems to happen?
Edited by Divetoxx, 12 March 2012 - 07:51 PM.
#19
Posted 05 May 2012 - 07:47 PM
I like your tool, but I can never find it.
So I'll add my own keywords , for future ref.
"easily create image tool"
easily make image diskimage tool.
Simple. I can never remember "simple".
Cheers.
r.
#20
Posted 12 March 2018 - 08:51 PM
Was wondering if there can be FAT12 support?? I am trying to figure out how to make an image I can flash to my rom to be loaded as an emulated drive and I believe it has to be FAT12?
Thanks
#21
Posted 12 March 2018 - 09:06 PM
Was wondering if there can be FAT12 support?? I am trying to figure out how to make an image I can flash to my rom to be loaded as an emulated drive and I believe it has to be FAT12?
Thanks
Hey, weren't you looking at the mtools yesterday?
Why don't you start a new thread specifying what you need/want to do, so that people can help you?
With all due respect , you seem like being in a X/Y/Z problem:
Wonko
#22
Posted 12 March 2018 - 09:42 PM
Will start my own thread..
Thanks
#23
Posted 13 March 2018 - 10:38 AM
Yes. More like an ABCDEFG problem!
No, I really meant a X/Y/Z problem, JFYI :
https://perl.plover....Questions3.html
Wonko
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users