History log of /freebsd-9.3-release/sys/dev/dcons/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


248085 09-Mar-2013 marius

MFC: r227309 (partial)

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


235743 21-May-2012 jhb

Toss bogus mergeinfo.


235738 21-May-2012 sbruno

MFC r235634

Fix and update battery status bits according to linux driver


235405 13-May-2012 avg

MFC r228631: kern cons: introduce infrastructure for console grabbing by
kernel


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


225214 27-Aug-2011 rwatson

Follow up to r225203 refining break-to-debugger run-time configuration
improvements:

(1) Implement new model in previously missed at91 UART driver
(2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h
to opt_kdb.h (spotted by np)
(3) Garbage collect now-unused opt_comconsole.h

MFC after: 3 weeks
Approved by: re (bz)


225203 26-Aug-2011 rwatson

Attempt to make break-to-debugger and alternative break-to-debugger more
accessible:

(1) Always compile in support for breaking into the debugger if options
KDB is present in the kernel.

(2) Disable both by default, but allow them to be enabled via tunables
and sysctls debug.kdb.break_to_debugger and
debug.kdb.alt_break_to_debugger.

(3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue
to behave as before -- only now instead of compiling in
break-to-debugger support, they change the default values of the
above sysctls to enable those features by default. Current kernel
configurations should, therefore, continue to behave as expected.

(4) Migrate alternative break-to-debugger state machine logic out of
individual device drivers into centralised KDB code. This has a
number of upsides, but also one downside: it's now tricky to release
sio spin locks when entering the debugger, so we don't. However,
similar logic does not exist in other device drivers, including uart.

(5) dcons requires some special handling; unlike other console types, it
allows overriding KDB's own debugger selection, so we need a new
interface to KDB to allow that to work.

GENERIC kernels in -CURRENT will now support break-to-debugger as long as
appropriate boot/run-time options are set, which should improve the
debuggability of BETA kernels significantly.

MFC after: 3 weeks
Reviewed by: kib, nwhitehorn
Approved by: re (bz)


193018 29-May-2009 ed

Last minute TTY API change: remove mutex argument from tty_alloc().

I don't want people to override the mutex when allocating a TTY. It has
to be there, to keep drivers like syscons happy. So I'm creating a
tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex()
should eventually be removed.

The advantage of this approach, is that we can just remove a function,
without breaking the regular API in the future.


190771 06-Apr-2009 ed

Reduce the dcons polling frequency to 25 Hz.

It makes little sense to use 100 Hz polling in dcons. We cannot live
without polling, because that's just how dcons works. It polls the
buffer filled by the firewire hardware. 25 Hz is probably enough for
most use cases.

Discussed with: rwatson
Tested by: kan


190756 06-Apr-2009 kan

Fix logic in MOD_LOAD handler to call dcons_attach after all successful
dcons_drv_init invocations. Testing return value for 0 does not work for
cases where dcons_drv_init was called already as part of low level
console initialization.


189752 13-Mar-2009 imp

We need to initialize the console for dcons to work.

Submitted by: nork@


186876 07-Jan-2009 marius

Check the return values of contigmalloc(9) as well as bus_dma(9)
functions and stop attaching of dcons(4) and dcons_crom(4) if
they indicate failure. This fixes a panic seen on sparc64 machines
with no free physical memory in the requested 32-bit region but
still doesn't make dcons(4)/dcons_crom(4) these work. I think
the latter can be fixed by simply specifying ~0UL as the upper
limit for contigmalloc(9) and letting the bounce pages and the
IOMMU respectively handle limitations of the DMA engine. I didn't
want to change that without the consensus of simokawa@ though,
who unfortunately didn't reply so far.

MFC after: 1 week


185108 19-Nov-2008 marius

Given that the buffer dcons_crom(4) exposes is used for both input
and output, set BUS_DMA_COHERENT when creating the DMA map used for
loading the buffer. As a side-effect this solves locking issues on
sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt
filter, which are executed in a critical section, and iommu(4) has
to use a sleep lock when taking advantage of the streaming buffer.

Reported and tested by: kensmith
Approved by: simokawa


185107 19-Nov-2008 ed

Also make dcons(4) use MPSAFE callouts.

The callout locks the TTY layer the way it should, so there is no reason
why its callout shouldn't set this flag.


181905 20-Aug-2008 ed

Integrate the new MPSAFE TTY layer to the FreeBSD operating system.

The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.

If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).

The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan


178771 05-May-2008 peter

Spell KDB_REQ_REBOOT correctly.


178766 04-May-2008 peter

Expand kdb_alt_break a little, most commonly used with the option
ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the
debugger), there is now "Enter ~ ctrl-P" (force panic) and
"Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons).

We've used variations of this at work. The force panic sequence is
best used with KDB_UNATTENDED for when you just want it to dump and
get on with it.

The reboot request is a safer way of getting into single user than
a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc).
It gives init the reboot signal, which causes an orderly reboot.

I've taken my best guess at what the !x86 and non-sio code changes
should be.

This also makes sio release its spinlock before calling KDB/DDB.


174898 25-Dec-2007 rwatson

Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument. This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.


171867 17-Aug-2007 simokawa

We don't need to call dcons_poll event handlers if KDB is not active.

Approved by: re (kensmith)


170537 11-Jun-2007 simokawa

- Don't force to be the GDB port since dcons(4) is in GENERIC now.

To enable the GDB port of dcons(4), you need to put
dcons_gdb=1
in /boot/loader.conf.


170426 08-Jun-2007 simokawa

Don't invalidate dcons buffer on shutdown.
We would like to keep connection after halt.


170420 08-Jun-2007 simokawa

