简体   繁体   English

如何在Linux下将显示输出传递给串口?

[英]How to pass display output to serial port under Linux?

We have 2 computer. 我们有2台电脑。 Fist computer's operating system is Linux( any version( not important for me) ) and another operating system is Windows( any version, i don't care). 拳头计算机的操作系统是Linux(任何版本(对我来说都不重要))而另一个操作系统是Windows(任何版本,我都不在乎)。 They are connected via 9 pin serial port. 它们通过9针串口连接。

I want to know how can I change Linux's default display output to serial port instead of it's own monitor. 我想知道如何将Linux的默认显示输出更改为串口而不是自己的显示器。 I want to view all Linux outputs( from first word of boot time ) via hyper terminal in Windows XP. 我想通过Windows XP中的超级终端查看所有Linux输出(从第一个启动时间开始)。

我的问题形象

BTW it's just a research for future uses ! 顺便说一句,这只是对未来用途的研究! I know there is no easy solution for doing this. 我知道这样做没有简单的解决方案。 Maybe I should compile Linux again ! 也许我应该再次编译Linux! I don't know. 我不知道。 Please give me some suggestions. 请给我一些建议。

Use the console kernel parameter to specify the default console. 使用console kernel参数指定默认控制台。 Add an entry in inittab to attach a login process to the serial line. inittab添加一个条目,以将登录过程附加到串行线路。

请参阅串行控制台H​​owto并在Windows上使用putty

It's certainly feasible. 这当然是可行的。 The easiest way to do this is just to put a "getty" process on the serial terminal, which is sometimes done by editing /etc/inittab (there will be some examples in there) and then you will see a login prompt via the serial terminal and use all (command-line) programs normally. 最简单的方法就是在串口终端上放置一个“getty”进程,有时通过编辑/ etc / inittab来完成(那里会有一些例子)然后你会看到一个通过串口的登录提示终端并正常使用所有(命令行)程序。 Historically, Unix machines did this as their primary way of working. 从历史上看,Unix机器将其作为主要工作方式。

Another option is to use the "serial console", which involves passing some boot-time parameters to the kernel; 另一个选择是使用“串行控制台”,它涉及将一些启动时参数传递给内核; this is only required if you want to see its startup messages on the serial port. 只有在串口上看到启动消息时才需要这样做。


Edit: On newer Linux distributions, it's not so easy to put "getty" on a serial line, presumably because it's such an old-fashioned thing to do. 编辑:在较新的Linux发行版中,将“getty”放在串行线上并不容易,大概是因为它是一个老式的事情。 Outside of embedded devices, pretty much nobody uses serial ports to log in to the system any more (most modern PCs don't even HAVE rs232 ports). 在嵌入式设备之外,几乎没有人使用串口登录系统(大多数现代PC甚至没有rs232端口)。 For example, Fedora and Ubuntu do not use "init", but something else which doesn't have inherent support for running "getty". 例如,Fedora和Ubuntu不使用“init”,而是使用其他没有固有支持来运行“getty”的东西。 There is probably a way of doing it but I don't know what it is; 可能有一种方法,但我不知道它是什么; consult your distributuon's documentation. 请参阅您的distributuon的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM