UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
console.c File Reference
#include "types.h"
#include "defs.h"
#include "param.h"
#include "traps.h"
#include "spinlock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"

Go to the source code of this file.

Macros

#define BACKSPACE   0x100
 
#define CRTPORT   0x3d4
 
#define INPUT_BUF   128
 
#define C(x)   ((x)-'@')
 

Functions

void cprintf (char *fmt,...)
 
void panic (char *s)
 
void consoleintr (int(*getc)(void))
 
int consoleread (struct inode *ip, char *dst, int n)
 
int consolewrite (struct inode *ip, char *buf, int n)
 
void consoleinit (void)
 

Variables

struct {
   struct spinlock   lock
 
   char   buf [INPUT_BUF]
 
   uint   r
 
   uint   w
 
   uint   e
 
input
 

Macro Definition Documentation

#define BACKSPACE   0x100

Definition at line 125 of file console.c.

#define C (   x)    ((x)-'@')

Definition at line 185 of file console.c.

#define CRTPORT   0x3d4

Definition at line 126 of file console.c.

#define INPUT_BUF   128

Definition at line 176 of file console.c.

Function Documentation

void consoleinit ( void  )

Definition at line 281 of file console.c.

void consoleintr ( int(*)(void)  getc)

Definition at line 188 of file console.c.

int consoleread ( struct inode ip,
char *  dst,
int  n 
)

Definition at line 228 of file console.c.

int consolewrite ( struct inode ip,
char *  buf,
int  n 
)

Definition at line 266 of file console.c.

void cprintf ( char *  fmt,
  ... 
)

Definition at line 54 of file console.c.

void panic ( char *  s)

Definition at line 106 of file console.c.

Variable Documentation

char buf[INPUT_BUF]

Definition at line 179 of file console.c.

uint e

Definition at line 182 of file console.c.

struct { ... } input
struct spinlock lock

Definition at line 22 of file console.c.

int locking

Definition at line 23 of file console.c.

uint r

Definition at line 180 of file console.c.

uint w

Definition at line 181 of file console.c.