From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Wed, 20 Dec 2006 20:37:31 -0500 To: joelcsalomon@gmail.com, 9fans@cse.psu.edu Subject: Re: [9fans] Implementing cooked mode MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: Topicbox-Message-UUID: f6dd2c98-ead1-11e9-9d60-3106f5b1d025 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