The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
termios.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* the console's terminal settings (termios) and the job-control ioctls.
5
* the layout, flags and request numbers are ABI: the libc's <termios.h>
6
* and <sys/ioctl.h> have the same ones (the Linux i386 values).
7
*/
8
9
#include "
common/stdint.h
"
10
11
#define NCCS 19
12
13
struct
ktermios
14
{
15
uint32_t
c_iflag
;
16
uint32_t
c_oflag
;
17
uint32_t
c_cflag
;
18
uint32_t
c_lflag
;
19
uint8_t
c_line
;
20
uint8_t
c_cc
[
NCCS
];
21
};
22
23
// c_iflag
24
#define INLCR 0x0040
// NL to CR on input
25
#define IGNCR 0x0080
// ignore CR
26
#define ICRNL 0x0100
// CR to NL on input
27
28
// c_oflag
29
#define OPOST 0x0001
// process output
30
#define ONLCR 0x0004
// NL to CR NL on output
31
32
// c_cflag
33
#define CS8 0x0030
34
#define CREAD 0x0080
35
36
// c_lflag
37
#define ISIG 0x0001
// INTR, QUIT and SUSP send signals
38
#define ICANON 0x0002
// line by line input with editing
39
#define ECHO 0x0008
// echo input
40
#define ECHOE 0x0010
// erase echoes as backspace, space, backspace
41
#define ECHOK 0x0020
// kill echoes a newline
42
#define TOSTOP 0x0100
// background writes get SIGTTOU (not yet honored)
43
#define IEXTEN 0x8000
44
// ginnOS: reads return keyboard_event_t records (keys and special keys)
45
// instead of bytes; this is what ttyctl(TTY_RAW) turns on
46
#define XKEYEVENTS 0x40000000
47
#define XKEYRAW 0x20000000
// with XKEYEVENTS: raw key down/up events
48
49
// c_cc indexes
50
#define VINTR 0
51
#define VQUIT 1
52
#define VERASE 2
53
#define VKILL 3
54
#define VEOF 4
55
#define VTIME 5
56
#define VMIN 6
57
#define VSUSP 10
58
59
// ioctl requests on the console and the pseudo-terminals
60
#define TCGETS 0x5401
61
#define TCSETS 0x5402
62
#define TCSETSW 0x5403
63
#define TCSETSF 0x5404
// set, and drop typed input not read yet
64
#define TIOCSCTTY 0x540E
65
#define TIOCGPGRP 0x540F
66
#define TIOCSPGRP 0x5410
67
#define TIOCGWINSZ 0x5413
68
#define TIOCSWINSZ 0x5414
// set the window size (SIGWINCH to the foreground)
69
#define TIOCGPTN 0x80045430
// pty master: the number N of /dev/pts/N
70
#define TIOCSPTLCK 0x40045431
// pty master: lock (1) or unlock (0) the slave
71
72
struct
kwinsize
73
{
74
uint16_t
ws_row
;
75
uint16_t
ws_col
;
76
uint16_t
ws_xpixel
;
77
uint16_t
ws_ypixel
;
78
};
79
80
/**
81
* set up the console terminal: default settings, and init's session as
82
* the one it controls (with init's group in the foreground). call once at
83
* boot, before the first process runs.
84
* @param init_pid the pid init will have (its session and group id).
85
*/
86
void
console_terminal_init
(
uint32_t
init_pid);
stdint.h
console_terminal_init
void console_terminal_init(uint32_t init_pid)
set up the console terminal: default settings, and init's session as the one it controls (with init's...
Definition
console_file.c:81
NCCS
#define NCCS
the console's terminal settings (termios) and the job-control ioctls.
Definition
termios.h:11
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
uint16_t
unsigned short uint16_t
Definition
stdint.h:13
ktermios
Definition
termios.h:14
ktermios::c_lflag
uint32_t c_lflag
Definition
termios.h:18
ktermios::c_oflag
uint32_t c_oflag
Definition
termios.h:16
ktermios::c_iflag
uint32_t c_iflag
Definition
termios.h:15
ktermios::c_cc
uint8_t c_cc[NCCS]
Definition
termios.h:20
ktermios::c_line
uint8_t c_line
Definition
termios.h:19
ktermios::c_cflag
uint32_t c_cflag
Definition
termios.h:17
kwinsize
Definition
termios.h:73
kwinsize::ws_xpixel
uint16_t ws_xpixel
Definition
termios.h:76
kwinsize::ws_col
uint16_t ws_col
Definition
termios.h:75
kwinsize::ws_ypixel
uint16_t ws_ypixel
Definition
termios.h:77
kwinsize::ws_row
uint16_t ws_row
Definition
termios.h:74
src
kernel
console
termios.h
Generated by
1.18.0