akkartik / mu

Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.
http://akkartik.name/akkartik-convivial-20200607.pdf
Other
1.35k stars 47 forks source link

SubX: decide on minimal set of syscalls to support #10

Closed tekknolagi closed 3 years ago

tekknolagi commented 5 years ago

https://syscalls.kernelgrok.com/

akkartik commented 5 years ago

So far: exit, read, write. Everything is a file, so that should be enough, right? 😛

But seriously we do need at least open and close. And probably the directory and socket calls.

akkartik commented 5 years ago

But we're not going to support them all. Certainly not all the ioctl()s.

akkartik commented 5 years ago

Draft list:

  1. ~exit~
  2. ~read~
  3. ~write~
  4. open
  5. close
  6. creat
  7. unlink
  8. rename

I was going to add socket ones like bind and accept -- but they aren't syscalls!

akkartik commented 5 years ago

Man, it sucks that POSIX is defined in terms of libc. The operating system interfaces defined in terms of a single language's standard library. Such ugly design. The whole thing is lying to generations of programmers.

akkartik commented 5 years ago

Looks like the socket API is multiplexed through socketcall: http://man7.org/linux/man-pages/man2/socketcall.2.html

Somebody actually mentioned it on Mastodon yesterday: https://social.coop/@h/100450184726157532. But I didn't know what I was looking at.

So we'll add the following:

  1. socketcall // socket
  2. socketcall // bind
  3. socketcall // connect
  4. socketcall // listen
  5. socketcall // accept
  6. socketcall // send
  7. socketcall // recv
  8. socketcall // shutdown
akkartik commented 5 years ago
  1. brk
tekknolagi commented 5 years ago

Suggestion: use a checklist instead of an OL. But I like that idea.

akkartik commented 5 years ago

https://john-millikin.com/unix-syscalls

via https://news.ycombinator.com/item?id=17706119

akkartik commented 5 years ago

Non-socket syscalls are done: https://github.com/akkartik/mu/commit/5cec03b414

akkartik commented 3 years ago

This ticket has probably gone as far as it will go. If necessary we'll open another one for socket syscalls at some point.