Re: bmake and interactive processes

2015-10-14 Thread Dan LaBell


On Oct 13, 2015, at 8:49 PM, Malcolm Herbert wrote:



I am able to restore my terminal with 'reset' or 'stty sane' however
when I add these to rules within my Makefile they appear to be  
triggered
by make but by the time it finishes, the terminal is back to its  
broken

state.


Is it any better if you try 'stty -g' ?
stty_save=`stty -g`# or $(stty -g)
psql
stty $stty_save
Or, in your trap.



Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Christos Zoulas
On Oct 14,  9:02pm, mayur...@acm.org (Mayuresh) wrote:
-- Subject: Re: NetBSD 7.0 i386 panic during boot

| On Wed, Oct 14, 2015 at 11:07:08AM -0400, Christos Zoulas wrote:
| > Add some printfs to vmem_alloc? This is happening way too early.
| 
| I tried enabling following option to see whether trace shows source level
| info. But it didn't.
| 
| makeoptions DEBUG="-g" 
| 
| Is there any way to get source level debug info in ddb trace?

No, you have to use gdb on a kernel core file.

christos


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Christos Zoulas
On Oct 14,  8:52pm, mayur...@acm.org (Mayuresh) wrote:
-- Subject: Re: NetBSD 7.0 i386 panic during boot

| On Wed, Oct 14, 2015 at 11:07:08AM -0400, Christos Zoulas wrote:
| > Add some printfs to vmem_alloc? This is happening way too early.
| 
| Is there a way to read source level info (line number etc) in the trace?
| May be, if that doesn't give a clue, I'll get into printfs?

You can use addr2line if you have the address or use gdb on the core file
with netbsd.gdb.

christos


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Mayuresh
On Wed, Oct 14, 2015 at 11:07:08AM -0400, Christos Zoulas wrote:
> Add some printfs to vmem_alloc? This is happening way too early.

I tried enabling following option to see whether trace shows source level
info. But it didn't.

makeoptions DEBUG="-g" 

Is there any way to get source level debug info in ddb trace?

Mayuresh


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Mayuresh
On Wed, Oct 14, 2015 at 11:07:08AM -0400, Christos Zoulas wrote:
> Add some printfs to vmem_alloc? This is happening way too early.

Is there a way to read source level info (line number etc) in the trace?
May be, if that doesn't give a clue, I'll get into printfs?

Mayuresh.


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Christos Zoulas
On Oct 14,  8:18pm, mayur...@acm.org (Mayuresh) wrote:
-- Subject: Re: NetBSD 7.0 i386 panic during boot

| That apart. Now I get the trace, mentioning the function names:

Add some printfs to vmem_alloc? This is happening way too early.

christos


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Mayuresh
On Tue, Oct 13, 2015 at 08:20:23AM -0400, Christos Zoulas wrote:
> So you have a usb keyboard and it does not work for you?
> Comment out the following lines:
> 
> #pckbc*  at acpi?# PC keyboard controller
> #pckbc0  at isa? # pc keyboard controller
> #pckbd*  at pckbc?   # PC keyboard
> #pms*at pckbc?   # PS/2 mouse for wsmouse  
> #wskbd*  at pckbd? console ? 
> #wsmouse*at pms? mux 0

Tried these, but it did not enable the keyboard on panic.

However in man pages I saw this and set
DDB_COMMANDONENTER="trace"

Surprisingly this option is not present in the GENERIC template
configuration. May be not all options appear there...

That apart. Now I get the trace, mentioning the function names:

vmem_alloc
uvm_km_kmem_alloc
kmem_intr_alloc
kmem_intr_zalloc
mpbios_scan
mainbus_attach
config_attach_loc
config_rootfound
cpu_configure
main


(This is with acpi disabled.)

Mayuresh


Re: View flags used in wd device

2015-10-14 Thread Rocky Hotas
> Sent: Wednesday, October 14, 2015 at 1:19 PM
> From: "Manuel Bouyer" 
> To: "Rocky Hotas" 
> Cc: "NetBSD Users Mailing List" 
> Subject: Re: View flags used in wd device
[...]
> The flags are defined in the kenrel config file, so you could see them
> with:
> config -x /netbsd
> (if the config file has been embeeded in the kernel binary).
> But most of the time the flags are set to 0 and the kernel autodetects the
> modes to use. You can see this in the boot message:

Ok, they are 0 as you said: the message is in fact

# IDE drives
# [...] comments
wd* at atabus? drive ? flags 0x

> armandeche:/#egrep ^wd /var/run/dmesg.boot 
> wd0 at atabus0 drive 0
> wd0: 
> wd0: drive supports 16-sector PIO transfers, LBA48 addressing
> wd0: 465 GB, 969021 cyl, 16 head, 63 sec, 512 bytes/sect x 976773168 sectors
> wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
> wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 
> (Ultra/133) (using DMA)

Yes, I have a message almost equal.
Thank you!

Rocky


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Mayuresh
On Wed, Oct 14, 2015 at 07:51:53AM -0400, Christos Zoulas wrote:
> | $sysctl ddb.onpanic
> | ddb.onpanic = 2
> | 
> | So looks like my procedure was alright. Is there anything else needed to
> | make kernel print trace on entering ddb, when keyboard can't be used?
> 
> Did the instructions I posted to make the kernel accept keyboard input work?

Sorry, if I missed your mail. I thought ddb.onpanic=2 would print the trace
automatically on panic, thus not requiring keyboard. No? If there were
more instructions to enable keyboard could you please repost? I don't seem
to find them.

