Comments (2)
Closing .... this proved much more complicated than I thought. May require a full rewrite of RunCPM's filesystem. Giving up for now.
from runcpm.
At the risk of resurrecting a dead issue, I've just now got $SYS, $R/O, $ARC and $PUBLIC working in my ZCPR3.3 fork of RunCPM.
Background: months ago I modified the file system routines to examine the FAT file's attribute bits and set the corresponding bits in the FCB's filename and type. Hidden became Public (FN2), and ReadOnly, System and Archive slid into FT1, FT2, and FT3. With the SD card plugged into a Linux system, I could use fatattr to set the various bits, and when the card was plugged back into the RunCPM system, the altered BDOS would see (and respect) the attributes. That was enough to get NovaDOS's/Z80DOS's public file support working, as well as preventing writes to $R/O files and hiding $SYS files in directory listings.
But while there was support in SdFat for reading the file attributes, there wasn't any for setting them. Which was a bit of a pain. Any time I wanted to change an attribute I had to shut down the RunCPM system, pull the card, put it in the Linux box, fatattr the file, pull the card again, etc., etc. But tonight I sat down and starting going through the SdFat library with a fine tooth comb. I figured out that I could add a handful of routines alongside isHidden(), isReadOnly() and isSystem() to set the attributes: makeHidden(), makeReadOnly(), makeSystem() and makeArchive(). Each gets passed a boolean parameter indicating whether the attribute should be set or reset. In addition, each make...() routine also sets the file's dirty bit. So when the file is closed, and sync() is called, the directory entry gets updated. A few lines of code in sync() was enough to transfer the attribute bits from the FatFile instance into the directory entry and get them written to the SD card. So now STAT can change the $R/O and $SYS attributes, and PUBLIC can do the same to the $PUBLIC attributes.
Keep in mind, I've done this in my divergent ZCPR3.3 fork. It's fairly different than the master branch by now, and it's only been done for the Arduino side of things. It's possible that the same kind of mods I've made to get the attributes working could be done for the Windows build; after all, I've done this with FAT file attributes and that's an MSDOS thing. But I'm not at all sure how a Linux port would work. Assuming I don't discover that my "let's try this and see how it goes" mods to SdFat have ended up trashing the filesystem on my SD card, is it worthwhile thinking about backporting something that might end up only working on some systems?
from runcpm.
Related Issues (20)
- Allow RunCPM to be used as a Github Action for SUBMIT jobs. HOT 4
- COPY program HOT 5
- Transverse (copy/execute) between slices HOT 1
- Going Crazt HOT 4
- CCP-ZCP3.60K HOT 1
- Feature request: Console on ESP32 TTL Serial port HOT 9
- BASIC/Z compiler not supported HOT 3
- NULU open lbr files does not work HOT 9
- saving/loading Problem with HEBAS under RunCPM HOT 2
- Bdos Err on M: Select when I try ASM DUMP.ASM HOT 2
- ESP32-Wrover kit freeze HOT 8
- Request: Simple variation on LED.BAS as a Hello World using BDOS 9 HOT 3
- [Q] Difference for RunCPM between TYPE and TYPE in a .SUB? HOT 4
- [Q] How about updateing to LUA v5.4.6? HOT 2
- Command switch to select base virtual-disk directory HOT 2
- Builds break after moving Lua in git submodule HOT 1
- Z80ASM (and M80) hang HOT 4
- 8085 and APU/FPU HOT 3
- Unable to build latest main branch HOT 4
- 8088/XT DOS as a build target ? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runcpm.