Release ttys0 as the communication serial port
# Include <sys/IOCTL. h>
# Include <sys/STAT. h>
# Include <sys/types. h>
# Include <fcntl. h>
# Include <termios. h>
# Include <errno. h>
Void closeconsole (void ){
Int FP;
Struct termios options;
Printf ("Change1 \ n ");
Fp = open ("/dev/tty1", o_rdonly); // change the Console
IOCTL (FP, tioccons );
Close (FP );
Fp = open ("/dev/TTS/0", o_rdwr | o_noctty | o_ndelay); // open the serial port 0 for reading and writing
If (FP =-1) Exit (0 );
Tcgetattr (FP, & options );
Cfsetispeed (& options, b115200 );
Cfsetospeed (& options, b115200 );
Options. c_cflag | = (clocal | cread );
Tcsetattr (FP, tcsanow, & options );
Write (FP, "Hello world! \ N123 ", 15 );
Close (FP); // close the serial port 0
Fp = open ("/dev/tty0", o_rdonly); // restore the console to the serial port 0
IOCTL (FP, tioccons );
Close (FP );
Printf ("Change2 \ n ");
}
Close shell usage on the serial port to enable normal serial port communication and dialing
1. steps:
Execute make menuconfig during kernel Compilation
Character devices --->
Serial drivers --->
S3C2410 serial port support
[] Console on S3C2410 serial port [note] Remove this option without modifying busybox/init. C.
<> 8250/16550 and compatible serial support (experimental)
2. Remarks:
In this way, you cannot use the ttys0 port to log on to the arm development board. You can use Telnet to log on.
Practice: Telnet 192.168.0.12 (the IP address of your Development Board)
Enter the "root" User Name To Go To Your Development Board.
3. OK ..