Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to call all syscalls #2

Open
redfast00 opened this issue Dec 13, 2016 · 3 comments
Open

Not able to call all syscalls #2

redfast00 opened this issue Dec 13, 2016 · 3 comments

Comments

@redfast00
Copy link

We're currently using this as our production HTTP server 😉.
Since tape overflowing is implemented correctly, if you increment a cell that holds 255, it will wrap back to 0. This means that we aren't able to call all Linux syscalls, only those under 255.

@ajyoon
Copy link
Owner

ajyoon commented Dec 14, 2016

Please feel free to make a pull request on this; we may need to do some discussion on implementation since this will have to be a breaking change and the example library will most likely have to be rewritten.

@redfast00
Copy link
Author

redfast00 commented Dec 14, 2016

A quick idea: if the instuction cell is 255, we look to the next cell and add that number to 255 and then call the syscall with the sum. We'll be able to get 512 syscalls with this, and it (mostly) doesn't break the examples, except if they use inotify_rm_watch.

@ajyoon
Copy link
Owner

ajyoon commented Dec 14, 2016

This wouldn't be consistent with the way large numbers are handled in multi-byte argument values, where large cells are combined as big endian values. To be consistent with that, the argument form would have to change to something like:

  • first cell -> arg value cell length (n) (or some flag for 1 vs 2 cells)
  • nth cell -> arg value
  • rest as before

On the other hand, given how uncommon it would be to use those higher-value syscalls, maybe this as a weird edge-case would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants