WIP: new abstraction layer, file system now a singleton, shell should be too

This commit is contained in:
2026-05-13 17:56:19 +02:00
parent 106abd851a
commit 619de5e1f8
24 changed files with 628 additions and 302 deletions
+44
View File
@@ -0,0 +1,44 @@
import type { Stack } from '$lib/stores/stack';
import { FileSystem } from '../filesystem/filesystem';
export class Shell {
private readonly _fs: FileSystem;
private _passwd: User[];
private _group: Group[];
private _commands: Command[];
private _userSessions: Stack<User>;
private user: User;
private _process?: Process;
constructor() {
this._fs = new FileSystem();
}
}
export enum ExitCode {
OK = 0,
ERR = 1,
INT = 2
}
export type User = {
username: string;
password: string;
readonly uid: number;
readonly gid: number;
home: string;
accessible: boolean;
history: string;
cwd?: number;
pwd?: number;
};
export type Group = {
groupname: string;
gid: number;
members: number[];
};