Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support read-only, hidden & system bits on files #2

Open
Kroc opened this issue Mar 17, 2023 · 0 comments
Open

Support read-only, hidden & system bits on files #2

Kroc opened this issue Mar 17, 2023 · 0 comments

Comments

@Kroc
Copy link

Kroc commented Mar 17, 2023

The flags byte for each directory entry currently has two bits for in-use and directory|file.

First, may I suggest that bit 6 is used for the directory|file bit as bits 7 & 6 are easy to read on 6502 but not bits 0-5 (should someone wish to implement a ZealFS driver on 6502). The 6502 has a very strange BIT instruction that ANDs the accumulator and sets the zero flag, but copies bit 6 & 7 from the parameter into the CPU flags (N&V). Madness, yet, but it means that bits 6&7 can be tested without using any registers. For the other bits the Accumulator is needed. The remaining flags can be in bits 0-5 (this also helps with processing as the bits could be popped off in order using shift-right).

  • A read-only / write-lock flag is a must and would not cost much in implementation
  • A hidden flag is a nice-to-have
  • A system flag is used to convey some special status. If you wanted to mimic Linux then it could be used for executables so that a file extension is not required and the OS can identify what to do with the file quickly. If you go with an execute bit, it should be on bit 0 so that it's fastest to check given once entry-in-use and is-file has been determined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant