mountroot issues (was Re: 10.0-release proposed patch for Atmel)

Warner Losh imp at bsdimp.com
Sun Dec 22 21:50:36 UTC 2013


On Dec 22, 2013, at 12:28 PM, John-Mark Gurney wrote:

> Warner Losh wrote this message on Sat, Dec 21, 2013 at 23:44 -0700:
>> Right now, the mountroot prompt doesn't work on Atmel CPUs. Almost all the characters are eaten. I recently committed an elegant fix for this into head to mask the interrupt for new characters and only do polling.
> 
> So, a similar issue plages i386/amd64 too.  There the console mostly
> works, but it will drop characters on occasion...  The problem is that
> mount root spins calling into the console code instead of asking the
> console code for a single character and having the console code wait
> for this character...  and if you type a character while it's outside
> the console routines, that character will be dropped...

I don't think that's the problem... Why is the character dropping?

> The problem is, not many of us spend time at the mountroot prompt, and
> so even if we notice the issue, it's so minor that we just deal w/
> it...

If characters are being dropped, it is because interrupts are enabled, the interrupt fires and the ISR eats them. This will happen because we don't properly implement cngrab/cnungrab in the serial driver at the moment...

I guess I've just gotten lucky and not been bit by this, or if I have it has been so infrequently that it hasn't registered. With Atmel, it happens all the time and I've seen it for perhaps a decade...

> The method I came up with years ago was to add a routine/flag that would
> have the console wait for a character instead of simply returning when
> there was no character...  Though if we implement cngrab properly where
> we don't flush buffers, turn off interupts, etc, then that would work
> too...

That's the more robust way to cope. cngrab works really well...

> I've cc'd -arch since it's not just an -arm issue.
> 

Agreed. 

Warner



More information about the freebsd-arm mailing list