Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Missing core utilities #43

Open
7 of 90 tasks
AtkinsSJ opened this issue Mar 4, 2024 · 6 comments
Open
7 of 90 tasks

Missing core utilities #43

AtkinsSJ opened this issue Mar 4, 2024 · 6 comments

Comments

@AtkinsSJ
Copy link
Contributor

AtkinsSJ commented Mar 4, 2024

The POSIX spec lists a whole lot of different utilities, some of which are not so relevant (I'm looking at you, fort77). Here's a list I've come up with, roughly grouped into categories.

  • alias/unalias
  • bc
  • cal
  • cksum
  • command
  • df
  • du
  • expr
  • fc (Needs some kind of terminal text editor)
  • file
  • find
  • getopts
  • iconv
  • man: Just print a message saying to use help instead
  • more/less. (more is the spec one, but less is nicer to use. Maybe redirect one to the other? Or just share a lot of code)
  • od
  • patch
  • pathchk
  • sh
  • sleep
  • tee
  • test - need to rename our existing test!
  • time
  • tsort
  • type
  • wait
  • xargs

Text processing

  • Per-line
  • cut
  • expand/unexpand
  • fold
  • grep
  • head
  • join
  • nl
  • paste
  • pr
  • sort
  • split
  • uniq
  • Printf-like
  • date
  • printf - missing a couple of features but mostly complete
  • Sed-like
  • awk
  • csplit
  • dd
  • sed
  • tr
  • Binary
  • strings

Comparison

  • cmp
  • comm
  • diff

Terminal things

  • read
  • stty
  • tabs
  • tput
  • tty

User/group/permission related

  • chgrp
  • chmod
  • chown
  • id
  • logname
  • mkdir lacks permission stuff too
  • newgrp
  • ulimit? Unless we just output "unlimited"
  • umask
  • uname
  • who

Other ones requiring platform support

  • crontab
  • fuser I think?
  • getconf?
  • jobs?
  • kill?
  • link/ln/unlink? (link is equivalent to a specific invocation of ln)
  • locale?
  • localedef?
  • logger
  • lp - printers!
  • mkfifo
  • nice/renice
  • nohup
  • ps

Missing functionality

  • cd: -LP and spec algorithm
  • cp: options and spec algorithm
  • echo: escapes
  • env: Assigning variables, running a command with a set environment
  • head: multiple inputs
  • ls: I'm sure we're missing a bunch of stuff here
  • mv: options and spec algorithm
  • pwd: -LP
  • tail: options
  • touch: options and spec algorithm
@Kreijstal
Copy link

you miss cc, a c compiler

@AtkinsSJ
Copy link
Contributor Author

AtkinsSJ commented Apr 5, 2024

you miss cc, a c compiler

Yeah that's one of the ones I skipped. A C compiler is not useful for Puter when it can't (yet?) run C programs. (Though, people are working on x86 emulation so who knows.)

This was originally a list I put together for my own notes, but decided to make it public instead. So what went on it was my opinion really. Feel free to implement anything not on this list if it makes sense. :^)

@Kreijstal
Copy link

Kreijstal commented Apr 5, 2024

you miss cc, a c compiler

Yeah that's one of the ones I skipped. A C compiler is not useful for Puter when it can't (yet?) run C programs. (Though, people are working on x86 emulation so who knows.)

This was originally a list I put together for my own notes, but decided to make it public instead. So what went on it was my opinion really. Feel free to implement anything not on this list if it makes sense. :^)

Most computers can't run C directly, that's why they compile it :)
You'd compile C into wasm, or into JavaScript ala emscripten.
That is not the hard part, the hard part is implementing the posix C extensions. Essentially we'd need to embed emscripten into puter.

@Kreijstal
Copy link

but maybe this is obviously too ambitious, so I would say, get us a wasm assembler and we will start from there

@KernelDeimos
Copy link
Collaborator

In discussions with the community (mostly via Discord at the moment) we seem to be leaning toward the direction of x86 emulation rather than something like emscripten. With this approach Puter's own filesystem could be mounted into something like a headless Archlinux instance using our FUSE driver.

@Kreijstal
Copy link

In discussions with the community (mostly via Discord at the moment) we seem to be leaning toward the direction of x86 emulation rather than something like emscripten. With this approach Puter's own filesystem could be mounted into something like a headless Archlinux instance using our FUSE driver.

assuming you get x86 emulation you'll still have to translate the posix syscalls, unless you emulate the whole OS (but then Id just visit v86 or JSlinux), also it will be slower. since you do have to do that, you can support native wasm/js anyway

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

No branches or pull requests

3 participants