BigDumbDinosaur wrote:
That screen shot in my last post is from software running on POC V1.1. The display is of the parameters calculated from the input value of 67,000,000 data blocks. When [CR] is pressed at the prompt, the filesystem is generated and is theoretically capable of storing files.
So, in UNIX term, you have implemented mkfs. Splendid.
Quote:
The Minix filesystem design borrowed from the BSD UNIX filesystem, which in turn, was derived from the UNIX S51K filesystem that came to life in the 1970s. The Minix FS is simplistic (as it was intended to be) and has some problematic areas that resulted in it being supplanted by the EXT series of Linux filesystems (in particular, the allocation bitmap design is such that the filesystem can be easily corrupted). ...
My main requirement was to be able to read files from a removable storage device. Everyone and their cat will use FAT16 as the filesystem of choice. My initial goal was to implement, in 6809 asm, a reader for EXT2, but that filesystem is complex to parse, and used 32bit block pointers. So instead I looked at MinixFS, and because - at least for MinixFS v1 - the pointers are all 16bit, it seemed ideal for my 8/16 bit 6809. Inodes are simple 32byte structures (so 32 per 1KB block), and dir entries are likewise 32bytes - 2 bytes for the inode pointer and 30 bytes for the filename. Nice and convient, for me, as inode block numbers and offsets within the blocks can be calculated with shifting and masking.
Quote:
... I describe the process I have followed to date in the 816NIX design in this forum topic—reading from the beginning will give you some insight into where I am headed with this.
I shall certainly go back and give it a good old read. I love the detail you go into with most of what you write.
Quote:
If you have a working mechanism for relating an inode to its corresponding data you're already most of the way to being able to list files by name, as well as display permissions, size, timestamps, etc. It really isn't all that complicated in principle and directories can be simple sequential files listing filenames and associated inodes.
Sorry I should have been more clear. I can list a directory by inode and view inode numbers, permissions, file sizes, and filenames. Like this:
Code:
Monitor: > m
Partition starts at: 0020
Magic is: 138F
Start of inodes at block: 000D
Monitor: > l 0001
0001 41ED 00E0 .
0001 41ED 00E0 ..
0002 81ED 154D article4.txt
0003 81A4 0139 settime.bin
0004 81A4 00A5 showtime.bin
0005 81A4 0037 testprog.bin
0006 81A4 001C type.bin
Columns are: inode, type/perms, filesize and filename. My next task is to write a directory parser then can find the named file and return its inode number. Then I can hook the directory and file reading commands to use that.
Quote:
Mass storage and filesystems are two separate concepts, and generally should be designed independently of each other. The storage medium dictates the mechanics of how bytes are read and written. The filesystem dictates the organization and meaning of the bytes that are read and written. In other words, what you do is look at raw storage as a black box into which you dump and later on retrieve bytes. Your filesystem primitives determine how to organize the bytes that are dumped and retrieved.
...
Yes indeed. For my IDE/CompactFlash reading code, I started off with "raw" I/O on 512byte disk bytes, reading those into memory and so on. My MinixFS reading code uses those same functions. Now, I haven't gone "all out" and written a proper abstraction layer. Are you doing that? It would not be too hard to do; just decide on a block-device layer API and stick to it. For each different block device driver, a different jump table could be slotted in.
While on the subject of APIs, are you planning on writing a full user filesystem API? By that I mean a mechanism to handle "open" files, with file handles, seek operations and so on? I'm not sure how far along the rest of your system-level code is. Implementing a full OS with multi-tasking, filesystem drivers, serial drivers, etc sounds like an awesome undertaking though!
Quote:
Quote:
I'm quite pleased with what I've done so far though, but reading files by filename would be a nice touch.
I don't think I'll ever do writing to the filesystem; It looks much too tricky, with bitmaps to update etc.
It's not that difficult if you think it through and modularize things. At least with the 65C816, manipulating a bitmap isn't too onerous. The rest is merely defining a sequence of steps that must be completed to find and allocate storage, write data into it and update the relevant data structures. Procedure, procedure...
I might have a look at writing to the filesystem at some point. Creating new files, or rewriting an entire new file, might be *reasonably* straightforward. Appending to files, though... sounds really fiddly.
Quote:
Quote:
Can't wait to see this progress. I wish I had a SCSI controller on my machine...
What are you waiting for? Fire up your schematic editor!
I think your skills are quite beyond mine.
Check out my blog if you're board... The filesystem stuff is roughly described here:
http://aslak3.blogspot.co.uk/2013/11/sound-and-running-programs-from-cf.html