Re: booting xen [was Re: serial console puzzle]

2021-05-07 Thread Mathew, Cherry G.
On 2021, മേയ് 7 8:35:54 PM IST, Patrick Welche  wrote:
>On Sat, May 01, 2021 at 12:33:17PM -0700, Greg A. Woods wrote:
>> I've copied this reply to port-xen as it's entirely Xen related.
>... 
>> On serial console machines I've been using NetBSD "console=xencons"
>for
>> ages.
>> 
>> This is the documented (by Xen, i.e. preferred Xen way), for serial
>> consoles:
>> 
>>  menu=Boot Xen:load /netbsd-XEN3_DOM0 -v bootdev=dk0
>console=xencons;multiboot /xen bootscrub=false dom0_mem=4G
>console=com1,vga console_timestamps=datems dom0_max_vcpus=4
>dom0_vcpus_pin=true pv-l1tf=off,domu=off vpmu=on cpuid=rdrand
>spec-ctrl=no-xen,l1d-flush=off guest_loglvl=all
>
>Amazing: I removed "rndseed /var/db/entropy-file;" from the beginning
>of the xen entry in /boot.cfg and instead of getting
>
>(XEN) *** Building a PV Dom0 ***
>(XEN) ELF: not an ELF binary
>(XEN)
>(XEN) 
>(XEN) Panic on CPU 0:
>(XEN) Could not construct domain 0
>(XEN) 
>
>I got
>
>(XEN) Dom0 has maximum 1128 PIRQs
>(XEN) *** Building a PV Dom0 ***
>(XEN) ELF: phdr: paddr=0x8020 memsz=0xe07000
>(XEN) ELF: memory: 0x8020 -> 0x81007000
>(XEN) ELF: note: GUEST_OS = "NetBSD"
>(XEN) ELF: note: GUEST_VERSION = "4.99"
>(XEN) ELF: note: XEN_VERSION = "xen-3.0"
>...
>!
>
>The only file which was edited was boot.cfg.
>
>
>Still no joy though:
>
>(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch
>input)
>(XEN) Freed 604kB init memory
>[   1.000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
>2003, 20,
>[   1.000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
>2014, 2015, ,
>[   1.000] 2018, 2019, 2020, 2021 The NetBSD Foundation, Inc. 
>All righ.
>[   1.000] Copyright (c) 1982, 1986, 1989, 1991, 1993
>[   1.000] The Regents of the University of California.  All
>rights res.
>
>[   1.000] NetBSD 9.99.82 (XEN3_DOM0) #4: Wed Apr 28 10:53:21 BST
>2021
>...
>[   1.030] pci14: i/o space, memory space enabled
>[   1.030] entropy: WARNING: extracting entropy too early
>(XEN) mm.c:2980:d0v0 Bad type (saw e401 != exp
>2000) fo)
>(XEN) mm.c:1142:d0v0 Attempt to create linear p.t. with write perms

uhuh. on a hunch:

can you reduce the dom0 RAM to, say 1G, or play with the configuration 
(dom0_mem=1G) to see if has any effect ?

Thanks,

Cherry


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


Re: booting xen [was Re: serial console puzzle]

2021-05-07 Thread Patrick Welche
On Sat, May 01, 2021 at 12:33:17PM -0700, Greg A. Woods wrote:
> I've copied this reply to port-xen as it's entirely Xen related.
... 
> On serial console machines I've been using NetBSD "console=xencons" for
> ages.
> 
> This is the documented (by Xen, i.e. preferred Xen way), for serial
> consoles:
> 
>   menu=Boot Xen:load /netbsd-XEN3_DOM0 -v bootdev=dk0 
> console=xencons;multiboot /xen bootscrub=false dom0_mem=4G console=com1,vga 
> console_timestamps=datems dom0_max_vcpus=4 dom0_vcpus_pin=true 
> pv-l1tf=off,domu=off vpmu=on cpuid=rdrand spec-ctrl=no-xen,l1d-flush=off 
> guest_loglvl=all

Amazing: I removed "rndseed /var/db/entropy-file;" from the beginning
of the xen entry in /boot.cfg and instead of getting

(XEN) *** Building a PV Dom0 ***
(XEN) ELF: not an ELF binary
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not construct domain 0
(XEN) 

I got

(XEN) Dom0 has maximum 1128 PIRQs
(XEN) *** Building a PV Dom0 ***
(XEN) ELF: phdr: paddr=0x8020 memsz=0xe07000
(XEN) ELF: memory: 0x8020 -> 0x81007000
(XEN) ELF: note: GUEST_OS = "NetBSD"
(XEN) ELF: note: GUEST_VERSION = "4.99"
(XEN) ELF: note: XEN_VERSION = "xen-3.0"
...
!

The only file which was edited was boot.cfg.


Still no joy though:

(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Freed 604kB init memory
[   1.000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 20,
[   1.000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, ,
[   1.000] 2018, 2019, 2020, 2021 The NetBSD Foundation, Inc.  All righ.
[   1.000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.000] The Regents of the University of California.  All rights res.

[   1.000] NetBSD 9.99.82 (XEN3_DOM0) #4: Wed Apr 28 10:53:21 BST 2021
...
[   1.030] pci14: i/o space, memory space enabled
[   1.030] entropy: WARNING: extracting entropy too early
(XEN) mm.c:2980:d0v0 Bad type (saw e401 != exp 2000) fo)
(XEN) mm.c:1142:d0v0 Attempt to create linear p.t. with write perms
[   1.030] xpq_flush_queue: 2 entries (0 successful) on cpu0 (0)
[   1.030] panic: HYPERVISOR_mmu_update failed, ret: -22

[   1.030] cpu0: Begin traceback...
[   1.030] vpanic() at netbsd:vpanic+0x14a
[   1.030] device_printf() at netbsd:device_printf
[   1.030] xpq_queue_machphys_update() at netbsd:xpq_queue_machphys_update
[   1.030] pmap_zero_page() at netbsd:pmap_zero_page+0xe3
[   1.030] uvm_pagealloc_strat() at netbsd:uvm_pagealloc_strat+0x1ef
[   1.030] pmap_get_physpage() at netbsd:pmap_get_physpage+0x1cb
[   1.030] pmap_growkernel() at netbsd:pmap_growkernel+0x1b3
[   1.030] uvm_map_prepare() at netbsd:uvm_map_prepare+0x3a2
[   1.030] uvm_map() at netbsd:uvm_map+0x70
[   1.030] ubc_init() at netbsd:ubc_init+0x15b
[   1.030] main() at netbsd:main+0x33b
[   1.030] cpu0: End traceback...
[   1.030] fatal breakpoint trap in supervisor mode
[   1.030] trap type 1 code 0 rip 0x8024093d cs 0xe030 rflags 0x2020
[   1.030] curlwp 0x80e75040 pid 0.0 lowest kstack 0x8198720
Stopped in pid 0.0 (system) at  netbsd:breakpoint+0x5:  leave
ds  
es  0
fs  bae0
gs  ba80
rdi 6
rsi deadbeefdeadf00d
rbp 8198bad0
rbx 2
rdx 1
rcx 6
rax 0
r8  2
r9  75
r10 0
r11 fffe
r12 80c57088ostype+0x138
r13 8198bb18
r14 104
r15 10
rip 8024093dbreakpoint+0x5
cs  e030
rflags  202
rsp 8198bad0
ss  e02b
netbsd:breakpoint+0x5:  leave


Cheers,

Patrick


Re: booting xen [was Re: serial console puzzle]

2021-05-01 Thread Greg A. Woods
I've copied this reply to port-xen as it's entirely Xen related.

At Fri, 30 Apr 2021 20:50:10 +0200, Manuel Bouyer  
wrote:
Subject: Re: booting xen [was Re: serial console puzzle]
> 
> On Fri, Apr 30, 2021 at 07:28:57PM +0100, Patrick Welche wrote:
> > 
> > boot.cfg contains:
> > 
> > menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> > /netbsd-XEN3_
> > DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz 
> > dom0_mem=1024M
> 
> should probably be:
> menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> /netbsd-XEN3_ DOM0 console=com0;multiboot /xen-debug.gz dom0_mem=1024M 
> console=com1 com1=57600,8n1,0x3f8
> 
> (should really be console=com0 for NetBSD, it doens't access the hardware and
> use the I/O services from the hypervisor)

On serial console machines I've been using NetBSD "console=xencons" for
ages.

This is the documented (by Xen, i.e. preferred Xen way), for serial
consoles:

menu=Boot Xen:load /netbsd-XEN3_DOM0 -v bootdev=dk0 
console=xencons;multiboot /xen bootscrub=false dom0_mem=4G console=com1,vga 
console_timestamps=datems dom0_max_vcpus=4 dom0_vcpus_pin=true 
pv-l1tf=off,domu=off vpmu=on cpuid=rdrand spec-ctrl=no-xen,l1d-flush=off 
guest_loglvl=all

From my Xen notes:

  - N.B.:  The Xen kernel handles serial input (and can pass it to
the dom0 kernel) but not keyboards, thus for serial console use
the NetBSD console should be "xencons", but when using the VGA
console the NetBSD console _must_ be "pc".

  - Xen counts serial ports from '1', but of course NetBSD counts
them from zero, so instead of "console=com0" as would be used
for /netbsd alone, it must be "console=com1,vga" for /xen.  Note
that Xen can print use multiple consoles simultaneously!  Note
also we could tell Xen to set the port up with something like
"com1=115200,8n1", but for now I think the BIOS does this OK on
the Dell PE machines.

These notes are based on direct examination of the code and are
confirmed by practice on multiple machines.

I believe the main advantage of keeping Xen in firm and sole control of
the serial console is that you can still talk to Xen directly with it
for debugging, as noted by Xen as it boots:

(XEN) [2021-04-21 20:54:44.504] *** Serial input to DOM0 (type 'CTRL-a' three 
times to switch input)

I've not really made use of this feature though -- just tested it a
couple of times.  I don't know if Xen still peeks at serial I/O if you
let the dom0 kernel take control of the UART, but it may.  I just don't
see the point of letting the dom0 use anything but xencons, if it can.
Similarly I don't see any point to trying to set or reset the UART
parameters if the BIOS already has them set and working -- keep it
simple and keep as much of the config in the first place it's needed and
nowhere else!


For systems with VGA console only though I finally figured out it has to
be "console=pc" explicitly else I didn't see any NetBSD boot messages
(this I have not diagnosed yet -- it is on a remote machine I've never
seen physically, though I do have Dell iDRAC access to it):

menu=Xen:load /netbsd -v bootdev=dk0 console=pc;multiboot /xen 
dom0_mem=2G dom0_max_vcpus=1 dom0_vcpus_pin

Of course VGA consoles suck for servers and for debugging, but sometimes
that's all you've got.


You'll note in the first example and the nodes, Xen can use two
different consoles simultaneously, so if I do go out into my machine
room (i.e. garage) I can see the Xen message on the screen too.  I
really wish NetBSD could do that.

-- 
Greg A. Woods 

Kelowna, BC +1 250 762-7675   RoboHack 
Planix, Inc.  Avoncote Farms 


pgpQ7huxel1C6.pgp
Description: OpenPGP Digital Signature


Re: booting xen [was Re: serial console puzzle]

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 08:50:10PM +0200, Manuel Bouyer wrote:
> On Fri, Apr 30, 2021 at 07:28:57PM +0100, Patrick Welche wrote:
> > On Fri, Apr 30, 2021 at 07:00:38PM +0200, Manuel Bouyer wrote:
> > > On Fri, Apr 30, 2021 at 05:55:37PM +0100, Patrick Welche wrote:
> > > > no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
> > > > Nothing more appears on the console. (-current XEN, xen.gz from 
> > > > xenkernel415)
> > > 
> > > Try xen-debug.gz ?
> > > Do you get the Xen boot messages ?
> > 
> > I don't get the Xen boot messages. Just tried xen-debug.gz and again I just
> > see loading, and then a reboot. I don't think it gets as far xen*.gz.
> > 
> > boot.cfg contains:
> > 
> > menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> > /netbsd-XEN3_
> > DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz 
> > dom0_mem=1024M
> 
> should probably be:
> menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> /netbsd-XEN3_ DOM0 console=com0;multiboot /xen-debug.gz dom0_mem=1024M 
> console=com1 com1=57600,8n1,0x3f8
> 
> (should really be console=com0 for NetBSD, it doens't access the hardware and
> use the I/O services from the hypervisor)

Ah - I remembered that NetBSD starts at 0, but xen at 1, but clearly still
muddled the boot.cfg.

We now have some serial console output!

Some of what flew by:

(XEN) Xen version 4.15.0nb0 (prlw1@) (gcc (nb1 20210411) 10.3.0) debug=y Thu Ap1
(XEN) Latest ChangeSet:
(XEN) build-id: d2ee973db9f01886c1297a3a469888de162702c6
(XEN) Bootloader: NetBSD/x86 BIOS Boot, Revision 5.11 (Tue Apr 20 14:32:11 UTC )
(XEN) Command line: dom0_mem=1024M console=com1 com1=57600,8n1,0x3f8
(XEN) Xen image load base address: 0
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: none; EDID transfer time: 0 seconds
(XEN)  EDID info not retrieved because no DDC retrieval method detected
(XEN) Disc information:
(XEN)  Found 1 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) CPU Vendor: AMD, Family 16 (0x10), Model 9 (0x9), Stepping 1 (raw 00100f9)
(XEN) Xen-e820 RAM map:
(XEN)  [, 0009dfff] (usable)
...
(XEN)   5 disabled
(XEN)   6 disabled
(XEN)   7 disabled
(XEN) TOM2: 00182000 (WB)
(XEN) Xenoprofile: AMD IBS detected (0x1f)
(XEN) Running stub recovery selftests...
(XEN) Fixup #UD[]: 82d07fffe040 [82d07fffe040] -> 82d04038aa07
(XEN) Fixup #GP[]: 82d07fffe041 [82d07fffe041] -> 82d04038aa07
(XEN) Fixup #SS[]: 82d07fffe040 [82d07fffe040] -> 82d04038aa07
(XEN) Fixup #BP[]: 82d07fffe041 [82d07fffe041] -> 82d04038aa07
(XEN) HPET: 3 timers usable for broadcast (4 total)
(XEN) NX (Execute Disable) protection active
(XEN) Dom0 has maximum 1128 PIRQs
(XEN) *** Building a PV Dom0 ***
(XEN) ELF: not an ELF binary
(XEN)
(XEN) 
(XEN) Panic on CPU 0:
(XEN) Could not construct domain 0
(XEN) 
(XEN)
(XEN) Reboot in five seconds...

$ file /netbsd*
/netbsd:   ELF 64-bit LSB executable, x86-64, version 1 (SYSV), 
statically linked, for NetBSD 9.99.82, not stripped
/netbsd-XEN3_DOM0: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), 
statically linked, for NetBSD 9.99.82, with debug_info, not stripped


(Should we move this to port-xen?)


Cheers,

Patrick


Re: booting xen [was Re: serial console puzzle]

2021-04-30 Thread Manuel Bouyer
On Fri, Apr 30, 2021 at 07:28:57PM +0100, Patrick Welche wrote:
> On Fri, Apr 30, 2021 at 07:00:38PM +0200, Manuel Bouyer wrote:
> > On Fri, Apr 30, 2021 at 05:55:37PM +0100, Patrick Welche wrote:
> > > no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
> > > Nothing more appears on the console. (-current XEN, xen.gz from 
> > > xenkernel415)
> > 
> > Try xen-debug.gz ?
> > Do you get the Xen boot messages ?
> 
> I don't get the Xen boot messages. Just tried xen-debug.gz and again I just
> see loading, and then a reboot. I don't think it gets as far xen*.gz.
> 
> boot.cfg contains:
> 
> menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> /netbsd-XEN3_
> DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz dom0_mem=1024M

should probably be:
menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
/netbsd-XEN3_ DOM0 console=com0;multiboot /xen-debug.gz dom0_mem=1024M 
console=com1 com1=57600,8n1,0x3f8

(should really be console=com0 for NetBSD, it doens't access the hardware and
use the I/O services from the hypervisor)

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


Re: booting xen [was Re: serial console puzzle]

2021-04-30 Thread Brian Buhrow
hello.  Because of the BIOS mixup  on your serial port numbering, what 
happens if you
change the com1 to com0 on the boot.cfg line where you tell xen to use com1?  
(Leave the
consdev com0 alone for the NetBSD kernel).  It may not work, but it might give 
you more
information.
-Brian



Re: booting xen [was Re: serial console puzzle]

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 07:28:57PM +0100, Patrick Welche wrote:
> On Fri, Apr 30, 2021 at 07:00:38PM +0200, Manuel Bouyer wrote:
> > On Fri, Apr 30, 2021 at 05:55:37PM +0100, Patrick Welche wrote:
> > > no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
> > > Nothing more appears on the console. (-current XEN, xen.gz from 
> > > xenkernel415)
> > 
> > Try xen-debug.gz ?
> > Do you get the Xen boot messages ?
> 
> I don't get the Xen boot messages. Just tried xen-debug.gz and again I just
> see loading, and then a reboot. I don't think it gets as far xen*.gz.
> 
> boot.cfg contains:
> 
> menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
> /netbsd-XEN3_
> DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz dom0_mem=1024M
> 
> [Any one know how to avoid "Collecting System Inventory ..." so booting
> doesn't take forever?]


Bizarre observation:

boot.cfg:

menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot
menu=Boot single user:rndseed /var/db/entropy-file;consdev com0,57600;boot -s
menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load 
/netbsd-XEN3_DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz 
dom0_mem=1024M
menu=Drop to boot prompt:prompt
default=3
timeout=5
clear=1


If I press "1", I still get "loading /netbsd-XEN3_DOM0" and a spontaneous
reboot. I need to press "2", then ctrl-D in single user for the equivalent
of "1".


Cheers,

Patrick


booting xen [was Re: serial console puzzle]

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 07:00:38PM +0200, Manuel Bouyer wrote:
> On Fri, Apr 30, 2021 at 05:55:37PM +0100, Patrick Welche wrote:
> > no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
> > Nothing more appears on the console. (-current XEN, xen.gz from 
> > xenkernel415)
> 
> Try xen-debug.gz ?
> Do you get the Xen boot messages ?

I don't get the Xen boot messages. Just tried xen-debug.gz and again I just
see loading, and then a reboot. I don't think it gets as far xen*.gz.

boot.cfg contains:

menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load /netbsd-XEN3_
DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz dom0_mem=1024M

[Any one know how to avoid "Collecting System Inventory ..." so booting
doesn't take forever?]


Cheers,

Patrick


Re: serial console puzzle

2021-04-30 Thread Brian Buhrow
hello Patrick.  Are you using a custom kernel with the  console defined 
in it?  That
overrides any settings in the boot.cfg file.  Another thing to check.  Are you 
using a machine
that has had NetBSD on it for a long time?  Is it possible the boot block on 
the boot disk is
old enough that it doesn't actually read the boot.cfg file?  I had one 
installation for many
years where I updated the OS, but the boot block never got updated, so boot.cfg 
was never
relevant on that system.

-thanks
-Brian


Re: serial console puzzle

2021-04-30 Thread Manuel Bouyer
On Fri, Apr 30, 2021 at 05:55:37PM +0100, Patrick Welche wrote:
> On Fri, Apr 30, 2021 at 04:52:41PM +0100, Patrick Welche wrote:
> > On Fri, Apr 30, 2021 at 05:23:54PM +0200, Manuel Bouyer wrote:
> > > On Fri, Apr 30, 2021 at 04:18:49PM +0100, Patrick Welche wrote:
> > > > On Fri, Apr 30, 2021 at 05:04:34PM +0200, Manuel Bouyer wrote:
> > > > > On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> > > > > > In /boot.cfg:
> > > > > > 
> > > > > > menu=Boot normally:rndseed /var/db/entropy-file;consdev 
> > > > > > com0,57600;boot
> > > > > > 
> > > > > > # installboot -ve /dev/rsd0a
> > > > > > File system: /dev/rsd0a
> > > > > > Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, 
> > > > > > console com0
> > > > > > 
> > > > > > Yet in dmesg:
> > > > > > 
> > > > > > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > > > > > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > > > > > com1: console
> > > > > > 
> > > > > > (so I don't actually see anything)
> > > > > > 
> > > > > > (Wednesday's -current/amd64)
> > > > > > 
> > > > > > 
> > > > > > Thoughts?
> > > > > 
> > > > > one possibility is that the bios has com0 and com1 swapped.
> > > > > In some case I had to explicitely set ioaddr with installboot to have
> > > > > the serial console working.
> > > > 
> > > > I should have said: according to the BIOS "COM A" is 0x3f8, and "COM B"
> > > > is 0x2f8, so they are the right way around.
> > > 
> > > I've seen BIOSes report it the right way on in setup, but the wrong way
> > > to the boot loader.
> > > In such cases and explicit ioaddr did help.
> > 
> > Indeed - it did!
> > 
> > # installboot -ve /dev/rsd0a
> > File system: /dev/rsd0a
> > Boot options:timeout 5, flags 0, speed 57600, ioaddr 3f8, console 
> > com0
> > 
> > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > com0: console
> > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > 
> > now for xen...
> 
> no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
> Nothing more appears on the console. (-current XEN, xen.gz from xenkernel415)

Try xen-debug.gz ?
Do you get the Xen boot messages ?

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


Re: serial console puzzle

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 04:52:41PM +0100, Patrick Welche wrote:
> On Fri, Apr 30, 2021 at 05:23:54PM +0200, Manuel Bouyer wrote:
> > On Fri, Apr 30, 2021 at 04:18:49PM +0100, Patrick Welche wrote:
> > > On Fri, Apr 30, 2021 at 05:04:34PM +0200, Manuel Bouyer wrote:
> > > > On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> > > > > In /boot.cfg:
> > > > > 
> > > > > menu=Boot normally:rndseed /var/db/entropy-file;consdev 
> > > > > com0,57600;boot
> > > > > 
> > > > > # installboot -ve /dev/rsd0a
> > > > > File system: /dev/rsd0a
> > > > > Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, 
> > > > > console com0
> > > > > 
> > > > > Yet in dmesg:
> > > > > 
> > > > > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > > > > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > > > > com1: console
> > > > > 
> > > > > (so I don't actually see anything)
> > > > > 
> > > > > (Wednesday's -current/amd64)
> > > > > 
> > > > > 
> > > > > Thoughts?
> > > > 
> > > > one possibility is that the bios has com0 and com1 swapped.
> > > > In some case I had to explicitely set ioaddr with installboot to have
> > > > the serial console working.
> > > 
> > > I should have said: according to the BIOS "COM A" is 0x3f8, and "COM B"
> > > is 0x2f8, so they are the right way around.
> > 
> > I've seen BIOSes report it the right way on in setup, but the wrong way
> > to the boot loader.
> > In such cases and explicit ioaddr did help.
> 
> Indeed - it did!
> 
> # installboot -ve /dev/rsd0a
> File system: /dev/rsd0a
> Boot options:timeout 5, flags 0, speed 57600, ioaddr 3f8, console com0
> 
> com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> com0: console
> com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> 
> now for xen...

no luck. I see loading /netbsd-XEN3_DOM0, and then it just reboots.
Nothing more appears on the console. (-current XEN, xen.gz from xenkernel415)

This is BIOS boot, with disklabeled disk. GENERIC boots.

Ho hum


Patrick


Re: serial console puzzle

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 05:23:54PM +0200, Manuel Bouyer wrote:
> On Fri, Apr 30, 2021 at 04:18:49PM +0100, Patrick Welche wrote:
> > On Fri, Apr 30, 2021 at 05:04:34PM +0200, Manuel Bouyer wrote:
> > > On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> > > > In /boot.cfg:
> > > > 
> > > > menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot
> > > > 
> > > > # installboot -ve /dev/rsd0a
> > > > File system: /dev/rsd0a
> > > > Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, console 
> > > > com0
> > > > 
> > > > Yet in dmesg:
> > > > 
> > > > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > > > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > > > com1: console
> > > > 
> > > > (so I don't actually see anything)
> > > > 
> > > > (Wednesday's -current/amd64)
> > > > 
> > > > 
> > > > Thoughts?
> > > 
> > > one possibility is that the bios has com0 and com1 swapped.
> > > In some case I had to explicitely set ioaddr with installboot to have
> > > the serial console working.
> > 
> > I should have said: according to the BIOS "COM A" is 0x3f8, and "COM B"
> > is 0x2f8, so they are the right way around.
> 
> I've seen BIOSes report it the right way on in setup, but the wrong way
> to the boot loader.
> In such cases and explicit ioaddr did help.

Indeed - it did!

# installboot -ve /dev/rsd0a
File system: /dev/rsd0a
Boot options:timeout 5, flags 0, speed 57600, ioaddr 3f8, console com0

com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO

now for xen...


Thanks,

Patrick


Re: serial console puzzle

2021-04-30 Thread Manuel Bouyer
On Fri, Apr 30, 2021 at 04:18:49PM +0100, Patrick Welche wrote:
> On Fri, Apr 30, 2021 at 05:04:34PM +0200, Manuel Bouyer wrote:
> > On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> > > In /boot.cfg:
> > > 
> > > menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot
> > > 
> > > # installboot -ve /dev/rsd0a
> > > File system: /dev/rsd0a
> > > Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, console 
> > > com0
> > > 
> > > Yet in dmesg:
> > > 
> > > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > > com1: console
> > > 
> > > (so I don't actually see anything)
> > > 
> > > (Wednesday's -current/amd64)
> > > 
> > > 
> > > Thoughts?
> > 
> > one possibility is that the bios has com0 and com1 swapped.
> > In some case I had to explicitely set ioaddr with installboot to have
> > the serial console working.
> 
> I should have said: according to the BIOS "COM A" is 0x3f8, and "COM B"
> is 0x2f8, so they are the right way around.

I've seen BIOSes report it the right way on in setup, but the wrong way
to the boot loader.
In such cases and explicit ioaddr did help.

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


Re: serial console puzzle

2021-04-30 Thread Patrick Welche
On Fri, Apr 30, 2021 at 05:04:34PM +0200, Manuel Bouyer wrote:
> On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> > In /boot.cfg:
> > 
> > menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot
> > 
> > # installboot -ve /dev/rsd0a
> > File system: /dev/rsd0a
> > Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, console com0
> > 
> > Yet in dmesg:
> > 
> > com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> > com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> > com1: console
> > 
> > (so I don't actually see anything)
> > 
> > (Wednesday's -current/amd64)
> > 
> > 
> > Thoughts?
> 
> one possibility is that the bios has com0 and com1 swapped.
> In some case I had to explicitely set ioaddr with installboot to have
> the serial console working.

I should have said: according to the BIOS "COM A" is 0x3f8, and "COM B"
is 0x2f8, so they are the right way around.

(Of course UEFI is fine, and I get console output, but...)


Cheers,

Patrick


Re: serial console puzzle

2021-04-30 Thread Manuel Bouyer
On Fri, Apr 30, 2021 at 03:44:46PM +0100, Patrick Welche wrote:
> In /boot.cfg:
> 
> menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot
> 
> # installboot -ve /dev/rsd0a
> File system: /dev/rsd0a
> Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, console com0
> 
> Yet in dmesg:
> 
> com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
> com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
> com1: console
> 
> (so I don't actually see anything)
> 
> (Wednesday's -current/amd64)
> 
> 
> Thoughts?

one possibility is that the bios has com0 and com1 swapped.
In some case I had to explicitely set ioaddr with installboot to have
the serial console working.

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


serial console puzzle

2021-04-30 Thread Patrick Welche
In /boot.cfg:

menu=Boot normally:rndseed /var/db/entropy-file;consdev com0,57600;boot

# installboot -ve /dev/rsd0a
File system: /dev/rsd0a
Boot options:timeout 5, flags 0, speed 57600, ioaddr 0, console com0

Yet in dmesg:

com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 1-byte FIFO
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, 1-byte FIFO
com1: console

(so I don't actually see anything)

(Wednesday's -current/amd64)


Thoughts?

Cheers,

Patrick


Re: serial console

2021-03-01 Thread Darrin B. Jewell
Patrick Welche  writes:

> On Wed, Feb 17, 2021 at 12:34:21AM -0800, Darrin B. Jewell wrote:
>> 
>> I honestly hope this isn't related to your problem, but I did make a
>> change to the amd64 cdrom building recently that is in this area
>> and may be the issue.
>> 
>>https://mail-index.netbsd.org/source-changes/2021/02/06/msg126676.html
>> 
>> I thought I was only affecting the boot-com.iso install cd, but this
>> change should probably be examined to make sure it isn't causing your
>> problem.
>
> I didn't think your change had anything to do with it, but just in case,
> I repeated the experiment with today's code (as you reverted your
> change already) and had the same outcome.

Thank you for the validation.  I also did a clean build and checked
all the bootloaders in OBJDIR and confirmed it only affects boot-com.iso.

I'll recommit my change when I get a chance.

Darrin

>
>
> Cheers,
>
> Patrick


Re: serial console

2021-03-01 Thread Patrick Welche
On Wed, Feb 17, 2021 at 12:34:21AM -0800, Darrin B. Jewell wrote:
> 
> I honestly hope this isn't related to your problem, but I did make a
> change to the amd64 cdrom building recently that is in this area
> and may be the issue.
> 
>https://mail-index.netbsd.org/source-changes/2021/02/06/msg126676.html
> 
> I thought I was only affecting the boot-com.iso install cd, but this
> change should probably be examined to make sure it isn't causing your
> problem.

I didn't think your change had anything to do with it, but just in case,
I repeated the experiment with today's code (as you reverted your
change already) and had the same outcome.


Cheers,

Patrick


Re: serial console

2021-02-17 Thread RVP

On Wed, 17 Feb 2021, Darrin B. Jewell wrote:


I honestly hope this isn't related to your problem, but I did make a
change to the amd64 cdrom building recently that is in this area
and may be the issue.

  https://mail-index.netbsd.org/source-changes/2021/02/06/msg126676.html


Has something changed recently in the land of serial consoles?
...
After getting access to the building(!), it seems I now need to add
consdev com0,115200 to each menu item in boot.cfg. (Putting it
on a line on its own seems insufficient - is that a bug?)



This completely slipped my mind, but, it's been an issue for some
time now. Other commands, like `gop' and `rndfile' which could be
put into their own lines in 9.x now need to go into the menu entry
lines for them to have any effect.

-RVP


Re: serial console

2021-02-17 Thread Darrin B. Jewell


I just reverted my change and will take another look at it
when I get a chance.  I know the boot-com.iso doesn't use
the serial port when booting EFI, but I think my fix was
not correct.  Sorry for the inconvenience.

Darrin

"Darrin B. Jewell"  writes:

> I honestly hope this isn't related to your problem, but I did make a
> change to the amd64 cdrom building recently that is in this area
> and may be the issue.
>
>https://mail-index.netbsd.org/source-changes/2021/02/06/msg126676.html
>
> I thought I was only affecting the boot-com.iso install cd, but this
> change should probably be examined to make sure it isn't causing your
> problem.
>
> Darrin
>
>> Has something changed recently in the land of serial consoles?
>> 
>> I am pretty sure that once I enabled serial console redirection
>> "after boot" in the "bios" of this amd64 uefi booting server, with
>> a serial port plugged in, I would have a serial console with the
>> default /boot.cfg.
>> 
>> After getting access to the building(!), it seems I now need to add
>> consdev com0,115200 to each menu item in boot.cfg. (Putting it
>> on a line on its own seems insufficient - is that a bug?)
>> 
>> 
>> Cheers,
>> 
>> Patrick
>> 
>> 


serial console

2021-02-17 Thread Darrin B. Jewell


I honestly hope this isn't related to your problem, but I did make a
change to the amd64 cdrom building recently that is in this area
and may be the issue.

   https://mail-index.netbsd.org/source-changes/2021/02/06/msg126676.html

I thought I was only affecting the boot-com.iso install cd, but this
change should probably be examined to make sure it isn't causing your
problem.

Darrin

> Has something changed recently in the land of serial consoles?
> 
> I am pretty sure that once I enabled serial console redirection
> "after boot" in the "bios" of this amd64 uefi booting server, with
> a serial port plugged in, I would have a serial console with the
> default /boot.cfg.
> 
> After getting access to the building(!), it seems I now need to add
> consdev com0,115200 to each menu item in boot.cfg. (Putting it
> on a line on its own seems insufficient - is that a bug?)
> 
> 
> Cheers,
> 
> Patrick
> 
> 


serial console

2021-02-16 Thread Patrick Welche
Has something changed recently in the land of serial consoles?

I am pretty sure that once I enabled serial console redirection
"after boot" in the "bios" of this amd64 uefi booting server, with
a serial port plugged in, I would have a serial console with the
default /boot.cfg.

After getting access to the building(!), it seems I now need to add
consdev com0,115200 to each menu item in boot.cfg. (Putting it
on a line on its own seems insufficient - is that a bug?)


Cheers,

Patrick


i915drmkms vs serial console--how to have both?

2017-01-02 Thread John D. Baker
I have machines with i82845 (i386) and 82Q45 (amd64) graphics devices
which engage the i915drmkms driver and intelfb.  On both, if one chooses
to use a serial console (i.e., 'consdev com0' in the bootloader), the
video output is disabled.  One can still log in blind on the wscons
virtual terminals, but this is hardly useful.

How can one have working i915drmkms/intelfb video while using a serial
console?

(IIRC, a machine with E7221 graphics device did not disable the video
if a serial console was used.  I am unable to confirm as that machine
is no longer accessible to me.)

-- 
|/"\ John D. Baker, KN5UKS   NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]comOpenBSDFreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645