File disk image

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gaiety

File disk image

Post by gaiety »

OK, I have read the osfaq about the disk image for window. I choose filedisk as it is free.I have problem with the filedisk.

Before that, I am using a raw floppy and bochs to testing my small os. Later, I change my mind to using image file.

Background:
I am using window xp, turbo C++, Nams to develop my hobby os. Now I am just doing bootstrap. After I have writing my bootstrap, I use debug to install the bootstrap to the floppy disk.

Code: Select all

debug 100 0 0 1
-w
-q
this will install the bootstrap into the floppy disk.

Here is the problem I face when I change to use of filedisk.

First, I use bochs Image Creation Tool to create a floppy disk image. It is 1.44MB. The floppy disk is empty and raw data.
Then I use filedisk to mount the image file.

Code: Select all

filedisk /mount 0 c:\bigcow.img 1.44M b:
OK, it has been mount with the driver b:, but it is in raw data.
so, I have to format it. Here is the first problem.

#1 I try to format it using FAT file system. Using the command

Code: Select all

format b: /fs:fat
OK, it has been format. But I don't know it is FAT12, FAT 16, VFAT, or FAT32, as I am unable to check it. For my bootstrap and my os, I use FAT12 for the beginning, So, how to format the disk image to FAT12.

#2 OK, so, I try to check the driver b:(The image disk driver I mount), I use the command

Code: Select all

debug 100 1 0 1
-File no found

The virtual driver is b:, so the driver number is 1(A for 0), but what I get the respone is the file not found. So, how to use the debug command for my virtual driver.

#3 OK, now I try another solution(But fail again), I try to debug the bigcow.img(The image file I create, it is about 1.44MB) by using debug.

Code: Select all

debug bigcow.img
-Insufficient memory
Ok, the file is too big to fit into memory, so, I fail again. What I want to do is to debug and write my bootstap into the image file. So, what to do.

Thank you for answering my question.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:File disk image

Post by Brendan »

Hi,

I haven't used FileDisk, but..

Code: Select all

debug 100 1 0 1
-File no found
I doubt this will ever work - typing "debug /?" gives:
DEBUG [[drive:][path]filename [testfile-parameters]]

[drive:][path]filename Specifies the file you want to test.
testfile-parameters Specifies command-line information required by
the file you want to test.
Debug probably thinks that "100" is the file name. Debug won't let you use "debug bigcow.img" either as it's too big for any real mode program (debug is limited to ~640KB).
gaiety wrote:What I want to do is to debug and write my bootstap into the image file. So, what to do.
How about something like:

Code: Select all

filedisk /mount 0 c:\bigcow.img 1.44M b:
debug boot_sector_code_only.bin
w 100 1 0 1
q
copy kernel.bin b:
filedisk /unmount b:
bochs
I think that should at least be close...

BTW the version of FAT windows uses is determined by the size of the disk - for 1440KB disks it'll always use FAT12.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply