flat assembler
Message board for the users of flat assembler.

Index > OS Construction > FAT12: Root Directory Entry

Author
Thread Post new topic Reply to topic
sz



Joined: 28 Nov 2004
Posts: 3
Location: Switzerland
sz 03 Dec 2004, 20:39
I want to read the number of the first sector of a file which is registered in the root directory. How long is that integer LSN and at which offset must I read? I tried to read a 16-bit integer value from offset 26(d), but it failed.

_________________
Windows was unable to detect your keyboard. Press F12 to reboot.
Post 03 Dec 2004, 20:39
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 03 Dec 2004, 22:01
Try adding 32 (d) to 26 (d) = 58 (d).
stored as a word,(but only users 12bit in the fat)
Code:
;----------------------------------------; Directory Entry format;----------------------------------------DIR_ENTRY           STRUCdirName                  DB      11 DUP (?)      ; 0x00dirAttr                 DB      ?               ; 0x0BdirReserved             DB      ?               ; 0x0CdirCreate10MS           DB      ?               ; 0x0DdirCreateTime           DW      ?               ; 0x0EdirCreateDate           DW      ?               ; 0x10dirAccessDate           DW      ?               ; 0x12dirClusterHigh          DW      ?               ; 0x14dirTime                 DW      ?               ; 0x16dirDate                 DW      ?               ; 0x18dirCluster              DW      ?               ; 0x1AdirSize                 DD      ?               ; 0x1CDIR_ENTRY               ENDS    


\\\\||////
(@@)
ASHLEY4.

Batteries not included, Some assembly required.


Last edited by ASHLEY4 on 03 Dec 2004, 22:17; edited 1 time in total
Post 03 Dec 2004, 22:01
View user's profile Send private message Reply with quote
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 03 Dec 2004, 22:15
aren't the LSN in FAT12 only 12 bits long? that's very complicated, because you've got to take them out and so on...
Post 03 Dec 2004, 22:15
View user's profile Send private message Visit poster's website Reply with quote
sz



Joined: 28 Nov 2004
Posts: 3
Location: Switzerland
sz 04 Dec 2004, 11:21
Why should I add 32 to the offset? And another, more important question: Must I add to the LSN the number of sectors of RootDir, BootSector and FAT?

_________________
Windows was unable to detect your keyboard. Press F12 to reboot.
Post 04 Dec 2004, 11:21
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 04 Dec 2004, 16:24
If you take a formated floppy and put one file on the disk and you look at the root dir with a hex editer, you will see the first entry, as if you renamed or deleted that file, this is only for the first entry, just add 32 for rest.

NOTE: this is for hardcoring a file from the disk, as in you load a kernel.bin for a boot loader.
The atached file as all the info you need,just add the html to the end, instead of the txt.

\\\\||////
(@@)
ASHLEY4.

Batteries not included, Some assembly required.


Last edited by ASHLEY4 on 06 Dec 2004, 17:22; edited 2 times in total
Post 04 Dec 2004, 16:24
View user's profile Send private message Reply with quote
sz



Joined: 28 Nov 2004
Posts: 3
Location: Switzerland
sz 05 Dec 2004, 16:12
Now it works, thx for the help.

_________________
Windows was unable to detect your keyboard. Press F12 to reboot.
Post 05 Dec 2004, 16:12
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 05 Dec 2004, 19:09
joachim_neu wrote:
aren't the LSN in FAT12 only 12 bits long? that's very complicated, because you've got to take them out and so on...


there are some things you have to do,
but imagine if it were 11 bit fat Smile
Post 05 Dec 2004, 19:09
View user's profile Send private message Visit poster's website Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 10 Dec 2004, 16:55
Here: is full fat12 boot code
Post 10 Dec 2004, 16:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.