Page 1 of 1

.vdi file modification takes no effect?

Posted: 24. Jul 2009, 04:11
by SpaceJehovah
Hi all,

I set the fixed size virtural HDD to 64MB and still couldn't find first sector start address. I've tried several plan included 512B, 4k, 1MB alignment address, also according to the tutorial, but all failed. I only want to insert my own 512B bootsector into the .vdi file to generate a bootable HDD virtual image...but couldn't find the accurate address to insert...

Thanks

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 11:23
by vbox4me2
Look into the OSE sources, its in there.

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 11:47
by SpaceJehovah
Thanks, my friend.But...

Gosh, i find something crazy in bootsector! I wrote a simple bootsector and made mistake in the END:0x55aa not 0xaa55, but this all works very well as a floppy image in VirtualBox and VirtualPC!! So when i copy these codes into .vdi, booting failed... Why floppy image could work?

Thanks

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 12:31
by mpack
SpaceJehovah wrote:Why floppy image could work?
Work as what? A floppy image does not require a boot sector in order to "work" - and it needs a lot more than a boot sector in order to boot.

Really, as I hinted in your other thread on the same subject, this is way beyond the scope of VBox support. It seems to me you are messing with stuff you have little or no knowledge of, and you will not gain that knowledge by asking piecemeal questions in a VM forum! About the only way I can think of that you could gain this knowledge by yourself is to download source code for some simple Intel based OS and study it. A VM might well be a useful tool in that study.

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 12:44
by mpack
mpack wrote:A floppy image does not require a boot sector in order to "work"
Actually, I'll amend that. It probably does require a boot sector with volume info, it just doesn't require any boot code.

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 13:10
by vbox4me2
Booting of any media envolves a bootstrap loader, so yes there is executable code in the boot sector.

Re: .vdi file modification takes no effect?

Posted: 24. Jul 2009, 14:26
by mpack
vbox4me2 wrote:Booting of any media envolves a bootstrap loader, so yes there is executable code in the boot sector.
Who is your comment addressed to, me? If so then your comment is misplaced - I'm well aware of what is required from bootable media.

The OP talked about the floppy image "working" - without making it clear what he meant by "working". If the floppy only had a valid boot sector and nothing else then he certainly could not mean that he successfully booted a VM off it (not in any useful sense).

Most likely he meant that his VM booted successfully (off a hard disk image) and the floppy image was afterwards accessable. However if he tried booting a VM with a hard disk consisting of nothing but a boot sector (and that copied off a floppy image!) then it won't boot - to which the natural response is "of course not".

Re: .vdi file modification takes no effect?

Posted: 25. Jul 2009, 04:48
by SpaceJehovah
Hi guy,

Everyone in the world knows that you are an expert, extreme expert! Can you be a little more humble! Such guy should be eliminated!

Re: .vdi file modification takes no effect?

Posted: 25. Jul 2009, 14:38
by mpack
What? You ask for information, then if you get a competent answer you accuse the contributer of arrogance? There's gratitude for you. [edit: Looking back over this thread I see nothing from me that could be called rudeness towards you, I merely stated what I believed was a plain and simple fact: you appear not to have the knowledge to do what you are discussing. There was no call for rudeness from you in return. ]

And by the way: I'm a software engineer by profession, and have been for more than thirty years. I've been using PCs since they were invented, and was already using computers of various designs for several years before that; so yes, I do feel that I've learned a thing or two in that time: including what a PC boot sector contains, what it does, and how any of several operating systems have used it.

Re: .vdi file modification takes no effect?

Posted: 25. Jul 2009, 16:11
by SpaceJehovah
Hi god,

Everybody knows that you are A computer science god or father?! By the way, i believe you are as old as the computer history.
U should say that u are as old as the history of earth, haha. Maybe, u r alien?

Thanks

Re: .vdi file modification takes no effect?

Posted: 25. Jul 2009, 20:21
by Sasquatch
Can we drop the names and all and get back on topic here? SpaceJehovah, if you are religious as I think you are, please drop it here. You don't have to pursue everyone with your way of thinking. Please treat this place as a neutral zone, so keep it to yourself on what and where you believe in. If you continue to take things here as insults, which are merely meant as helpful to solve your problem, I'll be forced to lock this topic.

Re: .vdi file modification takes no effect?

Posted: 25. Jul 2009, 20:25
by Perryg
@SpaceJehovah

Usually we do not try to suppress discussions for being heated, but I believe you have crossed the line here in your comments to mpack.
My suggestion is to stay civil. Abuse is not, nor will it be acceptable on the forum.

Re: .vdi file modification takes no effect?

Posted: 26. Jul 2009, 19:03
by TerryE
SpaceJehovah wrote:I set the fixed size virtural HDD to 64MB and still couldn't find first sector start address. I've tried several plan included 512B, 4k, 1MB alignment address, also according to the tutorial, but all failed. I only want to insert my own 512B bootsector into the .vdi file to generate a bootable HDD virtual image...but couldn't find the accurate address to insert...
Also to this point, you should do some basic research and this will give you the answers that you seek. The VDI is addressed internally to the VM just as a standard hard disk and the MBR is at sector 0. The mapping of virtual HD sectors to VDI file offsets is given in my tutorial All about VDIs, However I would just look at the Wikipedia MBR article which tells you how this works. Perhaps the easiest way to set up a virtual HD is to attach it as a second disk in your preferred VM (LiveCD Linux, Linux or Windows) and manipulate it as a normal disk within the VM.

However, +1 on the comments about abuse. Please read the Forum Posting Guide as you were asked to before posting. If you repeat this then you will be banned and receive no help.