Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Feb 2008 14:01:14 -0800
From:      Jeremy Chadwick <koitsu@freebsd.org>
To:        Oliver Fromme <olli@lurza.secnetix.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: loader and ficl/Forth help
Message-ID:  <20080224220114.GA52366@eos.sc1.parodius.com>
In-Reply-To: <20080224200305.GA49564@eos.sc1.parodius.com>
References:  <20080224145940.GA41037@eos.sc1.parodius.com> <200802241738.m1OHccfW031633@lurza.secnetix.de> <20080224200305.GA49564@eos.sc1.parodius.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 24, 2008 at 12:03:05PM -0800, Jeremy Chadwick wrote:
> I'll have to get the qemu stuff set up so I can test this more easily.

I re-thought the method a bit, and went with something slightly more
hackish, plus added code to deal with the case where one uses -h or -Dh
in /boot.config (thus setting boot_serial=YES).  The Forth code can
probably be simplified, but since I got this to work, I'll submit a PR
for the whole thing.  We can hash out details/improvements there.


\ Used when serial console is detected (-|+ characters)
45 constant ascii_dash
124 constant ascii_pipe
43 constant ascii_plus

: set_serial_charset	( -- )
	s" console" getenv
	dup -1 = if
		drop exit
	then
	s" comconsole" compare-insensitive 0= if
		drop
		ascii_dash h_el !
		ascii_pipe v_el !
		ascii_plus lt_el !
		ascii_plus lb_el !
		ascii_plus rt_el !
		ascii_plus rb_el !
	then
	s" boot_serial" getenv
	dup -1 = if
		drop exit
	then
	s" YES" compare-insensitive 0= if
		drop
		ascii_dash h_el !
		ascii_pipe v_el !
		ascii_plus lt_el !
		ascii_plus lb_el !
		ascii_plus rt_el !
		ascii_plus rb_el !
	then
;


set_serial_charset should be called after f_single in frames.4th.

I just tested it on our development box, which uses -S115200 -Dh in
/boot.config and nothing serial-related in loader.conf:

 +-----------------------------------------+
 |                                         |
 |                                         |      ______
 |                                         |     |  ____| __ ___  ___
 |          Welcome to FreeBSD!            |     | |__ | '__/ _ \/ _ \
 |                                         |     |  __|| | |  __/  __/
 |                                         |     | |   | | |    |    |
 |  1. Boot FreeBSD [default]              |     |_|   |_|  \___|\___|
 |  2. Boot FreeBSD with ACPI disabled     |      ____   _____ _____
 |  3. Boot FreeBSD in Safe Mode           |     |  _ \ / ____|  __ \
 |  4. Boot FreeBSD in single user mode    |     | |_) | (___ | |  | |
 |  5. Boot FreeBSD with verbose logging   |     |  _ < \___ \| |  | |
 |  6. Escape to loader prompt             |     | |_) |____) | |__| |
 |  7. Reboot                              |     |     |      |      |
 |                                         |     |____/|_____/|_____/
 |                                         |
 |                                         |
 |                                         |
 |  Select option, [Enter] for default     |
 |  or [Space] to pause timer  6           |
 +-----------------------------------------+

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080224220114.GA52366>