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

Add & and | operators to hull #994

Merged
merged 27 commits into from
Jul 6, 2023
Merged

Conversation

tsoutsman
Copy link
Member

@tsoutsman tsoutsman commented Jun 28, 2023

Adds & and | operators, and implements the jobs and history commands.

`graphic=no` adds the `-nographic` flag to the QEMU invocation.
Supporting this required a few changes to `captain`.

`terminal=(name of terminal)` e.g. `terminal=alacritty` will launch a
new terminal window connected to `SERIAL2`. We do this by testing the
next free TTY with `tools/free_tty` and assuming QEMU will use the same
TTY. This may seem jank, but I think it's the only feasible solution.

I've tested this on MacOS (side note: macOS makes it very hard to launch
a new terminal window from the terminal) so if someone could test this
on Linux as well that would be good. Also, I wasn't able to build for
`aarch64` so the changes to `captain` need to be tested to ensure builds
for `aarch64` didn't break.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
`concat!` prevents `format_args!` from capturing variables from the
surrounding scope. Implementing `println!` using a nested `format_args!`
removes this limitation allowing us to do the following:
```rust
let x = 3;
println!("{x}");
```
Similar to `std::println!`.

Also, the change [does not impact performance][1].

[1]: rust-lang/rust#106824

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
@tsoutsman tsoutsman marked this pull request as draft June 28, 2023 14:00
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Avoids disabling preemption for the duration of the program which can
interfere with printing to the terminal.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
@tsoutsman
Copy link
Member Author

Depends on #1000.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
@tsoutsman tsoutsman requested a review from kevinaboos July 4, 2023 04:30
@tsoutsman tsoutsman marked this pull request as ready for review July 4, 2023 04:30
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks generally good so far. The one thing I'm unsure of is spawning another entire task to watch a new app task, but I suppose we could accept that heavyweight approach for now and work on a different monitoring mechanism later, e.g., a select-like operator.

I'm ok with accepting it as is, though I'll wait for our meeting tmrw to discuss it in person.

@kevinaboos kevinaboos merged commit 5c269ad into theseus-os:theseus_main Jul 6, 2023
github-actions bot pushed a commit that referenced this pull request Jul 6, 2023
`hull` is now almost feature complete.

Not quite ready to replace the existing `shell` app,
but is implemented better and more canonically than `shell`.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com> 5c269ad
github-actions bot pushed a commit to kevinaboos/Theseus that referenced this pull request Jul 6, 2023
…eus-os#994)

`hull` is now almost feature complete.

Not quite ready to replace the existing `shell` app,
but is implemented better and more canonically than `shell`.

Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com> 5c269ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants