Ernest Wong
ba8a67f249
Filestorage tests: Avoid globals to improve script readability
2020-08-30 19:37:15 -05:00
Ernest Wong
c928964562
Minor: Tidy quotes and spacing
2020-08-30 19:37:15 -05:00
Ernest Wong
c273741405
Add tests for file storage chunking
2020-08-30 19:37:15 -05:00
Ernest Wong
a841194d28
Filestorage: Reuse IDBObjectStore throughout transaction
...
- More like passing the same reference to it when calling db_get/set.
- In reality, it was still the same store object being accessed, but
this commit improves the coherence of the db_get/set helper methods.
2020-08-30 19:37:15 -05:00
Ernest Wong
bf35f0ab0b
Filestorage: Avoid additional allocation for small files
2020-08-30 19:37:15 -05:00
Ernest Wong
840415a052
Filestorage: (minor) Improve naming can_uncache() -> uncache()
2020-08-30 19:37:15 -05:00
Ernest Wong
d6bfa143ed
Filestorage: Don't rely on errors to select type of storage
2020-08-30 19:37:15 -05:00
Ernest Wong
738edf7b6c
Filestorage: Initialise IndexedDB before constructor
...
Simplifies several checks
2020-08-30 19:37:15 -05:00
Ernest Wong
9db722f71f
Filestorage: Improve usefulness of IndexedDB error messages
2020-08-30 19:37:15 -05:00
Ernest Wong
2f4520619a
Filesystem: Tidy naming of STATUS_ON_SERVER to ON_STORAGE
2020-08-30 19:37:15 -05:00
Ernest Wong
c625bba498
Filestorage: Implement cache cleanup - avoid memory growth
2020-08-30 19:37:15 -05:00
Ernest Wong
3a74e66b72
Filestorage: Expose load_from_server
2020-08-30 19:37:15 -05:00
Ernest Wong
04d2b72248
9p: Simplify read - OpenInode is not asynchronous
2020-08-30 19:37:15 -05:00
Ernest Wong
62c880b415
Filestorage: Integrate chunking and revert unnecessary chunking
...
- Integrate new FileStorage interface with lib/filesystem.js
- Simplify the FileStorage interface with the intention that it only
serves read-only files.
2020-08-30 19:37:15 -05:00
Ernest Wong
afd27597d7
Filestorage: Draft chunking behind new FileStorage interface
2020-08-30 19:37:15 -05:00
Ernest Wong
efa45a3d11
Filestorage: Make filestorage .get .set atomic
...
...by sticking to the same transaction throughout an operation.
2020-08-30 19:37:15 -05:00
Ernest Wong
7cfe865556
Filestorage: Draft chunking behind existing FileStorage interface
2020-08-30 19:37:15 -05:00
Ernest Wong
dfb47f5907
Filesystem Tests: Add stopping-on-first-failure option
2020-08-30 19:37:15 -05:00
Ernest Wong
8b64844d27
Filestorage: Give project-related name for IndexedDB Storage
2020-08-30 19:37:15 -05:00
Ernest Wong
83b283ebbe
Filestorage: Replace the two server classes with a wrapper class
...
Simplifies both the filestorage.js code as well as the starter.js code
that uses these FileStorage classes.
Now, the ServerFileStorageWrapper decorates the other FileStorage
classes by loading from the server when the file is not available.
Moreover, the previous starter.js was incorrectly passing the `baseurl`
parameter (it was passing it when baseurl was not defined nor needed).
2020-08-30 19:37:15 -05:00
Ernest Wong
93d9f6923e
Filestorage: Prevent overlapped reinitialization of IndexedDB
...
Catches cases when IndexDBFileStorage#init is accidentally called in
multiple places.
2020-08-30 19:37:15 -05:00
Ernest Wong
a85dd50169
Filestorage: Improve assert coverage and robustness
...
Checks that sha256sum is also not undefrined nor null.
Avoids ReferenceError when window is not defined e.g. on NodeJS.
2020-08-30 19:37:15 -05:00
Ernest Wong
c2dcb440dd
Filestorage: Refactor fallback and load-from-server
...
Fallback logic is moved to the caller's responsibility.
Empty FileStorages and FileStorages that load from the server are
separated into different classes. This is to avoid faults where the
caller of the constructor forgets to pass in a `baseurl` parameter and
leads to some confusing bug.
2020-08-30 19:37:15 -05:00
Ernest Wong
c029944965
Filesystem: Distinguish server file via inode status.
...
Also make file_storage a mandatory argument to FS.
2020-08-30 19:37:15 -05:00
Ernest Wong
6a06a7108a
Tidy: file_storage snake case and interface naming convention
2020-08-30 19:37:15 -05:00
Fabian
df1ebec737
sync & drop caches before saving state
2020-08-30 19:37:15 -05:00
Fabian
88f482fae0
Commit temporary workaround
2020-08-30 19:37:15 -05:00
Fabian
639ec0019b
Commit a temporary workaround
2020-08-30 19:37:15 -05:00
Fabian
608559fa94
Call hlt_loop immediately on an hlt instruction
2020-08-30 19:37:15 -05:00
Fabian
01697a7ebb
Delete some dead code
2020-08-30 19:37:15 -05:00
Fabian
2233b069b3
Mark Bitmap as constructor
2020-08-30 19:37:15 -05:00
Fabian
02f657b836
tools: Force python 3
2020-08-30 19:37:15 -05:00
Fabian
ff3945bab4
Don't skip Linux 4 bzImage test
2020-08-30 19:37:15 -05:00
Fabian
7720f9a8e6
Print opcode on unimplemented sse instructions
2020-08-30 19:37:15 -05:00
Fabian
7a31922078
Add test for bzimage_initrd_from_filesystem
2020-08-30 19:37:15 -05:00
Fabian
fa540e6e86
fs2json: Handle tar files that don't report file type in mode bits
2020-08-30 19:37:15 -05:00
Fabian
38b8435c88
Print eip on bad instruction encodings
2020-08-30 19:37:15 -05:00
Fabian
1650bf85fb
Add networking.sh for docker
2020-08-30 19:37:15 -05:00
Fabian
92346f51ed
Add test for clean shutdown
2020-08-30 19:37:15 -05:00
Fabian
e7c16e6d96
Use emulator.stop() to exit
2020-08-30 19:37:15 -05:00
Fabian
400673646f
Remove unused constants
2020-08-30 19:37:15 -05:00
Fabian
58b8c49fb0
Pack memory in state image, reduces memory use during state loading
2020-08-30 19:37:15 -05:00
Fabian
32606a26ac
rtc: Implement alarm interrupt
2020-08-30 19:37:15 -05:00
Amaan Cheval
3eb15d328d
cpu: Update iret for minor fixes from manual
...
Citations for these changes:
https://imgur.com/a/QgNekKL
2020-08-30 19:37:15 -05:00
Amaan Cheval
1d5e0052b4
cpu: Port iret, iret16, iret32 to Rust
2020-08-30 19:37:15 -05:00
Amaan Cheval
8aa06b54e0
cpu: Port switch_cs_real_mode to Rust
2020-08-30 19:37:15 -05:00
Fabian
e5fbbd0f2d
Implement json loading for nodejs
2020-08-30 19:37:15 -05:00
Fabian
99f93a7740
Exit the process after state file has been built
2020-08-30 19:37:14 -05:00
Fabian
93a10651ca
Improve log notice
2020-08-30 19:37:14 -05:00
Fabian
d2f86799e9
Simplify load_from_json: Accept json object directly, don't run asynchronously
2020-08-30 19:37:14 -05:00