FauxOS - A virtual, completely in-browser, operating system
Installation
Installing is very straight-forward, it's one script in your web page.
The browser is the main target for this project, but you can freely
load into AMD and CommonJS environments too.
raw git provides a free cdn to you can use:
<script src="https://cdn.rawgit.com/fauxOS/fauxOS/master/dist/fauxOS.js"></script>
Dependencies
FauxOS has no runtime dependencies in the browser, just include it (preferably) in your <head>
.
If you don't want to build, simply copy from the pre-built /dist/fauxOS.js
.
To build it yourself, you need to get node.js and npm
Building
- Clone this repository :
git clone https://github.com/fauxOS/fauxOS.git
- Enter and get build dependencies :
cd fauxOS npm install
- Build it
npm run build
- Add the built file to your server :
cp dist/fauxOS.js ~/webserver/fauxOS.js
- Include the script :
<script src="/fauxOS.js"></script>
Testing (If you feel like it)
This uses Intern for testing
Run npm test
and go to localhost
-or-
Just navigate to index.html
in your browser
Note: the API is not set in stone right now, so there aren't many tests at the moment.
System Call Reference
This is not yet implemented, but all surrounding functionality is
Within the kernel, the sys
object holds all the system call functions. Userspace
can make kernel requests via a message, or
by loading in the included /lib
files.
- File System
mount()
- Mount a disk to the virtual file systemumount()
- Unmount a diskmknod()
- Make an inode of given typelink()
- Add an entry for an inode to a given directoryunlink()
- Remove an inode from a directory listingsymlink()
- Symbolically link an inode to a pathreadlink()
- Resolve a symbolic link to an inodecreate()
- Create an inode and automatically add it to the given directoryrename()
- Rename a directory entry in-place
- Files
access()
- Return short access privilege rulesstat()
- Return long file informationchmod()
- Change the permissions mode of a file or directoryopendir()
- Open a directory from path to directory file descriptorclosedir()
- Remove a directory file descriptoropen()
- Open a file and add a file descriptorclose()
- Close a file descriptordup()
- Duplicate a file descriptor to any other numberread()
- Read data from a file descriptorwrite()
- Write data to a file descriptor
- Pipes
mkfifo()
- Make a named "First In, First Out" pipe filepipe()
- Make an anonymous pipe between two processes
- Processes
spawn()
- Like windows CreateProcess()
, except not bloatedrfork()
- Resource fork, similar to linux's clone()
fork()
- Wrapper around rfork
exec()
- Replace the executing code of a processwait()
- Listen to a process and wait for a state change, like terminationgetpid()
- Get the Process ID of the calling processgetcwd()
- Return the current working directorychdir()
- Change a process's working directoryexit()
- Process terminates itself
- Inter-Process Communication
kill()
- Kill a process, do not confuse with linux's kill
callsignal()
- Send the given signal to a processassert()
- Wrapper around signal()
just for the current processsighandle()
- Change a process's signal handler, like sigaction()
rendezvous()
- Share private resources directly two between processes
- System
syslog()
- Append the current system state to the log fileuname()
- Get system information