flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > My Own file system |
Author |
|
JohnFound 30 Apr 2012, 07:36
IMHO, FAT32 is better to be learned. FAT12 have very limited use.
Whether you will use some file system standard or use your own file system is actually design choice in your OS planning. Both variants have advantages and disadvantages. My suggestion is to not use particular file system, but to implement in your OS core, some driver interface that to allow connecting modules that to handle different file systems. As a beginning you can write one file system driver for FAT32 (because there are ready made implementations that you can use). Later, you can implement another modules, including your own file system(s). |
|||
30 Apr 2012, 07:36 |
|
majidkamali1370 30 Apr 2012, 08:27
Quote: As a beginning you can write one file system driver for FAT32 (because there are ready made implementations that you can use). You mean I write FAT32 as an interface to my own FS or vise versa? What is difference between functions that I use to read/write hard disk and my own FS? Aren't both one thing? FS is just a template. Isn't it true? So, how physical division of hard drive should be? |
|||
30 Apr 2012, 08:27 |
|
JohnFound 30 Apr 2012, 09:19
I mean, that the proper approach is to not rely on particular file system. Plan your OS in module way, so in order to be able to use several file system drivers simultaneously.
|
|||
30 Apr 2012, 09:19 |
|
majidkamali1370 30 Apr 2012, 12:05
Excuse me, I don't understand what you say.
These functions/modules that you say must operate on a pattern-like format on Hard Disk for read/write. How should I implement that pattern? Isn't it what I call my own FS? Again, excuse me for much questioning |
|||
30 Apr 2012, 12:05 |
|
bubach 30 Apr 2012, 12:23
You implement an abstraction layer, that each filesystem driver hooks into, so you can call functions like openfile(path), writeFile(path) and it will automatically tell from the path which drive (for hdd vs floppy driver) and which filesystem (fat32, fat12, your own) to use - because the it's separated from the low level parts of each driver.
This interface/driver, would have a list of all hardware drivers for harddrives, floppies and so on, one list for all filesystem drivers, and one struct like list of which drives where found by what driver, and what filesystem was found on it. each hardware and filesystem driver could have an entry point where there's a calltable for the common operations it can preform, or zero if it's unimplemented, that way you know how to call it dynamically. HTH |
|||
30 Apr 2012, 12:23 |
|
JohnFound 30 Apr 2012, 12:33
OK, I will try to explain in details.
There are two aspects of storage devices access. First is the physical access - read and write of the sectors or clusters of the device. Different devices need different programs, depending on the interface. In general for every possible device your OS support you will need some subroutines to read or write sectors. The second aspect is the file system. The subroutines that manage the filesystem have as arguments different file parameters - file names, file attributes, etc. These subroutines process its operations reading and writing physical sectors - i.e. calling the subroutines of the previous layer, described. As long as there are different physical interfaces and different file systems, it is good idea to provide ability to use several of such libraries at the same time - some driver interface. At first time, you can keep your OS simple and use BIOS for the disk physical access and support only one file system. But it is good idea to make proper planning that to allow easy growth of the OS later. |
|||
30 Apr 2012, 12:33 |
|
majidkamali1370 30 Apr 2012, 22:46
I think now I understand what you said.
Thank you guys |
|||
30 Apr 2012, 22:46 |
|
adroit 02 May 2012, 15:56
An easier task would be the learn a existing filesystem, study it and try to re-implement it. From there, you may design your own filesystem, may it be a derivation of the existing one or not. But you've done some studying as to how the proper design of a filesystem is done. I haven't no experience in filesystems, but this seems like preferred thing to do, in my opinion.
_________________ meshnix |
|||
02 May 2012, 15:56 |
|
majidkamali1370 02 May 2012, 16:22
@JohnFound:
Quote: use BIOS for the disk physical access How can I use BIOS interrupts in pmode? |
|||
02 May 2012, 16:22 |
|
Dex4u 02 May 2012, 17:20
majidkamali1370 wrote: @JohnFound: With some simple code (depending on your OS design), there are many advantages to using it, along with drivers for the hardware. EG: As a backup if you do not have a suitable drivers. One of the big advantages is that you can read/write to USB fobs or USB FDD/HDD drives. Without the need for usb stack (you will need to add one at some point). Heres is some simple code, it goes to and from pm to switch modes, to swich between vesa mode and text mode every 10 seconds. You can use the same switching code to read/write using int 13h function. Best to switch evey 512bytes. (See DexOS code if you want a working example). Or see the work of "Mike Gonta" as a way to use BIOS interrupts in pmode.
|
|||||||||||
02 May 2012, 17:20 |
|
Mike Gonta 03 May 2012, 20:29
majidkamali1370 wrote: @JohnFound: That's the job of the BIOS extender. bootstrap32 is a PM32 USB FAT32 bootloader which includes a free BIOS extender (free in the sense that you are free to use it or not once loaded). Over 5 years in development and production. Tested on many PC's both old and new (with traditional BIOS). Correctly handles System Management Mode transitions. Directly supports the most commonly used BIOS functions. Access to the core function which allows access to any native motherboard BIOS function. No setup or special calls to make, just initialize the registers and make an interrupt call. Or you can roll your own as Craig has suggested. Last edited by Mike Gonta on 19 Nov 2012, 21:59; edited 2 times in total |
|||
03 May 2012, 20:29 |
|
tom tobias 06 May 2012, 11:22
Great comments, excellent thread. Thanks to all, much appreciated. A link to a tutorial explaining FAT 32 could also be useful for those wishing to follow the recommendation of first learning/using FAT 32, then designing one's own file system.
|
|||
06 May 2012, 11:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.