Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: HOWTO updates, console selection



On Fri, Feb 26, 2021 at 03:20:55PM -0500, Greg Troxel wrote:
> 
> (This note is amd64-centric.)
> 
> I am simultaneously struggling with console selection issues on an apu2
> (has only serial, non-xen) and regular amd64 (no serial ports wired up,
> xen).  I find that sometimes I have console output but not input
> (console=pc, under Xen, when in ddb, USB keyboard).
> 
> I've been rototilling the HOWTO again:
> 
>   https://wiki.netbsd.org/ports/xen/howto/
> 
> (I demoted the "converting from grub" section to the grub graveyard page,
> but I think nobody will be bothered.)
> 
> More importantly, I adjusted the install section about boot configs a
> fair bit.
> 
> As I understand things and don't understand things:
> 
>   mbr_bootsel uses BIOS calls so it uses the BIOS's notion of console,
>   working on keyboard/vga (which I'll call normal), and also on the
>   apu2's serial port.
> 
>   bootxx_ffsv1 (and similar) can be configured for a console.
>   \help Why doesn't bootxx use the same BIOS calls as MBR, so that
>   it doesn't need configuring?  (Or maybe it does, but the config is
>   about controlling /boot and then the kernel?)
> 
>   \help Is bootxx config passed to /boot, and on to the kernel?
>   boot_console(8) seems to say so, but the docs for the later config
>   doesn't seem to say that normally, one wouldn't need to configure
>   booting in other than bootxx.
>   \help boot_console(8) doesn't say this, but the build lines for some
>   boot stuff make it look like params are passed:
>     -DSUPPORT_SERIAL=boot_params.bp_consdev
> 
>   /boot can be configured in boot.cfg, by the consdev command.
> 
>   \help How does one set baud rate and parity with consdev?  Reading the
>   boot2.c, it looks like "consdev com0:9600".

All this is about the x86 boot, I can't say for sure how it works
in details. I think setting the console in /bootxx_ is for /boot
to have a working console before reading boot.cfg.

> 
>   \help boot.cfg(5) documents consdev but uses also console= in examples
>   without explaining.  Is the distinction that consdev controls how
>   /boot behaves and console= is a config for what is booted?

For a native boot, the /boot's notion of the console is passed
to the kernel, so the kernel knows which console to use.

For Xen (and more generally for multiboot I guess), the kernel can't access
/boot's settings, it only has the boot arguments of the command line.
So we have no choise but set the console on the command line.


> 
>   \help Is there any difference between using consdev on a menu line and
>   placing it on a line by itself, to always be in effect?  (To be,
>   choice of console is primarily about which kind the machine has, and
>   only secondarily to use serial sometimes.)
> 
>   \help Given that "pc" is the standard approach, why do examples give
>   console=pc?

I think it's better to be explicit. In fact I'm not sure if console=pc
is the default.

> 
>   \help Given that xen finds a console, and provides xencons(4) to the
>   dom0, why isn't the standard approach to let the dom0 console use
>   xencons?

Because the Xen kernel handles serial input (and can pass it to the
dom0 kenrel) but not keyboards.

> 
> And not about console:
> 
>   Reading boot.cfg, one finds that the -s for single user belongs with
>   the load statement as it's the dom0 kernel that is to be booted single
>   user, not the xen kernel.  Is this right?

Yes

> 
>      menu=Xen single user:load /netbsd-XEN3_DOM0.gz console=pc -s;multiboot /xen.gz dom0_mem=512M
> 
>   \help None of the examples show rndseed.  But this issue would seem to
>   apply to dom0 just as it would apply to booting GENERIC not under Xen.
>   Is this just a case of the examples not catching up with current
>   practice?

I guess so

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index