basic changes

This commit is contained in:
2026-03-23 11:41:39 +01:00
parent d5622d8009
commit a95b233c68
4 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
# For MVP functionality # For MVP functionality
- write a tester OS, basically a menu with tests to run
- stop doing linear scans and do hashmaps smh (ls /dev is awfully slow and this MIGHT be why) - stop doing linear scans and do hashmaps smh (ls /dev is awfully slow and this MIGHT be why)
- volatile filesystem - volatile filesystem
- device info - device info

Binary file not shown.

View File

@@ -200,7 +200,12 @@ nn_Exit ne_fsState_handler(nn_FilesystemRequest *req) {
if(feof(f)) { if(feof(f)) {
req->strarg1 = NULL; req->strarg1 = NULL;
} else { } else {
req->strarg1len = fread(req->strarg1, sizeof(char), req->strarg1len, f); size_t off = 0;
while(off < req->strarg1len) {
if(feof(f)) break;
off += fread(req->strarg1 + off, sizeof(char), req->strarg1len - off, f);
}
req->strarg1len = off;
} }
return NN_OK; return NN_OK;
case NN_FS_WRITE: case NN_FS_WRITE:

View File

@@ -2718,7 +2718,9 @@ nn_Exit nn_filesystem_handler(nn_ComponentRequest *req) {
if(nn_checkinteger(computer, 0, "bad argument #1 (integer expected)")) return NN_EBADCALL; if(nn_checkinteger(computer, 0, "bad argument #1 (integer expected)")) return NN_EBADCALL;
fsreq.fd = nn_tointeger(computer, 0); fsreq.fd = nn_tointeger(computer, 0);
fsreq.action = NN_FS_CLOSE; fsreq.action = NN_FS_CLOSE;
return state->handler(&fsreq); err = state->handler(&fsreq);
if(err) return err;
return nn_pushbool(computer, true);
} }
if(method == NN_FSNUM_READ) { if(method == NN_FSNUM_READ) {
nn_costComponent(computer, req->compAddress, state->fs.readsPerTick); nn_costComponent(computer, req->compAddress, state->fs.readsPerTick);