linux/Documentation/serial-console.txt
<<
> .10/spa> .10/form .10a > .1 href="../linux+v3.7.7/Documenta >/serial-console.txt"> > .10img src="../.sta c/gfx/right.png" alt=">>"> 0/spa> 0spa> class="lxr_search"> > ="+search" method="post" onsubmit="return do_search(this);"> > .10input typionhidden" namionnavtarget" > .10input typiontext" namionsearch" idonsearch"> > .10butt typionsubmit">Search 0spa> class="lxr_prefs" .10a href="+prefs?return=Documenta >/serial-console.txt" > .1 onclick="return ajax_prefs();"> > .1Prefs .10/a> 0/spa> > .1 10/div > .1 10form ac >="ajax+*" method="post" onsubmit="return false;"> 0input typionhidden" namionajax_lookup" idonajax_lookup" > .1 10/form > .1 10div class="headingbott m">
.1
.1 .1 10div idonsearch_results" class="search_results" . > .1 10/div 0div idoncontent" 0div idonfile_contents"
1 110/a>                       Linux Serial Console
1 120/a> 1 130/a>To use a serial port as console you need to compile the support into your 1 140/a>kernel - by default it is not compiled in. For PC style serial ports 1 150/a>it's the config .>
 
  next to "Standard/generic (dumb) serial support". 1 160/a>You must compile serial support into the kernel and not as a module. 1 170/a> 1 180/a>It is possible to specify multiple devices for console output. You can 1 190/a>define a new kernel command line .>
 
  to select which device(s) to 1 1  
a>use for console output. 1 110/a> 1 120/a>The format of this .>
 
  is: 1 130/a> 1 140/a>        console=device,.>
 
 s 1 150/a> 1 160/a>        device:         tty0 for the foreground virtual console 1 170/a>                        ttyX for any other virtual console 1 180/a>                        ttySx for a serial port 1 190/a>                        lp0 for the first parallel port 1 200/a>                        ttyUSB0 for the first USB serial device 1 210/a> 1 220/a>        .>
 
 s:        depend 
  the driver. For the serial port this 1 230/a>                        defines the baudrate/parity/bits/flow control of 1 240/a>                        the port, in the format BBBBPNF, where BBBB is the 1 250/a>                        speed, P is parity (n/o/e), N is number of bits, 1 260/a>                        and F is flow control ('r' for RTS). Default is 1 270/a>                        9600n8. The maximum baudrate is 115200. 1 280/a> 1 290/a>You can specify multiple console= .>
 
 s 
  the kernel command line. 1 300/a>Output will appear 
  all of them. The last device will be used when 1 310/a>you open /dev/console. So, for example: 1 320/a> 1 330/a>        console=ttyS1,9600 console=tty0 1 340/a> 1 350/a>defines that opening /dev/console will get you the current foreground 1 360/a>virtual console, and kernel messages will appear 
  both the VGA 1 370/a>console and the 2nd serial port (ttyS1 or COM2) at 9600 baud. 1 380/a> 1 390/a>Note that you can only define one console per device typi (serial, video). 1 400/a> 1 410/a>If no console device is specified, the first device found capable of 1 420/a>ac	 ng as a system console will be used. At this time, the system 1 430/a>first looks for a VGA card and then for a serial port. So if you don't 1 440/a>have a VGA card in your system the first serial port will automa	 cally 1 450/a>become the console. 1 460/a> 1 470/a>You will need to create a new device to use /dev/console. The official 1 480/a>/dev/console is now character device 5,1. 1 490/a> 1 500/a>(You can also use a network device as a console.  See 1 510/a>Documenta	  >/network ng/netconsole.txt for informat 
  
  that.) 1 520/a> 1 530/a>Here's an example that will use /dev/ttyS1 (COM2) as the console. 1 540/a>Replace the sample 1 550/a> 1 560/a>1. Create /dev/console (real console) and /dev/tty0 (master virtual 1 570/a>   console): 1 580/a> 1 590/a>   cd /dev 1 600/a>   rm -f console tty0 1 610/a>   mknod -m 622 console c 5 1 1 620/a>   mknod -m 622 tty0 c 4 0 1 630/a> 1 640/a>2. LILO can also take input from a serial device. This is a very 1 650/a>   useful .>
 
 . To tell LILO to use the serial port: 1 660/a>   In lilo.conf (global sec	  >):  1 670/a> 1 680/a>   serial  = 1,9600n8 (ttyS1, 9600 bd, no parity, 8 bits) 1 690/a> 1 700/a>3. Adjust to kernel flags for the new kernel, 1 710/a>   again in lilo.conf (kernel sec	  >) 1 720/a> 1 730/a>   append = "console=ttyS1,9600"  1 740/a> 1 750/a>4. Make sure a getty ru s 
  the serial port so that you can login to 1 760/a>   it once the system is done boo	 ng. This is done by add ng a line 1 770/a>   like this to /etc/inittab (exact syntax depends 
  your getty): 1 780/a> 1 790/a>   S1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 1 800/a> 1 810/a>5. Init and /etc/ioctl.save 1 820/a> 1 830/a>   Sysvinit remembers its stty sett ngs in a file in /etc, called 1 840/a>   `/etc/ioctl.save'. REMOVE THIS FILE before us ng the serial 1 850/a>   console for the first time, because otherwise init will probably 1 860/a>   set the baudrate to 38400 (baudrate of the virtual console). 1 870/a> 1 880/a>6. /dev/console and X 1 890/a>   Programs that want to do someth ng with the virtual console usually 1 900/a>   open /dev/console. If you have created the new /dev/console device, 1 910/a>   and your console is NOT the virtual console some programs will fail. 1 920/a>   Those are programs that want to access the VT interface, and use 1 930/a>   /dev/console instead of /dev/tty0. Some of those programs are: 1 940/a> 1 950/a>   Xfree86, svgalib, gpm, SVGATextMode 1 960/a> 1 970/a>   It should be fixed in modern vers 
 s 
f these programs though. 1 980/a> 1 990/a>   Note that if you boo	 without a console= .>
 
  (or with 11000/a>   console=/dev/tty0), /dev/console is the same as /dev/tty0. I  that 11010/a>   case everyth ng will still work. 11020/a> 11030/a>7. Thanks 11040/a> 11050/a>   Thanks to Geert Uytterhoeven <geert@linux-m68k.org> 11060/a>   for port ng the patches from 2.1.4x to 2.1.6x for tak ng care of 11070/a>   the integrat 
  
f these patches into m68k, ppc and alpha. 11080/a> 11090/a>Miquel van Smoorenburg <miquels@cistron.nl>, 11-Jun-2000 111  
a>
The original LXR software by the LXR community a>, this experimental vers by lxr@linux.no a>. 0/div 0div class="subfoo er"> lxr.linux.no k ndly hosted by Redpill Linpro AS a>, provider of Linux consulting and pera s services s nce 1995. 0/div 0/body 0/html