flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > NoFat Goto page 1, 2 Next |
Author |
|
crc 03 Nov 2004, 22:40
There are many, many ways to handle file systems. I use a simple block-based file system (1k blocks), where a file gets an entry like:
Code: rb 32 ; filename dd starting_block dd number_of_blocks It's very simple, and quite effective for a small OS. Your idea would works just as easily the other way: have each block know the location of the next block. You'd have a chain of blocks, with some metadata in each block, and terminate the chain with "0" or something like that. Then you could read the file in the correct order and still only have the name & initial block number in the FAT |
|||
03 Nov 2004, 22:40 |
|
joachim_neu 04 Nov 2004, 07:56
you can create every filesystem you want!!! i created my own, too, but the manual about it is in German... maybe i'll translate it.
|
|||
04 Nov 2004, 07:56 |
|
Ghost Cat 05 Nov 2004, 00:31
crc wrote: Your idea would works just as easily the other way: have each block know the location of the next block. Well, I don't know about your computer but mine is old and she can not predict the future. If I ask her to figure out where the blocks might fall she most likely will get beck to me with some sarcastic remark like "You want ME to guess?" |
|||
05 Nov 2004, 00:31 |
|
Gomer73 05 Nov 2004, 16:17
The problem with linking the blocks is slowness.
You read consecutive sectors off the disk straight into memory if the links aren't stored in the data, otherwise it is complicated or you have to do a lot of moves. |
|||
05 Nov 2004, 16:17 |
|
Ghost Cat 10 Nov 2004, 15:02
Are you sure that it is how it's being done, the consecutive sectors are read in the batch, or is it your guess?
|
|||
10 Nov 2004, 15:02 |
|
mastermind 11 Nov 2004, 21:40
No. They are.
Let's say you have a file on block 5. How would you know where block 5 is? You follow the pointer in block 4. But that assumes that you have block 4 in memory already. If not, you read block 4. How would you know where block 4 is? You follow the pointer in block 3. But that assumes that you have block 3 in memory already. If not, you read block 3. How would you know where block 3 is? You follow the pointer in block 2. But that assumes that you have block 2 in memory already. If not, you read block 2. How would you know where block 2 is? You follow the pointer in block 1. But that assumes that you have block 1 in memory already. If not, you read block 1. Now that you have block 1, you can follow its pointer to block 2. You can then sequentially get blocks 3, 4, and 5. So you read _all_ of the blocks up to the desired block. One way to reduce the amount of copying/moving is to use caching, in which you either store each block read somewhere in memory for future access or save only the pointer to each block. You still end up reading much of the disk. |
|||
11 Nov 2004, 21:40 |
|
joachim_neu 12 Nov 2004, 12:45
well, I think the biggest problem is, that the writing of all the files is easy, but what, if you delete a file? then there are for example 5 blocks in the middle free... and then they are only useable, if you make a moving with all the following files 5 blocks forward or wait for a file, which is 5 blocks big! much free memory is unuseable without movings...
|
|||
12 Nov 2004, 12:45 |
|
mastermind 12 Nov 2004, 13:18
Not really.
This FS uses something like a linked list, which is really easy to manipulate (insert, delete, ...). A file does not have to occupy sequential blocks. If each block has a link to the next block, then you can have a file A, for example that resides on blocks 1,5,2,3, and 9: 1->5->2->3->9 Removing a block is easy too, just set the pointer of the previous block to the next one. To insert involves a similar action. Then, of course, you'd have to keep track of which blocks are free. Then you can have a block that holds a list of free blocks. If you need a block, just find a block here, link it in, and remove it from the list. If you delete a block, just return it to this list. Except, it's now getting closer to a FAT, except the table is for free blocks. Last edited by mastermind on 12 Nov 2004, 13:22; edited 1 time in total |
|||
12 Nov 2004, 13:18 |
|
bubach 12 Nov 2004, 13:20
joachim_neu: I am thinking of this problem too. I'll have to figure that out, before i start implementing my own FS.
mastermind: I want all files to be in order, without fragmentation... Last edited by bubach on 13 Feb 2012, 14:56; edited 1 time in total |
|||
12 Nov 2004, 13:20 |
|
mastermind 12 Nov 2004, 13:24
You should keep using FAT until you have your new filesystem ready. Then you could make a driver or something. That way, your OS supports multiple filesystems, which is good.
Oh yeah. Bubach, I'm using your bootloader+secondstage for my own OS. I was using bootf02 before, but it was so tightly packed that I couldn't remove the paging code without breaking something (I wanted to do that in the kernel). Then I switched to GRUB, which wasn't good either, because I cannot execute any realmode code without either switching back into realmode or using v86. Your's was the only loader that I could successfully adapt for my purposes. Thanks! Last edited by mastermind on 12 Nov 2004, 13:30; edited 1 time in total |
|||
12 Nov 2004, 13:24 |
|
bubach 12 Nov 2004, 13:27
Thats what i am doing..
|
|||
12 Nov 2004, 13:27 |
|
mastermind 12 Nov 2004, 13:32
Hmm... Then perhaps once in a while, like in 10min intervals, you could run a diskgarbagecollect function or something. I cannot see any way right now to fix that problem.
Aiight. Gotta go to class now. bbl. |
|||
12 Nov 2004, 13:32 |
|
bubach 12 Nov 2004, 13:55
Yeah, i was thinking of doing some file-moving, when a specific size is needed. But i guess thats going to be slow. Installing software and get a 10min delay for file-moving..
Skip class? I (almost) only use school to get broadband access, as i live in the forrest.. |
|||
12 Nov 2004, 13:55 |
|
Gomer73 12 Nov 2004, 17:53
Sorry for not getting back sooner.
With LBA you can directly specify which memory locations to load the blocks to. If you use links within the blocks, you would have to load the block into memory and the transfer the non-link stuff into the destination memory. The speed would especially noticied for consecutive sectors in a row. ..Gome73 |
|||
12 Nov 2004, 17:53 |
|
mastermind 12 Nov 2004, 22:11
Or you could do what toe programmers of MeOS did: read the whole disk into memory on bootup. It's faster to move stuff around in RAM. Then you could write everything to disk when the OS exits.
What do you mean, skip class? Today I had first period free, so I could hack around, among other things... |
|||
12 Nov 2004, 22:11 |
|
joachim_neu 13 Nov 2004, 09:23
a clever idea, but if the OS breaks down? if there's a misstake or error, and the system reboots, all the work is away! and that's very bad! Or if you save when the misstake comes, you write the misstake on the floppy, too!
|
|||
13 Nov 2004, 09:23 |
|
bubach 13 Nov 2004, 13:39
I don't think it's that clever.. only an attempt to get a slow asm os a bit faster..
ps: i don't mean to offend the menuet people, but menuet is slow for an asm os. Last edited by bubach on 13 Feb 2012, 15:02; edited 1 time in total |
|||
13 Nov 2004, 13:39 |
|
ASHLEY4 13 Nov 2004, 16:45
I agree with bubach, but i do not think its MenuetOS fault, you can not make a pmode, multitasking, OS using vesa, much faster.
PS: Is that slowwww pong games still in menuet ?. \\\\||//// (@@) ASHLEY4. Batteries not included, Some assembly required. |
|||
13 Nov 2004, 16:45 |
|
mastermind 14 Nov 2004, 02:36
I don't know if it's still being distributed, but I still have it on my MeOS disk .
|
|||
14 Nov 2004, 02:36 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.