Mayuresh


Re: bmake and interactive processes

2015-10-14 Thread Christos Zoulas
In article <20151014004859.GD27214@phobos>,
Malcolm Herbert   wrote:
>Hello all - I've been a long time user of bmake/pmake for various
>tasks and have recently started using my make recipes to initiate an
>interactive PostgreSQL shell with the same set of arguments that I'm
>using elsewhere and reduce some duplication in my code.
>
>I'm finding that if I use ctrl-c to exit pgsql (and therefore make as
>well) that my terminal appears to end up in a no-echo mode for some
>reason. I definitely have this problem when using bmake/pmake under
>Linux, I haven't confirmed whether this also is the case under NetBSD at
>this point (I will do so tonight).
>
>I am able to restore my terminal with 'reset' or 'stty sane' however
>when I add these to rules within my Makefile they appear to be triggered
>by make but by the time it finishes, the terminal is back to its broken
>state.
>
>I know make isn't designed to drive interactive commands, so this isn't
>a gripe about that per se, but I am curious to know what I can do about
>it. Does anyone have ideas? 
>
>So far I've added a trap to the shell script on exit to run 'reset'
>after the pgsql command exits, however as noted above, although my
>terminal clears, the problem persists.

bmake does not change the terminal modes but probably the psql shell
does and does not restore them on some signal. I'd file a bug report
with the Postgres people.

christos



Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Christos Zoulas
On Oct 14,  2:54pm, mayur...@acm.org (Mayuresh) wrote:
-- Subject: Re: NetBSD 7.0 i386 panic during boot

| On a healthy system I tried triggering ddb with above kernel (with
| DDB_ONPANIC set), with Ctrl-Alt-Esc. It did not print trace.

yes, because that entry is not through panic().

| To cross check that the option is effective I did this:
| 
| $sysctl ddb.onpanic
| ddb.onpanic = 2
| 
| Also commented out the following line in /etc/sysctl.conf as below to
| ensure that it is not overriding the compiled option.
| #ddb.onpanic?=1
| 
| So looks like my procedure was alright. Is there anything else needed to
| make kernel print trace on entering ddb, when keyboard can't be used?

Did the instructions I posted to make the kernel accept keyboard input work?

christos


Re: boot device unknown on netbsd 7.0

2015-10-14 Thread David Brownlee
On 10 October 2015 at 11:07, Cayo Puigdefabregas
 wrote:
> Hello, I try install netbsd 7.0 on my laptop with usb img install.
> I'm get a problem with detected the root partition of usb stick.
> My computer have ssd disk and I think that netbsd not found the correct
> partition, but the system propose some partitions that any aren't the usb
> stick

Could the USB stick be in a USB3 port (and as such not recognised by
NetBSD). do you have any USB2 ports on the machine?


Re: View flags used in wd device

2015-10-14 Thread Manuel Bouyer
On Wed, Oct 14, 2015 at 12:51:15PM +0200, Rocky Hotas wrote:
> Hi!
> The wd (4) manpage shows some examples of the flags used with a particular 
> device.
> In the output of "mount" in my system there is the following line:
> 
> /dev/wd0a on / type ffs (log, local)
> 
> So, could this "wd0a" device be related to wd (4)?

it is

> And if it is, how can I view the flags actually used by the system for it?

The flags are defined in the kenrel config file, so you could see them
with:
config -x /netbsd
(if the config file has been embeeded in the kernel binary).
But most of the time the flags are set to 0 and the kernel autodetects the
modes to use. You can see this in the boot message:
armandeche:/#egrep ^wd /var/run/dmesg.boot 
wd0 at atabus0 drive 0
wd0: 
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 465 GB, 969021 cyl, 16 head, 63 sec, 512 bytes/sect x 976773168 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) 
(using DMA)

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


View flags used in wd device

2015-10-14 Thread Rocky Hotas
Hi!
The wd (4) manpage shows some examples of the flags used with a particular 
device.
In the output of "mount" in my system there is the following line:

/dev/wd0a on / type ffs (log, local)

So, could this "wd0a" device be related to wd (4)? And if it is, how can I view 
the flags actually used by the system for it?
Thank you in advance,

Rocky


Re: NetBSD 7.0 i386 panic during boot

2015-10-14 Thread Mayuresh
On Tue, Oct 13, 2015 at 05:24:31PM +0530, Mayuresh wrote:
> On Sun, Oct 11, 2015 at 01:13:42PM -0400, Christos Zoulas wrote:
> > | > This looks like a NULL pointer dereference. Do you have a backtrace?
> > | 
> > | Unfortunately the keyboard stops working when db prompt appears. So cannot
> > | gather complete trace.
> > 
> > Compile a kernel with
> > options DDB_ONPANIC 2
> > (man 4 options)
> 
> Did just that, make depend and make. Copied the kernel to bootable USB and
> tried to boot from it. Get the panic error but not stack trace.

On a healthy system I tried triggering ddb with above kernel (with
DDB_ONPANIC set), with Ctrl-Alt-Esc. It did not print trace.

To cross check that the option is effective I did this:

$sysctl ddb.onpanic
ddb.onpanic = 2

Also commented out the following line in /etc/sysctl.conf as below to
ensure that it is not overriding the compiled option.
#ddb.onpanic?=1

So looks like my procedure was alright. Is there anything else needed to
make kernel print trace on entering ddb, when keyboard can't be used?

Mayuresh.