Add the address of IDT in the configuration ROM. (i386/amd64 only)

A change to dconschat(8) will follow so that it can bomb
this address over FireWire to reset a wedged system.

Though this method is just a hack and far from perfection,
it should be useful if you don't want to go machine room
just to reset or to power-cycle a machine without
remote-managed power supply. And much better than doing:
# fwcontrol -m target-eui64
# dd if=/dev/zero of=/dev/fwmem0.2 bs=1m


170418 08-Jun-2007 simokawa

Replace breakpoint() with kdb_enter().


170408 08-Jun-2007 simokawa

Poll bus resets on FireWire while kdb/gdb is active.

Now, it's safe to call the fwohci interrupt(polling) routine while ddb/gdb
is active. After this change, a dcons connnection over FireWire can survive
bus resets even in kernel debugger.

This means that it is not too late to plug a FireWire cable after a panic
to investigate the problem.

Actually there is a small window(between a jump to kernel from loader and
initialization of dcons_crom) in which no one can take care of a bus reset.
Except that window, firewire console should keep working
from loader to reboot even with a panic and a bus reset.
(as far as you enable LOADER_FIREWIRE_SUPPORT)


170043 28-May-2007 simokawa

We should better ignore a break on gdb port if gdb is not enabled.


170018 27-May-2007 simokawa

Change default value of hw.firewire.dcons_crom.force_console to 0
for least astonishment.

MFC after: 3 days


170017 27-May-2007 simokawa

Make compile without GDB option.

MFC after: 3 days


169972 25-May-2007 simokawa

Include stand.h for loader.

MFC after: 3 days


164033 06-Nov-2006 rwatson

Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges. These may
require some future tweaking.

Sponsored by: nCircle Network Security, Inc.
Obtained from: TrustedBSD Project
Discussed on: arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
Alex Lyashkov <umka at sevcity dot net>,
Skip Ford <skip dot ford at verizon dot net>,
Antoine Brodin <antoine dot brodin at laposte dot net>


158959 26-May-2006 phk

Convert to new console interface.


158950 26-May-2006 phk

Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.

Use polling behaviour for gdb_getc() where convenient, this edges us
closer to the console code.


154016 04-Jan-2006 phk

Use ttyalloc() instead of ttymalloc()


153110 05-Dec-2005 ru

Fix -Wundef warnings found when compiling i386 LINT, GENERIC and
custom kernels.


151388 16-Oct-2005 phk

Make ttyconsolemode() call ttsetwater() so that drivers don't have to.


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


137013 28-Oct-2004 simokawa

Use dcons buffer passed by loader on amd64.


136898 24-Oct-2004 simokawa

- Use quad_t for dcons buffer address and size.
- Allow read/write access to dcons buffer passed by loader(8).


136781 22-Oct-2004 simokawa

Check _BOOT flag.


136680 18-Oct-2004 phk

Add new function ttyinitmode() which sets our systemwide default
modes on a tty structure.

Both the ".init" and the current settings are initialized allowing
the function to be used both at attach and open time.

The function takes an argument to decide if echoing should be enabled.
Echoing should not be enabled for regular physical serial ports
unless they are consoles, in which case they should be configured
by ttyconsolemode() instead.

Use the new function throughout.


136498 14-Oct-2004 simokawa

Fix warnings on non-i386 arch.

Submitted by: keramida


136467 13-Oct-2004 simokawa

- Split dcons core code and OS dependent code.
- Implement dcons_ischar() and dcons_load_buffer().
- If loader passed a dcons buffer address, keep using it.
(We still need a patch to cheat memory management system.)


135799 26-Sep-2004 simokawa

Invalidate dcons buffer on shutdown.


135733 24-Sep-2004 simokawa

Sync with DragonFly BSD.


132226 15-Jul-2004 phk

Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.


132199 15-Jul-2004 phk

Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".


132092 13-Jul-2004 simokawa

Re-enable debugger port.


131912 10-Jul-2004 marcel

Update for the KDB framework:
o Use kdb_alt_break() to handle the alternate break sequence instead
of handcoding it here.
o Remove GDB kluges to make this driver work with the pre-KDB remote
GDB code.
o Call kdb_enter() instead of Debugger().

Note that with this commit the dcons(4) driver cannot be used for
remote debugging anymore. This driver has to use the new GDB debug
port interface instead. Such has not been done yet.


130640 17-Jun-2004 phk

Second half of the dev_t cleanup.

The big lines are:
NODEV -> NULL
NOUDEV -> NODEV
udev_t -> dev_t
udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


130077 04-Jun-2004 phk

Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.


129944 01-Jun-2004 phk

Gainfully employ the new ttyioctl in the trivial cases.


129937 01-Jun-2004 phk

There is no need to explicitly call ttwakeup() and ttwwakeup() after
ttyclose() has been called. It's already been done once by ttyclose,
and probably once by the line-discipline too.


129934 01-Jun-2004 phk

ttyclose() increments t_gen. Remove redundant increments in drivers.


129879 30-May-2004 phk

Add missing <sys/module.h> includes


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


126078 21-Feb-2004 phk

Device megapatch 3/6:

Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.


126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


125862 16-Feb-2004 simokawa

- Clean up global data.
- Force dcons to be the high-level console after dcons_crom
has been attached.
- Add a tunable to be the high-level console.


122310 08-Nov-2003 simokawa

Move post dmamap_load processes into the callback function.


121468 24-Oct-2003 simokawa

Add dumb console driver and related bits.

dcons(4): very simple console and gdb port driver
dcons_crom(4): FireWire attachment
dconschat(8): User interface to dcons

Tested with: i386, i386-PAE, and sparc64.