code:gtty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

  • gtty 的系统调用函数
  • 得到 tty 参数(参看struct tty)
    • t_speeds
    • t_erase
    • t_kill
    • t_flags
  • 传入2个参数 fildes, arg
    • fildes : 指定tty设备的字符设备装载文件的文件描述号,保存在u.u_ar0[R0](参看 文件系统)
(在 sgtty 中处理)
    • arg : 保存tty参数的地址,保存在u.u_arg[0]

8162 /* The routine implementing the gtty system call.

8163  * Just call lower level routine and pass back values.

8164  */

8165 gtty()

8166 {

8167     int v[3];

8168     register *up, *vp;

8169

8170     vp = v;

8171     sgtty(vp);

  • tty 参数 传入到 缓存区v
8172     if (u.u_error)

8173          return;

8174     up = u.u_arg[0];

8175     suword(up, *vp++);

8176     suword(++up, *vp++);

8177     suword(++up, *vp++);

8178 }

8179 /* ------------------------- */

Param

(gtty = 32.)
(file descriptor in r0)
sys gtty; arg
...
arg: .=.+6
⚠️ **GitHub.com Fallback** ⚠️