Block device peripheral and SBFS file system implemented.

This commit is contained in:
Anachronaut
2026-08-16 14:03:29 -04:00
parent 04dfcd707b
commit eff6902bcf
36 changed files with 3251 additions and 31 deletions
+5
View File
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include "cpu.h"
#include "controller.h"
#include "io.h"
#include "utility.h"
#include <string.h>
#include <getopt.h>
@@ -90,6 +91,9 @@ int main (int argc, char *argv[]) {
fprintf(stderr, "Error: Couldn't read file: %s\n", programFile);
return 1;
}
if (options.disk != NULL && attachDisk(options.disk, options.writeProtect)) {
return 1;
}
CPURegisters cpu;
// The controller has to know where the memories are before anything can reach
// them through it. Banks 0 and 1 are those two arrays.
@@ -136,6 +140,7 @@ int main (int argc, char *argv[]) {
printf("Cycle: %lu\n", cycleCount);
}
}
detachDisk();
if (limitReached) {
printf("Execution stopped after %lu cycles. (cycle limit reached)\n", cycleCount);
} else if (cpu.Status & STATUS_FAULT) {