From: erik quanstrom <quanstro@coraid.com>
To: joelcsalomon@gmail.com, 9fans@cse.psu.edu
Subject: Re: [9fans] Implementing cooked mode
Date: Wed, 20 Dec 2006 20:37:31 -0500 [thread overview]
Message-ID: <dc99ff5395b785cb5e865cc165208cd9@coraid.com> (raw)
russ is right. raw mode on the console is really raw. control
characters are printed out. if you've got a pc, you'll see ibm-432
characters.
plan 9 has a different attitude about the console than linux.
one can't interrupt a program running at a console. the console
is there for bringing a machine up. nobody wants to work at the
console.
rio really does implement raw mode in userspace. just because it's
doing things with string() -- "graphically" -- instead of opening up /dev/x
and using write(2) on that device doesn't make it less of a raw
interface in userspace. in fact, string(2) is using write on /dev/draw
under the covers.
compare pc/cga.c with what rio does with the screen. the main
difference is that the byte value is written to a memory location
in cga.c whereas rio needs to write a raster image to a block of
memory. logically, it's a similar operation. ...
just because you're not bit-banging the 8042 and moving bytes
into the cga window, doesn't mean it's not in "raw" mode. ;-)
- erik
On Wed Dec 20 19:55:34 EST 2006, joelcsalomon@gmail.com wrote:
> If a program has the console in raw mode, can it erase characters or
> words that it has echoed to the screen?
>
> Context is a homework assignment to implement cooked mode in user
> space. The code in /sys/src/cmd/rio/wind.c looks to be a start, but I
> don't see how to remove characters from the screen. I suppose I could
> use string() in libdraw and draw the string graphically rather than
> echoing. Rio's wind.c and acme's text.c both handle the various
> control characters, but they aren't pretending to write to the
> console.
>
> Nemo's book has a similar assignment, so it seems to be doable; I just
> haven't found how in the manual.
>
> Failing that, are there printable glyphs shown if control characters
> are write()n to the console?
>
> --Joel
next reply other threads:[~2006-12-21 1:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-21 1:37 erik quanstrom [this message]
2007-02-15 17:44 ` Harri Haataja
-- strict thread matches above, loose matches on Subject: below --
2006-12-21 0:54 Joel Salomon
2006-12-21 1:08 ` Russ Cox
2006-12-21 1:47 ` Russ Cox
2006-12-21 12:50 ` Brantley Coile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc99ff5395b785cb5e865cc165208cd9@coraid.com \
--to=quanstro@coraid.com \
--cc=9fans@cse.psu.edu \
--cc=joelcsalomon@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).