rust-kernel
Rustbelt: a hobby x86_64 kernel written in Rust
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | //! getty [-1] DEVICE -- run a shell on another terminal, e.g. /dev/hvc0.
//!
//! Real Unix systems run one "getty" per terminal line: it opens the line
//! and starts a login shell on it. Ours skips the login: it opens DEVICE
//! and spawns `sh` with stdin, stdout and stderr all on it. When the shell
//! exits (`exit`) a new one starts, unless `-1` was given.
//!
//! Try it: `getty /dev/hvc0 &` here, then on the host
//! `socat - UNIX-CONNECT:target/hvc0.sock` and type commands. That shell
//! is not "interactive" (no line editing): it reads one line at a time and
//! prints each line after the prompt, like a script.
use *;
const SHELL: &str = "/mnt/disk0/bin/sh";
|