JavaScript OS is a simple operating system simulation written in JavaScript. It includes basic functionalities such as process management, memory management, and file system operations.
- Process Management: Create, run, and terminate processes.
- Memory Management: Load, store, and manipulate data in memory.
- File System: Create, read, write, and delete files.
project/ ├── fs/ # File system root ├── src/ │ ├── commands/ # Command modules │ │ ├── FileCommands.js │ │ ├── MemoryCommands.js │ │ ├── ProcessCommands.js │ ├── os/ # Operating system core │ │ ├── OperatingSystem.js │ │ ├── Process.js │ ├── index.js # Entry point
-
Clone the repository:
git clone https://github.com/yourusername/javascript-os.git cd javascript-os
-
Install dependencies (if any):
npm install
-
Start the operating system shell:
node src/index.js
-
Use the following commands in the shell:
load <value>
: Load a value into the accumulator.store <address>
: Store the accumulator value at the specified memory address.add <value>
: Add a value to the accumulator.sub <value>
: Subtract a value from the accumulator.mul <value>
: Multiply the accumulator by a value.div <value>
: Divide the accumulator by a value.print
: Print the value of the accumulator.clear
: Clear the accumulator.
createFile <filename>
: Create a new file.readFile <filename>
: Read the contents of a file.writeFile <filename> <content>
: Write content to a file.deleteFile <filename>
: Delete a file.
createProcess <instructions>
: Create a new process with a list of instructions.runProcess <pid>
: Run a process by its PID.terminateProcess <pid>
: Terminate a process by its PID.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.