tty layer - exercise.htm
来自「LINUX内核编程的一些程序例子」· HTM 代码 · 共 51 行
HTM
51 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0063)http://www.geocities.com/marco_corvi/games/lkpe/tty/mem_tty.htm -->
<HTML><HEAD><TITLE>The TTY layer</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK
href="tty layer - Exercise_file/style.css" rel=stylesheet>
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<H2>tty layer - Exercise </H2>
<DIV>The point of this exercise is to write a memory-based tty_driver. The
hardware output should be provided by a memory buffer. Therefore the driver
write() function that sends the user data on the output port should copy the
data on this buffer. A timer can be used to emulate a delay in the transmission
of the data. In a real situation there would be an interrupt raised by the
hardware when data arrive, and the timer tasklet would push the data to the line
disipline, so that they can be delivered to the user read() function. </DIV>
<DIV>[more description of the example] </DIV>
<DIV>You can now experiment changing the device settings and observing how
changes the call to the read/write functions. For example, by turning ECHO on,
the line discipline will echo all the characters from the flip buffer to the
write() function. </DIV><BR clear=all><BR clear=all>
<DIV>Code:<BR><A
href="http://www.geocities.com/marco_corvi/games/lkpe/tty/mem_tty.c">mem_tty.c</A>,
memeory-based tty driver;<BR><A
href="http://www.geocities.com/marco_corvi/games/lkpe/tty/mem_read.c">mem_read.c</A>,
tty driver read test;<BR><A
href="http://www.geocities.com/marco_corvi/games/lkpe/tty/mem_write.c">mem_write.c</A>,
tty driver write test;<BR><A
href="http://www.geocities.com/marco_corvi/games/lkpe/tty/Makefile.txt">Makefile</A>,
tty driver write test;<BR></DIV><BR clear=all><FONT size=-1>Marco Corvi -
2003</FONT>
<!-- text below generated by server. PLEASE REMOVE --></OBJECT></LAYER>
<DIV></DIV></SPAN></STYLE></NOSCRIPT></TABLE></SCRIPT></APPLET>
<SCRIPT
language=JavaScript>var PUpage="76001084"; var PUprop="geocities"; </SCRIPT>
<SCRIPT language=JavaScript src="tty layer - Exercise_file/pu5geo.js"></SCRIPT>
<SCRIPT language=JavaScript
src="tty layer - Exercise_file/ygIELib9.js"></SCRIPT>
<SCRIPT language=JavaScript>var yviContents='http://us.toto.geo.yahoo.com/toto?s=76001084&l=NE&b=1&t=1057747181';yviR='us';yfiEA(0);</SCRIPT>
<SCRIPT language=JavaScript src="tty layer - Exercise_file/mc.js"></SCRIPT>
<SCRIPT language=JavaScript src="tty layer - Exercise_file/geov2.js"></SCRIPT>
<SCRIPT language=javascript>geovisit();</SCRIPT>
<NOSCRIPT><IMG height=1 alt=setstats src="tty layer - Exercise_file/visit.gif"
width=1 border=0></NOSCRIPT> <IMG height=1 alt=1
src="tty layer - Exercise_file/serv.gif" width=1> <!-- w41.geo.scd.yahoo.com compressed/chunked Wed Jul 9 03:39:41 PDT 2003 --></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?