flat assembler
Message board for the users of flat assembler.

Index > OS Construction > OS Development?

Goto page 1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
I've took a sudden interest in the designing of operating systems, and I can seem to get any where?

I know how to write a bootloader, but I want to implement a FAT12 file system, and I want to know to. Because, I've seen a few examples and tutorials, but I don't understand. Do I need to memorize all of this stuff (meaning to know how to write one without any reference)?

_________________
meshnix
Post 26 Apr 2010, 21:23
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
No, just remember generalized "keywords" that will help you re-find stuff later. Or use bookmarks. It always works for me with the few things I've managed to learn.

I suggest you go with FAT16 or FAT32 because of how 12 always leaves you with that awkward nibble to deal with.
Post 26 Apr 2010, 22:14
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
i recommend you to read a lot of old threads in this sub forum.

you will see many interresting datas in earlier pages.
and yuo xwill find many implementations for FAT12, ready to use, many others for FAT32 or 16, and other interresting stuff

Very Happy
Post 27 Apr 2010, 00:52
View user's profile Send private message Visit poster's website Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman
http://www.brokenthorn.com/
http://www.osdcom.info/component/option,com_frontpage/Itemid,1/
and lots of stuff here
Dex has a simple and a less simple OS
MikeOS is also a great example
Lots of others, those just come to mind quickly
Post 27 Apr 2010, 05:12
View user's profile Send private message Visit poster's website Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
Thanks!

- I will start with Fat12, then graduate slowly as i learn more about file systems.
- I've found a few good threads as i browsed.
- osdcom.info and brokenthorn.com are two of the best sites I've seen.
Post 27 Apr 2010, 12:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17718
Location: In your JS exploiting you and your system
revolution
FAT12 would actually be harder to code than FAT16 for FAT32.
Post 27 Apr 2010, 12:55
View user's profile Send private message Visit poster's website Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
Really? So should I code FAT16 instead of FAT12?
Post 01 May 2010, 15:22
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
some M$ document about fat say that the 3 fat versions are needed.
fat12 for little drives.
fat16 for middle drives.
fat32 for large drives.
Post 01 May 2010, 15:50
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
revolution wrote:
FAT12 would actually be harder to code than FAT16 for FAT32.
revolution is right, that 12bit is a pain Wink

Also beginners think, coders that have been coding for some time memorizes everything.
But we just look it up, the only difference is we know where to look it up. Laughing
Post 01 May 2010, 18:02
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
I think I will code a FAT12 just to get more experience and take FAT16 into consideration.

Dex4u I don't have to take everything to memory except the basics, like knowing how to code.
Post 03 May 2010, 20:27
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
MeshNix wrote:

[...]knowing how to code.

I even have to look that up every once in a while.Wink

But you may want to consider the fact that when you start to read the FAT of the FAT12 fs, you'll have to deal with the leftover nibble.
Post 04 May 2010, 00:37
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
What exactly is the leftover nibble? The nibble comes from where exactly?
Post 06 May 2010, 04:40
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
MeshNix,

Tyler means that standard 512-byte sector contains 341⅓ FAT12 entries.
Post 06 May 2010, 05:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17718
Location: In your JS exploiting you and your system
revolution
MeshNix wrote:
What exactly is the leftover nibble? The nibble comes from where exactly?
12 bits is how many bytes?
Post 06 May 2010, 05:43
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
The overlap is where people get lost with FAT12...
Code:
0000000000001111
            1111111100000000
                        0000111111111111    

So this means that only 12 bits per word are used.
The extra 4 bits belong to the next group and so on...
Post 06 May 2010, 12:05
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
MeshNix wrote:
What exactly is the leftover nibble? The nibble comes from where exactly?
Four bits...is a nibble. Eight bits is a byte, sixteen bits is a word, 32 bits is a long word, 16 bytes is a paragraph...though not all systems agree on these semantecs, though they are close.
Post 06 May 2010, 12:37
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
franckly, fat12 is one of the worse designs never used to be a standard.
it is limited to only drives with less than 4192 sectors.. means that it is a pure limitation.

does OSes supports other file systems for floppies? like FAT16 for example...

it is like the 20bits address bus limitation in early 8086... does franckly the deisgners thinked about the possibility of 4GB of ram? etc... or the LBA28... or the 24bpp, or else....


Last edited by edfed on 06 May 2010, 23:24; edited 1 time in total
Post 06 May 2010, 18:35
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
baldr wrote:

MeshNix,

Tyler means that standard 512-byte sector contains 341⅓ FAT12 entries.

Actually, I never even thought of that Smile, although that too would be annoying. I was just talking about how that nibble would make reading the FAT a pain. Poor choice of words I guess. I think bitshiter is showing an example of what I meant.

Yet another reason not to use FAT12.
Post 06 May 2010, 21:45
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
edfed wrote:
franckly, fat12 is one of the worse designs never used to be a standard.
it is limited to only drives with less than 4196 sectors.. means that it is a pure limitation.
Frankly speaking, FAT12 is a part of ISO/IEC 9293 standard (9293:1994 revision is identical to ECMA-107).

Number of clusters on FAT12 volume indeed is limited (4084 max), with maximum allowed cluster size of 32 KiB that's 127.625 MiB.

FAT12 looks like good compromise for late-'70-born floppy disk file system: simple and compact, yet flexible (pre-2.0 DOSes didn't support directories, for example). IBM 5150 PC was 8088-based with 16 KiB RAM minimum — not a much room and power.

----8<----
Tyler wrote:
Yet another reason not to use FAT12.
FAT12 routines can be educational and endlessly funny. Writing code like
Code:
;;; si = cluster number
        mov     bx, si
        shr     bx, 1
        mov     ax, FAT12[bx+si]
        jnc     @f
        shr     ax, 4
@@:     and     ah, 0x0f
;;; ax = next cluster number or free/bad/EOF marker    
is good exercise for any coder.
Post 06 May 2010, 23:40
View user's profile Send private message Reply with quote
adroit



Joined: 21 Feb 2010
Posts: 252
adroit
I am totally lost!
Post 09 May 2010, 21:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3, 4  Next

< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.