Skip to content

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

Description

@Kroc

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions