FAT direct loading
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
FAT direct loading
I am trying to load stage2 from a FAT formatted floppy .. these are the specs for the volume:
Bytes Per Sector = 512 bytes
Root Entries = 224
Sector Per Cluster = 1
Sector Per FAT = 2
Sector Per Track = 18
Total Sectors = 2880
All I did was copied stage1 into sector 0 and copied stage2 as a file into the floppy.
Now, theoratically, the data sector should start at 19.
so I loaded cl, 0x00 and ch, 0x01 ... but this seems to be not loading stage2.bin from the floppy .. i tried with other sector numbers and track numbers, but Failed...
I checked by mounting this floppy (/dev/fd0) under linux and the volume contains the file stage2.bin ... but stage2 is not loading .. any idea ?
Bytes Per Sector = 512 bytes
Root Entries = 224
Sector Per Cluster = 1
Sector Per FAT = 2
Sector Per Track = 18
Total Sectors = 2880
All I did was copied stage1 into sector 0 and copied stage2 as a file into the floppy.
Now, theoratically, the data sector should start at 19.
so I loaded cl, 0x00 and ch, 0x01 ... but this seems to be not loading stage2.bin from the floppy .. i tried with other sector numbers and track numbers, but Failed...
I checked by mounting this floppy (/dev/fd0) under linux and the volume contains the file stage2.bin ... but stage2 is not loading .. any idea ?
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: FAT direct loading
You seem to be assuming that the stage2.bin file is the only (or first) file there, and is not at all fragmented. Even if this is somehow the case for you, Murphy's law will pretty much make it impossible to get other people to run it correctly. You either need to somehow hardcode the starting block of stage2.bin into the stage 1 on installation (and make sure there is no fragmentation, so no rewriting stage2.bin ever), or properly parse the FAT fileystsem at stage 1 (it's not too hard to code).
- salil_bhagurkar
- Member
- Posts: 261
- Joined: Mon Feb 19, 2007 10:40 am
- Location: India
Re: FAT direct loading
I think there's a small mistake there. You cannot load cl with 0 for a floppy, since the sectors start from 1. Besides, the starting sector of the first cylinder is 18 (starting from 0). So, to get to sector 19, you need ch = 1 and cl = 2. This should get you to the 19th sector IMHO.
Re: FAT direct loading
extremecoder, the good way to read stage2.bin file is that you implement reading of fat FS.
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: FAT direct loading
off course i am reading the Fatgen.pdf from Microsoft ... I tried many combinations (numbers) for track and sector number ... I calculated the RootDirSector, First Data Sector ... etc
I am trying this in VMWare and in Virtual Floppy Image ... will this make a difference ?
I am trying this in VMWare and in Virtual Floppy Image ... will this make a difference ?
Re: FAT direct loading
I've implemented the fat fs in VMWare and harddisk img.
And there was no difference. Maybe there'll be no problem with virtual floppy img.
And there was no difference. Maybe there'll be no problem with virtual floppy img.
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: FAT direct loading
I want to know whether the process of creating FAT16 Floppy is correct ... this is what I am doing.
1) Create a Blank Floppy Image in VMWare
2) format it with command: fdformat /dev/fd0
3) then use the command mkdosfs to create the DOS File System
4) writing the Stage1 bin into sector 0.
is the above step correct ?
1) Create a Blank Floppy Image in VMWare
2) format it with command: fdformat /dev/fd0
3) then use the command mkdosfs to create the DOS File System
4) writing the Stage1 bin into sector 0.
is the above step correct ?
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: FAT direct loading
Uhh, floppies use FAT12, not FAT16.
- salil_bhagurkar
- Member
- Posts: 261
- Joined: Mon Feb 19, 2007 10:40 am
- Location: India
Re: FAT direct loading
Have you checked if your root directory exists at sector 19 in your floppy image? If you have not done that, then do it, or post the image you made here. I will do that for you. If you see the root directory there, then you have a problem in the int 13h parameters you are setting. If not, then the computation '19' is wrong.
Edit: And yes, if you are thinking that the data of stage2.bin starts at sector 19, then thats not true. Its the root directory there. In that root directory, you find the directory entry of stage2.bin and then locate its cluster.
Edit: And yes, if you are thinking that the data of stage2.bin starts at sector 19, then thats not true. Its the root directory there. In that root directory, you find the directory entry of stage2.bin and then locate its cluster.
Re: FAT direct loading
???Sector Per FAT = 2
salil_bhagurkar is right:
0 - disk boot loader
1-9 - FAT1
10-18 - FAT2
19-32 - root directory
33-2879 - file data area
If you have seen bad English in my words, tell me what's wrong, please.
Re: FAT direct loading
you do not know how many questions you have answered for me
thanks you for posting that
thanks you for posting that